Process Refund
POST /payment/refund — full or partial refund of a successful payment.
Refunds a previously successful payment (full or partial).
Refunds are processed against the gateway transaction ID from the original sale. Partial refunds are supported until the remaining refundable balance reaches zero.
Request
| Method | POST |
| URL | {baseUrl}/payment/refund |
| Auth | Header x-api-key (required) |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
transactionId | string | Yes | DigetPay gateway transaction ID from the original sale |
amount | number | Yes | Refund amount (min 0.01, must not exceed remaining refundable balance) |
Critical: Do not pass the checkout session ID or numeric
paymentIdastransactionId. Only the gateway transaction UUID is accepted.
Request payload
{
"transactionId": "2232e99b-0257-47d5-bbfd-022c8951767f",
"amount": 0.2
}Important: Refund amount must not exceed the remaining refundable balance. Over-refunding returns
400withRefund amount more than sale amount.
Responses
{
"success": {
"status": 200,
"body": {
"code": 200,
"message": "Success",
"errorCode": null,
"data": {
"result": "accepted",
"referenceId": "2026001124",
"paymentId": "0808779145497567115585",
"message": "Refund Created Successfully!",
"amount": "0.20",
"refundId": "1046772"
}
}
}
}{
"failed": {
"status": 400,
"body": {
"code": 400,
"message": "Refund amount more than sale amount",
"errorCode": "400",
"data": null
}
}
}{
"failed_unauthorized": {
"status": 401,
"body": {
"statusCode": 401,
"message": "Missing API key",
"error": "Unauthorized"
}
}
}Response fields
| Field | Description |
|---|---|
result | accepted when refund is submitted |
refundId | DigetPay refund reference |
paymentId | Original payment reference |
amount | Refunded amount |
Best practice: After a successful refund, call Query Transaction Status and verify
refundStatusupdated toPARTIALorFULL.
result: acceptedmeans the refund request was submitted. Final settlement may complete asynchronously depending on the card scheme.
Updated 14 days ago
