Order Tracking Integration
WebDialogAI can connect to your order/e-commerce system so visitors can ask about order status, tracking numbers, and delivery estimates directly in the chat widget.
How It Works
- A visitor asks "Where is my order #12345?"
- The AI detects this as an order query and extracts the order number
- If the visitor's email is not on the conversation, the AI asks for it
- WebDialogAI calls your order API with the email + order number
- The AI responds with order details and renders an Order Card in the widget
Setup
- Go to Dashboard > Settings > AI Configuration
- Scroll to the Order Tracking card
- Select External API from the "Order source" dropdown
- Configure:
- Order API URL — your HTTPS endpoint (e.g.,
https://shop.example.com/api/orders) - API Key — Bearer token for authentication
- Identity Field — which field visitors must provide (Email, Phone, or Order Number only)
- CTA Button Label — text on the order card button (default: "Track Order")
- Order API URL — your HTTPS endpoint (e.g.,
- Click Save changes
API Contract
Your order API must accept GET requests with query parameters:
GET {your-api-url}?email={visitorEmail}&order_number={orderNumber}
Authorization: Bearer {your-api-key}
Expected Response
The recommended response format wraps orders in an "orders" array:
{
"orders": [
{
"orderId": "12345",
"status": "shipped",
"total": "79.99",
"currency": "USD",
"items": [
{ "name": "Blue Widget", "quantity": 2, "price": "39.99" }
],
"shipping": {
"carrier": "FedEx",
"trackingNumber": "7489274892",
"trackingUrl": "https://fedex.com/track/7489274892",
"estimatedDelivery": "2026-03-10"
},
"orderDate": "2026-03-01"
}
]
}
If no matching order is found, return {"orders": []} or HTTP 404.
Flexible Response Parsing
WebDialogAI automatically adapts to common e-commerce API formats. You don't need to build a custom adapter — the following response shapes all work:
| Format | Example | Platforms |
|---|---|---|
{"orders": [...]} | Standard wrapper | Recommended |
{"data": [...]} | Stripe-style | Stripe, generic APIs |
{"order": {...}} | Single object wrapper | Shopify |
[{...}] | Root array | WooCommerce |
{...} | Bare single order | Custom APIs |
Field name flexibility — these common field name variations are automatically mapped:
| Our field | Also accepts |
|---|---|
orderId | order_id, id, number, order_number |
orderDate | order_date, created_at, date, createdAt |
total | total_price, amount, grand_total, order_total |
items | line_items |
shipping.trackingNumber | Top-level tracking_number or trackingNumber |
shipping.carrier | Top-level carrier or shipping_carrier |
shipping.trackingUrl | Top-level tracking_url or trackingUrl |
shipping.estimatedDelivery | Top-level estimated_delivery, delivery_date, expected_delivery |
Unknown fields are silently ignored — your API can include additional fields without issues.
Testing
Use the Test button in the Order Tracking settings section. Enter a sample order number and email to verify your API returns data correctly. The test results will display as order card previews.
Security
- Only HTTPS URLs are accepted for the order API endpoint
- Visitor email and order number are URL-encoded before being sent to your API
- API keys are never exposed in API responses (write-only)
- Both email and order number are required for lookup (multi-factor match)
What Visitors See
When an order is found, the AI provides a text summary and renders an interactive Order Card:
- Order ID and status badge (color-coded)
- Item list with quantities and prices
- Total amount
- Carrier name and tracking number
- Estimated delivery date
- Clickable Track Order button linking to the carrier's tracking page