Tinka

Capture Request

Tinka offers two ways of capturing orders:

  1. Accept payment request and capture in one go.
  2. 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 operation
  • 400 - 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 security
  • 403 - Forbidden, the HMAC may be wrong or out of date. For more information, see security
  • 404 - Payment request for given ID does not exist

Request

AttributeTypeLengthDescription
paymentRequestId requiredString36A reference to the original payment request id. It is a UUID.
merchantCaptureReferenceIdrequiredString100A reference provided by the merchant. Must be unique.
lines requiredList of Line
callbackUrl requiredString2048The URL on which the result of the capture request can be send.

Line

AttributeTypeLengthDescription
merchantLineReference requiredString100The reference to the original line in the payment request.
numberOfItems requiredIntegerThe number of items to be captured

Response

AttributeTypeLengthDescription
captureId requiredString36Unique 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

AttributeTypeLengthDescription
captureId requiredString36A unique number for this capture request transaction. It`s a UUID
paymentRequestId requiredString36A unique number for this payment request transaction. It`s a UUID
decision requiredEnum StringThe decision of the CaptureRequest. Possible values Accepted, Rejected
rejectionReasonString255The 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'
}

© 2024 Tinka. All Rights Reserved. All trademarks, service marks and trade names used in this material are the property of their respective owners.