Skip to main content
Documentation menu

Integrate your ERP

When a shop uses an ERP, every new manufacturing order waits in analysis until the ERP has checked that the materials are there. This guide connects an ERP to that step: it hears about each new order, checks the stock, and then releases the order to production or puts it on hold with a reason.

Every ERP connects the same way, through the API and webhooks. There’s nothing to install.

Before you start

You need:

Step 1: Hear about new orders

Subscribe to webhooks for the topics your ERP acts on. At the least that’s manufacturing_order.created:

curl -X POST https://orderkraft.app/api/v1/webhook_subscriptions \
  -H "Authorization: Bearer ok_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://erp.example.com/orderkraft/webhooks", "topics": ["manufacturing_order.created", "manufacturing_order.released", "manufacturing_order.cancelled"] }'

Store the secret from the answer and verify every webhook with it. A merchant can also add the subscription under Settings → Webhooks and hand you the secret.

Step 2: Check the materials

A new order arrives as manufacturing_order.created with "status": "analysis". Its inputs list every material the order needs, with sku, requestedQuantity and unitOfMeasure. Check those against your stock.

Answer the webhook with a 2xx right away and do the check afterwards. See answer quickly.

Step 3: Release or hold the order

When everything is there, release the order. It goes to production with the status waiting:

curl -X POST https://orderkraft.app/api/v1/manufacturing_orders/5521/release \
  -H "Authorization: Bearer ok_live_..."

When something is missing, put the order on hold with a note the merchant can read:

curl -X POST https://orderkraft.app/api/v1/manufacturing_orders/5521/holds \
  -H "Authorization: Bearer ok_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "note": "Waiting on oak planks, expected on Thursday" }'

The answer is the manufacturing order, with your new hold in its holds list. Keep that hold’s id.

When you know when the materials arrive, move the order’s ship-by date too, so the merchant sees it’s going to be late before it is:

curl -X PATCH https://orderkraft.app/api/v1/manufacturing_orders/5521 \
  -H "Authorization: Bearer ok_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "shipBy": "2026-12-15" }'

Step 4: Lift the hold when the materials arrive

curl -X DELETE https://orderkraft.app/api/v1/manufacturing_orders/5521/holds/88 \
  -H "Authorization: Bearer ok_live_..."

Once nothing else holds the order, it goes on to production. You don’t release it separately: an order you held is moved on by lifting its holds, and release only works on an order still in analysis.

What the merchant can do

Your holds are ordinary holds. The merchant sees your note on the order and can lift the hold themselves, for example when they buy the material locally. An order you haven’t answered yet can be sent to production by hand too. Subscribe to manufacturing_order.released so your ERP hears when that happens.

Holds add up. If the merchant has an order on hold as well, production only resumes once every hold is lifted.

Test it

Point a subscription at a request bin like webhook.site, turn on ERP in a development store, and place an order for a made-to-order product. You’ll see manufacturing_order.created arrive with the order in analysis, and can try the release and hold calls against it.