Process Refund

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Refund a previously successful payment (full or partial) using the gateway transaction ID.

📘

Recommended usage: Refunds are processed against the original gateway transaction. Partial refunds are supported until the remaining refundable balance reaches zero.


Endpoint

MethodPOST
URL{baseUrl}/payment/refund
AuthenticationHeader x-api-key

Fin Staging Base URL

https://fin-api.digetpay.com/v1
❗️

Important: The transactionId must be the gateway transaction ID (UUID).

Do not use the checkout session ID or the numeric paymentId.


Request Body

ParameterTypeRequiredDescription
transactionIdstringYesGateway transaction UUID
amountnumberYesRefund amount (minimum 0.01)

Example Request

{
  "transactionId": "2232e99b-0257-47d5-bbfd-022c8951767f",
  "amount": 0.20
}
🚧

Important: The refund amount must not exceed the remaining refundable balance. Otherwise the API returns:

Refund amount more than sale amount

Refund Flow

sequenceDiagram
    autonumber

    participant Merchant as Your Server
    participant API as DigetPay API
    participant Gateway as Payment Gateway

    Merchant->>API: POST /payment/refund
    API->>Gateway: Process refund
    Gateway-->>API: Refund accepted
    API-->>Merchant: result, refundId

    Note over Merchant,API: Verify refundStatus using Query Transaction Status

Partial refunds

DigetPay supports both full and partial refunds.

  • A transaction can be refunded in multiple partial refunds until the original payment amount is fully refunded.
  • Each refund amount must be greater than 0.01 and must not exceed the remaining refundable balance.
  • After each successful refund, the refundStatus returned by the Query Transaction Status API changes accordingly:
    • NONE → No refunds processed
    • PARTIAL → One or more partial refunds processed
    • FULL → The payment has been fully refunded
📘

Example: For a payment of 100.00 SAR, you can refund 30.00 SAR first, then 20.00 SAR, and finally 50.00 SAR. After the final refund, the transaction's refundStatus becomes FULL.

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
resultRefund request status (accepted)
refundIdDigetPay refund reference
paymentIdOriginal payment reference
amountRefunded amount

Best practice: After submitting a refund, call Query Transaction Status and verify that refundStatus changes to PARTIAL or FULL.

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



Body Params
string
required
number
required
Response

Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json