> For the complete documentation index, see [llms.txt](https://startbutton.gitbook.io/startbutton-product-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://startbutton.gitbook.io/startbutton-product-api/collections/recharge-card.md).

# Recharge Card

Startbutton's 'Re-charge' feature allows you to charge your customer's card for subsequent transactions after the first charge has been successfully authenticated and completed.

#### Enable Card Re-Charge

Contact the Startbutton team <support@startbutton.africa> to access this feature. With a single API, you can initiate a card re-charge on domestic and international cards.

#### Complete First Charge

Initializing a first charge is required to ensure the card is valid and can be charged for subsequent transactions — see [Accept Payments — Overview](/startbutton-product-api/collections/accept-payments-overview.md) for your customer's first transaction with the card.

> The minimum recommended amount for the first charge is NGN 50.00 / GHS 0.10. Lower amounts aren't guaranteed to work on all card brands or banks.

#### Store Card Authorization Code

Once the first transaction is successful, retrieve the webhook payload (see [Overview & Verification](/startbutton-product-api/webhooks/overview-and-verification.md)) or the [Transaction Statuses](/startbutton-product-api/collections/transaction-statuses.md). Store the `authorizationCode` returned — this is used to charge the card subsequently. Avoid saving an `authorizationCode` multiple times.

Sample webhook payload (Recharge enabled):

```json
{
  "event": "collection.completed",
  "data": {
    "merchantId": "64459778bf350cc65485986c",
    "paymentPartner": { "id": "644a50bb188xxxxx", "name": "abc", "currency": "NGN" },
    "transaction": {
      "_id": "648ca8aba0fa64xxxxxx",
      "transType": "collection",
      "status": "processing",
      "toAmount": 200000,
      "toCurrency": "NGN",
      "merchantId": "64459778bf35xxxxxxc",
      "transactionReference": "69f146f0xxxxxx",
      "customerEmail": "test@customer.com",
      "paymentCode": "",
      "isRecurrent": "false",
      "createdAt": "2023-06-16T18:23:39.716Z",
      "updatedAt": "2023-06-16T18:23:41.837Z",
      "__v": 0
    },
    "authorizationCode": "f2e4a43dxxxxx"
  }
}
```

Sample webhook payload (Recharge disabled):

```json
{
  "event": "collection.completed",
  "data": {
    "merchantId": "64459778bf350cxxxxxx",
    "paymentPartner": { "name": "abc", "currency": "NGN" },
    "transaction": {
      "_id": "648ca8aba0fa6xxxxxxxx",
      "transType": "collection",
      "status": "processing",
      "toAmount": 2000,
      "toCurrency": "NGN",
      "merchantId": "64459778bf350ccxxxxx",
      "transactionReference": "69f146f0xxxxb",
      "customerEmail": "test@customer.com",
      "paymentPartnerId": { "name": "abc", "currency": "NGN" },
      "paymentCode": "",
      "createdAt": "2023-06-16T18:23:39.716Z",
      "updatedAt": "2023-06-16T18:23:41.837Z"
    }
  }
}
```

#### Post Re-Charge Request

For subsequent card charges, send the `authorizationCode` and `amount`.

| Header        | Value                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------ |
| Authorization | `Bearer SECRET_KEY` (see [Authentication](/startbutton-product-api/getting-started/authentication.md)) |
| Content-Type  | `application/json`                                                                                     |

See [Environments & Base URLs](/startbutton-product-api/getting-started/environments-and-base-urls.md) before making requests.

**Endpoint:** `POST {{baseurl}}/transaction/recurrent`

Sample request:

```json
{
    "authorizationCode": "f2e4a43dc7b313",
    "amount": 27000,
    "reference": "43ntjb4tph"
}
```

Sample response:

```json
{ "success": true, "message": "transaction", "data": "processing" }
```

#### Webhooks

See [Overview & Verification](/startbutton-product-api/webhooks/overview-and-verification.md) to understand webhooks and getting transaction status.

> `isRecurrent` is `true` in the webhook when the card is charged via the Recharge endpoint.
