Orders (Legacy)
POST {{BASE_HABITAT_URL}}/api/v3/exports
Required scope: reports:read
> ## ⚠️ Legacy — always use the async export flow instead
>
> For exporting orders from Dispatch (filtered order table → CSV/JSON/XLSX), do not use this endpoint.
>
> Always use:
> 1. Create Order Export — POST /v3/orders/export
> 2. Get Order Export — poll until status is ready (optional; you can also wait for the completion email)
> 3. Download Order Export — GET /v3/orders/export/:exportId/download
>
> The async flow supports large datasets, progress tracking, email notification, and time-limited download links. This legacy endpoint is retained for backward compatibility only.
Export order data and summaries for billing your merchants, and paying your drivers (if you have a fleet). We currently have three types of exports - available using the type field. This endpoint is similar to the GET /v3/orders endpoint, but is focused on billing and payments for completed orders, and has no limit.
Depending on the size of the query, you may be emailed the response as a CSV.
Merchant
Section titled “Merchant”Per order summary with relevant fields for billing merchants, if you aren’t using our Stripe integration
Runner
Section titled “Runner”Per order summary with relevant fields for paying your runners, if you aren’t using our Stripe integration
Runner Daily Summary
Section titled “Runner Daily Summary”Per day summary with relevant fields for paying your runners, if you aren’t using our Stripe integration
Request Body
Section titled “Request Body”| Field | Optional (default) | Description |
|---|---|---|
type |
One of runner merchant or runner_daily_summary |
|
start |
Export start, based on when order was created (ISO 8601 Date) | |
end |
Export end, based on when order was created (ISO 8601 Date) | |
format |
Yes - json |
One of csv json xlsx |
Request body
Section titled “Request body”{ "start": "2023-03-01T15:01:40.877Z", "end": "2023-04-02T15:01:40.877Z", "type": "merchant", "format": "json"}Examples
Section titled “Examples”curl --request POST '${BASE_HABITAT_URL}/api/v3/exports' \ --data '{ "start": "2023-03-01T15:01:40.877Z", "end": "2023-04-02T15:01:40.877Z", "type": "merchant", "format": "json"}'const response = await fetch("${BASE_HABITAT_URL}/api/v3/exports", { "method": "POST", "headers": {}, "body": "{\n \"start\": \"2023-03-01T15:01:40.877Z\",\n \"end\": \"2023-04-02T15:01:40.877Z\",\n \"type\": \"merchant\",\n \"format\": \"json\"\n}"})const data = await response.json()import requests
response = requests.request( "POST", "${BASE_HABITAT_URL}/api/v3/exports", headers={}, data="{\n \"start\": \"2023-03-01T15:01:40.877Z\",\n \"end\": \"2023-04-02T15:01:40.877Z\",\n \"type\": \"merchant\",\n \"format\": \"json\"\n}",)response.raise_for_status()Saved responses
Section titled “Saved responses”{ "type": "success", "data": [ { "time_requested": "2023-03-14T23:07:59.147Z", "order_number": 1792, "external_id": "12345", "external_delivery_id": null, "external_delivery_provider": null, "restaurant_name": "mikes test", "delivery_address": "2166 E Norris St., Philadelphia PA, 19125", "partner": null, "driver name": " ", "method": "Delivery", "territory": "Philly", "distance_straight_line": 0.35, "distance_routed": 0.67, "status": "pending_dispatch", "order_total": 9, "tip": 2, "billable_merchant_fee": null, "commission": 5, "merchant_delivery_fee": null, "diner_delivery_fee": null } ]}{ "type": "success", "data": [ { "time_requested": "2023-03-14T21:03:21.783Z", "order_number": 1234, "external_id": "b672c9ff-2567-4194-9a51-210f05174b8f", "restaurant_name": "TEST grubhub", "delivery_address": "1619 S Clarion St, Philadelphia PA 19148", "partner": null, "name": "judy29 ", "driver_email": "judy29@firstdelivery.com", "territory": "Philadelphia", "commission": 1.5, "tip": 7, "distance": null, "diner_delivery_fee": null } ]}{ "type": "success", "data": [ { "user_id": "9a32c2e8-4c1d-4aff-a3b0-c62a1e559b33", "day": "2023-03-21T04:00:00.000Z", "name": "Georgia Kuhlman", "email": "idell_friesen18@yahoo.com", "territory": "Philadelphia", "order_count": "1", "hours": 0, "hourly_base_pay": 0, "order_commissions": 5, "tip_total": 2, "bonus_pay": 0, "total_pay": 7, "unpaid": 0 } ]}
