Payment modificationsPayment modifications

Capture a pre-authorised payment

post/api2.php?action=capture

Captures a payment that was only authorised (a pre-auth). The amount can be equal to or less than the authorised amount. Identify the payment by its xref (O<order_id>M<merchant_id>T<payment_id>), which you receive in the payment status webhook.

Validation errors are returned with HTTP 200 and outcome: failed. When the request reaches the payment provider, its HTTP status is returned: 201 when accepted, or an error status. outcome is then success even if the provider returned an error.

Endpoint destination URL

https://sandbox-payments.datmanpay.com/api2.php?action=capture

Authorization

ApiTokenAuth
headerapi_token<token>

API token issued by Datman.

Request Parameters

Request Body

application/json
  1. body
xref*string

The payment's reference, O<order_id>M<merchant_id>T<payment_id>.

Match^O([A-Z]*\d+)M(\d+)T(\d+)$
merchant_id*string

The merchant that took the payment, as a string.

amount*number

The amount to capture, or the new authorised amount for an adjustment, in major units.

Range0.01 <= value
split_fee?array<>|

Adjustment only. New split fees; when omitted the existing splits are kept.

Response parameters & Errors

Response Body

The request failed before reaching the payment provider.

application/json
  1. response
outcome*string
message?string
code?integer

An error code, present for some failures.