Capture

Capture a pre-authorised payment.


When a payment is pre-authorised, the authorisation reserves the funds on the shopper's card. When you send a request to capture the payment, the reserved funds are taken from the shopper's card and the payment is completed for your merchant.

An example of when to capture separately: a takeaway pre-authorises the order when the shopper pays, and captures it when the order leaves the shop. If the order can't be delivered, the takeaway reverses the authorisation instead.

Requirements

Before you begin, take into account the following requirements, limitations, and preparations.

RequirementDescription
Integration typeAn online payments integration.
API credentialsYour api_token, sent in the api_token header.
WebhooksListen for the payment status webhook with the following status values:
- capture
- capture_failed
LimitationsYou can only capture a payment that was pre-authorised and hasn't been captured yet. The capture amount can be equal to or less than the authorised amount.

Capture a payment

To capture a pre-authorised payment:

  1. From the payment status webhook for the payment, get the xref of the authorisation you want to capture.

  2. Make a capture request with your api_token header and the following parameters:

    ParameterRequiredDescription
    xrefRequiredThe payment's reference, O<order_id>M<merchant_id>T<payment_id>.
    merchant_idRequiredThe merchant that took the payment, as a string.
    amountRequiredThe amount to capture, in major units. This must be the same as or, for a partial capture, less than the authorised amount. Minimum 0.01.

    The Capture a pre-authorised payment page in the API Explorer has the full request, with examples you can try.

  3. In the capture response, note the following:

    • HTTP status 201: the acquirer accepted the capture.
    • outcome: success.
    • payment_reference: the acquirer's reference for this capture.
    • status: received. Your capture request is processed asynchronously. You receive the result in a webhook.

    Capture response

    {
      "outcome": "success",
      "payment_reference": "QFQTPCQ8HXSKGK82",
      "status": "received",
      "amount": 27.75
    }
  4. Wait for the payment status webhook to learn the outcome of the request.

Reasons for a failed capture 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:

messageDescription
Capture amount cannot be greater than the authorised amount of 27.75The capture amount is more than the authorised amount. The response also has code 400.
No record found for the given order_idNo authorised payment matches the xref. Check the xref, and that the payment is authorised and not yet captured.
Token is empty or Invalid tokenThe 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. Read the HTTP status and message, not only outcome.

Webhooks for captures

Capture is an asynchronous process. To keep you informed, Datman sends payment status webhooks to the webhook_url of the payment:

  • capture: indicates whether the capture succeeded.
  • capture_failed: indicates that the capture failed after it was accepted.

Capture webhook

When the capture is processed, Datman sends a payment status webhook with:

  • status: capture.
  • xref: the reference of the payment.
  • amount: the captured amount, in major units with two decimals.
  • success: whether the capture succeeded. Possible values:
    • true: the capture succeeded.
    • false: the capture failed. The webhook includes a reason field with a short description of the problem.
  • split_fee_status: the split outcome, present only for orders with split fees.

Example capture webhook for a successful capture

{
  "order_id": "EP-1001",
  "amount": "27.75",
  "currency": "GBP",
  "xref": "O88213045M10012345T4821937",
  "status": "capture",
  "success": "true",
  "date": "2026-10-15 13:05:10+01:00"
}

capture_failed webhook

In rare cases, a capture fails after it was accepted. When this happens, Datman sends a payment status webhook with:

  • status: capture_failed
  • reason: a short description of the problem.

See also

On this page

Need help?

Questions about your integration, credentials or going live?

Contact supportRequest a sandbox