After The Payment
Once you have concluded a customer- or merchant-initiated transaction you can proceed with further actions. You can either settle, cancel, refund, or check the status of a transaction. The details of these operations can be found on this page.
Settling a transaction
To settle or capture a transaction you have two options: Either you settle transactions automatically with the authorization or you send us a request to settle them. The first approach is the easier one, as you do not have to think about sending a second call to our API to settle a transaction. However, the second approach allows you to debit your customers only if you have successfully processed the payment response in your system. So if your business case requires it, you may defer the settlement and send us an additional call to our settlement endpoint.
We strongly suggest you to settle transactions as fast as possible, as some payment methods or acquirers decline settlements after a few days. Usually, a transaction can be settled up to 30 days after the authorization.
To settle transactions automatically, add the parameter autoSettle
to your payload when initializing a transaction.
"autoSettle": true
Below is an example showing you how to settle a transaction using our API. You can also settle a lower amount than the one previously authorized. This can be useful if you wish to finalize transactions with a lower amount or to settle the full amount in separate intervals (so-called partial settlements). A settlement with a higher amount than the authorized amount is not supported.
curl 'https://api.sandbox.datatrans.com/v1/transactions/{transactionId}/settle' \
--header 'Authorization: Basic {basicAuth}' \
--header 'Content-Type: application/json' \
--data-raw '{
"currency": "CHF",
"amount": 100,
"refno": "Test-1234-settled"
}'
Deferred Settlements not possible with all payment methods
Please be aware that not all payment methods support deferred settlements. More details on which payment methods accept deferred settlements can be found on our payment methods overview.
Cancelling a transaction
A transaction that has not been settled yet can be cancelled. This will lead to a cancelled transaction which will no longer be debited from your customer and the amount will be unblocked on the customer's account. The cancel request is also referred to as a reversal. Send a call to our cancel endpoint.
curl 'https://api.sandbox.datatrans.com/v1/transactions/{transactionId}/cancel' \
--header 'Authorization: Basic {basicAuth}' \
--header 'Content-Type: application/json' \
--data-raw '{
"refno": "Test-1234-cancelled"
}'
Refunding a transaction
A settled transaction can be refunded to any amount equal or lower than the settled amount. Send a call to our refund endpoint to refund a transaction. A refund will create a new transactionId dedicated to the refund process.
curl 'https://api.sandbox.datatrans.com/v1/transactions/{transactionId}/credit' \
--header 'Authorization: Basic {basicAuth}' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 100,
"currency": "CHF",
"refno": "Test-1234-credit"
}'
Checking the status of a transaction
Regardless of the status of a transaction, you can check for the current status at any time. This call will return all steps previously completed and useful information related to the transaction. Call our status endpoint to do check for the status.
curl 'https://api.sandbox.datatrans.com/v1/transactions/{transactionId}' \
--header 'Authorization: Basic {basicAuth}' \
--header 'Content-Type: application/json'
The response will also include the token (alias) and further details, once a registration has been completed.
"card": {
"alias": "{cardAlias}",
"fingerprint": "{fingerprint}",
"masked": "424242xxxxxx4242",
"expiryMonth": "06",
"expiryYear": "25",
"info": {
"brand": "VISA CREDIT",
"type": "credit",
"usage": "consumer",
"country": "GB",
"issuer": "DATATRANS"
},
"3D": {
"authenticationResponse": "D"
}
}
Reconciling your transactions
Add our reconciliation service to reconcile your online transactions with your acquirers' payouts. This gives you the option to identify missing payouts and chargebacks quickly and easily from your merchant dashboard. Please refer to our dedicated Reconciliation page in our documentation for more information.
Updated 5 months ago