Create orders safely

A checkout is safe when network retries cannot create a duplicate order or duplicate wallet charge.

The safe checkout

Fresh productFull addressOrder + keyPersist orderNo

Idempotency

Generate a unique reference between 8 and 200 characters for each intended checkout. Store it before calling Shioja. If the request times out, retry with the same key. Never generate a new key merely because the response was lost.

Transaction behavior

Shioja checks the idempotency record first, calculates delivery from the submitted address, and verifies the current product and wallet. The order, wallet entry, financial summary, and idempotency record are committed together.

Retry decision table

ResultAction
Timeout / connection lostRetry with the same idempotency key.
IDEMPOTENCY_CONFLICTUse a new key only for a genuinely different order.
PRODUCT_CHANGEDRetry the same intended order with the same idempotency key.
INSUFFICIENT_FUNDSTop up the matching wallet, then retry deliberately.
PRODUCT_UNAVAILABLEStop checkout and ask the customer to choose another product.

Order status

New orders begin at PROCESSING. Use the order identifier returned as data.orderNo as your canonical Shioja reference. Existing v1 order-read endpoints remain available with a secret key while v2 order reads are introduced separately.

Customer experience

Disable duplicate submit actions, show a durable “processing” state during uncertain network outcomes, and reconcile by idempotency key or stored order number before telling a customer to try again.