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

# Invoicing

> Create, send and track invoices for your customers.

**Ideal for**: Billing a named customer for itemised work or goods — professional services, B2B orders, anything that needs a document with line items, tax and a due date.

Create and send invoices without code on the [merchant dashboard](https://dashboard.seerbit.com/#/auth/register), or use the API below to automate it.

## Invoice or payment link?

Both send a customer a request to pay, but an invoice is a document and a [payment link](/online-payments/payment-features/payment-link) is a door.

| | [Payment Link](/online-payments/payment-features/payment-link) | Invoice |
| - | - | - |
| **What the customer receives** | A URL you share however you like | An invoice, emailed to them by SeerBit |
| **Addressed to** | Anyone who opens it | One named customer |
| **Line items** | None — a single amount | Itemised, with quantity, rate and tax per line |
| **The amount** | Fixed, or entered by the customer | Calculated from the line items |
| **Timing** | Optional expiry date | An explicit `dueDate` |
| **Reuse** | Many payments from one link | One invoice, one payment |
| **The record** | Appears in your transaction list | Gets an invoice number (`SBT-INV-000092`) you can look up by number, order or customer email |
| **Best for** | Donations, social selling, event tickets | Professional services, B2B billing, anything needing a paper trail |

Use an invoice when the customer needs a document — something with your line items on it that they can file, forward to their finance team, or reconcile against a purchase order. Use a payment link when they just need to pay.

Sending many invoices at once? See [Bulk invoicing](/online-payments/payment-features/bulk-invoicing).

## How it works

You post the customer, a due date and the line items. SeerBit calculates the total, assigns an invoice number, and emails the invoice to `customerEmail` with a payment link inside it. The customer pays through SeerBit's hosted page, and you can look the invoice up at any time by its number, your order number, or the customer's email — or [re-send it](#re-send-an-invoice) if they lost it.

## Authentication

Invoicing 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>

## Creating and sending an invoice

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

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

```bash theme={null}
https://merchant.seerbitapi.com/invoice/create
```

#### Request Sample

The code snippet below shows an example request for creating and sending an invoice

**All body parameters are required**

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://merchant.seerbitapi.com/invoice/create' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_ENCRYPTED_KEY' \
  --data-raw '{
      "publicKey":"YOUR_PUBLIC_KEY",
      "orderNo": "333333221321",
      "dueDate": "2022-10-23",
      "currency": "NGN",
      "receiversName": "Jane Smith",
      "customerEmail": "janesmith@emaildomain.com",
      "invoiceItems": [
          {
              "itemName": "Bluetooth Pods",
              "quantity": 1,
              "rate": 25000,
              "tax": 7.5
          },
          {
              "itemName": "Quest 10",
              "quantity": 4,
              "rate": 100000,
              "tax": 7.5
          }
      ]
  }'
  ```

  ```javascript NODE theme={null}
  var request = require('request');
  var options = {
    method: 'POST',
    url: 'https://merchant.seerbitapi.com/invoice/create',
    headers: {
      'Content-Type': 'application/json',
      Authorization: 'Bearer TOKEN',
    },
    body: JSON.stringify({
      publicKey: 'YOUR_PUBLIC_KEY',
      orderNo: '333333221321',
      dueDate: '2022-10-23',
      currency: 'NGN',
      receiversName: 'Jane Smith',
      customerEmail: 'janesmith@emaildomain.com',
      invoiceItems: [
        {
          itemName: 'Bluetooth Pods',
          quantity: 1,
          rate: 25000,
          tax: 7.5,
        },
        {
          itemName: 'Quest 10',
          quantity: 4,
          rate: 100000,
          tax: 7.5,
        },
      ],
    }),
  };
  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://merchant.seerbitapi.com/invoice/create',
    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",
      "orderNo": "333333221321",
      "dueDate": "2022-10-23",
      "currency": "NGN",
      "receiversName": "Jane Smith",
      "customerEmail": "janesmith@emaildomain.com",
      "invoiceItems": [
          {
              "itemName": "Bluetooth Pods",
              "quantity": 1,
              "rate": 25000,
              "tax": 7.5
          },
          {
              "itemName": "Quest 10",
              "quantity": 4,
              "rate": 100000,
              "tax": 7.5
          }
      ]
  }',
    CURLOPT_HTTPHEADER => array(
      'Content-Type: application/json',
      'Authorization: Bearer TOKEN'
    ),
  ));

  $response = curl_exec($curl);

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

#### Response Sample

The code snippet below shows an example response for creating and sending an invoice

```json theme={null}
{
  "message": "Invoice created successfully ",
  "payload": {
    "InvoiceID": 92,
    "InvoiceNo": "SBT-INV-000092"
  },
  "code": "00"
}
```

#### Parameter description

All body parameters are required.

