Refunds
You can reimburse your customer for a previous transaction, either partially or in full, by initiating a refund and monitoring notifications for updates.
In situations where a customer requests a refund after a successful transaction or when an order cannot be fulfilled post-payment, you must decide whether to initiate a:
- Partial refund or,
- Full refund
With our RefundAPI endpoints, you can reimburse your customers partially or entirely. Simply initiate a refund request, and we'll provide ongoing updates on the status of the refund.
Create a refund
To initiate a refund, you make a POST request to the Create Refund API and provide the payment reference in the payment
field. If no amount is specified, we process the request as a full refund.
For a partial refund, include an amount
parameter with the refund amount. The refunded amount must not exceed the original transaction amount.
Example request
curl https://api.notchpay.co/refunds
-H 'Authorization: YOUR_PUBLIC_KEY'
-H 'X-Auth: 'YOUR_SECRET_KEY'
-H 'cache-control: no-cache'
-H 'content-type: application/json'
-d '{ "payment":"trx.qufywna9w9a5d8v", "amount":"10000" }'
-X POST
List Refunds
To retrieve a list of your refunds, you can utilize the List Refunds API to fetch all your refunds.
curl https://api.notchpay.co/refunds
-H 'Authorization: YOUR_PUBLIC_KEY'
-H 'X-Auth: YOUR_SECRET_KEY'
-H 'cache-control: no-cache'
-H 'content-type: application/json'
-X GET
Refund status
Throughout the refund lifecycle, its status evolves based on actions taken by the refund processor, triggering corresponding changes in the associated transaction status.
The following table illustrates the correlation between the refund status and the associated transaction status:
Refund Status | Description |
---|---|
pending | Refund initiation pending, awaiting processor response |
processing | Refund received by the processor |
failed | Refund processing failed; account credited |
complete | Refund successfully processed by the processor |