API for the workflow automation course. Each learner creates an isolated shop.
A new poll generates three orders with different products, amounts and payment statuses. Existing orders keep their IDs and contents.
Create a shop to begin.
All paths below start with /workflow-automation.
| Method | Path | Result |
|---|---|---|
| POST | /shops | A shop ID, orders URL and expiration time. |
| GET | /shops/{shop_id}/orders?after=0 | New orders and pagination cursors. |
| GET | /shops/{shop_id}/orders/{id} | One previously generated order. |
| POST | /shops/{shop_id}/orders/{id}/process | Mark a paid order as processed. Repeating the request returns the same result. |
Start with after=0. Save next_after and send it as after in the next poll to receive new orders. Payment statuses are paid, pending and cancelled. Only paid orders can be processed.
For smaller pages, set limit from 1 to 100. While has_more is true, use next_after and the returned through for the next page. Passing through keeps the same batch and does not generate orders. Omit it when starting a new poll.
Add ?failure=before to a processing request for a single 503 before processing. Add ?failure=after for a single 503 after the order has been processed. Both return Retry-After: 1. Read the order or repeat the processing request to check the outcome.
A shop lives for 24 hours and holds up to 300 orders. Its data is stored in memory and is cleared on server restart. Create a new shop after expiration, restart or the order limit. Amounts are in RUB. All products and orders are fictional.