Browse the API docs

Webhooks

Instead of asking the API what changed, let the store tell your app. When an order is placed, paid, shipped or refunded, or a product, stock level or customer changes, Weftstore sends a signed POST to your URL with the resource as JSON.

Subscribing#

A subscription is a topic and a URL, and belongs to an app. Add one on the app's page in the admin (Apps, then the app, then Webhooks), or with the app's own token through the webhooks endpoints. An App Store app subscribes through the API, once for each store that installs it, with the token it got from OAuth. An app can subscribe to a topic when it has read access to its resource, for example read_orders for orders/create; if the store takes that access away, the subscription is removed too.

An app can send one topic to several addresses. Each is its own subscription, and they are sent in parallel. The same topic at the same address twice is refused with a 422 (address: ["for this topic has already been taken"]), so list the subscriptions before you create one.

URLs must start with https:// and can't point at private, loopback or link-local addresses. Plain http, and local addresses such as http://127.0.0.1:4200/webhooks, are accepted only on development servers. On a hosted Weftstore, use a tunnel such as ngrok or Cloudflare Tunnel and its https address while you build: Run it on your machine shows how.

Request
curl -X POST "https://store.weftgrid.com/api/admin/2026-10/webhooks.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "webhook": { "topic": "orders/paid", "address": "https://erp.example.com/hooks/storeloom" } }'

Topics#

The body is the resource as the Admin API returns it, at the moment of the event: an order webhook carries the same fields as GET /orders/{id}.json. Deletions send only the id.

