Skip to main content

Refund API

This API is used to initiate refund process on a successful transaction.

Authorization

Any request made without the authorization key (secret key) will fail with a 401 (Unauthorized) response code.

info

The authorization key is sent via the request header as Bearer Token Authorization

Example: Authorization: Bearer sandbox_sk_94f2b798466408ef4d19e848ee1a4d1a3e93f104046f

POST
https://sandbox-api-d.squadco.com/transaction/refund

This endpoint refunds an already completed transactions

Parameters

Body

gateway_transaction_ref*

String

Unique reference that uniquely identifies the medium of payment and can be obtained from the webhook notification sent to you.

transaction_ref*

String

unique reference that identifies a transaction. Can be obtained from the dashboard or the webhook notification sent to you

refund_type*

String

The value of this parameter is either 'Full' or 'Partial'

reason_for_refund*

String

Reason for initiating the refund

refund_amount

String

Refund amount is in kobo or cent. This is only required for 'Partial' refunds

Responses

200:OK
Success
{
"status": 200,
"success": true,
"message": "Success",
"data": {
"gateway_refund_status": "pending",
"refund_status": 2,
"refund_reference": "REFUND-SQOKOY1708696818297_1_1"
}
}
401:Unathorized
No API Key
{
"success": false,
"message": "",
"data": {}
}

Sample Request

Full Refund

{
"gateway_transaction_ref": "wvszqsdrujscpuaofnea529117332_1_1",
"refund_type": "Full",
"reason_for_refund": "Any reason",
"transaction_ref": "vszqsdrujscpua"
}

Partial Refund

{
"gateway_transaction_ref": "SQOKOY3167299494777_1_1",
"refund_type": "Partial",
"reason_for_refund": "Testing Testing",
"transaction_ref": "SQOKOY3167299494777",
"refund_amount":"20000"
}

GO LIVE - Production

To Use this API on production:

  1. Kindly change the base URL of the endpoint from sandbox-api-d.squadco.com to api-d.squadco.com
  2. Get production keys from your production environment on dashboard.squadco.com and replace as authorization keys.