Authorize Charge
Authorize already created charge on a debit card
POST {{ BASE_URL }}/v1/corporate/authorize-chargeBody Parameters
Property
Data Type
Description
Example
Required
deviceIp
string
IP address of the customer's device or your device
"192.168.206.32"
Yes
authorize
object
The object that holds authorize properties
{...}
Yes
authorize.pin
string
Debit card pin
"1111"
If type is pin
authorize.otp
string
OTP sent to customer
"037895"
If type is otp
authorize.phone
string
Customer's phone number
"08137031202"
If type is phone
authorize.birthday
string
Customer birthday
"1992-01-12"
If type is birthday
import Axios from 'axios';
// set the api url
const API_URL = `${BASE_URL}/v1/corporate/authorize-charge`;
// define request body
const data = {
type: "pin",
reference: "TSX64D469F547F04752",
deviceIp: "",
authorize: {
pin: "1111",
otp: "",
phone: "",
birthday: "",
address: {
city: "",
state: "",
zipCode: "",
address: ""
}
}
}
// 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)
}){
error: false,
errors: [],
data: {
status: "successful",
type: "credit",
domain: "test",
reference: "TSXFD77BA471CD84E82",
merchantRef: "",
amount: 20,
fee: 0.2,
vat: 0.015,
feature: "payment-link",
ipAddress: "",
currency: "NGN",
description: "incoming payment of NGN20 to Gnik Digitals Limited via payment link",
vasData: {
ref: "",
type: "",
network: "",
phoneNumber: "",
billerCode: "",
billerName: "",
hasToken: false,
token: ""
},
metadata: [
{
staffId: "002RTOPG",
department: "engineering"
}
],
bank: {
name: "",
accountName: "",
accountNo: "",
bankCode: ""
},
customer: {
firstName: "Oluwatobi",
lastName: "Immanuel",
email: "[email protected]",
phoneNumber: "08137031202",
phoneCode: "+234",
city: "",
state: "",
accountNo: "",
sourceAccount: ""
},
createdAt: "2024-06-02T01:09:15.582Z",
updatedAt: "2024-06-02T01:09:26.876Z",
card: {
brand: "visa",
cardBin: "400758",
cardLast: "9961",
expiryMonth: "06",
expiryYear: "27",
createdAt: "2024-06-01T23:46:15.036Z",
updatedAt: "2024-06-01T23:53:21.777Z",
authCode: "TAUTH_MY5NABBW"
}
},
message: "successful",
status: 200
}{
error: false,
errors: [],
data: {
nextStep: "OTP is required",
displayText: "enter the otp sent to your phone number and/or email",
status: "pending",
reference: "TSXA96227AAAB93491B",
type: "otp",
path: "send_otp",
url: "",
statusCode: 206,
metadata: {
reference: "TSXA96227AAAB93491B",
type: "send_otp"
}
},
message: "OTP is required",
status: 206
}Authorization types
Type
Description
pin
Customer's debit card pin
otp
OTP sent to customer's phone/email
phone
Customer's phone number
birthday
Customer's birthday
Last updated