TopicSent whenNeedsPayload
orders/createAn order is placed (checkout, draft order or API).read_ordersorder
orders/updatedAnything on an order changes.read_ordersorder
orders/paidAn order is paid in full.read_ordersorder
orders/cancelledAn order is cancelled.read_ordersorder
orders/fulfilledEvery item on an order is fulfilled.read_ordersorder
orders/partially_fulfilledSome items on an order are fulfilled.read_ordersorder
orders/editedItems are added to or removed from an order after it was placed.read_ordersorder edit
orders/paid_by_bank_transferAn order is paid in full by bank or wallet transfer, matched automatically or by staff. It also sends orders/paid.read_ordersorder
orders/risk_analyzedAn order's risk is scored: a new cash on delivery order, or staff check it again.read_ordersorder risk
orders/tags_addedTags are added to an order, by staff, an app or a workflow.read_orderstags change
orders/tags_removedTags are taken off an order.read_orderstags change
cod/confirmedA customer confirms a cash on delivery order: a WhatsApp button, an SMS reply, the order status page, a call staff recorded, or the advance payment.read_orderscod verification
cod/declinedA customer answers the cash on delivery confirmation by cancelling the order.read_orderscod verification
cod/no_responseA customer didn't answer the cash on delivery confirmation in time, and the store's rule ran: cancel, call, or mark and ship.read_orderscod verification
cod/delivery_refusedA cash on delivery parcel comes back: refused, or returning after a failed delivery.read_orderscod refusal
fulfillments/createA fulfillment is created.read_ordersfulfillment
fulfillments/updateA fulfillment's tracking or status changes.read_ordersfulfillment
fulfillment_events/createA shipment's tracking status changes (a courier update, or added by staff).read_ordersfulfillment event
fulfillments/deliveredA shipment is marked delivered, by the courier's tracking or by staff. It also sends fulfillment_events/create.read_ordersfulfillment event
refunds/createA refund is issued.read_ordersrefund
returns/requestA customer asks to return items.read_returnsreturn
returns/approveA return is approved (or created by staff).read_returnsreturn
returns/declineA return request is declined.read_returnsreturn
returns/updateA return changes: items received, tracking added, restocked.read_returnsreturn
returns/closeA return is closed (refunded or settled).read_returnsreturn
returns/cancelA return is cancelled.read_returnsreturn
order_transactions/createA payment or refund transaction is recorded.read_orderstransaction
bank_receipts/matchedA payment alert from a bank or wallet is matched to a waiting order automatically, and the order is marked paid.read_ordersbank receipt
bank_receipts/unmatchedA payment alert fits no waiting order (or several), so staff need to match it by hand.read_ordersbank receipt
courier_settlements/importedA courier's cash on delivery payment is imported, from its payment sheet or its API.read_orderscourier settlement
couriers/cod_overdueA delivered cash on delivery parcel is still unpaid by the courier after the days it usually takes. Sent once per parcel.read_orderscod overdue
checkouts/createA buyer starts checkout and enters their email.read_orderscheckout
checkouts/abandonedA buyer leaves checkout without ordering. Sent about 10 minutes after their last change, once per checkout.read_orderscheckout
draft_orders/createA draft order is created.read_draft_ordersdraft order
draft_orders/updateA draft order changes or is completed.read_draft_ordersdraft order
draft_orders/deleteA draft order is deleted.read_draft_orders{ "id": "…" }
products/createA product is created.read_productsproduct
products/updateA product or its variants change.read_productsproduct
products/deleteA product is deleted.read_products{ "id": "…" }
products/status_changedA product becomes active, draft or archived.read_productsproduct status
products/tags_addedTags are added to a product, by staff, an app, an import or a workflow.read_productstags change
products/tags_removedTags are taken off a product.read_productstags change
products/added_to_collectionA product joins a collection: picked by hand, or because an automated collection's conditions match it now.read_productscollection membership
products/removed_from_collectionA product leaves a collection, by hand or because it no longer matches an automated collection's conditions.read_productscollection membership
reviews/createdA customer, an app or staff add a product review in Loom Reviews, published or waiting for approval. Reviews brought in from a CSV import don't send it.read_reviewsreview
reviews/publishedA review goes live on the storefront: published automatically, or approved by staff or an app.read_reviewsreview
search/no_resultsThe first time each day that shoppers search the storefront for words that find nothing (Loom Search & Discovery).read_productssearch
collections/createA collection is created.read_productscollection
collections/updateA collection changes.read_productscollection
collections/deleteA collection is deleted.read_products{ "id": "…" }
inventory_levels/updateA variant's stock changes for any reason, at any location.read_inventoryinventory level
locations/createA location is added.read_locationslocation
locations/updateA location changes, or is deactivated.read_locationslocation
locations/deleteA location is deleted.read_locations{ "id": "…" }
customers/createA customer is created.read_customerscustomer
customers/updateA customer changes.read_customerscustomer
customers/deleteA customer is deleted.read_customers{ "id": "…" }
customers/tags_addedTags are added to a customer, by staff, an app, an import or a workflow.read_customerstags change
customers/tags_removedTags are taken off a customer.read_customerstags change
customers/subscribedA customer agrees to get marketing emails: the newsletter form, checkout, their account, staff, an app or an import.read_customersconsent
customers/unsubscribedA customer stops getting marketing emails: the unsubscribe link, their account, staff or an app.read_customersconsent
customers/text_subscribedA customer agrees to get offers by WhatsApp and SMS: the box at checkout, the unsubscribe page, or staff.read_customersconsent
customers/text_unsubscribedA customer leaves WhatsApp and SMS offers: a STOP reply, the unsubscribe page, or staff.read_customersconsent
messages/receivedA customer sends the store a WhatsApp or SMS message. STOP replies and answers to a cash on delivery confirmation don't send it.read_customersmessage
discounts/createA discount is created.read_discountsdiscount
discounts/updateA discount changes.read_discountsdiscount
discounts/deleteA discount is deleted.read_discounts{ "id": "…" }
gift_cards/createA gift card is issued.read_gift_cardsgift card
gift_cards/updateA gift card's balance or status changes.read_gift_cardsgift card
markets/createA market is added.read_marketsmarket
markets/updateA market's countries, currency, prices or status change.read_marketsmarket
markets/deleteA market is deleted.read_markets{ "id": "…" }
themes/createA theme is added (from the theme library, a copy or an upload).read_themestheme
themes/updateA theme's settings, templates or files change.read_themestheme
themes/publishA theme is published and shoppers start seeing it.read_themestheme
themes/deleteA theme is deleted.read_themes{ "id": "…" }
metaobjects/createA metaobject entry is created.read_metaobjectsmetaobject
metaobjects/updateA metaobject entry changes (its fields, handle or status).read_metaobjectsmetaobject
metaobjects/deleteA metaobject entry is deleted (alone or with its definition).read_metaobjects{ "id": "…" }
shop/updateStore settings change.Any appshop
app/uninstalledThe app is deleted from the store.Any appshop
app_subscriptions/updateThe merchant approves, declines or cancels one of the app's charges, or it expires.Any appapp subscription

checkouts/create sends the cart when the buyer first enters their email at checkout (or when a Storefront API app saves it):

checkout
{
  "id": "cm2cart0001",
  "token": "pB1u0n2Qk1lY3m9sXy7Z0aVvQ3cS4dE5",
  "email": "[email protected]",
  "currency": "USD",
  "line_items": [
    {
      "variant_id": "cm2vari0001",
      "product_id": "cm2prod0001",
      "title": "Linen shirt",
      "variant_title": "Sand / M",
      "quantity": 2
    }
  ],
  "discount_code": null,
  "created_at": "2026-10-23T09:12:00.000Z",
  "updated_at": "2026-10-23T09:20:00.000Z"
}

