Orders are delivery workflows for courier organizations, composed of a single pickup and a corresponding dropoff task, that couriers and or clients create and manage for fulfillment.
The Orders endpoints allow creating, updating, cancelling, and cloning orders. This module is designed to be used by courier-client users with the appropriate permissions. An Order is a linked pair of tasks that consists of one pickup and one dropoff.
The base API URL is https://onfleet.com/api/v2/taskOrders .
To Create an order - POST - https://onfleet.com/api/v2/taskOrders
To Update an order - PUT - https://onfleet.com/api/v2/taskOrders/:orderShortId
To Cancel an order - POST - https://onfleet.com/api/v2/taskOrders/cancel
To Clone an order - POST - https://onfleet.com/api/v2/taskOrders/:orderId/clone
To Get an order - GET - https//onfleet.com/api/v2/taskOrders/:orderShortId
To Reject an order as the Courier - POST - https//onfleet.com/api/v2/taskOrders/:orderShortId/reject
To quote an order before accepting - https://onfleet.com/api/v2/deliveryServices/quote?clientId=clientId
The Orders endpoints can now be used by both the Client or the Courier using each of their respective API keys. Here a reference table on which endpoints can be accessed by each.
| Endpoints | Clients | Couriers |
|---|---|---|
| Create Order | Yes | Yes |
| Get Order | Yes | Yes |
| Update Order | Yes | Yes |
| Cancel Order | Yes | Yes |
| Clone Order | Yes, only if the original order does not have rates/services | No |
| Reject Order | No | Yes |
