Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.arcuserp.com/llms.txt

Use this file to discover all available pages before exploring further.

Error envelope

All errors return a JSON body in this shape:
{
  "error": "not_found",
  "code": "not_found",
  "type": "not_found",
  "hint": "The requested order does not exist or does not belong to this entity.",
  "param": null,
  "request_id": "req_01H..."
}
FieldAlways presentDescription
errorYesMachine-readable error key
codeYesSame as error (included for forward compatibility)
typeNoError category (see below)
hintNoHuman-readable one-sentence explanation
paramNoThe request parameter that caused the error
requiredNoThe scope required (only on insufficient_scope errors)
request_idNoUnique request ID for support tracing

HTTP status codes

StatusMeaning
200 OKSuccess
201 CreatedResource created
204 No ContentSuccess with no body (DELETE)
304 Not ModifiedETag matched; use your cached copy
400 Bad RequestInvalid request body or parameters
401 UnauthorizedMissing or invalid API key
403 ForbiddenValid key but insufficient scope or IP not allowlisted
404 Not FoundResource does not exist or belongs to a different entity
409 ConflictState conflict (idempotency key mismatch, duplicate record, RI violation)
422 Unprocessable EntityValidation error on request body
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorArcus-side error; safe to retry with exponential backoff

Error types

TypeHTTP statusDescription
validation_error400 / 422Request body or parameter failed validation
permission_error401 / 403Auth or scope issue
not_found404Resource not found
conflict409State conflict
rate_limit429Too many requests
expand_error400Expand parameter syntax or limit violated
not_implemented501Endpoint exists but the operation is not yet available
internal500Arcus-side error

Common error codes

Authentication and authorization

CodeStatusDescription
missing_api_key401Authorization header not provided
invalid_api_key401Key not found or revoked
missing_entity_id401Entity ID not present in the URL path
entity_id_mismatch403Entity ID in the URL does not match the key’s entity
insufficient_scope403Key lacks the required scope
ip_not_allowlisted403Request IP is not in the key’s allowlist
key_expired401Key has passed its expiry date

Validation

CodeStatusDescription
invalid_id_format400Path parameter is not a valid UUID
missing_required_field422Required field missing from request body
invalid_field_value422Field value fails type or range validation
idempotency_key_mismatch409Same key reused with a different request body

Resource state

CodeStatusDescription
not_found404Resource not found or belongs to a different entity
conflict409Operation conflicts with current resource state
resource_in_use409Cannot delete; resource is referenced by other records

Expand

CodeStatusDescription
invalid_expand_unknown_field400Expand path does not exist on this resource
invalid_expand_too_many_paths400More than 10 expand paths in one request
invalid_expand_depth_exceeded400Expand path nesting deeper than 4 levels
invalid_expand_list_requires_data_prefix400List endpoint expand missing data. prefix

Rate limits

CodeStatusDescription
rate_limit_exceeded429Per-key rate limit hit; check Retry-After header

Handling errors in code

import Arcus, { ArcusAPIError } from '@arcuserp/sdk-node';

try {
  const order = await arcus.orders.retrieve('ord_invalid');
} catch (err) {
  if (err instanceof ArcusAPIError) {
    console.error(err.code);      // e.g. "not_found"
    console.error(err.hint);      // human-readable
    console.error(err.requestId); // for support
    console.error(err.status);    // HTTP status code

    if (err.status === 429) {
      // Respect Retry-After
      const retryAfter = err.headers['retry-after'];
      await sleep(parseInt(retryAfter, 10) * 1000);
    }
  }
}

Retry strategy

  • 5xx errors: safe to retry with exponential backoff (1s, 2s, 4s, 8s, max 5 retries)
  • 429 errors: wait the number of seconds in the Retry-After response header before retrying
  • 4xx errors (except 429): do not retry; fix the request first
  • Always use Idempotency-Key on retried POST/PATCH/DELETE requests to prevent duplicates

Support

Include request_id when contacting support. It allows the Arcus team to retrieve the full trace for the failing request.