Events from Weftstore's own features#

Cash on delivery, bank transfers, courier payments, reviews, messages, customer consent, tags, collections, abandoned checkouts and search send webhooks too. Subscribe the way you do for any topic in the table above: the app needs the access in its Needs column, and the signature, headers and retries are the same.

These payloads are small on purpose: ids, names and what changed, not the whole order or customer. Read the record from the Admin API when you need more. Ids are strings, times are ISO 8601, and money is a decimal string next to its currency. A section says so when its payload carries personal data.

X-Storeloom-Event-Id is new for each event and the same for every app told about it, so keep the ones you have handled and skip repeats. A retry of a delivery keeps its id.

Three topics send a payload described elsewhere. orders/paid_by_bank_transfer sends the order, as orders/paid does, and fulfillments/delivered sends the tracking update, as fulfillment_events/create does. Each is sent in addition to the topic it comes from, and only when the order was paid by bank transfer or the update says delivered. checkouts/abandoned sends the checkout, as checkouts/create does, about 10 minutes after the buyer's last change.

The Send test button on a custom app's webhook sends the store's latest matching record in these shapes. A store with none gets an example marked "test": true.

Order risk#

The score Weftstore gives an order and the reasons behind it, as staff see them on the order. Sent each time the risk is scored: for a new cash on delivery order, and when staff check it again.

Sent by orders/risk_analyzed (needs read_orders).

FieldTypeWhat it holds
idstringThe order's id.
namestringThe order's name, as the store shows it.
risk_levelstringlow, medium or high. Always high when the buyer is on the store's blocklist as high risk.
risk_scorenumber0 to 100. The higher, the riskier.
reasonsarray of objectsWhat raised or lowered the score, biggest first. code is one of refused_deliveries, blocklist_flag, invalid_phone, phone_other_names, vague_address, repeat_orders, shared_network, over_cod_limit, large_order, throwaway_email, first_order and good_history. text is for people and can change.
occurred_atstringWhen the risk was scored (ISO 8601).
orders/risk_analyzed
{
  "id": "cm2ordr0001",
  "name": "#1042",
  "risk_level": "high",
  "risk_score": 72,
  "reasons": [
    {
      "code": "refused_deliveries",
      "points": 25,
      "text": "1 earlier cash on delivery parcel came back (refused or returned)"
    },
    {
      "code": "first_order",
      "points": 5,
      "text": "First order from this buyer"
    }
  ],
  "occurred_at": "2026-10-30T09:15:00.000Z"
}

Tags changed#

Which tags were added to or taken off an order, a customer or a product, and the tags it has now. The Admin API shows tags as one comma-separated string; here both are lists.

Sent by orders/tags_added and orders/tags_removed (needs read_orders); products/tags_added and products/tags_removed (needs read_products); customers/tags_added and customers/tags_removed (needs read_customers).

FieldTypeWhat it holds
idstringThe order's, the customer's or the product's id.
namestringThe order's name, as the store shows it.Only with orders/tags_added and orders/tags_removed.
titlestringThe product's title.Only with products/tags_added and products/tags_removed.
tagsarray of stringsThe tags that were added (tags_added) or taken off (tags_removed).
current_tagsarray of stringsAll the tags it has now.
occurred_atstringWhen the tags changed (ISO 8601).
orders/tags_added
{
  "id": "cm2ordr0001",
  "name": "#1042",
  "tags": [
    "vip"
  ],
  "current_tags": [
    "vip",
    "wholesale"
  ],
  "occurred_at": "2026-10-30T09:15:00.000Z"
}
products/tags_added
{
  "id": "cm2prod0001",
  "title": "Linen shirt",
  "tags": [
    "vip"
  ],
  "current_tags": [
    "vip",
    "wholesale"
  ],
  "occurred_at": "2026-10-30T09:15:00.000Z"
}
customers/tags_added
{
  "id": "cm2cust0001",
  "tags": [
    "vip"
  ],
  "current_tags": [
    "vip",
    "wholesale"
  ],
  "occurred_at": "2026-10-30T09:15:00.000Z"
}

Cash on delivery confirmation#

How a customer answered the store's confirmation of a cash on delivery order, or that nobody answered and the store's rule ran.

Sent by cod/confirmed, cod/declined and cod/no_response (needs read_orders).

