> ## Documentation Index
> Fetch the complete documentation index at: https://doc.seerbit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# USSD

> Let customers pay from a feature phone using a short dial code.

**Ideal for**: Reaching customers on feature phones, or anyone without a card or reliable data. The customer dials a short code from the phone their bank knows.

This payment method allows you to collect payments offline from your customers. Payment is completed by the customer dialling a USSD code on their mobile device.

## How it works

1. To initiate a USSD payment, make a request to the USSD payments service with the payments/initiates endpoint.
2. When the request is made you are expected to get a dial code.
3. Customer completes transactions using the USSDdial code generated
4. Verify the payment

## Before you use these endpoints

These endpoints are for merchants who want to **build their own checkout**. You collect the payment details in your own interface and send them to SeerBit, deciding for yourself how the payment experience looks.

If you would rather not build and maintain that, use [Simple Checkout](/online-payments/integrations/simple-checkout) or [Standard Checkout](/online-payments/integrations/standard-checkout) instead — SeerBit renders the payment interface, supports every method, and takes on the compliance burden.

### You calculate the fee, not SeerBit

The hosted checkout works out the transaction fee and shows it to the customer. **These endpoints do not.** SeerBit charges exactly the `amount` you send.

So if your dashboard is set so the **customer** bears the fee, you must calculate that fee and include it yourself. If you don't, the fee comes out of your settlement instead — you will receive less than you charged.

| Fee bearer | [Hosted checkout](/online-payments/integrations/standard-checkout#transaction-fees) | These endpoints |
| - | - | - |
| **Merchant** | Send your amount; the fee is deducted at settlement | Send your amount; the fee is deducted at settlement |
| **Customer** | Checkout adds the fee for you | **You add the fee yourself** |

Set the fee bearer in your dashboard settings, and see [transaction fees](/online-payments/integrations/standard-checkout#transaction-fees) for how the two models differ.

## How methods are selected

Every payment method uses the **same endpoint** — what changes is the `paymentType` you send and the extra fields that method needs.

```bash theme={null}
POST https://seerbitapi.com/api/v2/payments/initiates
```

| Method | `paymentType` | Extra fields |
| - | - | - |
| [Card](/payment-methods/card-payment) | `CARD` | `cardNumber`, `cvv`, `expiryMonth`, `expiryYear`, `pin` |
| [Transfer](/payment-methods/transfer) | `TRANSFER` | — |
| [USSD](/payment-methods/ussd-payment) | `USSD` | `bankCode` |
| [Mobile money](/payment-methods/mobile-money) | `MOMO` | `network`, `voucherCode` |
| [Bank account](/payment-methods/bank-account) | `ACCOUNT` | `clientAppCode`, `redirectUrl` |

## Authentication

All payment method calls are authenticated with a **bearer token**, generated from your public and secret keys.

```bash theme={null}
POST https://seerbitapi.com/api/v2/encrypt/keys
```

<Card title="Authentication" icon="key" href="/authentication#bearer-token">
  How to generate the token, and which credential every other SeerBit API expects.
</Card>

## Initialising a USSD Payment

For the full specification, see our [API Reference](/api-reference)

<Badge color="blue">POST</Badge>

```bash theme={null}
https://seerbitapi.com/api/v2/payments/initiates
```

### Request Sample

The code snippet below shows an example request for initialising this payment

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://seerbitapi.com/api/v2/payments/initiates' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_ENCRYPTED_KEY' \
  --data-raw '{
      "publicKey":"YOUR_PUBLIC_KEY",
      "amount":"100",
      "fullName": "FirstName LastName",
      "mobileNumber": "customer mobile number",
      "email":"firstname@mail.com",
      "currency": "NGN",
      "country": "NG",
      "paymentReference": "dsffererer",
      "callbackUrl": "http://yourdomain.com",
      "redirectUrl": "http://yourdomain.com",
      "paymentType": "USSD",
      "bankCode":"044"
    }'
  ```

  ```javascript NODE theme={null}
  var request = require('request');
  var options = {
    method: 'POST',
    url: 'https://seerbitapi.com/api/v2/payments/initiates',
    headers: {
      'Content-Type': 'application/json',
      Authorization: 'Bearer YOUR_ENCRYPTED_KEY'
    },
    body: JSON.stringify({
      publicKey: 'YOUR_PUBLIC_KEY',
      amount: '100',
      fullName: 'FirstName LastName',
      mobileNumber: 'customer mobile number',
      email: 'firstname@mail.com',
      currency: 'NGN',
      country: 'NG',
      paymentReference: 'dsffererer',
      callbackUrl: 'http://yourdomain.com',
      redirectUrl: 'http://yourdomain.com',
      paymentType: 'USSD',
      bankCode: '044'
    })
  };
  request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
  });
  ```

  ```php PHP theme={null}
  <?php

  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://seerbitapi.com/api/v2/payments/initiates',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS =>'{
      "publicKey":"YOUR_PUBLIC_KEY",
      "amount":"100",
      "fullName": "FirstName LastName",
      "mobileNumber": "customer mobile number",
      "email":"firstname@mail.com",
      "currency": "NGN",
      "country": "NG",
      "paymentReference": "dsffererer",
      "callbackUrl": "http://yourdomain.com",
      "redirectUrl": "http://yourdomain.com",
      "paymentType": "USSD",
      "bankCode":"044"
    }',
    CURLOPT_HTTPHEADER => array(
      'Content-Type: application/json',
      'Authorization: Bearer YOUR_ENCRYPTED_KEY'
    ),
  ));

  $response = curl_exec($curl);

  curl_close($curl);
  echo $response;
  ```
</CodeGroup>

### Response Sample

The code snippet below shows an example request for initialising this payment

```json theme={null}
{
  "status": "SUCCESS",
  "data": {
    "code": null,
    "payments": {
      "paymentReference": "dsffererer",
      "linkingReference": "CSEERBIT724622561618580872054",
      "providerreference": "8206",
      "ussdDailCode": "*901*000*8206#"
    },
    "message": null
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.