Tinka

Invoice Refund Request

Only available for payment method: Invoice

A refund request for invoice can be sent from the merchant when the customer don't need to pay anymore for a line. For example when the line is Canceled or Returned . The merchant can send a refund request for one or more lines of a payment request.

We expect from the merchant an endpoint to send the result of the invoice refund request. When the invoice refund request is Accepted, then Tinka will cancel or refund the invoice for the customer.

URL

POST /merchant-api/v2/invoices/{paymentRequestId}/refunds


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 refunded. Payment method not allowed. MerchantRefundReferenceId 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
merchantRefundReferenceId requiredString100A reference provided by the merchant. Must be unique.
lines requiredList of Line
callbackUrl requiredString2048The URL on which the result of the invoice refund request can be send.

Line

AttributeTypeLengthDescription
merchantLineReference requiredString100The reference to the original line in the payment request. Must be unique per invoice refund request
numberOfItems requiredIntegerThe number of items to be refunded

Response

AttributeTypeLengthDescription
refundId requiredString36Unique identifier issued by Tinka. It is a UUID.

Example

Request

{
    merchantRefundReferenceId: 'merchant-refund-id-1',
    lines: [{
      merchantLineReference: 'Example_0000001',
      numberOfItems: 1
    }],
    callbackUrl: 'https://merchant.nl/refund'
}

Response

{
  refundId: '65446767-ffff-tttt-5555-34567321abc';
}

Callback Invoice Refund Request

The merchant needs to have an endpoint available where Tinka can send an update of the invoice refund 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
refundId requiredString36A unique number for this invoice refund 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 InvoiceRefundRequest. Possible values Accepted, Rejected
rejectionReasonString255The possible reason for the rejection of the refund request

Example

Accepted Request Body for endpoint

{
  refundId: '65446767-ffff-tttt-5555-34567321abc',
  paymentRequestId: '01234567-aaaa-bbbb-cccc-987654321abc',
  decision: 'Accepted'
}

Rejected Request Body for endpoint

{
  refundId: '65446767-ffff-tttt-5555-34567321abc',
  paymentRequestId: '01234567-aaaa-bbbb-cccc-987654321abc',
  decision: 'Rejected',
  rejectionReason: 'All lines where already refunded'
}

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