curl --request POST \
--url https://app.dimepayments.com/api/transaction/authorize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": []
}'import requests
url = "https://app.dimepayments.com/api/transaction/authorize"
payload = { "data": [] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: []})
};
fetch('https://app.dimepayments.com/api/transaction/authorize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.dimepayments.com/api/transaction/authorize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.dimepayments.com/api/transaction/authorize"
payload := strings.NewReader("{\n \"data\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.dimepayments.com/api/transaction/authorize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dimepayments.com/api/transaction/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": []\n}"
response = http.request(request)
puts response.read_body{
"data": {
"transaction_type": "Credit Card",
"transaction_status": "Pending",
"transaction_status_description": "Pending",
"transaction_number": "1234567890",
"transaction_date": "2020-01-01",
"fund_date": "",
"settle_date": "",
"amount": "100.50",
"description": "a memo concerning this transaction",
"status_code": "00",
"status_text": "APPROVAL",
"email": "email@email.com",
"phone": "+17701234567",
"customer_uuid": "66f1c230-1337-5g59-b43c-1bcb83adfaaa",
"multi_use_token": "abcdefg123456790",
"pending": true,
"transaction_info_id": "",
"parent_transaction_info_id": "",
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"addr1": "123 Main St",
"addr2": "Suite 100",
"city": "New York",
"state": "NY",
"zip": "10001"
},
"shipping_address": {
"addr1": "12 Street Ave",
"addr2": "Suite 123",
"city": "Boulder",
"state": "CO",
"zip": "80302"
}
}
}{
"errors": {
"data.amount": [
"The data.amount field is required."
]
}
}{
"data": {
"message": "Permission Denied."
}
}{
"data": {
"message": "Merchant is not PCI Compliant"
}
}{
"data": {
"message": "No such Merchant"
}
}{
"data": {
"message": "Token expired. Please retokenize, or provide the card details."
}
}Authorize a Credit Card
Places a hold on a credit card without moving any money. The authorized amount is reserved against the cardholder’s available credit, and no funds reach the merchant until the authorization is captured via the capture endpoint.
Use this when the final amount is not yet known or goods have not shipped. Capture the authorization once you are ready to collect. An authorization that is never captured is released by the card issuer on its own schedule, so capture promptly — typically within 24 hours — to avoid the hold expiring.
The transaction_number in the response is your handle on the authorization: pass it as
data.transaction_id to the capture endpoint to collect, or to the void endpoint to release.
Releasing the hold. If the sale falls through, release the held funds instead of
capturing by calling the void endpoint — PATCH /api/transaction/void:
{ "data": { "sid": 1234567, "transaction_type": "CC", "transaction_id": "1234567890" } }
data.transaction_type must be CC. Voiding is gated by its own separate API key
permission, not by this one, so make sure your key carries it if you need to release holds.
Two ways to supply the card, pick one. Either send a token from the tokenize-card
endpoint, or send the raw card fields — card_number, expiration_date, cardholder_name and
billing_address.zip, all four of which are required only when no token is present, and
ignored when one is. Sending raw card data requires PCI compliance (an AoC on file with Dime
Payments); a token does not, because no card number is transmitted.
curl --request POST \
--url https://app.dimepayments.com/api/transaction/authorize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": []
}'import requests
url = "https://app.dimepayments.com/api/transaction/authorize"
payload = { "data": [] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: []})
};
fetch('https://app.dimepayments.com/api/transaction/authorize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.dimepayments.com/api/transaction/authorize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.dimepayments.com/api/transaction/authorize"
payload := strings.NewReader("{\n \"data\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.dimepayments.com/api/transaction/authorize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dimepayments.com/api/transaction/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": []\n}"
response = http.request(request)
puts response.read_body{
"data": {
"transaction_type": "Credit Card",
"transaction_status": "Pending",
"transaction_status_description": "Pending",
"transaction_number": "1234567890",
"transaction_date": "2020-01-01",
"fund_date": "",
"settle_date": "",
"amount": "100.50",
"description": "a memo concerning this transaction",
"status_code": "00",
"status_text": "APPROVAL",
"email": "email@email.com",
"phone": "+17701234567",
"customer_uuid": "66f1c230-1337-5g59-b43c-1bcb83adfaaa",
"multi_use_token": "abcdefg123456790",
"pending": true,
"transaction_info_id": "",
"parent_transaction_info_id": "",
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"addr1": "123 Main St",
"addr2": "Suite 100",
"city": "New York",
"state": "NY",
"zip": "10001"
},
"shipping_address": {
"addr1": "12 Street Ave",
"addr2": "Suite 123",
"city": "Boulder",
"state": "CO",
"zip": "80302"
}
}
}{
"errors": {
"data.amount": [
"The data.amount field is required."
]
}
}{
"data": {
"message": "Permission Denied."
}
}{
"data": {
"message": "Merchant is not PCI Compliant"
}
}{
"data": {
"message": "No such Merchant"
}
}{
"data": {
"message": "Token expired. Please retokenize, or provide the card details."
}
}
