Country:
/payments/{paymentId}/refund
Refund Payment
Process a refund for an existing payment
URL Parameters
paymentId
Unique identifier for the payment to refund
example
amount
Refund amount in cents (optional for full refund)
example
reason
Reason for refund
example
Response Examples
200
Refund processed successfully
{
"id": "ref_1234567890",
"payment_id": "pay_1234567890",
"amount": 500,
"currency": "USD",
"status": "succeeded",
"reason": "requested_by_customer",
"created": 1647875400
}400
Invalid refund request
{
"error": {
"type": "invalid_request_error",
"code": "amount_too_large",
"message": "Refund amount cannot exceed the original payment amount"
}
}500
Internal server error
{
"error": {
"type": "api_error",
"message": "An unexpected error occurred. Please try again later."
}
}Language
Login required to test API
Code Examples
cURL
curl -X POST "https://api.akua.la/payments/pay_1234567890/refund" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 500,
"reason": "requested_by_customer"
}''