Refund Payment
POST
/v1/payments/{id}/refundCoreRefund a captured payment fully or partially. 200 when the refund settled synchronously; 202 when it is in-flight (the refund-reconciler completes it — do not mint a fresh Idempotency-Key on 202). Supports an optional Idempotency-Key header.
Authentication
Signature Pattern
HMAC-SHA256(secretKey, "{timestamp}\nPOST\n/v1/payments/{id}/refund\n{sha256(body)}")| Header | Value | Description |
|---|---|---|
X-Api-Key | pk_live_a1b2c3d4e5f6g7h8 | Merchant public API key |
X-Signature | {hmac_sha256_hex} | Hex HMAC-SHA256 request signature (see below) |
X-Timestamp | 2026-04-13T10:00:00Z | ISO 8601 UTC request time, validated within ±5 min |
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
amount | integer | Optional | Partial refund amount in kuruş (<= refundableAmount). Omit for a full refund. |
reason | string | Optional | Refund reason (truncated at 500 chars) |
Request Example
JSONRequest Body
{
"amount": 5000,
"reason": "Customer request"
}Response Parameters
| Field | Type | Example |
|---|---|---|
paymentId | string | "pay_1a2b3c4d5e6f" |
status | string | "captured" |
refundAmount | integer | 5000 |
refundableAmount | integer | 10000 |
lastRefund | object | {…} |
lastRefund.refundId | string | "rfn_7c8d9e0f1a2b" |
lastRefund.status | string | "completed" |
lastRefund.amount | integer | 5000 |
lastRefund.bankRefundId | string | "rfn_mock_44182" |
lastRefund.createdAt | string | "2026-04-13T14:00:00Z" |
lastRefund.completedAt | string | "2026-04-13T14:00:01Z" |
Response Example
JSONResponse
{
"paymentId": "pay_1a2b3c4d5e6f",
"status": "captured",
"refundAmount": 5000,
"refundableAmount": 10000,
"lastRefund": {
"refundId": "rfn_7c8d9e0f1a2b",
"status": "completed",
"amount": 5000,
"bankRefundId": "rfn_mock_44182",
"createdAt": "2026-04-13T14:00:00Z",
"completedAt": "2026-04-13T14:00:01Z"
}
}Status Codes
200Success
201Created
400Bad Request
401Unauthorized
404Not Found
429Rate Limited
Try itMock
POSThttps://api.pay.sandbox.kvell.group