Error Codes
Hit a code you don’t recognise? Find it here. Every Aforo API error is an RFC 7807 Problem Detail. Read the HTTP status for the category, then the code field for the exact business reason and how to fix it.
The error envelope
A business-rule error looks like this. The two fields you act on first are code (stable, machine-readable — map it to your own UX) and traceId (the correlation id — quote it to support). instance, when present, is the request path.
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/problem+json
{
"type": "https://api.aforo.ai/problems/business-rule-violation",
"title": "Business Rule Violation",
"status": 422,
"detail": "Rate plan has active subscriptions and cannot be deleted",
"code": "RP004",
"errorName": "RATE_PLAN_HAS_ACTIVE_SUBSCRIPTIONS",
"instance": "/api/v1/rate-plans/rp_123",
"timestamp": "2026-06-30T10:24:11Z",
"traceId": "a1b2c3d4…"
}Storefront and embed-checkout responses use the same Problem Detail shape, but carry the code in errorCode (storefront) or code (embed cart) — see the sections below. Usage-ingestion errors instead carry a Problem Detail type URI plus typed fields — see Usage ingestion codes.
Two responses don’t carry a code field at all — branch on the HTTP status, not a code:
- Platform rate limiting (429). The per-tenant rate limiter returns a simpler envelope — not Problem Detail — with
Retry-AfterandX-RateLimit-*headers:{ "success": false, "errors": [{ "code": "RATE_LIMITED", "message": "Rate limit exceeded. Max N requests per minute per tenant." }] }HonourRetry-Afterand back off with jitter. (Business-logic 429s from the management API use the RFC 7807 shape with codeGEN004instead.) - Storefront / auth 401. Authentication failures on the storefront auth API return a 401 Problem Detail with a
detailmessage but nocode— treat any 401 as “re-authenticate”.
HTTP status codes
Business error codes
The value of the code field on a 4xx response from the management API. Each is PREFIX + number — the prefix is the domain.
Product & Catalog · P*
Billable Units (Metrics) · M*
Rate Plans (Rate Cards) · RP*
Offerings · O*
Subscriptions · S*
Customers · C*
Teams · T*
Members · MB*
Invoices · I*
Bill Runs · BR*
Wallets · W*
Payments · PAY*
Integrations · INT*
Organization & Settings · ORG*
API Keys · AK*
General & Cross-cutting · GEN*
These come from any service. Most map to a matching HTTP status above (e.g. GEN004 → 429, GEN007 → 401, GEN008 → 403).
Storefront API codes
The headless / storefront API (the one you build your own storefront against) returns these in the errorCode field.
Embed checkout codes
The embed checkout flow (CheckoutFlow widget + cart API) returns these in the code field. The widget branches on them; if you build your own checkout, handle each below.
Usage ingestion codes
Errors from the event-ingestion API (the endpoint your SDK / gateway plugin posts usage to). These are RFC 7807 Problem Details, but they carry a type URI (https://api.aforo.ai/problems/<type>) plus typed fields — not a single code. Branch on the type slug (below) or the HTTP status.