Order Management
After creating an order, you'll want to keep your customer informed and manage any exceptions.
Tracking Orders
You can check the status of an order at any time using the ID or tracking code.
Endpoint: GET /api/v1/orders/{id}
Statuses
created: Order received, awaiting package.in_transit: Package is on its way to the pickup point.ready_for_pickup: Package is at the pickup point, waiting for customer.delivered: Customer has collected the package.cancelled: Order was cancelled.returned: Package returned to sender (expired or refused).
Webhooks (Recommended)
Instead of polling the API, provide a webhook_url when creating an order to receive real-time updates.
NowPost will POST a JSON payload to your URL whenever the status changes.
Example Webhook Payload
{
"event": "order.status_changed",
"order_id": "np_ord_987654321",
"partner_order_id": "ORD-2023-001",
"old_status": "in_transit",
"new_status": "ready_for_pickup",
"timestamp": "2023-10-25T14:30:00Z"
}
Note: When you receive ready_for_pickup, NowPost automatically sends an SMS/Email to the customer with their collection code. You can also send your own branded email at this point.
Cancellation
You can cancel an order as long as it hasn't been picked up by the logistics partner.
Endpoint: POST /api/v1/orders/{id}/cancel
curl -X POST "https://api.nowpost.com/api/v1/orders/np_ord_987654321/cancel" \
-H "Authorization: Bearer <YOUR_SECRET_KEY>"
Customer Returns
If a customer fails to pick up their package within the stipulated time (usually 7 days), the status will change to returned. The package will be sent back to your designated return address.