Capture
The API method Capture enables you to perform a partial of full capture of an authorized transaction.
API Parameters
With version 2 modificationId is mandatory for any capture API call. If you implemented capture according to v1 specifications please add this parameter.
Field | Description | Type | Length | Mandatory |
---|---|---|---|---|
transactionId | Unique transaction identifier. | String | 36 | Yes |
merchantKey | Merchant identifier. | String | 36 | Yes |
modificationId | Your unique reference for the requested modification. Used to distinguish between retry and new modification. | String | 64 | Yes |
customReferences | For external party usage | customReferences | Object | No |
modifiedAmount | Additional transaction data. | Object | - | No |
modifiedAmount.description | Description of the i.e. the reason for the payment. | String | 127 | No |
modifiedAmount.amount | Transaction modification amount | Decimal | 18.2 | Yes |
modifiedAmount.currencyCode | Transaction modification currency. The 3-letter currency ISO-4217 code. | String | 3 | Yes |
In retry situations, please make sure to always use the same modificationID as provided in the initial request. SmartPay uses the modificationID to recognize retries and will always provide you this the same result as in the initial request posted with the same modificationID.
The request must have the following headers:
Content-Type: application/json
Accept-Language: en-US
Origin: { Origin }
Example
Request - full capture
Path:
POST {Base URL}/payment/capture
Header:
Content-Type: application/json
Accept-Language: en-US
{
"transactionId": "933a0fab-80a0-42c5-b010-c71174f4ab32",
"merchantKey": "31928de9-1344-469f-b0eb-8e5d0fef3d21",
"modificationId": "ab5df182-e642-4e37-8cdb-d684eb2142d6"
}
Request - partial capture
Path:
POST {Base URL}/payment/capture
Header:
Content-Type: application/json
Accept-Language: en-US
{
"merchantKey": "31928de9-1344-469f-b0eb-8e5d0fef3d21",
"transactionId": "933a0fab-80a0-42c5-b010-c71174f4ab32",
"modificationId": "f7c55bb3-0004-4363-9a34-56af8d5e691e",
"modifiedAmount": {
"description": "SMP-Transaction-01",
"amount": 25,
"currencyCode": "EUR"
}
}
"modifiedAmount" is only required for partial capture.
Response
Status Code:
200 (OK)
Header:
Content-Type: application/json
Accept-Language: en-US
{
"reconciliationReferenceId": "pzFdwq0ImRFYGYuq41xCH",
"description": "Purchase 1x product ABC",
"paymentStatus": "CAPTURED",
"creationDate": "2020-12-15T14:38:59.150Z",
"lastStatusDate": "2020-12-15T14:40:08.853Z",
"transactionOverview": {
"amount": 10.99,
"currencyCode": "EUR",
"mit": false,
"transactionId": "48c4e923-e88c-464b-a4e7-ccb2c6d3775e",
"paymentMethod": "CARDS",
"customerAccountId": "Test"
},
"modification": {
"modificationData": {
"type": "CAPTURE",
"modificationId": "jhgjhabkjh58gjgkjhlkjkhgkjhg6",
"reconciliationReferenceId": "pzFdwq0ImRFYGYuq41xCH"
},
"modificationAmount": {
"description": "SMP-Transaction-01",
"amount": 10.99,
"currencyCode": "EUR"
},
"status": "CAPTURED",
"creationDate": "2020-12-15T14:38:59.150Z",
"statusHistory": [
{
"status": "CAPTURE_PENDING",
"statusDate": "2020-12-15T14:40:07.406Z",
"modificationAmount": {
"amount": 10.99,
"currencyCode": "EUR"
}
},
{
"status": "CAPTURED",
"statusDate": "2020-12-15T14:40:08.678Z",
"modificationAmount": {
"amount": 10.99,
"currencyCode": "EUR"
}
}
]
}
}
We unified the modification API responses. Please refer to the modification API response model for further details on API responses and error handling.
Capture Error Handling
An authorization is generally a guarantee that a capture should succeed. However a capture can nonetheless fail due to errors between the Gateway and Acquirer. You can retry your request up to 3 times. If the error continues to persist, you can contact Customer Support for details.
3.1 - 2021-03-17 - Added "description" field to API