FieldTypeWhat it holds
idstringThe order's id.
namestringThe order's name, as the store shows it.
verification_statusstringconfirmed, declined or no_response.
channelstringHow the customer answered: whatsapp, sms, call (a call staff recorded), status_page (the order status page), staff (staff recorded it) or advance (they paid the advance).Only with cod/confirmed and cod/declined.
cancelledbooleanWhether the order was cancelled automatically. When false it waits for staff.Only with cod/declined.
rulestringWhat the store's rule did: cancel the order, call (leave it for staff to call) or mark (mark it as not confirmed and let it ship).Only with cod/no_response.
afterstringWhat ran out: time (the hours the store waits) or calls (the calls staff tried).Only with cod/no_response.
occurred_atstringWhen the customer answered, or the rule ran (ISO 8601).
cod/confirmed
{
  "id": "cm2ordr0001",
  "name": "#1042",
  "verification_status": "confirmed",
  "channel": "whatsapp",
  "occurred_at": "2026-10-30T09:15:00.000Z"
}
cod/declined
{
  "id": "cm2ordr0001",
  "name": "#1042",
  "verification_status": "declined",
  "channel": "whatsapp",
  "cancelled": true,
  "occurred_at": "2026-10-30T09:15:00.000Z"
}
cod/no_response
{
  "id": "cm2ordr0001",
  "name": "#1042",
  "verification_status": "no_response",
  "rule": "call",
  "after": "time",
  "occurred_at": "2026-10-30T09:15:00.000Z"
}

Cash on delivery parcel refused#

A cash on delivery parcel that comes back: the courier brings it back, or it is returning after a failed delivery. Sent once per order, however many of its parcels come back.

Sent by cod/delivery_refused (needs read_orders).

FieldTypeWhat it holds
idstringThe order's id.
namestringThe order's name, as the store shows it.
fulfillment_idstringThe parcel's fulfillment.
courierstring or nullThe courier's id (postex, leopards, tcs…) when the parcel was booked through its API.
tracking_numberstring or nullThe parcel's tracking number.
shipment_statusstring or nullreturned, or returning after a failed delivery.
refused_countnumberHow many cash on delivery orders of this buyer (the same phone or email) have come back, this one included.
blockedbooleanWhether this one put the buyer on the store's blocklist.
occurred_atstringWhen the parcel started to count as refused (ISO 8601).
cod/delivery_refused
{
  "id": "cm2ordr0001",
  "name": "#1042",
  "fulfillment_id": "cm2fulf0001",
  "courier": "postex",
  "tracking_number": "PX-30415528",
  "shipment_status": "returned",
  "refused_count": 2,
  "blocked": false,
  "occurred_at": "2026-10-30T09:15:00.000Z"
}

Bank receipt#

A payment alert Weftstore read from the store's bank or wallet, after it tried to match it to an order waiting for a transfer.

Sent by bank_receipts/matched and bank_receipts/unmatched (needs read_orders).

The payer's name, the account number and the text of the alert aren't sent.

