Refund a payment
Performing a refund will return the funds to the customer after a payment has been settled. For this reason, refunds can only be requested for payments in a captured state.
Multiple refund requests for the same transaction can be made if supported by the respective channel. The total amount of all successful partial refunds cannot exceed the total captured amount of the original payment.
If no amount value is provided in the refund request then a full refund will be processed.
You will receive notifications related to a refund through webhooks or by calling the GET endpoints
Refund amounts are in minor units, for example a refund for €1.20 should be sent as 120.
Details on required fields and validation can be found in our Open API specification.
- Production
- Sandbox
POST https://api.paytently.io/payments/{payment_id}/refunds
POST https://sandbox.api.paytently.io/payments/{payment_id}/refunds
Request:
- Full Refund
- Partial Refund
curl --location 'https://sandbox.api.paytently.io/payments/{payment_id}/refunds'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer token_here'
--data-raw '{
"reference": "ord123"
}'
curl --location 'https://sandbox.api.paytently.io/payments/{payment_id}/refunds'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer token_here'
--data-raw '{
"reference": "ord123",
"amount": 50
}'
Response:
- 202
- 400
- 404
- 422
- 500
{
"id": "ref_12345",
"status": "pending",
"_links": {
"self": {
"href": "https://sandbox.api.paytently.io/payments/pay_12345/refunds/ref_12345",
"method": "GET"
}
}
}
{
"trace_id": "12345",
"errors": [
{
"property": "metadata",
"code": "malformed_request",
"reason": "",
"docs": "https://docs.paytently.io/api/reference"
}
]
}
No body returned for response
{
"trace_id": "12345",
"errors": [
{
"property": "reference",
"code": "reference_invalid",
"reason": "reference must not be more than 64 characters",
"detail": "Invalid length: 70",
"docs": "https://docs.paytently.io/api/reference"
},
{
"property": "reference",
"code": "reference_invalid",
"reason": "reference must only contain letters, numbers and accepted special characters: _-",
"detail": "Invalid characters: @",
"docs": "https://docs.paytently.io/api/reference"
}
]
}
{
"title": "Server error",
"status": 500,
"trace_id": "12345"
}