Order Sync
The situation
Northline Supply is a small online store. Every time someone places an order, two things have to happen: the stock gets held in the warehouse system, and the customer gets added to the CRM so support can find them later.
Right now that sync breaks every week. The warehouse API goes down, rate limits kick in, the store sends the same order twice, and once in a while a broken order comes through. Last month a retry reserved the same order twice and a customer got charged for stock they never ordered.
Your job is to build the sync that doesn't break.
What you're building
A webhook endpoint. The store sends it a POST for every order. For each order, your build must:
- Reserve stock with the Inventory API.
- Add or update the customer with the CRM API.
Build it in whatever you work in: n8n, Make, Zapier, Pipedream, Python, Node. If it can receive a POST at a public https URL, it works.
What you get when you finish
- A score out of 100 and a plain breakdown of what held up and what didn't.
- The result is sealed to your public WeTheBuilders record, breaks included. Nobody, including us, can change it without it showing.
- Every attempt counts and stays on your record. Recruiters see how you improved, not only your best score, so a first attempt that breaks is normal and fine.
What your endpoint receives
POST {your endpoint}
Content-Type: application/json
X-Sandbox-Key: sbx_...
X-Delivery-Id: dlv_...
{
"event": "order.created",
"order_id": "ord_ab12cd_001",
"created_at": "2026-12-02T18:00:00Z",
"customer": { "email": "ana.1@example.com", "name": "Ana Ruiz" },
"items": [ { "sku": "TEE-BLK-M", "qty": 2 } ]
}
Every webhook carries an X-Sandbox-Key header. Read it from the incoming request and send it with every API call you make. It changes on every run, so don't hard-code it.
The APIs you call
Base URL:
https://muxxuakbvxkqapczcyyu.supabase.co/functions/v1/mock-api
Reserve stock
POST {base}/inventory/reserve
X-Sandbox-Key: (from the webhook)
Idempotency-Key: (optional, any string you choose)
{ "order_id": "...", "items": [ { "sku": "...", "qty": 1 } ] }
200 { "reservation_id": "res_..." }
Add or update the customer
POST {base}/crm/upsert
X-Sandbox-Key: (from the webhook)
{ "order_id": "...", "email": "...", "name": "..." }
200 { "customer_id": "cus_..." }
The APIs only answer during a run, because the sandbox key only exists while a run is going.
What the sandbox throws at you
This is the part the score is really about.
- Server errors. Some calls return 500.
- Rate limits. Some calls return 429 with a
Retry-Afterheader (in seconds). Retrying before that time is up counts against you. - Hangs. Some calls wait 8 seconds, then return 504.
- The nasty one. Sometimes the Inventory API saves your reservation, then returns 502 anyway. If you retry blindly, you reserve the same order twice.
- Duplicate webhooks. The store re-sends some orders, the way real webhook providers do.
- Bad data. Some webhooks are broken: missing fields, empty items, negative quantities, bad emails, or JSON that doesn't parse.
How a run works
- Sign in, paste your endpoint URL, and start a run.
- The sandbox sends 44 webhooks, up to 6 at a time.
- Your endpoint has 12 seconds to answer each one. After it answers, your build can keep working in the background.
- After the last webhook, the sandbox waits 30 seconds for your build to finish, then checks what actually happened in the inventory system and the CRM.
- You get your scorecard in about two minutes.
You get 5 runs a day, one at a time.
How you're scored
| What we check | Points | What earns them |
|---|---|---|
| Every order lands | 35 | Each valid order ends up with stock reserved and the customer in the CRM |
| No doubles | 20 | No order is ever reserved twice |
| Recovery | 20 | Orders that hit an error still finish, and you wait out every Retry-After |
| Bad data | 15 | Broken webhooks get a 400 and never touch inventory |
| Speed | 10 | Your endpoint answers fast (95% of answers in 2 seconds or less earns full marks) |
If your build doesn't process any orders, the other categories score zero too. Rejecting everything doesn't count as handling bad data.
Grades: 90 and up is Production-ready, 75 and up is Solid, 50 and up is Fragile, and below 50 is Not ready.
Before your first run
- Use a public https URL. Localhost won't work. If your tool gives you a separate test or draft webhook URL, use the live one and make sure the workflow is turned on or deployed. Test URLs often only listen while the editor is open.
- Answer the webhook yourself. Return 400 for broken orders and 200 for good ones. 401, 403, 404 and 405 don't count as rejecting bad data.
- Use AI if you want. Use whatever helps you ship. What goes on your record is what you built and how it held up.