Place an order
FreeFlowA shopper buys a product; the order service checks stock, charges the card through a payment provider and saves the order.
Checkout from "Buy" to a paid order:
- Client app sends the product, quantity and card token, and shows the answer.
- Order service checks the quantity, finds the product, refuses when stock is short, charges the total and saves the order.
- Shop database answers the product lookup and keeps the orders. Payment provider charges the card. Event bus (optional) receives
order.placed.
The card is charged only after the stock check, and the order is saved only when the payment is accepted.
The unhappy paths are in: a declined card (402), a card that needs 3-D Secure (202 with the bank’s page; the order waits as awaiting_payment), a payment provider that doesn’t answer in time (504, safe to retry), and the same order sent twice, which gets the first order back (200) instead of a second charge. The idempotency key goes to the payment provider too, so a retry after a timeout never charges twice.
- No matches
Up and down arrows: previous or next step. Home, End: first or last. Enter: select. Shift F10: more actions.
productId: string quantity: integer cardToken: string idempotencyKey: string
id: string total: number
id: string total: number
id: string actionUrl: string
error: string
error: string
error: string
error: string
error: string
