# 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.

<table><thead><tr><th width="225">API Name</th><th width="521">Description</th><th></th></tr></thead><tbody><tr><td><a href="https://docs.terraswitching.com/api-endpoints/collections/charge/create-charge">Create Charge</a></td><td>Allows you to initiate charge or a debit on a Debit card.</td><td></td></tr><tr><td><a href="https://docs.terraswitching.com/api-endpoints/collections/charge/authorize-charge">Authorize Charge</a></td><td>Authorize every charge you initiate based on response from creating a charge</td><td></td></tr><tr><td><a href="https://docs.terraswitching.com/api-endpoints/collections/charge/charge-authorization">Charge Authorization</a></td><td>Allows you to collect recurring payments from a card without initiating a charge.</td><td></td></tr></tbody></table>

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.

```typescript
{
  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
}
```

<table><thead><tr><th width="183">Property</th><th width="473">Description</th></tr></thead><tbody><tr><td>nextStep</td><td>Specifies the next step of authorization</td></tr><tr><td>displayText</td><td>Specifies what should be displayed on the screen to customer or user</td></tr><tr><td>status</td><td>Specifies the status of the transaction</td></tr><tr><td>reference</td><td>Specifies the transaction reference</td></tr><tr><td>type</td><td>Specifies the authorization type</td></tr><tr><td>url</td><td>Specifies redirect url, should in case 3DS auth is needed</td></tr><tr><td>statusCode</td><td>specifies the current status code in the charge stage</td></tr></tbody></table>
