חנות Webflow Ecommerce: הזמנה חדשה מפיקה מסמך, כולל משלוח, מע״מ והנחה.
התקנה (5 דקות)#
ב-Webflow צרו Data Client App (או השתמשו באפליקציית OAuth קיימת) עם ההרשאות
ecommerce:readו-sites:write.צרו Webhook דרך ה-API. כתובת ה-
urlמוצגת במסך החיבור:curl -X POST "https://api.webflow.com/v2/sites/<site_id>/webhooks" \ -H "Authorization: Bearer <SITE_TOKEN>" -H "Content-Type: application/json" \ -d '{ "triggerType": "ecomm_new_order", "url": "https://invoice.slk.co.il/api/billing/ecommerce/webflow/<hookId>" }'העתיקו את ה-
secretשבתשובה (Webhook שנוצר עם site token), או את ה-Client secret של אפליקציית ה-OAuth, והדביקו בשדה הסוד במסך החיבור.בחרו סוג מסמך ולחצו על שליחת הזמנת בדיקה. מסמך יופק להזמנות במצב unfulfilled או fulfilled.
Developer reference#
Mode: hook, push (the delivery carries the whole order). Category: builder. Refunds: skipped.
Event. ecomm_new_order, v2 envelope (a bare order body is accepted too):
{ "triggerType": "ecomm_new_order",
"payload": { "orderId": "5e8a1b", "status": "unfulfilled", "acceptedOn": "2026-09-20T10:00:00.000Z",
"customerPaid": { "unit": "ILS", "value": "210.00" },
"customerInfo": { "fullName": "...", "email": "..." },
"billingAddress": { "type": "billing", "addressee": "...", "line1": "...", "city": "...", "postalCode": "...", "country": "IL" },
"purchasedItems": [ { "productName": "...", "variantName": "M", "count": 2,
"variantPrice": { "value": "100.00" }, "rowTotal": { "value": "200.00" } } ],
"totals": { "subtotal": { "value": "200.00" },
"extras": [ { "type": "shipping", "price": { "value": "20.00" } }, { "type": "tax", "price": { "value": "32.03" } },
{ "type": "discount", "price": { "value": "10.00" } } ],
"total": { "value": "210.00" } } } }Money objects are { unit, value, string } with value a decimal string in the currency's base unit.
Auth. x-webflow-signature = hex HMAC-SHA256 over "<x-webflow-timestamp>:<raw body>", keyed with the per-webhook secret (API-created webhooks after 2025-04-14) or the OAuth app's client secret. It is { kind: "custom" } rather than the plain hmac kind so the receiver can also enforce Webflow's recommended 5-minute timestamp window (replays are rejected; the timestamp is accepted in seconds or milliseconds). Constant-time compare; the body is signed exactly as delivered.
Which orders issue. triggerType ecomm_new_order (or no envelope) with status unfulfilled or fulfilled. pending, disputed, dispute-lost, refunded and every other trigger are acknowledged with 200 and no row.
Mapping.
| Webflow field | Document field |
|---|---|
orderId | externalId; apiIdentifier = webflow-<orderId> |
purchasedItems[].productName + variantName | line name |
purchasedItems[].count | line quantityMilli |
purchasedItems[].variantPrice.value | line unitPriceAgorot when count x variantPrice equals rowTotal; otherwise one line for rowTotal named "<name> x count" |
totals.extras[type=shipping] | line "משלוח" |
totals.extras[type=discount / discount-shipping] | document discountValue (fixed, absolute value) |
totals.extras[type=tax] | vatBp derived over the net amount, snapped to 1800 within 80bp |
totals.total.value (else customerPaid.value) | decides whether item prices already include tax |
customerInfo.fullName, email | customerName, customerEmail |
billingAddress.line1/line2/city/postalCode/country | customerAddress |
customerPaid.unit | currency |
acceptedOn | issueDate |
paypalDetails present | payment type PayPal, otherwise card |
The document is always tax-included; the single payment row is computed from the lines so it can differ from customerPaid by an agora of rounding.
Refunds. ecomm_order_changed with status: "refunded" documents refundedOn but no refund amount, so a credit note cannot be sized from it. It is ignored (supportsRefunds is false). Issue a credit note manually.
Test with curl:
SECRET='<webhook secret>'; TS=$(date +%s)000
BODY='{"triggerType":"ecomm_new_order","payload":{"orderId":"5e8a1b","status":"unfulfilled","acceptedOn":"2026-09-20T10:00:00.000Z","customerPaid":{"unit":"ILS","value":"100.00"},"customerInfo":{"fullName":"מיכל רוזן","email":"[email protected]"},"purchasedItems":[{"productName":"מוצר","count":1,"variantPrice":{"value":"100.00"},"rowTotal":{"value":"100.00"}}],"totals":{"subtotal":{"value":"100.00"},"extras":[],"total":{"value":"100.00"}}}}'
SIG=$(printf '%s:%s' "$TS" "$BODY" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $NF}')
curl -i -X POST "https://invoice.slk.co.il/api/billing/ecommerce/webflow/<hookId>" \
-H "content-type: application/json" -H "x-webflow-timestamp: $TS" -H "x-webflow-signature: $SIG" -d "$BODY"Sources: ecomm_new_order, ecomm_order_changed, signatures, create webhook.
Troubleshooting#
- 401 — הסוד שגוי, הגוף שונה בדרך, או שהשעון של השולח סוטה יותר מ-5 דקות. ודאו שהעתקתם את ה-secret של אותו Webhook (או את ה-Client secret של אפליקציית ה-OAuth).
- 404 — ה-hookId בכתובת שגוי. העתיקו שוב ממסך החיבור.
- אין מסמך להזמנה — הזמנה במצב pending עדיין לא שולמה, והחזרים אינם מפיקים מסמך אוטומטי.
- "blocked" — מכסת המסמכים החודשית או חבילת המנוי. "dormant" — מודול החיוב כבוי; הפעילו אותו ולחצו "הפק מסמך ידנית" ביומן ההזמנות.