Create Refund

Create a refund on a transaction

POST {{ BASE_URL }}/v1/corporate/refund

Body Parameters

Property
Data Type
Description
Example
Required

reference

string

The transaction reference

"VPX014ba225-00914672"

Yes

option

string

The reund option type. This can be instant or request

"instant"

Yes

reason

string

The reason for refund

"Quick refund"

Yes

type

string

The type of refund. This can be full or partial

"full"

Yes

amount

number

amount to be refunded

100

Only if refund type is partial

bank

object

An object that hold bank details if refund type is instant

N/A

Only if refund type is instant

bank.accountNo

string

Bank account number to refund to

"0252872742"

Yes

bank.bankCode

string

Bank sort code to refund to. Get sort code from the List Banks endpoint

"058"

Yes

pin

string

Your 4-digit transaction pin

"0000"

Yes

import Axios from 'axios';

// set the api url
const API_URL = `${BASE_URL}/v1/corporate/refund`;

// define request data
const data = {
    reference: "VPX65f83c03-c11c4e54",
    option: "instant",
    reason: "Transaction was successful but needs to be refunded",
    type: "full",
    amount: 0,
    bank: {
        accountNo: "0252872742",
        bankCode: "058"
    },
    pin: "3662"
}
// make request using axios
Axios({
    method: "POST",
    url: `${API_URL}`,
    headers: {
        lg: 'en',
        ch: 'web'
        Authorization: `Bearer ${API_KEY}`,
        'Content-Type': 'application/json',
    },
    data: data
}).then((resp) => {
    console.log(resp)
}).catch((err) => {
    console.log(err)
})

Last updated