Capture Transaction

In this section you will learn how to process a Capture transaction

Capture Overview

Following a PreAuthorization or Topup, a Capture transaction requests settlement of the transaction (capture the final transaction amount).

456

How to process a Capture transaction request message

The merchant's system Posts a JSON Capture transaction message to the ANYpay Gateway. Section Card Transactions describes the elements required to build a Capture transaction request message.

📘

Key elements of a Capture transaction request message

Type MUST be set to [ecom.capture] or [mailorder.capture]

clientSystemInvoiceId Must match the same value used in the associated PreAuthorization transaction

cardTokenizedNumber Must match the same value returned in the associated PreAuthorization transaction

[ecom.capture] or [mailorder.capture] MUST be used to capture an associated PreAuthorization transaction, otherwise 3D Secure (3DS) data will not be submitted to the acquirer in settlement.

An example of a Capture transaction message request can be seen below.

{ 
  "merchantId": "BDD", 
  "storeId": "BDD500000005", 
  "userId": "BDDTest", 
  "type": "ecom.capture", 
  "amount": "10.00", 
  "currencyCode": "GBP", 
  "clientSystemInvoiceId": "1", 
  "clientSystemTransactionId": "1-2",
  "accountDetails": {
    "cardTokenizedNumber": "9997000000005071111"
  }
}

Handling a Capture transaction response message

An example of a Capture transaction response message can be seen below.

{
  "id": "7890ff90-e277-4ead-a7d8-6929a3f83286",
  "state": "Approved",
  "providerStateCode": "000",
  "providerStateMessage": null,
  "currencyCode": "USD",
  "accountDetails": {
    "cardNumber": "444433******1111",
    "tokenizedCardNumber": "9997000000005071111",
    "isVisaCheckout": null
  },
  "details": {
    "providerMerchantId": "542929008043127",
    "providerTerminalId": "00630376"
  },
  "stateDetails": {
    "approvalCode": "06268A"
  },
  "cardSecurityResponseCode": null,
  "addressVerificationResponseCode": null
}
{
  "code": "4017740",
  "details": {
    "message": "Invalid username or password"
  }
}