Capture Request
Tinka offers two ways of capturing orders:
- Accept payment request and capture in one go.
- After accepting the payment request, capture the order after some time, when the product is delivered to the consumer.
A capture request must be sent from the merchant when the order is fulfilled. For both Pay in 14 days (Invoice) and Pay in 12 months+ (Credit) payment methods, the capture is done based on the order line(s) received in the capture request.
We expect from the merchant an endpoint to send the result of the capture request. When the capture request is Accepted, then Tinka will create an invoice for the customer.
The Capture is available only for the following payment methods: Pay in 14 days(invoice) and Pay in 12 months+ (Credit)
URL
POST
/merchant-api/v2/capture
HTTP response codes
200
- Successful operation400
- Request body not as expected. MerchantLineReference does not exist for the given payment request. NumberOfItems can't be captured. Payment method not allowed. MerchantCaptureReferenceId already exists.401
- Unauthorized, maybe the credentials are missing. For more information, see security403
- Forbidden, the HMAC may be wrong or out of date. For more information, see security404
- Payment request for given ID does not exist
Request
Attribute | Type | Length | Description |
---|---|---|---|
paymentRequestId required | String | 36 | A reference to the original payment request id. It is a UUID. |
merchantCaptureReferenceId required | String | 100 | A reference provided by the merchant. Must be unique. |
lines required | List of Line | ||
callbackUrl required | String | 2048 | The URL on which the result of the capture request can be send. |
Line
Attribute | Type | Length | Description |
---|---|---|---|
merchantLineReference required | String | 100 | The reference to the original line in the payment request. |
numberOfItems required | Integer | The number of items to be captured |
Response
Attribute | Type | Length | Description |
---|---|---|---|
captureId required | String | 36 | Unique identifier issued by Tinka. It is a UUID. |
Example
Request for Pay in 14 days (Invoice) and Pay in 12 months+ (Credit).
{
paymentRequestId: '01234567-aaaa-bbbb-cccc-987654321abc',
merchantCaptureReferenceId: 'merchant-capture-id-1'
lines: [{
merchantLineReference: 'Example_0000001',
numberOfItems: 1
}]
callbackUrl: 'https://merchant.nl/capture'
}
Response
{
captureId: '65446767-ffff-tttt-5555-34567321abc',
}
Callback Capture Request
The merchant needs to have an endpoint available where Tinka can send an update of the
capture request. The message below is sent to this endpoint in JSON format with a HTTP
POST request. The request will be signed in the same way a response of a synchronous call is
signed. The signature will be sent via a HTTP header:
X-Authorization: hmac <merchant-id>:<hash>:<nonce>:<timestamp>
for more information see security.
Request Body for endpoint
Attribute | Type | Length | Description |
---|---|---|---|
captureId required | String | 36 | A unique number for this capture request transaction. It`s a UUID |
paymentRequestId required | String | 36 | A unique number for this payment request transaction. It`s a UUID |
decision required | Enum String | The decision of the CaptureRequest. Possible values Accepted , Rejected | |
rejectionReason | String | 255 | The possible reason for the rejection of the capture request |
Example
Accepted Request Body for endpoint
{
captureId: '65446767-ffff-tttt-5555-34567321abc',
paymentRequestId: '01234567-aaaa-bbbb-cccc-987654321abc',
decision: 'Accepted'
}
Rejected Request Body for endpoint
{
captureId: '65446767-ffff-tttt-5555-34567321abc',
paymentRequestId: '01234567-aaaa-bbbb-cccc-987654321abc',
decision: 'Rejected'
rejectionReason: 'All lines where already captured'
}