With version 2 modificationId is mandatory for any capture API call. If you implemented capture according to v1 specifications please add this parameter.
Capture V1
Last changes: 03-08-2021
The API method Capture enables you to perform a partial of full capture of an authorized transaction.
Field | Description | Type | Length | Mandatory |
transactionId | Unique transaction identifier. | String | 36 | Yes |
merchantKey | Merchant identifier. | String | 36 | Yes |
modificationId | Merchant unique request identifier. | String | 64 | Yes |
modifiedAmount | Additional transaction data. | Object | 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 reccognize retrys 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 }
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": {
"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
{
"transactionId": "933a0fab-80a0-42c5-b010-c71174f4ab32",
"paymentStatus": "CAPTURED"
}
Response on (logical) failure
-
Status Code:
-
200 (OK)
-
Header:
-
Content-Type: application/json
Accept-Language: en-US
{
"transactionId": "93252586-4fa2-4d2a-9d1f-ad611eedbacf",
"paymentStatus": "[...]" //Payment status is not CAPTURED or CAPTURE PENDING
}
For response codes other than 200 (e.g. 4xx or 5xx) please retry the opteration up to three times within ten minutes and contact VW Payments customer support in case the error persits.