Adjust authorisation
Pre-authorise a payment, adjust the authorised amount, and capture the payment.
In a pre-authorised payment, the amount is authorised first and captured later. Before you capture it, you can increase or decrease the authorised amount, for example when the final order total differs from what the shopper first paid. Changes to a pre-authorised payment are called authorisation adjustments.
Be aware that:
- You rely on webhooks to know whether the capture succeeds.
- You need to implement logic on your end to decide when to adjust, and to calculate the new amount.
Requirements
Before you begin, take into account the following requirements, limitations, and preparations.
| Requirement | Description |
|---|---|
| Integration type | An online payments integration. |
| API credentials | Your api_token, sent in the api_token header. |
| Webhooks | Listen for the payment status webhook with the following status values:- authorisation_adjustment - capture - capture_failed |
| Limitations | You can only adjust a payment that was pre-authorised and hasn't been captured yet. For a payment with a saved card, the new amount can't be more than the merchant's limit. |
1. Pre-authorise a payment
Take the payment as a pre-authorisation, then save the xref from the payment status webhook with status authorisation and success true. You need the xref for the adjustment and the capture.
2. Adjust the pre-authorised amount
To increase or decrease the pre-authorised amount:
-
Make an adjustment request with your
api_tokenheader and the following parameters:Parameter Required Description xrefRequired The payment's reference, O<order_id>M<merchant_id>T<payment_id>.merchant_idRequired The merchant that took the payment, as a string. amountRequired The new authorised amount, in major units. This is the full new total, not the difference. Minimum 0.01. split_feeNew split instructions. Each item has partner_merchant_id,type_id,valueandvalue_type(amount or percentage). If you leave it out, the existing splits are kept. The total of the splits must be less thanamount.For example, when the shopper adds a drink, Example Pizza Ltd increases a GBP 24.50 pre-authorisation by sending
amount27.75. The Adjust the amount of a pre-authorised payment page in the API Explorer has the full request, with examples you can try. -
In the response, note the following:
- HTTP status 201: the acquirer accepted the adjustment.
outcome: success.payment_reference: the acquirer's reference for this adjustment.status: authorised.
Adjustment response
{ "outcome": "success", "payment_reference": "QFQTPCQ8HXSKGK82", "status": "authorised", "amount": 27.75 }If the acquirer refuses the adjustment, you receive HTTP 422 with
outcomesuccess,messageAmount adjustment refused, andresultCodeandreasonRefused. -
Datman also sends a payment status webhook with
statusauthorisation_adjustment, andsuccesstrue if the new amount was authorised or false if it wasn't.
Reasons for a failed adjustment request
If the request fails before it reaches the acquirer, you receive HTTP 200 with outcome failed and a message. The most common messages are:
message | Description |
|---|---|
Amount exceeds the limit | The new amount is more than the merchant's limit for saved-card payments. The response also has code 1006. |
Total split cannot be greater than or equal to order value (30.00 / 27.75) | The total of split_fee is equal to or more than amount. The response also has code 400. |
No record found for the given order_id | No authorised payment matches the xref. Check the xref, and that the payment is authorised and not yet captured. |
Token is empty or Invalid token | The api_token header is missing or invalid. |
If the acquirer returns an error, you receive its HTTP status, for example 500, with outcome success and a message.
3. Capture the payment
After you make your last authorisation adjustment, you must capture the payment to take the reserved funds.
Always double-check that you have completed all adjustments for the payment before you capture it. Captures are processed asynchronously.
- Decide whether you are ready to capture the payment:
- If there are additional charges to make, first adjust the authorisation.
- If you don't want to take the payment, don't capture it. Instead, reverse the authorisation.
- When you are ready, make a capture request with the same
xref. See Capture.