FieldTypeWhat it holds
idstringThe receipt's id.
bankstringThe bank or wallet, as the store named it.
methodstringbank_transfer, raast, jazzcash or easypaisa.
refstringThe bank's transaction reference, or a fingerprint of the alert when it has none.
amountstringThe amount received, as a decimal string.
currencystringThe currency of the amount.
statusstringmatched for bank_receipts/matched; new (waiting for staff) for bank_receipts/unmatched.
matched_howstring or nullHow it was matched: reference (the customer's transaction id), amount (a unique amount) or name (amount, name and time). null when it wasn't.
order_idsarray of stringsThe orders it paid. Empty when it wasn't matched.
sourcestringWhere Weftstore read the alert: mail (the store's mailbox) or sms (forwarded by SMS).
received_atstringWhen the bank sent the alert (ISO 8601).
created_atstringWhen Weftstore filed the receipt (ISO 8601).
bank_receipts/matched
{
  "id": "cm2rcpt0001",
  "bank": "Meezan Bank",
  "method": "bank_transfer",
  "ref": "IBFT-20261030-118",
  "amount": "7200.00",
  "currency": "PKR",
  "status": "matched",
  "matched_how": "reference",
  "order_ids": [
    "cm2ordr0001"
  ],
  "source": "mail",
  "received_at": "2026-10-30T09:15:00.000Z",
  "created_at": "2026-10-30T09:16:04.000Z"
}

Courier payment#

A courier's cash on delivery payment, imported from its payment sheet or its API, after its parcels were matched to orders. The counts say how many need a look.

Sent by courier_settlements/imported (needs read_orders).

FieldTypeWhat it holds
idstringThe payment's id.
courierstringThe courier's id: postex, leopards, tcs, trax, mnp, callcourier or blueex.
courier_namestringThe courier's name.
referencestringThe courier's reference for the payment.
paid_atstring or nullWhen the courier paid (ISO 8601), when it says.
sourcestringupload (a payment sheet) or api (the courier's API).
currencystringThe currency of the amounts.
cod_totalstringThe cash the courier collected on these parcels.
charges_totalstringWhat the courier took off: delivery, cash on delivery fees and returns.
net_amountstringWhat the courier paid.
lines_countnumberParcels on the payment.
matched_countnumberParcels matched to an order and paid as expected, counting the ones that came back and only have return charges.
problems_countnumberParcels that need a look: short, over, not found or already paid.
short_countnumberParcels the courier paid less for than it was to collect.
over_countnumberParcels the courier paid more for.
unmatched_countnumberParcels that match no order of the store.
duplicate_countnumberParcels that an earlier payment already covered.
return_charge_countnumberParcels that came back and only have charges.
short_totalstringHow much the courier paid short, in all.
created_atstringWhen it was imported (ISO 8601).
courier_settlements/imported
{
  "id": "cm2setl0001",
  "courier": "postex",
  "courier_name": "PostEx",
  "reference": "CPR 104233",
  "paid_at": "2026-10-30T09:15:00.000Z",
  "source": "upload",
  "currency": "PKR",
  "cod_total": "54000.00",
  "charges_total": "3150.00",
  "net_amount": "50850.00",
  "lines_count": 12,
  "matched_count": 10,
  "problems_count": 2,
  "short_count": 1,
  "over_count": 0,
  "unmatched_count": 1,
  "duplicate_count": 0,
  "return_charge_count": 1,
  "short_total": "500.00",
  "created_at": "2026-10-30T09:15:00.000Z"
}

Courier hasn't paid#

A delivered cash on delivery parcel that the courier still hasn't paid for after the days it usually takes. Sent once per parcel.

Sent by couriers/cod_overdue (needs read_orders).

FieldTypeWhat it holds
idstringThe parcel's fulfillment id.
order_idstringThe order it belongs to.
courierstringThe courier's id (postex, leopards, tcs…).
courier_namestringThe courier's name.
tracking_numberstring or nullThe parcel's tracking number.
amountstringThe cash the courier holds, as a decimal string.
currencystringThe currency of the amount.
daysnumberDays since the parcel was delivered.
expected_daysnumberThe days the courier usually takes to pay.
delivered_atstring or nullWhen the parcel was delivered (ISO 8601).
couriers/cod_overdue
{
  "id": "cm2fulf0001",
  "order_id": "cm2ordr0001",
  "courier": "postex",
  "courier_name": "PostEx",
  "tracking_number": "PX-30415528",
  "amount": "4500.00",
  "currency": "PKR",
  "days": 9,
  "expected_days": 7,
  "delivered_at": "2026-10-21T10:40:00.000Z"
}

Product status#

A product became active, draft or archived. The same fields as the product's own id, title, handle and status in the Admin API.

Sent by products/status_changed (needs read_products).

FieldTypeWhat it holds
idstringThe product's id.
titlestringThe product's title.
handlestringThe product's handle.
statusstringThe new status: active, draft or archived.
previous_statusstringThe status it had before.
updated_atstringWhen the product last changed (ISO 8601).
products/status_changed
{
  "id": "cm2prod0001",
  "title": "Linen shirt",
  "handle": "linen-shirt",
  "status": "active",
  "previous_status": "draft",
  "updated_at": "2026-10-30T09:15:00.000Z"
}

Product added to or removed from a collection#

A product joined or left a collection: picked by hand, or because an automated collection's conditions started or stopped matching it. When one change moves more than 1,000 products (new conditions on a big collection), the first 1,000 are sent.

Sent by products/added_to_collection and products/removed_from_collection (needs read_products).

FieldTypeWhat it holds
idstringThe product's id.
titlestringThe product's title.
handlestringThe product's handle.
collection_idstringThe collection's id.
collection_titlestringThe collection's title.
collection_handlestringThe collection's handle.
occurred_atstringWhen the product joined or left (ISO 8601).
products/added_to_collection
{
  "id": "cm2prod0001",
  "title": "Linen shirt",
  "handle": "linen-shirt",
  "collection_id": "cm2coll0001",
  "collection_title": "Summer linen",
  "collection_handle": "summer-linen",
  "occurred_at": "2026-10-30T09:15:00.000Z"
}

Review#

A product review in Loom Reviews, with the fields of the Admin API's review. reviews/created is sent when it is added, published or waiting for approval; reviews/published when it goes live.

Sent by reviews/created and reviews/published (needs read_reviews).

The reviewer's name and what they wrote are sent. Their email and phone aren't: an app that also has read_customers can read them with the Admin API.

FieldTypeWhat it holds
idstringThe review's id.
product_idstringThe product it is about.
ratingnumber1 to 5.
titlestringThe review's title. Empty when there is none.
bodystringWhat the reviewer wrote.
author_namestringThe reviewer's name.
photosarray of stringsLinks to the photos they added.
statusstringpending, published, hidden or spam.
verifiedbooleanWhether the reviewer bought the product.
sourcestringWhere it came from: storefront, request, import, api or admin.
replystring or nullThe store's reply.
replied_atstring or nullWhen the store replied (ISO 8601).
helpful_countnumberHow many shoppers found it helpful.
reported_countnumberHow many shoppers reported it.
order_idstring or nullThe order the reviewer bought it in.
customer_idstring or nullThe reviewer's customer.
localestring or nullThe language the review was written in.
external_idstring or nullWhere an imported review came from, for re-imports.
published_atstring or nullWhen it went live (ISO 8601).
created_atstringWhen it was written (ISO 8601).
updated_atstringWhen it last changed (ISO 8601).
reviews/created
{
  "id": "cm3rev0001",
  "product_id": "cm2prod0001",
  "rating": 5,
  "title": "Soft and true to size",
  "body": "The lawn is soft and the print looks just like the photos.",
  "author_name": "Fatima M.",
  "photos": [
    "https://dhaaga.example/uploads/review-1.jpg"
  ],
  "status": "published",
  "verified": true,
  "source": "request",
  "reply": null,
  "replied_at": null,
  "helpful_count": 0,
  "reported_count": 0,
  "order_id": "cm3order001",
  "customer_id": "cm3cust001",
  "locale": "en",
  "external_id": null,
  "published_at": "2026-10-30T09:15:00.000Z",
  "created_at": "2026-10-30T09:00:00.000Z",
  "updated_at": "2026-10-30T09:15:00.000Z"
}

Shoppers searched the storefront for words that found nothing (Loom Search & Discovery). Sent the first time each day for the same words; searching them again that day sends nothing.

Sent by search/no_results (needs read_products).

These are the words shoppers typed. Nothing says who typed them.

FieldTypeWhat it holds
querystringThe words searched, as the store's search read them.
resultsnumberProducts found. Always 0.
daystringThe day in the store's time zone (YYYY-MM-DD).
searched_atstringWhen the search was made (ISO 8601).
search/no_results
{
  "query": "lawn kurta",
  "results": 0,
  "day": "2026-10-30",
  "searched_at": "2026-10-30T09:15:00.000Z"
}

A customer's agreement to get marketing changed: emails (customers/subscribed, customers/unsubscribed) or offers by WhatsApp and SMS (customers/text_subscribed, customers/text_unsubscribed). Sent when the setting changes, not when it is saved unchanged.

Sent by customers/subscribed, customers/unsubscribed, customers/text_subscribed and customers/text_unsubscribed (needs read_customers).

Carries the customer's email and phone, as the Admin API's customer does under read_customers.

FieldTypeWhat it holds
idstringThe customer's id.
emailstring or nullThe customer's email.
phonestring or nullThe customer's phone.
channelstringemail, or text for offers by WhatsApp and SMS.
subscribedbooleanWhether the customer agrees to get them now.
sourcestring or nullHow the change came about, for example newsletter, checkout, account, admin, import, api, unsubscribe_link or reply_stop. null when it isn't known.
updated_atstring or nullWhen the consent changed (ISO 8601).
customers/subscribed
{
  "id": "cm2cust0001",
  "email": "[email protected]",
  "phone": "03001234567",
  "channel": "email",
  "subscribed": true,
  "source": "checkout",
  "updated_at": "2026-10-30T09:15:00.000Z"
}

Customer message#

A customer wrote to the store's WhatsApp number or replied to an SMS. Not sent for STOP replies or answers to a cash on delivery confirmation: Weftstore handles those itself.

Sent by messages/received (needs read_customers).

Carries what the customer wrote and their phone number, so subscribe only if the app needs them.

FieldTypeWhat it holds
idstringThe message's id.
channelstringwhatsapp or sms.
fromstringThe sender's phone number, as the provider gave it.
textstringWhat the customer wrote.
button_payloadstring or nullThe payload of the quick-reply button they tapped, when they tapped one.
reply_tostring or nullThe provider's id of the message they replied to, when it says.
customer_idstring or nullThe customer with that phone number, when there is one.
order_idstring or nullThe customer's latest order of the last 7 days, when there is one.
received_atstringWhen the message arrived (ISO 8601).
messages/received
{
  "id": "cm2inbx0001",
  "channel": "whatsapp",
  "from": "03001234567",
  "text": "Kab tak deliver hoga?",
  "button_payload": null,
  "reply_to": null,
  "customer_id": "cm2cust0001",
  "order_id": "cm2ordr0001",
  "received_at": "2026-10-30T09:15:00.000Z"
}

Headers#

HeaderWhat it is
X-Storeloom-TopicThe topic.orders/create
X-Storeloom-Hmac-Sha256Base64 HMAC-SHA256 of the raw request body. The key is a custom app's API secret, or an App Store app's client secret.XWmrwMey6OsLMeiZKwP4FppHH3cmAiiJJAweH5Jo4bM=
X-Storeloom-Webhook-IdThis delivery. The same on every retry of it, so use it to ignore duplicates.cm2wdel0001
X-Storeloom-Event-IdThe event. The same for every app notified about it.6f1c9a1e-0b8e-4a55-9d83-3cbbd1c8a1f2
X-Storeloom-Triggered-AtWhen the event happened (ISO 8601). Retries keep the original time.2026-10-23T09:30:00.000Z
X-Storeloom-Shop-DomainThe store's primary domain: its own domain when it has one, otherwise its Weftstore address. It can change.demo.storeloom.example
X-Storeloom-Shop-IdThe store's id, the same as the id in the shop object. It never changes, so use it rather than the domain to tell stores apart.cm2stor0001
X-Storeloom-API-VersionThe API version the payload is in (the subscription's version).2026-10
Content-TypeAlways JSON.application/json
User-AgentIdentifies Weftstore's sender.Storeloom-Webhooks/1.0

Verifying signatures#

Anyone can send a request to your URL, so check that it came from Weftstore. X-Storeloom-Hmac-Sha256 is the HMAC-SHA256 of the raw request body, base64-encoded. Compute it over the exact bytes you received, before any JSON parsing, and compare in constant time. Answer 401 when it doesn't match.

The key is the app's secret, and which one depends on the kind of app. The header and the algorithm are the same, so one check works for both.

AppSigned withWhere to find it
A custom app, made in a store's adminIts API secret, which starts with slsk_Reveal it on the app's page in the admin.
An App Store appIts client secret, which starts with slcs_. It is the same for every store that installs the app.Shown once when you create the app. Rotate secret on the app's page in the partner dashboard makes a new one, and everything sent from then on is signed with it.
webhooks.js
import crypto from "node:crypto";

export function validWebhook(rawBody, hmacHeader, secret) {
  const digest = crypto.createHmac("sha256", secret).update(rawBody).digest("base64");
  const expected = Buffer.from(digest);
  const received = Buffer.from(hmacHeader ?? "");
  return expected.length === received.length && crypto.timingSafeEqual(expected, received);
}

// Express: read the raw body. The signature covers the exact bytes sent.
// The secret is a custom app's API secret, or an App Store app's client secret.
app.post("/webhooks/storeloom", express.raw({ type: "application/json" }), (req, res) => {
  if (!validWebhook(req.body, req.get("X-Storeloom-Hmac-Sha256"), process.env.STORELOOM_API_SECRET)) {
    return res.sendStatus(401);
  }
  res.sendStatus(200); // answer right away, then do the work
  const payload = JSON.parse(req.body.toString("utf8"));
  jobs.add(req.get("X-Storeloom-Topic"), payload, { jobId: req.get("X-Storeloom-Webhook-Id") });
});

Responses and retries#

Answer with any 2xx status within 5 seconds and the delivery counts as delivered. Anything else is a failure: another status, a redirect (they aren't followed), a timeout or a connection error. Failed deliveries are tried again on this schedule, 9 attempts over about two days, then marked failed:

AttemptWhenSince the event
1When the event happens0 min
21 min after the previous attempt1 min
35 min after the previous attempt6 min
415 min after the previous attempt21 min
51 h after the previous attempt1 h 21 min
63 h after the previous attempt4 h 21 min
76 h after the previous attempt10 h 21 min
812 h after the previous attempt22 h 21 min
924 h after the previous attempt46 h 21 min

Weftstore sends to different addresses at the same time and takes turns between them when many deliveries are waiting, so a slow or dead address doesn't hold up the others. Deliveries to one server go out only a couple at a time.

Every delivery, with its payload, the response code and the error, is listed on the app's page in the admin, where you can resend it. Send test there posts a sample of the topic, built from the store's latest matching record; tests aren't retried. Delivered webhooks are kept for 30 days and failed ones for 60.

The developer of an App Store app has the same list in the Webhooks tab of the app in the partner dashboard: the addresses each store's install subscribed to, with how each is doing, and the deliveries sent to them with the answer your server gave. It shows store names and delivery facts, never a payload or anything about a customer. Send test, Resend and Resume are there too. A test posts a signed message that says it is a test and holds no store data, { "test": true, "topic": "orders/create", "note": "…" }, so your handler should recognize it and skip it.

Pausing and resuming#

Weftstore keeps count for each subscription: one topic, sent to one address, from one store. Every failed attempt adds one to its run of failures, and a delivery that gets through, or a test, clears the run. When a subscription has failed 20 attempts in a row and the run has lasted at least 24 hours, Weftstore pauses it. A server that is down pauses every store's subscription to it, each on its own count.

StatusWhat it means
HealthyThe last attempt got through, or nothing has been sent yet.
FailingThe latest attempts failed. Deliveries are still tried again on the schedule above, and nothing else changes.
PausedThe run of failures reached the limit. Nothing is sent to this subscription until it is started again.
  • Who is told. For an App Store app, the developer is emailed at the address of their developer account, with a link to the Webhooks tab of the app. For a custom app, the store's contact address is emailed, with a link to the app. An app gets at most one of these emails in 24 hours, however many stores and topics were paused in that time: the Webhooks tab lists every one. The store's activity log records the pause too.
  • Send test. Fix the address, then press Send test on its row. A test is a real, signed delivery, and the first one your server answers with a 2xx starts the subscription again. One that fails counts as another failure.
  • Resume. Resume starts a paused subscription without a test. Its count starts from zero, so a server that is still down is paused again only after another 20 failed attempts over 24 hours.

Developers of App Store apps find both buttons on the Webhooks tab of the app in the partner dashboard, one row for each store and topic. For a custom app they are on its page in the store's admin, under Webhooks.

Uninstall and privacy messages#

A store's subscriptions are deleted when it uninstalls the app, so the last messages about an install can't be sent through them. For App Store apps Weftstore keeps a queue of its own for four messages. They are signed with the client secret, carry the same headers and are never paused. app/uninstalled is tried again on the same schedule as other webhooks: 9 attempts over about two days. The three privacy messages are tried for longer, 14 attempts over about 7 days, so a server that was down for a weekend still gets them.

TopicGoes toSent when
app/uninstalledEvery address the app subscribed to for this topicThe store uninstalls the app. The first attempt is made at once.
shop/redactThe app's privacy webhook URL48 hours after an uninstall, unless the store installs the app again before then.
customers/data_requestThe app's privacy webhook URLA merchant asks for the data apps hold about a customer. Only apps that can read customer data are sent it.
customers/redactThe app's privacy webhook URLA merchant erases a customer. Only apps that can read customer data are sent it.

Only app/uninstalled needs a subscription. The three privacy topics aren't in the topic list: they go to the privacy webhook URL that every App Store app sets in the partner dashboard, whether or not it subscribed to anything. shop/redact goes to every app that has one; the two customer topics carry a customer's email and phone number, so they go only to an app that can read customer data. Privacy webhooks says which access that is, and has the payloads and what your app has to do.

A retry of app/uninstalled can arrive after the token has stopped working, so don't count on the Admin API from it. Its body is the shop object, the same as GET /shop.json: use its id to find what you kept about the store. If the store may have installed your app again since, call the API with the token you hold before you forget the store: a 401 means the install is over, and a success means the store is still there. A custom app gets app/uninstalled once, just before its token stops working, and none of the other three.

The Webhooks tab in the partner dashboard lists all four under Uninstall and privacy messages, and Resend sends a failed one again. A message about a customer can't be sent again: once it has been delivered, or given up on, its body is replaced with {"redacted":true}.

Good practice#

  • Answer first, then work: put the payload on a queue and return 200. Slow answers time out and are retried.
  • Expect duplicates. A retry, or a resend from the admin, carries the same X-Storeloom-Webhook-Id; skip ids you've handled. X-Storeloom-Event-Id is the same for every app notified about one event.
  • Expect them out of order, especially after retries. Compare the payload's updated_at with what you have, or fetch the latest version from the Admin API.
  • Don't rely on webhooks alone for money or stock: an occasional sync with updated_at_min catches anything your endpoint missed while it was down.
  • Subscribe to app/uninstalled to hear when the store deletes your app. A custom app gets it once, just before the tokens stop working; an App Store app gets it again if its server doesn't answer.