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

MethodPOST
URL{baseUrl}/payment/refund
AuthHeader x-api-key (required)

Body parameters

ParameterTypeRequiredDescription
transactionIdstringYesDigetPay gateway transaction ID from the original sale
amountnumberYesRefund amount (min 0.01, must not exceed remaining refundable balance)

Critical: Do not pass the checkout session ID or numeric paymentId as transactionId. 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 400 with Refund 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"
      }
    }
  }
}

Response fields

FieldDescription
resultaccepted when refund is submitted
refundIdDigetPay refund reference
paymentIdOriginal payment reference
amountRefunded amount

Best practice: After a successful refund, call Query Transaction Status and verify refundStatus updated to PARTIAL or FULL.

result: accepted means the refund request was submitted. Final settlement may complete asynchronously depending on the card scheme.


Did this page help you?