| Name | Type | Description |
| - | - | - |
| publicKey | `string` | Your SeerBit public key, from **Settings > API Keys**. |
| orderNo | `string` | Your own order reference. Use it to [look the invoice up](#get-invoice-by-orderno) later. |
| dueDate | `string` | Date the invoice falls due, `YYYY-MM-DD`. |
| currency | `string` | Currency for the invoice, e.g. `NGN`. See [currency codes](/development-resources/currency-codes/overview). |
| receiversName | `string` | Name of the customer the invoice is addressed to. |
| customerEmail | `string` | Where SeerBit sends the invoice. |
| invoiceItems | `array` | The line items. At least one. See below. |

##### `invoiceItems` object

| Field | Type | Description |
| - | - | - |
| `itemName` | `string` | What the line is for, as it appears on the invoice. |
| `quantity` | `number` | How many units. |
| `rate` | `number` | Price per unit, before tax. |
| `tax` | `number` | Tax rate applied to the line, as a percentage — `7.5` means 7.5%. |

The invoice total is calculated from the line items; you do not send an amount.

#### Response fields

| Name | Type | Description |
| - | - | - |
| code | `string` | `00` on success. See [status codes](/development-resources/responses/seerbit-status-code). |
| message | `string` | Human-readable result. |
| payload.InvoiceID | `number` | Internal numeric identifier. |
| payload.InvoiceNo | `string` | The invoice number, e.g. `SBT-INV-000092`. Use it to [look up](#get-invoice-by-invoiceno) or [re-send](#re-send-an-invoice) the invoice. |

## Re-send an Invoice

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

<Badge color="green">GET</Badge>

```bash theme={null}
https://merchant.seerbitapi.com/invoice/{{publicKey}}/send/{{InvoiceNo}}
```

#### Request Sample

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://merchant.seerbitapi.com/invoice/{{publicKey}}/send/{{InvoiceNo}}' \
  --header 'Authorization: Bearer TOKEN' \
  ```

  ```javascript NODE theme={null}
  var request = require('request');
  var options = {
    method: 'GET',
    url: 'https://merchant.seerbitapi.com/invoice/{{publicKey}}/send/{{InvoiceNo}}',
    headers: {
      Authorization: 'Bearer TOKEN',
    },
  };
  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://merchant.seerbitapi.com/invoice/{{publicKey}}/send/{{InvoiceNo}}',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',

    CURLOPT_HTTPHEADER => array(
      'Authorization: Bearer TOKEN'
    ),
  ));

  $response = curl_exec($curl);

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

#### Response Sample

The code snippet below shows an example response to resend an invoice

```json theme={null}
{
  "message": "Invoice has been sent successfully",
  "code": "00"
}
```

## Get invoice by customer email

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

<Badge color="green">GET</Badge>

```bash theme={null}
https://merchant.seerbitapi.com/invoice/{{publicKey}}/customer/{{customerEmail}}
```

#### Request Sample

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://merchant.seerbitapi.com/invoice/{{publicKey}}/customer/{{customerEmail}}' \
  --header 'Authorization: Bearer TOKEN' \
  ```

  ```javascript NODE theme={null}
  var request = require('request');
  var options = {
    method: 'GET',
    url: 'https://merchant.seerbitapi.com/invoice/{{publicKey}}/customer/{{customerEmail}}',
    headers: {
      Authorization: 'Bearer TOKEN',
    },
  };
  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://merchant.seerbitapi.com/invoice/{{publicKey}}/customer/{{customerEmail}}',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',

    CURLOPT_HTTPHEADER => array(
      'Authorization: Bearer TOKEN'
    ),
  ));

  $response = curl_exec($curl);

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

#### Response Sample

The code snippet below shows an example response to get invoice by customer email

```json theme={null}
{
    "payload": [
        {
            "invoiceId": 66,
            "invoiceNo": "SBT-INV-000066",
            "totalAmount": 529.75,
            "subTotal": 500.00,
            "tax": 29.75,
            "dueDate": "2022-10-22",
            "currency": "NGN",
            "invoiceItems": [
                {
                    "itemName": "Bag",
                    "unitPrice": 100,
                    "vat": 5.95,
                    "amount": 100,
                    "quantity": 4
                },
                {
                    "itemName": "Bag",
                    "unitPrice": 400,
                    "vat": 23.80,
                    "amount": 400,
                    "quantity": 4
                }
            ],
            "customer": {
                "externalIdentify": "289276",
                "businessName": "Jane Smith Ent",
                "customerName": "Jane Smith",
                "customerEmail": "js@emaildomian.com",
                "businessId": "00000051",
                "id": 19
            },
            "billingCycle": false,
            "payButtonOnInvoices": false,
            "enableAdvancedOptions": false,
            "partialPayment": false,
            "status": "DRAFT",
            "createdAt": "2022-10-18T17:23:13.259"
        },
        {
            "invoiceId": 67,
            "invoiceNo": "SBT-INV-000067",
            "totalAmount": 529.75,
            "subTotal": 500.00,
            "tax": 29.75,
            "dueDate": "2022-10-23",
            "currency": "NGN",
            "invoiceItems": [
                {
                    "itemName": "Bag",
                    "unitPrice": 100.00,
                    "vat": 5.95,
                    "amount": 100.00,
                    "quantity": 4
                },
                {
                    "itemName": "Bag",
                    "unitPrice": 400.00,
                    "vat": 23.80,
                    "amount": 400.00,
                    "quantity": 4
                }
            ]
        }
    ],
    "code": "00"
}
```

