Charge Authorization
POST {{ BASE_URL }}/v1/corporate/charge-authorizationBody Parameters
Property
Data Type
Description
Example
Required
import Axios from 'axios';
// set the api url
const API_URL = `${BASE_URL}/v1/corporate/charge-authorization`;
// define request body
const data = {
authCode: "TAUTH_MY5NACDG",
amount: 20,
reference: "",
redirectUrl: "https://staging-app.terraswitching.com/verify",
description: "Staff payment for internal training",
deviceIp: "",
customer: {
firstName: "Oluwatobi",
lastName: "Immanuel",
email: "[email protected]",
phoneNumber: "08137031202",
phoneCode: "+234"
},
metadata: [
{
staffId: "002RTOPG",
department: "engineering"
}
]
}
// 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