Credit Refund Request
Merchants with direct capture can refund a certain amount of a payment. The amount can't be higher then the original requested amount.
Merchants with delayed capture can refund one or more order lines of a payment. The total refund lines amount can't be higher than the initial requested amount.
URL
POST
/merchant-api/v2/refunds
HTTP response codes
200
- Successful operation400
- Payment method Invoice is not allowed / Refund amount is not allowed / Number of items for a refund must be a positive number / MerchantLineReference is not allowed / Please supply at least one refund line / Merchant line references must be unique / Either refundAmount of refundLines should be provided401
- 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. |
refundAmount* | Int | The amount of the refund. The amount is always in euro cents and should be >= 0 | |
merchant required | Merchant | ||
transactionId required | String | 100 | A reference provided by the caller. We recommend to use this for linking the refund request and make it unique for every transaction |
merchantRequestReference required | String | 100 | A reference provided by the merchant |
refundLines* | String | 255 | List of Lines (below) |
* This depends on whether the merchant supports delayed capturing or not. The refundAmount is required for merchants that do not support delayed capturing and refundLines is required for merchants that do support delayed capturing.
Lines
Attribute | Type | Length | Description |
---|---|---|---|
merchantLineReference required | String | 100 | The reference to the original line in the payment request |
numberOfItems required | Int | The number of items to be refunded |
Type: Merchant
Unique identification of the merchant provided by Tinka.
Attribute | Type | Length | Description |
---|---|---|---|
merchantId required | String | 100 | The unique id of the merchant provided by Tinka. Should be the same as the merchant id used to sign the request |
Response
Attribute | Type | Length | Description |
---|---|---|---|
refundRequestId required | String | 36 | Unique identifier issued by Tinka. It is a UUID. |
response required | String Enum | The decision on the refund request. Possible values Accept , Reject . Rejection can occur when the requested refund amount exceeds the requested payment amount | |
additionalData | String | 255 | Additional info about the refund request. Reason why the refund is Rejected |
Example
Request
{
paymentRequestId: "01234567-aaaa-bbbb-cccc-987654321abc",
refundAmount: "40000",
merchant: {
merchantId: "example"
},
transactionId: "flkgfhkjh238iksdf",
merchantRequestReference:"ssg5455g"
}
Request with refund lines
{
paymentRequestId: "01234567-aaaa-bbbb-cccc-987654321abc",
merchant: {
merchantId: "example"
},
transactionId: "flkgfhkjh238iksdf",
merchantRequestReference:"ssg5455g",
refundLines: [{
merchantLineReference: "Example_0000001",
numberOfItems: 1
}]
}
Response
{
additionalData: "Requested refund amount exceeds open balance",
refundRequestId: "01234567-aaaa-bbbb-cccc-987654321abc",
response: "Reject"
}