Commerce context
Give Theo product, order and customer context from WooCommerce or your own store.
/api/v1/developer/commerce/contextDeveloper API keyOne contract for any store
Call this from a trusted server adapter for WooCommerce or your own backend. Your adapter handles the store's authorisation, customer sign-in and fresh data.
Request body
| Field | Meaning |
|---|---|
| kind | Required: customer, order, product or catalog |
| external_id | Stable record ID, up to 200 characters |
| provider | Store platform or adapter name, up to 80 characters |
| conversation_id | Optional. Order context must be linked to the active conversation. |
| contact_id | Optional contact in this workspace |
| data | Supported store fields only. Anything else is removed. |
Attach verified order context
POST /api/v1/developer/commerce/context
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"provider": "local-store-api",
"kind": "order",
"external_id": "order-123",
"conversation_id": "conv_example",
"customer_verified": true,
"data": {
"status": "shipped",
"total": 84000,
"currency": "NGN",
"tracking_url": "https://carrier.example/track/123",
"customer_email": "discarded before storage"
}
}Sync several records
POST /api/v1/developer/commerce/context/batch
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"records": [
{"provider":"woocommerce","kind":"product","external_id":"sku-123","data":{"title":"Linen shirt","price":25000,"currency":"NGN","available":true}},
{"provider":"custom-commerce","kind":"product","external_id":"sku-456","data":{"title":"Leather sandals","price":48000,"currency":"NGN","available":true}}
]
}Privacy and freshness
Only allowed commerce fields are kept; email, phone, address and internal notes are dropped. Order status and tracking are hidden after five minutes, and stale product prices are hidden, so keep syncing fresh data.
Updates and retries
The same provider, kind and external_id updates the stored record, so retries are safe. Send the full current data each time: it replaces the old record rather than merging. A conversation from another workspace returns 404.
What it doesn't do
These endpoints give Theo evidence for a conversation. They don't sign shoppers in, take payments, issue refunds or fulfil orders.