Help

Orders, refunds, and cancellations

When a Shopify order arrives, KeepBatch deducts the recipe materials. Refunds and cancellations put them back. The same event is never counted twice.

KeepBatch listens for Shopify order, refund, and cancellation events. It uses them only to update raw-material counts inside KeepBatch. Shopify finished-goods inventory is never changed.

When an order arrives

For each line on the order, KeepBatch looks up the recipe for that variant and deducts recipe quantity × units sold from each material. The recipe lines used for that order are stored on the order line, so a later recipe edit does not change a sale that already happened.

If a variant has no recipe, that line is skipped and no materials move. If the order is already cancelled when KeepBatch first sees it, stock is not moved.

When an order is refunded

A refund puts materials back using the stored recipe snapshot, multiplied by the refunded units. The restore is capped at what is still deducted for that line, so you cannot put back more than was taken off.

When an order is cancelled

A cancellation restores whatever is still deducted for that order. If part of the order was already refunded, only the remaining deducted quantity is put back.

Events that arrive out of order, and retries

If a refund or cancellation arrives before the original order event, KeepBatch remembers it and nets it against the deduction when the order shows up. You do not have to fix that by hand.

Each delivery has a unique key — a deduction, refund, or cancellation tied to the order and line, or to the refund id. If Shopify retries the same event, the key already exists and KeepBatch does nothing. The same event is never counted twice.

Every movement is written to the Activity log, including the material, the change, and the on-hand balance after the change. Activity is a raw-materials log only. Shopify product inventory is not part of it.