Path A, inventory sync · 8 of 15
Keep stock in sync
Apply inventory.adjusted events and reconcile stock while sellers ship orders from the Snapcaster dashboard.
On Path A, the inventory subscription, your system owns stock counts and sellers ship their orders from the Snapcaster dashboard.
Your platform supplies on-hand quantities and receives no buyer personal information.
The order operations, such as GET /orders and PATCH /orders/{orderId}/fulfillment, return HTTP 403 SUBSCRIPTION_EXCLUDES_ORDERS to an inventory platform.
What you build
Section titled “What you build”Build these calls and notifications in this order.
- Validate each seller’s key with
GET /meand store itssellerId. - Push listings with
POST /listings, orPOST /listings/bulkfor a mix of writes and deletes, and remove them withDELETE /listings, the calls Sync a full catalog uses. - Receive
inventory.adjustedand apply itsdeltabefore you return2xx. - Push a newer listing snapshot after the
2xxto release the hold on sold units. - Reconcile your stock with
availablefromGET /listings.
Your platform makes no order calls.
Snapcaster sends the signed inventory.adjusted event whenever an order moves stock.
The event carries seller_id and lines with sku_id, external_ref, and a signed delta, which you apply as on_hand[sku] += delta.
Build a webhook receiver has a complete receiver that does this.
A negative delta follows a sale, and a positive delta follows a cancellation or a refund with restocking. Snapcaster sends a positive event only after you have acknowledged the sale whose units it returns, so you never add back units you have not deducted. If the sale is never delivered, its positive event is never sent either.
When a buyer accepts a substitute card from the seller’s own listings, you receive two events with their own event_ids.
A positive one returns the original units, and a negative one deducts the substitute, which is always a listing you already pushed.
Return 2xx only after you have saved the adjustment to durable stock state.
Queueing it does not count, and a 2xx sent before you save it can make a sold card available to buyers again.
Failed deliveries follow the retry schedule, and a replay sends a sale before the stock it later gave back, so apply events in the order they arrive.
Reconcile safely
Section titled “Reconcile safely”Every listing write is an ordered snapshot whose asOf is the UTC instant you measured on-hand.
Only the sequence in Release the hold on sold units releases a committed hold.
available in GET /listings is the quantity buyers can purchase right now, your last on-hand minus the committed units.
Use it to check your stock, never as an on-hand value to push.
Pushing available as on-hand puts the sale into your stock count before its adjustment arrives, and applying that adjustment then deducts the same units a second time.
Recover from an outage
Section titled “Recover from an outage”Snapcaster keeps every adjustment your receiver did not acknowledge, so recovery replays the missed events rather than replacing stock counts.
- Keep returning non-2xx while your receiver cannot save adjustments, so Snapcaster keeps the events and retries them.
- If the outage lasted longer than 24 hours, email info@snapcaster.gg to have Snapcaster replay the events it holds for your platform.
- Apply each delivered event once, deduplicating on
event_id, and acknowledge it after saving. A replay keeps the originalevent_id, so events you already applied are no-ops. - After every outstanding event is applied, measure on-hand and push it with an
asOfat the measurement time. - Compare your stock with
availablefromGET /listings, and investigate a difference instead of overwriting on-hand with it.
Deduct from exactly one source
Section titled “Deduct from exactly one source”With the inventory subscription, only inventory.adjusted moves your stock, and the seller ships from the dashboard without your platform deducting anything.
The delivery payload is in the Inventory adjusted webhook reference.
The Path B pages apply only to orders and both, so skip them and test your integration in the sandbox.
Need help?
The email includes this page and selects sandbox as the environment. Update it if you need help with production.
Never include an API key or signing secret in the message.