# Charge Subscription

## /recurring/charge

<mark style="color:green;">`POST`</mark> `https://seerbitapi.com/api/v2/recurring/charge`

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | String | Bearer Token |

#### Request Body

| Name                                                 | Type    | Description                                                                                                                                                                                                              |
| ---------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| publicKey<mark style="color:red;">\*</mark>          | String  | This is the merchant public key.                                                                                                                                                                                         |
| amount<mark style="color:red;">\*</mark>             | String  | This is the amount to be paid.                                                                                                                                                                                           |
| email<mark style="color:red;">\*</mark>              | String  | This is the email of the customer.                                                                                                                                                                                       |
| country<mark style="color:red;">\*</mark>            | String  | This is the country from which the transaction is been carried out from                                                                                                                                                  |
| paymentReference<mark style="color:red;">\*</mark>   | String  | This is the unique identifier for a transaction, to be generated by merchant.                                                                                                                                            |
| planId                                               | String  | the planId represents a product of the merchant that the customer wants to pay for e.g DSTV bouqet.                                                                                                                      |
| CardNumber<mark style="color:red;">\*</mark>         | String  | this is the name of the cardholder                                                                                                                                                                                       |
| expiryYear<mark style="color:red;">\*</mark>         | String  | this is the card's expiry year                                                                                                                                                                                           |
| expiryMonth<mark style="color:red;">\*</mark>        | String  | this is the card's expiry month                                                                                                                                                                                          |
| cvv<mark style="color:red;">\*</mark>                | String  | this is the 3 digit code behind the debit card                                                                                                                                                                           |
| productDescription<mark style="color:red;">\*</mark> | String  | this is the product description supplied by the merchant                                                                                                                                                                 |
| billingCycle<mark style="color:red;">\*</mark>       | String  | this is the rate of reoccurrence of the charge to the tokenized card                                                                                                                                                     |
| subscriptionAmount<mark style="color:red;">\*</mark> | boolean | this is passed as true if the subscription amount is to be charged at the point of creating subscription. It is passed as false if the default amount of SeerBit is to be charged at the point of creating subscription. |
| mobileNumber<mark style="color:red;">\*</mark>       | String  | customer's number                                                                                                                                                                                                        |
| customerId                                           | String  |                                                                                                                                                                                                                          |
| billingPeriod<mark style="color:red;">\*</mark>      | String  | this is the number of times seerBit will do a recurrent billing                                                                                                                                                          |
| redirectUrl<mark style="color:red;">\*</mark>        | String  | this is returned when the payment link service is called                                                                                                                                                                 |

{% tabs %}
{% tab title="cURL" %}

```javascript
curl --location 'https://seerbitapi.com/api/v2/recurring/charge' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_ENCRYPTED_KEY' \
--data-raw '{
	"amount":"200", 
	"publicKey":"YOUR_PUBLIC_KEY", 
	"email":"js@emaildomain.com", 
  "allowPartialDebit":"true",
	"authorizationCode":"1234567898765325", 
	"paymentReference":"2938765582R37065687631",
	"currency":"NGN"
}'
```

{% endtab %}

{% tab title="200: OK Successful" %}

```javascript
{
  "status": "SUCCESS",
  "data": {
     "code": "00",
     "payments": {
         "code": "00",
         "message": "Successful",
         "paymentReference": "2938765582R37065687631",
         "publicKey": "SBTEST**************************viTF",
         "amount": "200",
         "currency": "NGN",
         "country": "NG",
         "email": "js@emaildomain.com", 
         "productDescription": "Authorised charge"
      },
      "message": "Successful"
	}
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid Authentication Token" %}

```javascript
{
  "message": "Invalid Authentication Token",
  "error": "INPUT"
}
```

{% endtab %}

{% tab title="400: Bad Request Bad Request" %}

```javascript
{
"message": "Bad Request",
"error": "There has been a problem with reading or understanding the request."
}
```

{% endtab %}
{% endtabs %}
