Onward API V2 ## Sections • [API Reference](https://docs.onwarddelivery.com/api-reference.md): Authorization Append provided api_key as a query parameter for all requests Plain text https://api-stg.onwarddelivery.com/…?key=${API_KEY} • [Submitting Orders](https://docs.onwarddelivery.com/demand-api/submitting-orders.md): Here are some common configuration options for submitting orders to Onward Marketplace Orders Pricing and submitting orders to the Onward Marketplace require additional fields: For orders: dropoff_info.phone dropoff_info.del_type dropoff_info.dest_type For Items: item_type_details assembly_type For marketplace orders that are being shipped into an Onward carrier's warehouse, include this field if the store_info/pickup_info is the shipper origin rather than the carrier warehouse. pickup_info.is_middle_mile_origin: true • [Get Routes](https://docs.onwarddelivery.com/demand-api/get-routes.md): Get Routes for a given Shipper after start (inclusive) before end (exclusive) • [Create orders](https://docs.onwarddelivery.com/demand-api/create-orders.md): Creates orders in the onward system Orders are processing asynchronously. Use webhooks to listen for an order_created event • [Update Orders](https://docs.onwarddelivery.com/demand-api/update-orders.md): Updates orders in the onward system Orders are processing asynchronously • [Price Order](https://docs.onwarddelivery.com/demand-api/price-order.md): Price an Order . Does not save the order • [List Orders](https://docs.onwarddelivery.com/demand-api/list-orders.md): List orders in the onward system for a particular shipper_id or carrier_id • [Get Order Status](https://docs.onwarddelivery.com/demand-api/get-order-status.md): Retrieves Order Status Details in the onward system. DEPRECATED - See Webhook Management instead or poll /job/{id} • [Cancel Order](https://docs.onwarddelivery.com/demand-api/cancel-order.md): Cancels an Order in the Onward system • [Get Job](https://docs.onwarddelivery.com/demand-api/get-job.md): Return Job status as well as successfully created orders • [Ingest activity](https://docs.onwarddelivery.com/supply-api/ingest-activity.md): Share order and route activity with Onward • [Webhook Management](https://docs.onwarddelivery.com/webhook-management.md) • [Subscriptions](https://docs.onwarddelivery.com/webhook-management/subscriptions.md): Each api key can attach one webhook to each supported event • [List Subscriptions](https://docs.onwarddelivery.com/webhook-management/list-subscriptions.md): List all current subscriptions • [Get Subscription](https://docs.onwarddelivery.com/webhook-management/get-subscription-1.md): Get a specific subscription • [Create Subscription](https://docs.onwarddelivery.com/webhook-management/create-subscription.md): Create a new subscription • [Update Subscription](https://docs.onwarddelivery.com/webhook-management/update-subscription.md): Update / disable a subscription • [Events](https://docs.onwarddelivery.com/webhook-management/events.md): The possible values and their descriptions for the “event” field of the webhook payload. Title Description Event Description order_created Order has successfully been created in Onward. mm_pickup_scheduled Order has been scheduled for pickup by a middle mile carrier. mm_in_transit Order has been picked up by a middle mile carrier and is en route to the final mile terminal. mm_arrived Order has been delivered to the final mile terminal by a middle mile carrier. carrier_received Order has been received into the final mile terminal by the carrier. customer_comms_availability Onward has reached out to the customer via sms for their availability customer_comms_predelivery Onward has reached out the the customer via sms to confirm their delivery information order_scheduled Order has been assigned a delivery window order_in_transit Order has been picked up by the carrier and is en route to the consignee. order_completed Order has been completed by the carrier. order_rejected Order has been rejected by the carrier. order_cancelled Order has been cancelled by the shipper. pod_uploaded A POD has been uploaded by the carrier. exception_reported The driver has reported an exception for this order. Order may be cancelled or rescheduled depending on the severity of the exception. POD Uploaded For the “pod_uploaded” event, the order object will contain a “pod” array of files. Each file contains a “filename” which includes the extension (png, jpg, jpeg, or pdf), and the “file” which is a Base64 encoded string of the file contents. Plain text { "event": "order_completed", "timestamp": "2024-01-16T21:50:46.158Z", "location": { "lat": 39.6754944, "lng": -104.7658496 }, "order": { "order_number": "OD67065", "po_number": "test-1", “pod”: [ { “filename”: “xxx-xxx-xxx-xxx.jpg” “file”: “base64 string” } ] ... } } Exception Reported For the “exception_reported” event, the webhook payload will additionally include the “exception” object as shown below. Exception Types: Title Damaged Shortage Overage Refusal Attempted Delivery Customer Cancellation No Room on Truck Carrier/Onward Cancellation Weather Plain text { "event": "order_completed", "timestamp": "2024-01-16T21:50:46.158Z", "location": { "lat": 39.6754944, "lng": -104.7658496 }, "order": { "order_number": "OD67065", "po_number": "test-1", ... }, “exception”: { “type”: “Attempted Delivery”,// see table above for possible values “reported_at”: “DROPOFF”, //either “PICKUP” or “DROPOFF” “notes”: “customer not home” } } • [Payload](https://docs.onwarddelivery.com/webhook-management/payload.md): JSON { "event": "order_created", "timestamp": "2024-01-16T21:50:46.158Z", "location": { "lat": 39.6754944, "lng": -104.7658496 }, "order": { "order_number": "OD67065", "po_number": "test-1", "notes": [ { "timestamp": "2024-12-03T16:19:05.731838+00:00", "note": "Order Notes - Test Notes" } ] ... } } • [Authentication](https://docs.onwarddelivery.com/webhook-management/authentication.md): Plain text Onward will sign the payload with your api_key and include the signature in the x-onward-signature header. A sample express middleware handler: Plain text const crypto = require('crypto-js'); const { ONWARD_API_KEY } = process.env; const handler = (req, res, next) => { const signature = req.headers["x-onward-signature"]; const hash = crypto.HmacSHA256(JSON.stringify(req.body), ONWARD_API_KEY).toString(); if(signature === hash) { return next(); } return res.status(401).send('Unauthorized'); } • [Partners](https://docs.onwarddelivery.com/partners/partners-2.md): Partners are how the user indicates to Onward who the intended counterparty is for an order. This lets the user customize tariff rates. Each shipping account will have its own set of Partners. • [List Partners](https://docs.onwarddelivery.com/partners/list-partners.md): List all Partners • [Get Partner](https://docs.onwarddelivery.com/partners/get-partner.md): Get a Partner • [Create Partner](https://docs.onwarddelivery.com/partners/create-partner.md): Create a new Partner • [Delete Partner](https://docs.onwarddelivery.com/partners/delete-partner.md): Delete a Partner • [Update Partner](https://docs.onwarddelivery.com/partners/update-partner.md): Update a Partner • [Create Draft Manifest](https://docs.onwarddelivery.com/wms/create-draft-manifest.md) • [Get Manifest](https://docs.onwarddelivery.com/wms/get-manifest.md) • [List Manifests](https://docs.onwarddelivery.com/wms/list-manifests.md)