# Create Token

## /payments/create-token

<mark style="color:green;">`POST`</mark> `https://seerbitapi.com/api/v2/payments/create-token`

This endpoint allows you create a token

#### Headers

| Name                                            | Type   | Description                                             |
| ----------------------------------------------- | ------ | ------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | [Bearer Token](https://apis.seerbit.com/authentication) |

#### Request Body

| Name                                               | Type   | Description                                                                                  |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| publickey<mark style="color:red;">\*</mark>        | String | merchant public key                                                                          |
| amount<mark style="color:red;">\*</mark>           | String | amount to be charged                                                                         |
| fullName<mark style="color:red;">\*</mark>         | String | Customer's fullname                                                                          |
| mobileNumber<mark style="color:red;">\*</mark>     | String | Customer's phone number                                                                      |
| currency<mark style="color:red;">\*</mark>         | String | The transaction currency (NGN, GHS, KES,XOF or USD). Country Default currency must be passed |
| country<mark style="color:red;">\*</mark>          | String | country should be set to Country default                                                     |
| paymentReference<mark style="color:red;">\*</mark> | String | This is the unique identifier for a transaction, to be generated by merchant.                |
| email<mark style="color:red;">\*</mark>            | String | customer emails                                                                              |
| paymentType<mark style="color:red;">\*</mark>      | String | paymentType should be set to CARD                                                            |
| cardNumber<mark style="color:red;">\*</mark>       | String | customer card number                                                                         |
| expiryMonth<mark style="color:red;">\*</mark>      | String | customer card expiry month (e.g 01,02,11)                                                    |
| expiryYear<mark style="color:red;">\*</mark>       | String | customer card expiry month (e.g 23,24,25)                                                    |
| cvv<mark style="color:red;">\*</mark>              | String | customer card cvv                                                                            |
| pin<mark style="color:red;">\*</mark>              | String | customer card pin                                                                            |
| redirectUrl<mark style="color:red;">\*</mark>      | String | a page to be redirect to after successful payment                                            |

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

```javascript
curl --location 'https://seerbitapi.com/api/v2/payments/create-token' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_ENCRYPTED_KEY' \
--data-raw '{
    "publicKey": "YOUR_PUBLIC_KEY",
    "amount": "50",
    "fullName": "Jane Smith",
    "mobileNumber": "03447522256",
    "redirectUrl":"http://example.com",
    "currency": "NGN",
    "country": "NG",
    "paymentReference": "204g4de74a7ib0j18dg6bi521aiaejf4",
    "email": "janesmith@seerbit.com",
    "paymentType": "CARD",
    "cardNumber": "512348984984988883",
    "expiryMonth": "01",
    "expiryYear": "25",
    "cvv":"000",
    "pin":"2222" 
}'
```

{% endtab %}

{% tab title="200: OK Transaction is pending" %}

```javascript
{
    "status": "SUCCESS",
    "data": {
        "code": "S20",
        "message": "Transaction is pending",
        "payments": {
            "paymentReference": "{{paymentReference}}",
            "linkingReference": "SEERBIT60416746746373661414266005",
            "redirectUrl": "https://seerbitapi.com/50E84E82C25D"
        }
    }
}
```

{% endtab %}
{% endtabs %}
