Skip to main content

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 the X-TakeTheme-Delivery header. Use it to deduplicate.
  • type — one of the event types below. Also sent in the X-TakeTheme-Event header.
  • 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.

EventTrigger
order.placedA new order is created (storefront checkout, admin-created order, or draft order completed).
order.paidPayment is captured or the order is manually marked as paid.
order.fulfilledThe order — or its remaining items — is marked fulfilled.
order.cancelledThe order is cancelled.
order.returnedThe order is marked as returned.
order.refundedThe order is refunded (fully or partially).
order.updatedThe 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:

FieldTypeDescription
idstringThe order's unique ID.
internalIdstringHuman-facing order number (e.g. 1042). Use this in your UI, not id.
trackNumberstringTracking number (may be empty for some orders).
statusstringOrder status (e.g. open, cancelled).
paymentStatusstringPayment state (e.g. unpaid, paid, partially_refunded, refunded).
fulfillmentStatusstringFulfillment state (e.g. unfulfilled, partially_fulfilled, fulfilled).
totalPricenumberOrder total in the store's currency.
currencystringISO currency code (e.g. EGP, USD).
paymentobjectMoney breakdown — see below.
discountCodestring | nullCoupon code applied, if any.
appliedDiscountsarrayStructured automatic + code discounts applied to the order.
customerobject{ customerId, name, email, phone } for the order's customer.
contactobject{ email, phone } order-level contact (populated for guest/COD orders).
itemsarrayLine items — see below.
deliveryStatusarrayPer-item shipment/tracking — see below.
shippingAddressobjectThe shipping address (may be empty for digital-only orders).
billingAddressSameAsShippingbooleanWhether billing equals shipping.
notestringMerchant/customer order note.
tagsarrayOrder tags.
originstringOrder channel (e.g. online_store, admin).
isDraftbooleanWhether the order is a draft.
isAllDigitalbooleanWhether every line item is a digital product.
previousStatusstring | nullPrior status — handy for detecting the transition on order.updated.
createdAtstring (ISO 8601)When the order was created.

payment:

FieldTypeDescription
subTotalnumberItems subtotal before shipping/tax/discounts.
shippingnumberShipping charged.
taxnumberTax charged.
discountAmountnumberTotal discount applied.
handlingFeenumberHandling/COD fee.
totalnumberGrand total (equals totalPrice).
methodstringPayment method (e.g. cod, card).
providerstring | nullPayment provider/gateway.
refundedAmountnumberAmount refunded so far (for refund/return events).
refundedShippingnumberShipping refunded so far.

Each entry in items:

FieldTypeDescription
idstringThe order line's ID (correlates with deliveryStatus.itemId).
productIdstringThe product's ID (null for ad-hoc / custom items).
namestringProduct name at time of order.
quantitynumberQuantity ordered.
pricenumberUnit price charged.
discountPricenumber | nullOriginal (strikethrough) unit price, when discounted.
imagestring | nullLine item thumbnail URL.
variantIdstring | nullSelected variant ID.
variantLabelstring | nullHuman label for the variant (e.g. Size: L • Color: Blue).
variantDetailsarray[{ optionName, value }] for the selected variant.
isPhysicalProductbooleanWhether the line requires shipping.
isCustomItembooleanWhether it's an ad-hoc/custom line.
customInputValuestring | nullBuyer personalization (e.g. engraving text).
removedbooleantrue if the line was removed after fulfilment — filter these out when reconciling to totalPrice.
fulfillmentStatusstringPer-line fulfilment state.

Each entry in deliveryStatus:

FieldTypeDescription
itemIdstringThe order line this shipment covers.
trackingNumberstring | nullCarrier tracking number.
trackingUrlstring | nullCarrier tracking URL.
trackingCompanystring | nullCarrier name.
deliveryStatusstring | nullCarrier-reported delivery state.
What's intentionally omitted

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;
}
Forward-compatibility

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​

EventSent when
product.createdA merchant product is created (dashboard, API, bulk import). Sample products are excluded.
product.updatedProduct details, prices, status, categories, tags, variants, or stock change — including stock moved by checkout and order workflows (see reason).
product.deletedA 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:

reasonSource
product_created, product_updated, product_deletedSingle create, edit, or delete.
bulk_update, bulk_deleteBulk actions.
inventory_adjustedExplicit stock adjustment.
category_updatedA category was created, edited, or deleted and the product's categories changed.
importPlatform or spreadsheet import.
undoAn AI-assistant change was undone.
order_placedStock reserved by checkout, a merchant-created order, or a completed draft order.
order_editedItems added, removed, or re-quantified on an existing order.
order_cancelledStock restored by cancelling an order.
order_returnedStock restored by processing a return.
order_refundedStock restored by refunding items with restock.
post_purchase_accepted, post_purchase_revertedPost-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"]
}'