Events Reference
This page lists every webhook event TakeTheme can send and the shape of the payload it carries. All events share the same envelope structure; the data.object differs by event.
Envelope
Every delivery, for every event type, is wrapped in this envelope:
{
"id": "3f1c2b9e-8a4d-4c7e-9b1a-2d6f8e0c1a34",
"type": "order.paid",
"created": 1751371200.123,
"data": {
"object": { "...": "the order object" }
}
}
id— unique event ID (UUID). Also sent in theX-TakeTheme-Deliveryheader. Use it to deduplicate.type— one of the event types below. Also sent in theX-TakeTheme-Eventheader.created— Unix timestamp (seconds) when the event was generated.data.object— the resource; for all events below, the order object.
Order events
All order events carry the same order object in data.object. The event type tells you what changed; inspect the object's status fields to see the resulting state.
| Event | Trigger |
|---|---|
order.placed | A new order is created (storefront checkout, admin-created order, or draft order completed). |
order.paid | Payment is captured or the order is manually marked as paid. |
order.fulfilled | The order — or its remaining items — is marked fulfilled. |
order.cancelled | The order is cancelled. |
order.returned | The order is marked as returned. |
order.refunded | The order is refunded (fully or partially). |
order.updated | The order is edited (items, address, tracking, notes, hold/release, archive, etc.). Debounced to one delivery per order per ~5s. |
Order object
data.object for order events:
| Field | Type | Description |
|---|---|---|
id | string | The order's unique ID. |
internalId | string | Human-facing order number (e.g. 1042). Use this in your UI, not id. |
trackNumber | string | Tracking number (may be empty for some orders). |
status | string | Order status (e.g. open, cancelled). |
paymentStatus | string | Payment state (e.g. unpaid, paid, partially_refunded, refunded). |
fulfillmentStatus | string | Fulfillment state (e.g. unfulfilled, partially_fulfilled, fulfilled). |
totalPrice | number | Order total in the store's currency. |
currency | string | ISO currency code (e.g. EGP, USD). |
payment | object | Money breakdown — see below. |
discountCode | string | null | Coupon code applied, if any. |
appliedDiscounts | array | Structured automatic + code discounts applied to the order. |
customer | object | { customerId, name, email, phone } for the order's customer. |
contact | object | { email, phone } order-level contact (populated for guest/COD orders). |
items | array | Line items — see below. |
deliveryStatus | array | Per-item shipment/tracking — see below. |
shippingAddress | object | The shipping address (may be empty for digital-only orders). |
billingAddressSameAsShipping | boolean | Whether billing equals shipping. |
note | string | Merchant/customer order note. |
tags | array | Order tags. |
origin | string | Order channel (e.g. online_store, admin). |
isDraft | boolean | Whether the order is a draft. |
isAllDigital | boolean | Whether every line item is a digital product. |
previousStatus | string | null | Prior status — handy for detecting the transition on order.updated. |
createdAt | string (ISO 8601) | When the order was created. |
payment:
| Field | Type | Description |
|---|---|---|
subTotal | number | Items subtotal before shipping/tax/discounts. |
shipping | number | Shipping charged. |
tax | number | Tax charged. |
discountAmount | number | Total discount applied. |
handlingFee | number | Handling/COD fee. |
total | number | Grand total (equals totalPrice). |
method | string | Payment method (e.g. cod, card). |
provider | string | null | Payment provider/gateway. |
refundedAmount | number | Amount refunded so far (for refund/return events). |
refundedShipping | number | Shipping refunded so far. |
Each entry in items:
| Field | Type | Description |
|---|---|---|
id | string | The order line's ID (correlates with deliveryStatus.itemId). |
productId | string | The product's ID (null for ad-hoc / custom items). |
name | string | Product name at time of order. |
quantity | number | Quantity ordered. |
price | number | Unit price charged. |
discountPrice | number | null | Original (strikethrough) unit price, when discounted. |
image | string | null | Line item thumbnail URL. |
variantId | string | null | Selected variant ID. |
variantLabel | string | null | Human label for the variant (e.g. Size: L • Color: Blue). |
variantDetails | array | [{ optionName, value }] for the selected variant. |
isPhysicalProduct | boolean | Whether the line requires shipping. |
isCustomItem | boolean | Whether it's an ad-hoc/custom line. |
customInputValue | string | null | Buyer personalization (e.g. engraving text). |
removed | boolean | true if the line was removed after fulfilment — filter these out when reconciling to totalPrice. |
fulfillmentStatus | string | Per-line fulfilment state. |
Each entry in deliveryStatus:
| Field | Type | Description |
|---|---|---|
itemId | string | The order line this shipment covers. |
trackingNumber | string | null | Carrier tracking number. |
trackingUrl | string | null | Carrier tracking URL. |
trackingCompany | string | null | Carrier name. |
deliveryStatus | string | null | Carrier-reported delivery state. |
For privacy and security the payload excludes internal/sensitive fields: ad-tracking identifiers (fbc/fbp/IP/user-agent), conversion attribution, fraud/risk scoring, digital download tokens, the internal timeline, and staff assignment. Fetch the order by ID from the Orders API if you need more.
Example: order.paid
{
"id": "3f1c2b9e-8a4d-4c7e-9b1a-2d6f8e0c1a34",
"type": "order.paid",
"created": 1751371200.123,
"data": {
"object": {
"id": "665f1b2c9a3e4d0012ab34cd",
"internalId": "1042",
"trackNumber": "TT-1042",
"status": "open",
"paymentStatus": "paid",
"fulfillmentStatus": "unfulfilled",
"totalPrice": 349.99,
"currency": "EGP",
"payment": {
"subTotal": 329.99,
"shipping": 20,
"tax": 0,
"discountAmount": 0,
"handlingFee": 0,
"total": 349.99,
"method": "card",
"provider": "kashier",
"refundedAmount": 0,
"refundedShipping": 0
},
"discountCode": null,
"appliedDiscounts": [],
"customer": {
"customerId": "665d9f0a9a3e4d0012a9f0aa",
"name": "Mona Adel",
"email": "mona@example.com",
"phone": "+201000000000"
},
"contact": { "email": "mona@example.com", "phone": "+201000000000" },
"items": [
{
"id": "665f1b2c9a3e4d0012ab3500",
"productId": "665e0a1b9a3e4d0012aa11bb",
"name": "Linen Shirt — Medium",
"quantity": 2,
"price": 174.995,
"discountPrice": null,
"image": "https://cdn.example.com/linen-shirt.jpg",
"variantId": "665e0a1b9a3e4d0012aa11cc",
"variantLabel": "Size: M",
"variantDetails": [{ "optionName": "Size", "value": "M" }],
"isPhysicalProduct": true,
"isCustomItem": false,
"customInputValue": null,
"removed": false,
"fulfillmentStatus": "unfulfilled"
}
],
"deliveryStatus": [],
"shippingAddress": {
"name": "Mona Adel",
"street": "12 Nile St.",
"city": "Cairo",
"state": "Cairo",
"country": "EG"
},
"billingAddressSameAsShipping": true,
"note": "",
"tags": [],
"origin": "online_store",
"isDraft": false,
"isAllDigital": false,
"previousStatus": "open",
"createdAt": "2026-07-01T12:00:00.000Z"
}
}
}
Example: order.fulfilled
Same object shape; note the changed fulfillmentStatus:
{
"id": "a2b9c1d0-7e6f-4a3b-8c2d-1f0e9d8c7b6a",
"type": "order.fulfilled",
"created": 1751374800.501,
"data": {
"object": {
"id": "665f1b2c9a3e4d0012ab34cd",
"internalId": "1042",
"trackNumber": "TT-1042",
"status": "open",
"paymentStatus": "paid",
"fulfillmentStatus": "fulfilled",
"totalPrice": 349.99,
"currency": "EGP",
"customer": { "customerId": "665d9f0a9a3e4d0012a9f0aa", "name": "Mona Adel", "email": "mona@example.com", "phone": "+201000000000" },
"items": [
{ "id": "665f1b2c9a3e4d0012ab3500", "productId": "665e0a1b9a3e4d0012aa11bb", "name": "Linen Shirt — Medium", "quantity": 2, "price": 174.995, "fulfillmentStatus": "fulfilled" }
],
"deliveryStatus": [
{ "itemId": "665f1b2c9a3e4d0012ab3500", "trackingNumber": "EG123456789", "trackingUrl": "https://track.bosta.co/EG123456789", "trackingCompany": "Bosta", "deliveryStatus": "in_transit" }
],
"shippingAddress": { "city": "Cairo", "country": "EG" },
"createdAt": "2026-07-01T12:00:00.000Z"
}
}
}
Handling events
Branch on type and read the status fields you care about:
switch (event.type) {
case "order.placed":
// Reserve inventory, create a record in your system.
break;
case "order.paid":
// Trigger fulfillment / accounting.
break;
case "order.fulfilled":
// Notify the customer, close the fulfillment task.
break;
case "order.cancelled":
case "order.returned":
case "order.refunded":
// Reverse inventory / issue store credit / update ledgers.
break;
case "order.updated":
// Re-sync the order snapshot from event.data.object.
break;
default:
// Unknown/future event type — acknowledge and ignore.
break;
}
New event types may be added over time. Always acknowledge unrecognized type values with a 2xx and ignore them, rather than erroring — this keeps your endpoint healthy and avoids auto-disable.
Product events
| Event | Sent when |
|---|---|
product.created | A merchant product is created (dashboard, API, bulk import). Sample products are excluded. |
product.updated | Product details, prices, status, categories, tags, variants, or stock change — including stock moved by checkout and order workflows (see reason). |
product.deleted | A product is deleted, including bulk deletion. |
Subscribe to these events when creating or editing an endpoint. Existing endpoints retain their selected events; add product events explicitly. Each bulk action emits a separate event for each affected product. Product events are not debounced, but changes made inside one transaction are combined: a checkout with three lines of the same product emits one product.updated.
Events are sent only after the change is committed. A checkout that fails (payment declined, insufficient stock) emits nothing.
Why the product changed: data.reason
Every product event carries data.reason next to data.object:
reason | Source |
|---|---|
product_created, product_updated, product_deleted | Single create, edit, or delete. |
bulk_update, bulk_delete | Bulk actions. |
inventory_adjusted | Explicit stock adjustment. |
category_updated | A category was created, edited, or deleted and the product's categories changed. |
import | Platform or spreadsheet import. |
undo | An AI-assistant change was undone. |
order_placed | Stock reserved by checkout, a merchant-created order, or a completed draft order. |
order_edited | Items added, removed, or re-quantified on an existing order. |
order_cancelled | Stock restored by cancelling an order. |
order_returned | Stock restored by processing a return. |
order_refunded | Stock restored by refunding items with restock. |
post_purchase_accepted, post_purchase_reverted | Post-purchase offer stock reserved, or released when the offer lapses. |
New reasons may be added; treat unknown values like product_updated.
If you also consume order events, use reason to avoid counting the same stock movement twice: an order.placed and a product.updated with reason: "order_placed" describe the same sale.
Ordering
data.object is the product state read after the change committed, so it is always the latest state at send time, not a delta. Deliveries can arrive out of order (retries, concurrent orders). Apply an event only if data.object.updatedAt is newer than the version you stored.
Product payload
product.created and product.updated carry a product snapshot in data.object:
{
"id": "3f1c2b9e-8a4d-4c7e-9b1a-2d6f8e0c1a34",
"type": "product.updated",
"created": 1794139200,
"data": {
"reason": "order_placed",
"object": {
"id": "665f1b2c9a3e4d0012ab34cd",
"title": "T-shirt",
"slug": "t-shirt",
"type": "physical",
"productStatus": "published",
"sku": "TSHIRT",
"price": 150,
"discountPrice": null,
"quantity": 97,
"trackInventory": true,
"continueSellingWhenOutOfStock": false,
"categories": [],
"tags": [],
"variants": [],
"createdAt": "2026-11-01T09:00:00.000Z",
"updatedAt": "2026-11-06T12:00:00.000Z"
}
}
}
Variants contain id, sku, price, discountPrice, quantity, optionCombination (optionName and value), and continueSellingWhenOutOfStock. For variant products, read variants[].quantity. Quantity can be negative when overselling is allowed. Optional fields may be omitted; an unset quantity or discount price is null. Digital file keys, private metadata, and internal fields are excluded.
product.deleted carries a minimal tombstone: {"id":"665f1b2c9a3e4d0012ab34cd","deleted":true}. Do not fetch the deleted product to process this event.
Product events use the same signature headers, retry policy, and event-ID deduplication as order events. Like order events, they are dispatched in-process after commit; a process crash in that window can lose an event. Use GET /api/v1/product to reconcile periodically if you need a guaranteed-complete inventory mirror.
curl -X POST 'https://api.taketheme.com/api/v1/store/webhooks/endpoints' \
-H 'tt-api-key: tt_YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com/webhooks/taketheme",
"events": ["product.created", "product.updated", "product.deleted"]
}'