HomeGuidesAPI Reference
API Reference

Void

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

The Void API allows merchants to void (reverse) a transaction that has been authorized but not yet captured.

This operation releases the held amount from the customer’s bank before settlement.

🚧

The VOID API now applies only to transactions where:

  • auth = Y (authorized), and
  • no capture has been performed yet.

Once a transaction is captured, you must use the Refund API instead.

Endpoint

POST https://demo-api.edfapay.com/api/v1/payment-gateway/s2s/void

Content-Type: application/json


Authentication

All requests to this endpoint must include a valid X-API-KEY in the request header for authentication. The X-API-KEY must be sent from the server side and should not be exposed on the client side.

How to generate API key


Request Body

FieldTypeRequiredDescription
transactionIdstringYesUnique transaction ID from EdfaPay.
🚧

Important Note

You can get the transactionId from

  • Dashboard in the transaction page with name Transaction ID.
  • Webhook(callback) response with value of parameter transactionId also in the Successful Response

Example Request

curl --location 'https://demo-api.edfapay.com/api/v1/payment-gateway/s2s/void' \
--header 'accept: */*' \
--header 'X-API-KEY: <Your API Key>' \
--header 'Content-Type: application/json' \
--data '{
  "transactionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}'

Response Example

{
    "code": 200,
    "message": "Success",
    "errorCode": null,
    "data": {
        "result": "ACCEPTED",
        "action": "CREDITVOID",
        "rrn": "XXXXXXXXXX",
        "order_id": "XXXXXXXXXX",
        "trans_id": "XXXXXXXXXXXXXXXX",
        "card_brand": "MASTER",
        "merchant_name": "Your Name",
        "decline_reason": null
    }
{
    "code": 400,
    "message": "[400] during [POST] to [http://payment-gateway/payment-gateway/s2s/payment/void] [PaymentGatewayClient#postS2SVoid(AuthorizedTransactionRequest)]: [{\"code\":400,\"message\":\"Invalid request body: amount: must be greater than 0; \",\"errorCode\":\"400\",\"data\":null}]",
    "errorCode": "400",
    "data": null
}

Notes

  • You cannot Void after Capture
  • You cannot void an already voided or refunded transaction
Body Params
Headers
string
Response

Language
URL
LoadingLoading…