Authorize/Settle
Using this API allows you to simply send a json request with a token to just **reserve **(authorize) or **charge **(settle) an amount.
Reserve an amount
Charge cardholder
When you reserve an amount on a stored card, the monthly allowance of the cardholder is reduced by the authorised amount, no matter whether the transaction will be settled later or not. The authorised amount is reserved for the merchant and should be settled within the period agreed with the acquirer. The issuer returns an authorisation code which serves as the reference of the authorisation. Once a transaction has been successfully authorised it can be settled.
Important: the cardholder will not be charged without settlement. Authorisation 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.
Stored cards can be used multiple times for recurring transactions or One-Click payments.

1. Add acquirer to your account

For this feature, you need an existing acquiring contract.
Text
Text
You can choose from a list of Supported Acquirer and contact us at [email protected]

2. Authorize a stored card

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
In test mode, only test credit cards are allowed.

Examples

Reserve amount (authorize)
Charge amount (auth+settle)
Request
1
curl -X POST \
2
https://api.sandbox.datatrans.com/v1/transactions/authorize \
3
-H 'Authorization: Basic MTAwMDAwMTExMTpwWUU4bFE2TlBiM2thRXpR' \
4
-H 'Content-Type: application/json; charset=UTF-8' \
5
-d '{
6
"currency": "EUR",
7
"refno": "vptJ07xyr",
8
"amount": 1000,
9
"card": {
10
"alias": "AAABcHxr-sDssdexyrAAAfyXWIgaAF40",
11
"expiryMonth": "12",
12
"expiryYear": "21"
13
}
14
}
Copied!
Response (successful)
1
{
2
"transactionId": "191023111742635093",
3
"acquirerAuthorizationCode": "111742",
4
"card": {
5
"masked": "490000xxxxxx0086"
6
}
7
}
Copied!
Charge
1
curl -X POST \
2
https://api.sandbox.datatrans.com/v1/transactions/authorize \
3
-H 'Authorization: Basic MTAwMDAwMTExMTpwWUU4bFE2TlBiM2thRXpR' \
4
-H 'Content-Type: application/json; charset=UTF-8' \
5
-d '{
6
"currency": "EUR",
7
"refno": "vptJ07xyr",
8
"amount": 1000,
9
"autoSettle": "true",
10
"card": {
11
"alias": "AAABcHxr-sDssdexyrAAAfyXWIgaAF40",
12
"expiryMonth": "12",
13
"expiryYear": "21"
14
}
15
}
Copied!
Response (successful)
1
{
2
"transactionId": "191023113146339569",
3
"acquirerAuthorizationCode": "113146",
4
"card": {
5
"masked": "424242xxxxxx4242"
6
}
7
}
Copied!

Error table

If the authorisation failed, you receive one of the 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 4d ago