Skip to main content

Capture

The API method Capture enables you to perform a partial of full capture of an authorized transaction.

API Parameters

important

With version 2 modificationId is mandatory for any capture API call. If you implemented capture according to v1 specifications please add this parameter.

FieldDescriptionTypeLengthMandatory
transactionIdUnique transaction identifier.String36Yes
merchantKeyMerchant identifier.String36Yes
modificationIdYour unique reference for the requested modification. Used to distinguish between retry and new modification.String64Yes
customReferencesFor external party usagecustomReferencesObjectNo
modifiedAmountAdditional transaction data.Object-No
modifiedAmount.descriptionDescription of the i.e. the reason for the payment.String127No
modifiedAmount.amountTransaction modification amountDecimal18.2Yes
modifiedAmount.currencyCodeTransaction modification currency. The 3-letter currency ISO-4217 code.String3Yes
info

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.

info

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"
}
}
info

"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"
}
}
]
}
}
info

We unified the modification API responses. Please refer to the modification API response model for further details on API responses and error handling.

info

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