Charge

The Terraswitch Charge-API allows you to collect card payments seamlessly via APIs. These APIs are available for all businesses on our platform but only enabled for selected businesses based on compliance and certifications. Below are the three powerful APIs that helps you collect card payments easily.

API Name
Description

Allows you to initiate charge or a debit on a Debit card.

Authorize every charge you initiate based on response from creating a charge

Allows you to collect recurring payments from a card without initiating a charge.

For every charge created, there will be a need to authorize that charge and to do so, you will have to understand the structure of the API response from the create-charge endpoint. Below is a sample response and explanation.

{
  error: false,
  errors: [],
  data: {
    nextStep: "card PIN is required",
    displayText: "enter card pin",
    status: "pending",
    reference: "TSXA96227AAAB93491B",
    type: "pin",
    path: "send_pin",
    url: "",
    statusCode: 206,
    metadata: {
      reference: "TSXA96227AAAB93491B",
      type: "send_pin"
    }
  },
  message: "enter card pin",
  status: 206
}
Property
Description

nextStep

Specifies the next step of authorization

displayText

Specifies what should be displayed on the screen to customer or user

status

Specifies the status of the transaction

reference

Specifies the transaction reference

type

Specifies the authorization type

url

Specifies redirect url, should in case 3DS auth is needed

statusCode

specifies the current status code in the charge stage

Last updated