Skip to main content
A delivery order sends your items to a customer: by UrbnBox rider to their address, or for the customer to collect. Start with the quickstart to create your first order.

Authentication

All Vendor API endpoints require an X-API-Key header with a vendor key. Keys begin with ubx_. Create and revoke them under Integrations in the vendor dashboard.

Create order

POST /api/vendor/v1/orders

Fulfilment types

An unrecognised value is treated as delivery.

Items

Each item references a product in your UrbnBox catalogue. List your products with GET /api/vendor/v1/products to find their IDs. UrbnBox rejects the order with 400 when a product:
  • does not exist for your vendor account,
  • is inactive, or
  • does not have enough available stock for the requested quantity.
Creating an order reserves the stock for its items. The order total is the sum of the item prices plus the delivery fee.

Delivery fee

UrbnBox calculates DeliveryFeeKES when the order is created, using the delivery coordinates. Send client_lat and client_lng when you have them. If you send only address and it cannot be geocoded, the order is created without coordinates; check DeliveryFeeKES in the response.

Idempotency

When external_reference matches an order you already created, UrbnBox returns that order instead of creating a duplicate. The response status is 201 in both cases. Send a stable external_reference for every order so retries are safe.

Response

201 Created with the order:
Order responses use these capitalised field names (ID, Status, TotalKES). Request fields are lowercase with underscores.

Order status

List orders

GET /api/vendor/v1/orders Returns your orders, newest first. Use cursor pagination to walk through all orders:
Request the next page with ?cursor=<next_cursor>. When next_cursor is empty, you have reached the last page.

Get order

GET /api/vendor/v1/orders/{id} Returns the order and its items:
Returns 404 when the order does not exist for your vendor account.

Cancel order

POST /api/vendor/v1/orders/{id}/cancel Cancels the order and returns { "status": "cancelled" }.

Create orders in bulk

POST /api/vendor/v1/orders/bulk Send a JSON array of orders, each with the same fields as Create order. UrbnBox creates each order independently and returns one result per array index:
The bulk endpoint does not read external_reference, so it does not deduplicate. Retrying a bulk request creates the orders again. Use POST /api/vendor/v1/orders for each order when you need safe retries.

Check a CSV before you send it

Use the CSV tools to validate a spreadsheet of orders. They check the rows; they do not create orders.

Step 1: download the template

GET /api/vendor/v1/orders/csv-template Returns urbnbox-orders-template.csv with the headers and two example rows. No authentication required.

Step 2: upload for validation

POST /api/vendor/v1/orders/import-csv Upload the file as multipart/form-data with the field name file. The response lists every row with its parsed values and an Error, which is empty for valid rows:
Fix the errors, then create the orders with POST /api/vendor/v1/orders/bulk or POST /api/vendor/v1/orders. Those endpoints take items with product IDs rather than the CSV’s description and price columns.