Defered settlement

The Settlement request is often also referred to as “Capture” or “Clearing”. It can be used for the settlement of previously authorized transactions. The transactionId is needed to settle an authorization. Note: This API call is not needed if "autoSettle": true was used when initializing a transaction.

The service requires HTTP Basic Authentication. Provide your merchantId as the basic authentication username value. The password can be found in the Web Admin Tool under UPP Administration > Security > Server-to-Server services security.

post
Defered settlement

https://api.sandbox.datatrans.com/v1/transactions/{transactionId}/settle
Settle a previously authorized transaction. Settled amount may not exceed initially authorized amount.
Request
Response
Request
Path Parameters
transactionId
required
integer
The transactionId received after an authorization
Headers
Authorization
required
string
Basic MTEwMDAwNzAwNjpLNnFYMXUklQ==
Content-Type
required
string
application/json; charset=UTF-8
Body Parameters
amount
required
integer
The amount of the transaction in the currency's smallest unit. For example use 1000 for EUR 10.00
currency
required
string
3 letter ISO-4217 character code. E.g. EUR or USD
refno
required
string
The merchants reference number. It should be unique for each transaction.
Response
204: No Content
Transaction successfully settled
400: Bad Request
Invalid request
{
"error": {
"code": "see table below for detailed error messages",
"message": "see table below for detailed error messages"
}
}

Example

Request
Response (success)
Response (error)
Request
curl -X POST \
https://api.sandbox.datatrans.com/v1/transactions/191023125905647521/settle \
-H 'Authorization: Basic MTAwMDAwMTExMTpwWUU4bFE2TlBiM2thRXpR' \
-H 'Content-Type: application/json; charset=UTF-8' \
-d '{
"amount": 1000,
"currency": "EUR",
"refno": "49raer8TC"
}'
Response (success)
204 Transaction successfully settled
Response (error)
{
"error": {
"code": "INVALID_PROPERTY",
"message": "exceeded authorization amount"
}
}

Error table

If the settlement 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"