Manage Orders
Create, update, and track orders programmatically
Automate your order management workflow by integrating with Tracktile's Orders API. Create orders, track status changes, and manage fulfillment programmatically.
What You Can Do
- Create orders from external systems (e-commerce, EDI, ERP)
- Update order status as fulfillment progresses
- Track shipments and delivery confirmations
Quick Start
1. Create an Order
curl -X POST "https://api.tracktile.io/orders" \
-H "Authorization: Bearer api-YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"shortId": "ORD-001",
"customerId": "cust_abc123",
"dueDate": "2025-01-15T00:00:00Z",
"currency": "USD",
"orderItems": [
{ "productId": "prod_xyz", "quantity": 100, "price": 10.00 },
{ "productId": "prod_456", "quantity": 50, "price": 25.00 }
]
}'2. Track Order Status
Subscribe to order webhooks to receive real-time status updates:
// Webhook handler for order events
app.post("/webhooks/orders", (req, res) => {
// Verify the webhook signature (see Webhook Security docs)
const event = verifyWebhook(req, process.env.WEBHOOK_SECRET);
if (event.kind === "order.status.changed") {
const { orderId, previousOrderStatus, currentOrderStatus } = event;
// Update your system
updateOrderStatus(orderId, currentOrderStatus);
// Notify customers if completed
if (currentOrderStatus === "completed") {
notifyCustomer(orderId);
}
}
res.status(200).send("OK");
});Order Lifecycle
Orders progress through these statuses:
| Status | Description |
|---|---|
pending | Order created, awaiting processing |
ready | Order is ready for fulfillment |
inProgress | Order is being fulfilled |
completed | Order has been fulfilled |
cancelled | Order was cancelled |