> For the complete documentation index, see [llms.txt](https://docs.bulkdelivery.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bulkdelivery.pro/api/sales-reporting-api.md).

# Sales Reporting API

Pull your sales records straight into accounting, BI, or spreadsheet tools

[Export Orders](https://docs.bulkdelivery.pro/orders/orders.md#export-orders) is great for a quick spreadsheet. If you'd rather have your accounting software, a BI dashboard, or a script pull sales records automatically, use the **Order Export API**. It returns the same rows and columns as Export Orders, as JSON.

{% hint style="info" %}
The API is available to users with the **Owner** or **Admin** role on your account.
{% endhint %}

## 1. Create an API Token

1. While logged in to BDP, go to **https\://(your BDP domain)/user/api-tokens**
2. Under **Create API Token**, enter a **Token Name** (e.g. *"Sales Sync"*) and click **Create**.
3. Copy the token. *For your security, it won't be shown again.*

Tokens belong to your user login, and can be deleted from the same page at any time (**Manage API Tokens**). If a token is lost or leaked, delete it and create a new one.

## 2. Request Your Orders

```http
GET https://(your BDP domain)/api/order-export
Authorization: Bearer (your token)
Accept: application/json
```

Use your own BDP address, e.g. `https://yourcompany.bulkdelivery.app` or your [Custom Domain](https://docs.bulkdelivery.pro/pro-tips/custom-domains.md).

Results are sorted **newest orders first**, **100 rows per page**. Each row is one item (delivery or pick up) on an order, just like Export Orders.

#### Filters (optional)

Add any of these as query parameters, e.g. `/api/order-export?date_min=2026-11-01&date_max=2026-11-30&product_type=delivery`

| Parameter              | Description                                                                                                             |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `date_min`, `date_max` | Scheduled delivery date range (YYYY-MM-DD). `date_max` is inclusive.                                                    |
| `product_type`         | `delivery` or `pick-up`                                                                                                 |
| `status`               | Comma-separated: `draft`, `pending` (Scheduled / Ready for Pick Up), `assigned`, `delivering`, `delivered`, `cancelled` |
| `product`              | Product name contains                                                                                                   |
| `amt_min`, `amt_max`   | Item amount (product + delivery) range                                                                                  |
| `search`               | Same as the Orders search box: name, PRO Team, job, email, product, address, or order number                            |
| `email`                | Exact customer email                                                                                                    |
| `phone`                | Phone number ends with                                                                                                  |
| `void`                 | `1` to include void orders                                                                                              |
| `page`                 | Page number                                                                                                             |

#### Response

```json
{
  "data": [
    {
      "order_number": "17866",
      "ordered_at": "2026-11-12T18:04:11.000000Z",
      "product": "Brown Mulch",
      "product_option": "8 Yards",
      "product_qty": 8,
      "product_unit": "yd",
      "product_price": 240,
      "team": null,
      "job": null,
      "customer": "Jane Smith",
      "phone": "4065550123",
      "email": "jane@example.com",
      "delivery_address": "123 Main St",
      "delivery_city": "Missoula",
      "delivery_state": "MT",
      "delivery_zone": "Base",
      "delivery_price": 75,
      "service_fee": 0,
      "add_ons": "1 x Tarp (6x8)",
      "add_ons_price": 15,
      "total_price": 330,
      "status": "Scheduled",
      "payment": "Card Not Present",
      "delivery_scheduled": "2026-11-14T15:00:00.000000Z",
      "delivery_time": null,
      "delivery_driver": null,
      "is_test": false
    }
  ],
  "links": { "first": "...", "last": "...", "prev": null, "next": "..." },
  "meta": { "current_page": 1, "last_page": 12, "per_page": 100, "total": 1163 }
}
```

*Values above are illustrative.* To fetch everything, keep following `links.next` until it's `null`; your filters are carried along automatically.

**Notes**

* Dates and times are in UTC (ISO 8601). `delivery_scheduled` is the start of the scheduled time slot; `delivery_time` is when the item was actually delivered or picked up (`null` until then).
* `service_fee` appears on the first row of each order only, so it isn't double-counted.
* `add_ons_price` and `total_price` include [Add-on Products](https://docs.bulkdelivery.pro/products/add-on-products.md). Cancelled items show 0 add-ons.
* `payment` is one of *Card Present*, *Card Not Present*, *Comped*, *Internal*, *Payment Due*, or *Other Payment*.
* Test orders are included and flagged with `is_test: true`. Filter them out for accounting.
