Sending orders to a print partner
Your task
Design how an online shop that sells custom T-shirts and posters hands each paid order to an outside print-and-ship partner through the partner's REST API. The shop takes about 8,000 orders a day, up to 2,000 in an hour during promotions. The partner's API allows 5 requests a second, goes down for maintenance now and then, sometimes times out after it has already created the order on its side, and reports progress (printed, shipped with a tracking number) back by webhook. Customers can cancel within an hour of ordering. Describe how orders are queued and sent, how retries avoid duplicate print jobs, how a cancellation is kept behind its order, and how failures are surfaced.
It covers
- Idempotency
- Rate limiting
- Dead letter queue