Get Plans
API to fetch list of plans based on a set of filters Unplanned orders may include planning_failure_reason, a customer-facing explanation of why automated planning could not assign the order.
In: header
Query Parameters
Date (YYYY-MM-DD) used as a filter to retrieve plans that are fulfilled on a given date.
Unique Handle of Ops Group to fetch plans for
Encoded value provided by our API to retrieve the next page of plans
String representation of Plan status to fetch plans for.
String indicating the preferred sorting type
Flag to fetch summary also for each plan.
Number of plans to be fetched.
Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/orders/plans/"{ "plans": [ { "summary": { "orders": { "total": 2, "planned": 1, "unplanned": 1, "assigned": 1, "completed": 1, "cancelled": 0 }, "estimate": { "distance": 1000, "duration": 600 }, "distance": 1000, "duration": 600, "routes": 1, "drivers": 1 }, "plan_id": "352a45c3-99b7-4528-9eca-a6f318c2ca23", "status": "failed", "started_at": "2023-10-19T12:34:45.000Z", "fulfillment_date": "2023-10-19", "created_at": "2023-10-19T12:32:45.000Z", "ops_group_handle": "d57deee8-d75f-4db5-ad37-4985ddcb47ac", "sequence_number": 2, "failure_reason": "No Workers Available", "routes": [ { "route_handle": "route-1", "ops_group_handle": "SAN_JOSE_WH", "plan_mode": "manual", "status": "completed", "completed_at": "2023-03-14T23:55:00Z", "worker_handle": "James", "version": 1, "estimate": { "start_by": "2023-03-14T23:20:00Z", "distance": 1000, "duration": 600, "polyline": { "type": "LineString", "coordinates": [ [ 77.72123, 12.89617 ], [ 77.72169, 12.89595 ], [ 77.72214, 12.89572 ] ] }, "start_location": { "type": "Point", "coordinates": [ -121.8924515, 37.4124516 ] }, "end_location": { "type": "Point", "coordinates": [ -121.8984515, 37.5124516 ] } }, "orders": [ { "order_handle": "order-101", "fulfillment_attempt": 1, "status": "completed", "completed_at": "2023-03-14T23:55:00Z", "ops_group_handle": "store-sjc", "worker_handle": "James", "device_id": "2F659D4D-B524-45F0-A6E2-093CF2BB5574", "created_at": "2023-03-14T23:00:00Z", "scheduled_at": "2023-03-14T23:50:00Z", "scheduled_after": "2023-03-14T23:20:00Z", "metadata": { "customerId": "1223344" }, "region": { "city": "Fremont", "state": "California", "country": "United States of America" }, "destination": { "geometry": { "type": "Point", "coordinates": [ -121.8984515, 37.5124516 ] }, "radius": 50, "address": "Mission Peak, Fremont CA 94539" }, "risk_status": false, "expected_service_time": 600, "product_type": [ "plumber" ], "type": "drop", "capacity_used": 5 } ], "device_id": "2F659D4D-B524-45F0-A6E2-093CF2BB5574", "metadata": { "customerId": "4255534", "zone": 4 }, "embed_url": "https://embed.hypertrack.com/dkdkddnd" } ], "unplanned_orders": [ { "order_handle": "ORD_1223", "status": "unplanned", "type": "drop", "planning_failure_reason": "The optimizer dropped this order to satisfy planning constraints for the overall plan." } ] } ], "pagination_token": "bvdshjbcjksbcjk"}{ "title": "string", "detail": "string"}{ "code": "string", "title": "string", "detail": "string"}Track Orders POST
This API allows the creation and immediate tracking of order fulfillment. If the route has been planned and exists in the HyperTrack system, then tracking can be initiated using the route_handle. Send your own `route_handle` with `orders` to create a route under that handle. A retry with the same handle returns the same route (200) and does not create a second one; the `orders` of a retry are ignored. A handle of a route with a different worker, of a completed route, or of a route with other times returns 409. **Shift routes.** Send `scheduled_start_at` (and `auto_complete_at`), or `tracking_window: shift`, to make a shift route. Times that you send always win. With `tracking_window: shift`, the times that you do not send come from the worker's schedule, else from the schedule of the worker's ops group. The response shows the resolved `scheduled_start_at` and `auto_complete_at`. A route with hours from a schedule follows later edits of that schedule until it completes: a route that waits moves to the new hours, a tracking route takes the new end of the current shift. It keeps its times when the edit leaves no current shift, breaks a limit, or overlaps another shift. A route with times you sent, or with times set by a PATCH, does not follow schedule edits. Without `tracking_window`, a missing `auto_complete_at` is `scheduled_start_at` plus 24 hours. Limits for shift routes: `scheduled_start_at` is at most 24 hours in the past, and a past start starts tracking at once; `auto_complete_at` is in the future, after the start, and at most 24 hours after it. A start in the future (at most 24 hours ahead) creates the route as `assigned` with no tracking; HyperTrack starts tracking at `scheduled_start_at`, within about one minute, with the route's own `track_mode`. A call by handle before the start returns the route and does not start it. Another open shift route of the same worker at the same time returns 409 (`shift_overlap`). A start by handle of a shift route that is not tracking and whose `auto_complete_at` has passed returns 409 (`shift_ended`). A shift route needs `worker_handle`. `track_mode` stays required; the route keeps the mode of the call. Schedules are read in the timezone of the worker's ops group (else the ops group of the call) when it is set and is not UTC; else in the timezone of the worker's device; else in UTC. An 08:00 schedule read in UTC starts at 08:00 UTC. A call that sends only `auto_complete_at` makes a route that is not a shift route, as before.
Create an order export job POST
Creates an asynchronous job to export orders to CSV.gz file. Returns a job_id that can be used to check status. Download link will be sent via email when ready.