Refunds

Learn how you can initiate refunds in your accounts.

You can refund payments made through links or via the API; you are able to refund the whole amount or part of it. Refunds use your available Okra Wallet credit balance — this doesn’t include any pending payouts. If your available wallet balance doesn’t cover the amount of the refund, Okra will debit the remaining amount from your connected bank account.

​​If Okra can’t debit the remaining amount from your bank account, your refunds will be pending until you fund your Okra Wallet. You can view a list of all your pending refunds in the Dashboard.

If the original charge underwent currency conversion, the refunded amount converts back using the same process.

📘

There are no fees to refund a charge, but the fees from the original charge are not returned.

We submit refund requests to your customer’s bank. Your customer sees the refund as a credit approximately 3-10 business days later, depending upon the bank. Once issued, a refund cannot be canceled.

We’ll also send an email to your customer notifying them of the refund if all of these conditions apply:

  • The original charge was created on a Account object in your Okra account.
  • The customer object has a stored email address.
  • You have Email Customers for Refunds enabled.

Issue a refund

Refunds can be issued via the API or the Dashboard and are processed immediately. Once issued, a refund cannot be canceled.

You can issue more than one refund against a charge, but you cannot refund a total greater than the original charge amount.


Refunds via the API

To refund payment via the API, create a Refund and provide the ID of the payment to be refunded.

To refund the customer’s payment, create a refund using the Payment ID, which is equivalent to refunding the underlying charge. You can also optionally refund part of their payment by specifying an amount. You can perform refunds with the API or through the Dashboard.

To refund part of a Payment, provide an amount parameter, as an integer in kobo (or the charge currency’s smallest currency unit):

