On an ordinary Tuesday, a store’s integration with its courier makes a few API calls a minute, and nobody remembers there’s a limit.
On Black Friday, mid-morning, the same integration goes over it and the API starts rejecting calls.
You can’t tell from the store: the customer paid, got the confirmation, and the order shows as received. The shipping label, though, was never created.
The team often finds out on Monday, when complaints come in about packages that never shipped.
An order makes more calls than anyone counts
Say the courier accepts 60 calls per minute. Ask the team how many calls each order makes to it, and the answer is usually two: create the shipment and request the label.
Follow a real order from payment until it has a label, and there are five.
The missing three are status checks the process repeats every few seconds until the courier confirms the label is ready.
Tracing an order this way takes logs that record each outgoing call with the order that triggered it, and many integrations don’t have them.
Without them, the vendor’s dashboard usually gives a good approximation. Many couriers and ERPs with an API show usage per key and per hour.
The calls in a quiet hour, divided by the orders in that same hour, give an average per order.
Before dividing, subtract the calls from processes that don’t depend on orders, such as tracking open shipments.
Another way is to read the code that calls the courier, counting the polling loops and the retries, which is where the calls nobody mentions live.
Either one is enough to do the math. The logging is worth adding anyway, because it’s the only thing that will show what happened to each order if the peak goes badly.
The ERP works the same way, with its own limit, and there the size of the order tends to matter.
Some integrations reserve stock product by product, so an order with 10 products ends up making 12 calls.
The integration handles eight orders per minute and the peak hits 18
At five calls per order, 60 per minute would cover 12 orders. But the limit applies to the whole account.
The store also runs a job that updates tracking for open shipments every minute and spends about 20 calls.
That leaves 40 for new orders, which means eight orders per minute.
Last year’s average won’t tell you much. With 2,400 orders that day, the store averaged fewer than two per minute, far below the ceiling.
Grouped by minute, the same data shows that in the 20 minutes after the promo email went out, 18 orders came in per minute.
Before taking the 60 at face value, it’s worth reading how the vendor counts it. There are limits per account, per API key, and per endpoint.
A fixed one-minute window lets through bursts that a sliding window rejects.
Many APIs report how many calls are left in the window with every response. Saving that header in the logs shows the real headroom on a normal day.
It also matters what the API returns once you go over the limit. The standard is a 429, which is what this example uses.
But some APIs return a 403 or a 503, and others a 200 with the error written in the body. Some ERPs don’t reject anything: they slow down until the call times out.
The integration has to recognize that particular vendor’s response. If it treats it as just another error, the order gets marked as failed and nobody tries it again.
What happens to order number nine
In the peak minute, the first eight orders go through and the ninth gets a 429. With a 429, the courier rejected the whole call, so retrying it is safe.
A timeout doesn’t give you that certainty, because the call may have gone through.
Even with a 429, retrying right away does harm: the next minute’s quota goes to calls that bounce again, and the integration ends up handling fewer orders than before.
The integration has to wait as long as the Retry-After header says. If the courier doesn’t send one, the usual pattern is exponential backoff with jitter.
That means longer and longer waits, with a random component so the processes don’t all retry in the same second.
Even so, for those 20 minutes, 18 orders per minute come in and eight go out. When the peak ends there are 200 orders waiting.
With new ones still arriving, the integration takes over half an hour to catch up.
That’s acceptable if the orders wait in a queue, each with its state recorded, and a worker drains it at the rate the courier allows.
Without a queue, each of those 200 depends on its retries not running out.
A queue also lets you put the most urgent work first. Requesting labels can go ahead of the tracking update, which can lag half an hour without anyone noticing.
It helps to put an alert on 429s and on queue length. An order that ran out of retries without telling anyone only turns up on Monday, in a complaint.
That alert is part of what we call observability.
Each order can drop from five calls to two
The queue keeps orders from getting lost, but it delays them. For the peak to fit under the ceiling, each order has to spend less.
The three status checks are the first candidates. If the courier offers a webhook that fires when the label is ready, the order drops to two calls.
With two calls, the same 40 calls of quota cover 20 orders per minute, more than the peak of 18.
Without a webhook, spacing out the checks also helps: one every 30 seconds instead of every five already changes the math.
The tracking update can be paused during the event’s busiest hours. That frees up 20 calls per minute, in exchange for shipment status showing up a little late.
If that’s still not enough, you can ask the courier for a temporary limit increase, in writing, with the estimated peak and the exact hours.
Some vendors treat it as a plan change and take days to approve it. Coordinating with the vendor on the other side is part of the integration between the store and external systems.
To run this same math with your store’s numbers, the hardest figure to get is how many calls an order really makes.
Once you have that number, the rest fits in a spreadsheet.