> For the complete documentation index, see [llms.txt](https://docs.tendar.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tendar.co/documentation/buy-now-pay-later/orders.md). Agents can also search and read this documentation through its [MCP server](https://docs.tendar.co/~gitbook/mcp).

# Orders

An order is how a merchant starts a BNPL purchase. The merchant creates it from its own website, sends the customer to Tendar's checkout, and follows it until it's paid.

Each order has a [transaction](https://docs.tendar.co/documentation/buy-now-pay-later/transactions.md) with the same `reference`: the transaction is the purchase on your company's credit, and the order is the merchant's side of it.

These endpoints use the **merchant's** API key (`BNPL|…`), from the merchant dashboard's developer settings. Only a merchant signed up under a company can use them, with its email verified.

```
Authorization: Bearer BNPL|merchant_api_key
```

### Create an order

***

```
POST /api/v1/order/create
```

**Request body**

```json
{
  "email": "customer@example.com",
  "currency": "NGN",
  "reference": "ORD-12345",
  "narration": "Samsung 55\" Smart TV x 1",
  "success_url": "https://yourstore.com/checkout/success",
  "cancel_url": "https://yourstore.com/checkout/cancel",
  "products": [
    {
      "id": "sku-tv-55",
      "name": "Samsung 55\" Smart TV",
      "description": "55-inch 4K UHD",
      "unit_price": 250000,
      "quantity": 1,
      "images": ["https://yourstore.com/images/tv.png"]
    }
  ],
  "delivery": {
    "address": "4 Admiralty Way",
    "city": "Lekki",
    "state": "Lagos",
    "country": "Nigeria"
  },
  "delivery_cost": 3500,
  "metadata": { "cart_id": "CART-88213" }
}
```

| Field           | Required | Description                                                                |
| --------------- | -------- | -------------------------------------------------------------------------- |
| `email`         | Yes      | The customer's email. A new email becomes one of your company's customers. |
| `currency`      | Yes      | `NGN`.                                                                     |
| `success_url`   | Yes      | Where the checkout sends the customer when they're done.                   |
| `cancel_url`    | Yes      | Where it sends them if they leave.                                         |
| `products`      | Yes      | At least one product. See below.                                           |
| `reference`     | No       | Your own unique reference. Defaults to one Tendar generates.               |
| `narration`     | No       | What the purchase is for.                                                  |
| `delivery`      | No       | `address`, `city`, `state`, `country`, `longitude`, `latitude`.            |
| `delivery_cost` | No       | Added to the customer's first payment. Needs `delivery`.                   |
| `metadata`      | No       | Your own data, kept with the order and its transaction.                    |

**Products**

| Field         | Required | Description                           |
| ------------- | -------- | ------------------------------------- |
| `name`        | Yes      |                                       |
| `unit_price`  | Yes      | The price of one, `0` or more.        |
| `quantity`    | Yes      | A whole number.                       |
| `id`          | No       | Your product ID, unique in the order. |
| `description` | No       |                                       |
| `images`      | No       | Image URLs.                           |
| `weight`      | No       | In grams.                             |

The order's amount is the products' total: `unit_price` × `quantity`, added up.

**Response** `200 OK`

```json
{
  "error": false,
  "message": "Success",
  "data": {
    "amount": 250000,
    "currency": "NGN",
    "reference": "ORD-12345",
    "status": "pending",
    "checkout_url": "https://checkout.tendar.co/?transactionId=6707c1a2b3c4d5e6f7a8b9c0"
  }
}
```

Send the customer to `checkout_url`. When they finish, or leave, they come back to your `success_url` or `cancel_url`. Your company gets the `transaction.created` [webhook](https://docs.tendar.co/documentation/buy-now-pay-later/transactions.md#webhooks).

{% hint style="info" %}
A `reference` can only be used once, so a retried request can't create the purchase twice. If a request times out, fetch the order by its reference before trying again.
{% endhint %}

### Order status

***

An order always has its transaction's status.

| Status              | Meaning                                                          |
| ------------------- | ---------------------------------------------------------------- |
| `pending`           | The customer is checking out.                                    |
| `awaiting_approval` | The customer picked a plan; the company is deciding.             |
| `approved`          | Approved, waiting for the customer's first payment.              |
| `success`           | The first payment is made.                                       |
| `disbursed`         | The loan is running and the merchant is paid. Deliver the order. |
| `declined`          | The company declined it.                                         |
| `cancelled`         | The customer cancelled it.                                       |
| `failed`            | The first payment failed.                                        |
| `abandoned`         | Nothing happened for 7 days.                                     |

Each change is added to the order's `activity_logs`, with a time.

### Fetch and list orders

***

| Action             | Endpoint                                       |
| ------------------ | ---------------------------------------------- |
| Fetch by ID        | `GET /api/v1/order/fetch/:id`                  |
| Fetch by reference | `GET /api/v1/order/fetch/reference/:reference` |
| List               | `GET /api/v1/order/list`                       |

**Response** `200 OK` — fetch

```json
{
  "error": false,
  "message": "Success",
  "data": {
    "id": "6707c1a2b3c4d5e6f7a8b9d5",
    "merchant": "66fb2a1c3d4e5f6a7b8c9d01",
    "customer": {
      "id": "6707b0f1e2d3c4b5a6978801",
      "first_name": "Chioma",
      "last_name": "Okafor",
      "email": "customer@example.com",
      "phone": "+2348031234567",
      "image": "",
      "gender": "female"
    },
    "amount": 250000,
    "currency": "NGN",
    "reference": "ORD-12345",
    "narration": "Samsung 55\" Smart TV x 1",
    "status": "disbursed",
    "status_reason": "",
    "products": [
      { "id": "sku-tv-55", "name": "Samsung 55\" Smart TV", "unit_price": 250000, "currency": "NGN", "quantity": 1 }
    ],
    "delivery": { "address": "4 Admiralty Way", "state": "Lagos", "city": "Lekki" },
    "receipt": "",
    "metadata": { "cart_id": "CART-88213" },
    "activity_logs": [
      { "action": "Order Created", "description": "A new order with reference ORD-12345 has been created.", "timestamp": "2026-10-10T09:00:00.000Z" },
      { "action": "Order Disbursed", "description": "Product is ready for delivery/pickup, funds have been disbursed to the merchant.", "timestamp": "2026-10-10T11:31:00.000Z" }
    ],
    "created_at": "2026-10-10T09:00:00.000Z",
    "updated_at": "2026-10-10T11:31:00.000Z"
  }
}
```

The list takes these [query params](https://docs.tendar.co/documentation/getting-started/query-params.md): `status`, `reference`, `customer` (the customer's ID), `currency`, `amount` (`50000` or a range like `50000/300000`), `search`, `sort-created_at` and `sort-updated_at`. In a list, `delivery` also has `country`, `longitude` and `latitude`.

{% hint style="success" %}
Deliver when the order is `disbursed`. Check it with **Fetch by reference** rather than trusting the customer's return to your `success_url`.
{% endhint %}

### Errors

***

| Status | Message                                                      | Cause                                                        |
| ------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| 400    | `The email field is required.`                               | A required field is missing. Other fields work the same way. |
| 400    | `Products are required`                                      | `products` is empty.                                         |
| 400    | `Reference already exists`                                   | The `reference` is already used.                             |
| 400    | `Duplicate product id`                                       | Two products share an `id`.                                  |
| 400    | `Invalid currency`                                           | The currency isn't `NGN`.                                    |
| 400    | `Delivery cost is set but delivery details are not provided` | `delivery_cost` without `delivery`.                          |
| 400    | `Merchant business info not set or business profile not set` | The merchant hasn't finished its profile.                    |
| 400    | `This route is only available for company merchants`         | The merchant isn't signed up under a company.                |
| 400    | `Please verify your email before proceeding`                 | The merchant's email isn't verified.                         |
| 400    | `Bnpl is not enabled for this company`                       | BNPL is switched off in the company's settings.              |
| 401    | `Invalid token`                                              | The API key is wrong.                                        |
| 403    | `company not subscribed to BNPL service`                     | The company's plan doesn't include BNPL.                     |
| 404    | `order not found`                                            | No order with that ID or reference.                          |

See [Error](https://docs.tendar.co/documentation/getting-started/error.md) for the error format.

### Next steps

***

* [Transactions](https://docs.tendar.co/documentation/buy-now-pay-later/transactions.md) — approve the purchase, as the company.
* [BNPL SDK](https://docs.tendar.co/documentation/buy-now-pay-later/bnpl-sdk.md) — what the customer sees at checkout.