curl -X POST https://api.okra.ng/v2/pay/refund
-H 'Content-Type: application/json' 
-H 'Authorization: Bearer <secretKey>'
-d '{ 
			payment_id: "xxxxxxxxxxxxxxxx" ,
	    reason: "" //optional reason for customer
  		amount: 10000, //optional amount for partial payments
		}'
{
    "status": "success",
    "message": "Refund has been initated; Please verify `reufund_payment` to confirm.",
    "data": {
        "refund": {
            "history": {
                "initiated_at": "2021-03-06T03:06:40.849Z",
                "success_at": null,
                "failed_at": null
            },
            "_id": "xxxxxxxxxxxxxxxx",
            "env": "production-sandbox",
            "owner": null,
            "payment": "5f894ee474b8fde5851af169",
            "receiever": "5f89451c0f0c0775eed267ac",
            "__v": 0,
            "amount": 10000,
            "created_at": "2021-03-06T03:06:40.851Z",
            "currency": "NGN",
            "initiator": "xxxxxxxxxxxxxxxx",
            "last_updated": "2021-03-06T03:06:40.851Z",
            "reason": null,
            "record": "xxxxxxxxxxxxxxxx",
            "status": "initiated"
        },
        "refund_payment": {
            "success": true,
            "data": {
                "payment": {
                    "record": "xxxxxxxxxxxxxxxx",
                    "amount": 10000,
                    "bank": "xxxxxxxxxxxxxxxx",
                    "bank_response": null,
                    "created_at": "2021-03-06T03:06:42.118Z",
                    "credit_account": "xxxxxxxxxxxxxxxx",
                    "currency": "NGN",
                    "customer": null,
                    "debit_account": "xxxxxxxxxxxxxxxx",
                    "email": null,
                    "env": "production-sandbox",
                    "error": null,
                    "fee": null,
                    "last_updated": "2021-03-06T03:06:42.118Z",
                    "link": null,
                    "meta": null,
                    "meta_responses": null,
                    "owner": "xxxxxxxxxxxxxxxx",
                    "ref": "dIPC-C8Dhtxka7m",
                    "schedule": null,
                    "source": "api",
                    "status": "initialize",
                    "id": "xxxxxxxxxxxxxxxx"
                },
                "okra_wallet": {
                    "amount": 4356660,
                    "currency": "NGN",
                    "last_updated": "2021-03-06T03:06:41.040Z",
                    "id": "xxxxxxxxxxxxxxxx"
                },
                "callback_url": "https://api.okra.ng/v2/callback?record=6042f1c03183ddf6d0e2b7ec&method=PAYMENT",
                "customer": {
                    "name": "Dami Banwo",
                    "id": "xxxxxxxxxxxxxxxx",
                    "account": {
                        "id": "xxxxxxxxxxxxxxxx",
                        "name": "Dami Banwo",
                        "nuban": "6444696413",
                        "bank": {
                            "name": "Guaranty Trust Bank",
                            "slug": "guaranty-trust-bank",
                            "id": "5d6fe57a4099cc4b210bbeb3",
                            "logo": "https://okra-images.s3.eu-west-3.amazonaws.com/GT+Bank.svg",
                            "png_logo": "http://d1f1tz87xvarxp.cloudfront.net/Nigerian+Banks/Guaranty+Trust+Bank+Logo.png",
                            "icon": "https://okra-images.s3.eu-west-3.amazonaws.com/Guaranty+Trust+Bank+Logo+Color.svg"
                        }
                    }
                }
            },
            "error": null,
            "msg": "Payment has been initiated; Please verify to complete"
        }
    }
}
{
    "status": "error",
    "message": "Duplicate request. This payment has already been refunded.",
    "data": {
        "refund": {
            "_id": "xxxxxxxxxxxxxxxx",
            "amount": 10000,
            "created_at": "2021-03-06T02:51:41.413Z",
            "currency": "NGN",
            "history": {
                "initiated_at": "2021-03-06T02:51:41.412Z",
                "success_at": "2021-03-06T02:52:06.055Z",
                "failed_at": null
            },
            "initiator": "xxxxxxxxxxxxxxxx",
            "reason": null,
            "status": "completed",
            "meta": null,
            "refund_payment": {
                "_id": "xxxxxxxxxxxxxxxx",
                "amount": 10000,
                "credit_account": "xxxxxxxxxxxxxxxx",
                "currency": "NGN",
                "customer": "xxxxxxxxxxxxxxxx",
                "debit_account": "xxxxxxxxxxxxxxxx",
                "env": "production-sandbox",
                "owner": "xxxxxxxxxxxxxxxx",
                "ref": "OKR PAY Ref 4KwQPxWigTf6KmQ",
                "status": "success"
            }
        }
    }
}
{
    "status": "error",
    "message": "You cannot intiate a refund for an amount greater than the initial payment.",
    "data": {
        "payment": {
            "_id": "xxxxxxxxxxxxxxxx",
            "record": "xxxxxxxxxxxxxxxx",
            "__v": 0,
            "amount": 10000,
            "created_at": "2020-10-16T07:42:28.857Z",
            "credit_account": "xxxxxxxxxxxxxxxx",
            "currency": "NGN",
            "customer": "xxxxxxxxxxxxxxxx",
            "debit_account": "xxxxxxxxxxxxxxxx",
            "email": null,
            "env": "production-sandbox",
            "error": {},
            "last_updated": "2021-01-08T09:51:54.531Z",
            "link": "xxxxxxxxxxxxxxxx",
            "meta": null,
            "owner": "xxxxxxxxxxxxxxxx",
            "ref": "OKR PAY Ref E9dv5IK__",
            "schedule": null,
            "source": "link",
            "status": "success",
            "refund_amount": 40000,
            "account_to_debit": "xxxxxxxxxxxxxxxx"
        }
    }
}
{
    "status": "error",
    "message": "You cannot intiate a refund on a payment that is in progress or failed.",
    "data": {
        "payment": {
            "_id": "xxxxxxxxxxxxxxxx",
            "record": "xxxxxxxxxxxxxxxx",
            "amount": 10000,
            "created_at": "2020-10-16T07:42:28.857Z",
            "credit_account": "xxxxxxxxxxxxxxxx",
            "currency": "NGN",
            "customer": "xxxxxxxxxxxxxxxx",
            "debit_account": "xxxxxxxxxxxxxxxx",
            "email": null,
            "env": "production-sandbox",
            "error": {},
            "last_updated": "2021-01-08T09:51:54.531Z",
            "link": "xxxxxxxxxxxxxxxx",
            "meta": null,
            "ref": "OKR PAY Ref E9dv5IK__",
            "schedule": null,
            "source": "link",
            "status": "success",
            "refund_amount": 40000,
            "account_to_debit": "xxxxxxxxxxxxxxxx"
        }
    }
}
{
    "status": "error",
    "message": "You do not have sufficient funds in your wallet to initiate this refund, please pass an `account` ID or lower the refund amount to continue",
    "data": {
        "wallet": {
            "_id": "xxxxxxxxxxxxxxxx",
            "amount": 0,
            "currency": "NGN",
            "env": "production-sandbox",
            "last_updated": "2021-03-06T03:06:41.040Z"
        }
    }
}