Charge Authorization

Charge a debit card for recurring payments using authorization code

POST {{ BASE_URL }}/v1/corporate/charge-authorization

Body Parameters

Property
Data Type
Description
Example
Required

authCode

string

card authorization code recieved via webhook or response

"TAUTH_MY5NACDG"

Yes

amount

number

The amount to charge

200

Yes

currency

string

The currency of the payment. This can be NGN or USD

"NGN"

Yes

reference

string

Your unique reference for the transaction

"23456789876CBD"

No

redirectUrl

string

Url you want to redirect to after successful or failed payment

"https://...."

No

description

string

Description of the transaction

"Payment for card"

No

deviceIp

string

IP address of the customer's device or your device

"192.168.206.32"

Yes

customer

object

The customer object that holds customer details

{...}

Yes

customer.firstName

string

Customer first name

"John"

Yes

customer.lastName

string

Customer last name

"Doe"

Yes

customer.phoneNumber

string

Customer phone number without country code

"08137031202"

Yes

customer.phoneCode

string

Country code for customer's phone number.

"+234"

No

metadata

Array of objects

Additional parameters you want using the metadata object. Learn how to craft metadata here

[ {...}. {...} ]

No

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