Skip to main content

Errors & Rate Limits

This reference describes the standard error payload structures, common machine-readable error codes, distributed trace correlation, and rate-limiting boundaries enforced across the PrintPrice OS API Gateway.


1. Standard Error Envelope​

When an API request fails, the gateway and microservices return a consistent JSON payload:

{
"ok": false,
"error": {
"code": "INVALID_PAYLOAD",
"message": "Missing required parameters: copies and interior_pages are mandatory."
},
"correlationId": "trc_9a8b7c6d5e",
"timestamp": "2026-10-27T02:00:00.000Z"
}
Production Security Invariant

In production environments, unhandled internal server exceptions (HTTP 500) never expose raw stack traces, database schema paths, or internal server IPs. Instead, a generic message is returned alongside a unique correlationId that can be quoted to engineering support:

{
"ok": false,
"error": "INTERNAL_SERVER_ERROR",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected internal error occurred. Please contact support quoting the correlation ID.",
"correlationId": "trc_err_88291a9b"
}

2. Standard HTTP Status Codes​

Status CodeMeaningTypical Scenario
200 OKRequest succeededOffer calculated, job status retrieved, capabilities catalog returned.
201 CreatedResource initializedOrder created in DRAFT status, file metadata registered.
400 Bad RequestInvalid input formatMissing mandatory payload fields, invalid offer payload, or API key passed via query parameter.
401 UnauthorizedAuthentication missing or invalidMissing Authorization: Bearer or X-Marketplace-Token.
403 ForbiddenScope or tenant authorization failureValid token but insufficient permissions for the requested route or tenant.
404 Not FoundResource does not existorderId or jobId does not match any record for the tenant.
409 ConflictResource state conflictTriggering autofix on a preflight job that is still in ANALYZING state.
410 GoneExpired resourceCustomer remediation link has passed its expiration timestamp.
413 Payload Too LargeUpload exceeds size limitPDF file submitted to /api/preflight/jobs exceeds the 2GB limit.
429 Too Many RequestsRate limit exceededTenant or IP threshold exceeded; check Retry-After header.
500 Internal ErrorServer-side exceptionContact support with the returned correlationId.

3. Catalog of Error Codes​

Error CodeHTTP StatusDescription & Recommended Client Action
INVALID_PAYLOAD400Required fields (such as copies or interior_pages) are missing. Check payload against schema.
API_KEY_QUERY_PARAMETER_FORBIDDEN400An API key was detected in the URL query string. Transmit keys exclusively via X-API-Key or Authorization: Bearer.
INVALID_OFFER400The offer identifier provided during order creation or offer selection is empty or invalid.
DUPLICATE_ROLE400A file slot (e.g., INTERIOR_PDF) has already been registered for the order.
UNAUTHORIZED401Credential token is missing, expired, or invalid.
ORDER_NOT_FOUND404The requested orderId does not exist or does not belong to your tenant.
JOB_NOT_FOUND404The preflight jobId was not found.
ARTIFACT_NOT_FOUND404The requested artifact ID was not generated for this preflight run.
SNAPSHOT_NOT_FOUND400*The snapshot for the preflight report is missing (currently returns 400 in controller; 404 in future version).
JOB_NOT_READY409The preflight job must complete analysis before triggering fixes.
TOKEN_EXPIRED410The customer remediation link has expired. Request a new link.
PDF_TOO_LARGE413The uploaded PDF exceeds 2,147,483,648 bytes (2GB). Optimize or downsample high-res assets.
BPE_UNAVAILABLE200 (fallback)The Book Pricing Engine is temporarily unreachable. Handle gracefully and retry.
DEPLOYMENT_CONSTRAINT_BLOCKED429System concurrency limit reached for preflight processing. Back off and retry.

4. Distributed Tracing & Request Correlation​

To correlate client requests with internal logs and outbox events across Control Plane, BPE, and Preflight:

  1. Include x-trace-id in Request Headers:
    POST /api/marketplace/offers HTTP/1.1
    Host: api.printprice.pro
    Content-Type: application/json
    x-trace-id: trace_myplatform_20261027_001
  2. Automatic Trace Propagation: If omitted, PrintPrice OS automatically assigns a UUID v4 prefixed with trace_ and returns it in the response payload (trace_id).
  3. Quoting Correlation IDs in Support Inquiries: If an unexpected error occurs, provide the trace_id or correlationId to api-support@printprice.pro for instant forensic log retrieval.

5. Rate Limits & Concurrency Policies​

  • Pricing Endpoint (/api/marketplace/offers): 60 requests per minute per IP.
  • Preflight Job Submission (/api/preflight/jobs): Up to 10 concurrent active analysis jobs per partner tenant.
  • Order Ingestion (/api/marketplace/orders): 120 requests per minute.
  • Throttling Responses: When throttled, the gateway returns HTTP 429 Too Many Requests with a Retry-After: <seconds> header indicating when requests can resume.