Acumatica · Quota

API Quota Management — A Field Guide

API Quota Management — A Field Guide is the work that makes the systems talk. The API is the contract between the producer and the consumer; the contract is what determines.

John Kihiu12 min read

Quota management and rate limiting get talked about together so often that people treat them as the same thing. They're not: rate limiting shapes traffic over short windows to protect capacity, while quotas cap total consumption over a longer period — a day, a month, a billing cycle — to enforce a plan or a budget. Getting quotas right means getting the accounting right, and accounting problems don't forgive sloppy engineering.

Quota vs. rate limit: different problems, different windows

A rate limit answers "how fast can you send requests right now" — 100 requests per minute, enforced with a short rolling window. A quota answers "how many can you send this month" — 50,000 requests per billing cycle, tracked over a much longer horizon and usually tied to a plan tier rather than abuse prevention. A caller can be well within their rate limit and still be out of quota, and the two need to be checked independently: rate limiting protects your infrastructure in the moment, quota enforcement protects your business model over time.

Where quota state lives, and why it's a hard problem

The core engineering challenge is that quota consumption has to be tracked consistently across every instance of your API, under concurrent load, without becoming a bottleneck itself. A naive implementation — read the counter, check it, increment it — has a race condition under concurrency: two simultaneous requests can both read the same "499 of 500 used" state and both proceed, blowing past the cap. The fix is an atomic increment-and-check, typically done in Redis with INCR plus a TTL, or with a database-level atomic update rather than a read-then-write from application code.

TEXT · REDIS ATOMIC QUOTA CHECK
# Atomic increment, TTL set only on first request of the period
MULTI
INCR quota:acct_4521:2026-07
EXPIRE quota:acct_4521:2026-07 2678400 NX
EXEC
# Application checks the returned INCR value against
# the account's plan limit — no separate read step,
# so no window for a race between two concurrent requests
Read-then-write quota checks will eventually overcount an account's allowance

Under low concurrency this bug is invisible. Under a traffic spike — the exact moment a customer is most likely to hit their limit — it lets requests through that should have been rejected, and the discrepancy shows up as a billing dispute weeks later.

Soft limits, hard limits, and warning thresholds

A hard quota rejects every request once the cap is hit — simple, but it turns a customer's success (their usage growing) into a hard outage at the worst possible moment. A soft quota allows overage, often at a different price point, and only hard-stops at some higher ceiling. Most production systems land on a hybrid: warn the customer at 80% via email or a dashboard banner, allow modest overage with a billing consequence, and hard-stop only well past the point where continued consumption is either abusive or a runaway bug on the customer's end.

Resetting and resolving quota periods correctly

Monthly quotas reset on a billing anniversary, not the calendar month, for most B2B APIs — a customer who signed up on the 15th expects their quota to reset on the 15th, not the 1st. This sounds like a minor detail until you're debugging why a customer's dashboard shows a different number than your billing system; the two need to agree on exactly which period boundary they're using, and that boundary needs to be stored per account, not computed ad hoc in two different places.

Communicating quota state back to the caller

A caller should never have to guess their quota status by counting rejected requests. Return remaining quota and reset time on every response, not just the rejection — this lets well-behaved clients throttle themselves proactively instead of hammering the API until they get blocked.

ConceptTime windowEnforces
Rate limitSeconds to minutesInfrastructure protection
QuotaDays to a billing cyclePlan tier / budget
Soft quota + overageBilling cycleRevenue capture without hard outages

Wrapping up

Quota bugs are accounting bugs wearing an engineering costume — get the atomicity and the period boundaries right, and the rest (thresholds, overage policy, dashboards) is product decisions layered on top of a foundation that has to be correct under concurrency from day one.

John Kihiu
Acumatica ERP Developer · Laravel Engineer

Independent software engineer in Nairobi specialising in Acumatica customisations, Laravel backends, and tax fiscalisation integrations across East and Southern Africa.