Authorize / Settle
Using this API allows you to simply send a json request with a token to just authorize (reserve) or settle (charge) an amount.
When you reserve an amount on a stored card, the monthly allowance of the cardholder is reduced by the authorized amount, no matter whether the transaction will be settled later or not. The authorized amount is reserved for the merchant and should be settled within the period agreed with the acquirer. The issuer returns an authorization code that serves as the reference of the authorization. Once a transaction has been successfully authorized it can be settled. Important: the cardholder will not be charged without settlement. Authorization and settlement can also be processed in one single step. Please continue here with deferred settlement API if you just authorized the transaction.
When you charge a stored card, the authorization and settlement will be processed in one single step. The settlement is often also referred to as “capture” or “clearing”. Once you sent a charge request, the authorized amount is reduced from the monthly allowance of the cardholder and will be automatically settled, which means that the cardholder will be actually charged.
For both options, you need an existing acquiring contract and we will have to add this acquirer to your account. You can choose from our list of Supported Acquirers and contact us at [email protected].
Stored tokens can be used multiple times for Recurring or One-Click Payments.
The service requires HTTP basic authentication. The required credentials can be found in our dashboard. Please refer to API authentication data for more information.
post
https://api.sandbox.datatrans.com
/v1/transactions/authorize
AUTHORIZE Method
Authorize
Authorize and Settle
Request
curl -X POST \
https://api.sandbox.datatrans.com/v1/transactions/authorize \
-H 'Authorization: Basic MTAwMDAwMTExMTpwWUU4bFE2TlBiM2thRXpR' \
-H 'Content-Type: application/json; charset=UTF-8' \
-d '{
"currency": "EUR",
"refno": "vptJ07xyr",
"amount": 1000,
"card": {
"alias": "AAABcHxr-sDssdexyrAAAfyXWIgaAF40",
"expiryMonth": "12",
"expiryYear": "21"
}
}
Response (successful)
{
"transactionId": "191023111742635093",
"acquirerAuthorizationCode": "111742",
"card": {
"masked": "490000xxxxxx0086"
}
}
Charge
curl -X POST \
https://api.sandbox.datatrans.com/v1/transactions/authorize \
-H 'Authorization: Basic MTAwMDAwMTExMTpwWUU4bFE2TlBiM2thRXpR' \
-H 'Content-Type: application/json; charset=UTF-8' \
-d '{
"currency": "EUR",
"refno": "vptJ07xyr",
"amount": 1000,
"autoSettle": "true",
"card": {
"alias": "AAABcHxr-sDssdexyrAAAfyXWIgaAF40",
"expiryMonth": "12",
"expiryYear": "21"
}
}
Response (successful)
{
"transactionId": "191023113146339569",
"acquirerAuthorizationCode": "113146",
"card": {
"masked": "424242xxxxxx4242"
}
}
If the authorization failed, you receive one of the following error codes.
"UNKNOWN_ERROR"
,"UNRECOGNIZED_PROPERTY"
,"INVALID_PROPERTY"
,"INVALID_TRANSACTION_STATUS"
,"TRANSACTION_NOT_FOUND"
,"INVALID_JSON_PAYLOAD"
,"UNAUTHORIZED"
,"EXPIRED_CARD"
,"INVALID_CARD"
,"UNSUPPORTED_CARD"
,"DUPLICATED_REFNO"
,"DECLINED"
,"BLOCKED_BY_VELOCITY_CHECKER"
,"CLIENT_ERROR"
,"SERVER_ERROR"
Last modified 1yr ago