## Get invoice by InvoiceNo

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

<Badge color="green">GET</Badge>

```bash theme={null}
https://merchant.seerbitapi.com/invoice/{{publicKey}}/{{InvoiceNo}}
```

#### Request Sample

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://merchant.seerbitapi.com/invoice/{{publicKey}}/{{InvoiceNo}}' \
  --header 'Authorization: Bearer TOKEN' \
  ```

  ```javascript NODE theme={null}
  var request = require('request');
  var options = {
    method: 'GET',
    url: 'https://merchant.seerbitapi.com/invoice/{{publicKey}}/{{InvoiceNo}}',
    headers: {
      Authorization: 'Bearer TOKEN',
    },
  };
  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://merchant.seerbitapi.com/invoice/{{publicKey}}/{{InvoiceNo}}',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',

    CURLOPT_HTTPHEADER => array(
      'Authorization: Bearer TOKEN'
    ),
  ));

  $response = curl_exec($curl);

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

#### Response Sample

The code snippet below shows an example response to get an invoice by invoice number

```json theme={null}
{
  "payload": {
    "invoiceId": 54,
    "invoiceNo": "SBT-INV-000054",
    "totalAmount": 556.0,
    "subTotal": 556.0,
    "externalBusiness_id": "00000051",
    "discount": 0.0,
    "dueDate": "2022-10-12",
    "currency": "NGN",
    "invoiceItems": [
      {
        "itemName": "Ada Ada iyoo",
        "unitPrice": 556.0,
        "vat": 0.0,
        "amount": 556.0,
        "quantity": 278
      }
    ],
    "customer": {},
    "billingCycle": false,
    "payButtonOnInvoices": false,
    "enableAdvancedOptions": false,
    "partialPayment": false,
    "status": "DRAFT",
    "createdAt": "2022-10-12T10:27:45.732"
  },
  "code": "00"
}
```

## Get invoice by orderNo

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

<Badge color="green">GET</Badge>

```bash theme={null}
https://merchant.seerbitapi.com/invoice/{{publicKey}}/order/{{orderNo}}
```

#### Request Sample

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://merchant.seerbitapi.com/invoice/{{publicKey}}/order/{{orderNo}}' \
  --header 'Authorization: Bearer TOKEN' \
  ```

  ```javascript NODE theme={null}
  var request = require('request');
  var options = {
    method: 'GET',
    url: 'https://merchant.seerbitapi.com/invoice/{{publicKey}}/order/{{orderNo}}',
    headers: {
      Authorization: 'Bearer TOKEN',
    },
  };
  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://merchant.seerbitapi.com/invoice/{{publicKey}}/order/{{orderNo}}',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',

    CURLOPT_HTTPHEADER => array(
      'Authorization: Bearer TOKEN'
    ),
  ));

  $response = curl_exec($curl);

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

#### Response Sample

The code snippet below shows an example response to get an invoice by invoice order

```json theme={null}
{
  "payload": {
    "invoiceId": 54,
    "invoiceNo": "SBT-INV-000054",
    "totalAmount": 556.0,
    "subTotal": 556.0,
    "externalBusiness_id": "00000051",
    "publicKey": "SBPUBK_TCDUH6MNIDLHMJXJEJLBO6ZU2RNUUPHI",
    "testKey": "SBTESTPUBK_4v0JR58modUFJjF1Es206pveBQjOLxe2",
    "supportEmail": "ts@greentechng.com",
    "customerEmail": "qwertypoiuy@mailinator.com",
    "businessName": "Green Technological Concepts",
    "discount": 0.0,
    "dueDate": "2022-10-12",
    "currency": "NGN",
    "invoiceItems": [
      {
        "itemName": "Ada Ada iyoo",
        "unitPrice": 556.0,
        "vat": 0.0,
        "amount": 556.0,
        "quantity": 278
      }
    ],
    "customer": {},
    "billingCycle": false,
    "payButtonOnInvoices": false,
    "enableAdvancedOptions": false,
    "partialPayment": false,
    "status": "DRAFT",
    "createdAt": "2022-10-12T10:27:45.732"
  },
  "code": "00"
}
```

## Notes

* **Store the `InvoiceNo` you get back.** It is how you re-send, look up or reconcile the invoice afterwards — `InvoiceID` is internal.
* **Tax is per line, not per invoice.** Each item carries its own `tax` percentage, so mixed-rate invoices work without extra fields.
* **Re-sending does not create a new invoice.** It emails the existing one again, so the invoice number and amount stay the same.
* Confirm payment server-side before you treat an invoice as settled — see [Verify a payment](/online-payments/after-payments/verify-payment).
* Invoices created with test keys only work in test mode. See [Test and live modes](/test-and-live).


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