Skip to content
Last updated

Error Code Reference

All API errors follow a consistent envelope format. The response body contains an error object with machine-readable code, human-readable message, resolution guidance in detail, a request_id for support, and an optional field pointer. See the Error schema for the full response format.

{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable description.",
    "detail": "Additional context and resolution guidance.",
    "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "field": null
  }
}

The code field is always one of six values: AUTHENTICATION_ERROR, INVALID_REQUEST_ERROR, RATE_LIMIT_ERROR, NOT_FOUND_ERROR, CONFLICT_ERROR, INTERNAL_ERROR. Specific error scenarios are differentiated by the message and detail fields.

Per-Partner Location Scoping

When you authenticate with client credentials, the resulting access token grants access to all locations associated with your developer account. Each partner account is provisioned with a set of location IDs during onboarding. Attempting to access a location outside your partner scope returns a 403 Forbidden response with AUTHENTICATION_ERROR.

The Forbidden response includes the specific location ID that was denied, so your integration can surface a clear message to the developer or end user:

{
  "error": {
    "code": "AUTHENTICATION_ERROR",
    "message": "Insufficient permissions.",
    "detail": "Your API credentials do not have access to location 'd7a8fbb3-07d4-4e3c-b5f2-9a6c8b1e0f23'. Contact your account manager to request access.",
    "request_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "field": null
  }
}

Use GET /locations to discover which locations your credentials can access. This endpoint returns only locations within your partner scope -- if a location is missing from the list, your account does not have access to it.

Planned: Granular per-partner configuration of feature access and tender restriction enforcement is planned (x-status: planned). When available, partner accounts will be able to configure which features and payment tenders are enabled per location. Plan your integration to handle cases where specific features may be restricted at the partner level. Current behavior: all enabled features are available at all locations in your scope.


400 Bad Request

The request is malformed or missing required fields. Check the field property for the specific field that caused the error, and detail for resolution guidance.

{
  "error": {
    "code": "INVALID_REQUEST_ERROR",
    "message": "Request validation failed.",
    "detail": "The field 'quantity' must be a positive integer.",
    "request_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "field": "items[0].quantity"
  }
}
CodeMessageWhenRetry?
INVALID_REQUEST_ERRORRequest validation failedA field has an invalid type or format (e.g., string instead of integer, invalid UUID)Fix request
INVALID_REQUEST_ERRORMalformed JSON in request bodyRequest body is not valid JSONFix request
INVALID_REQUEST_ERRORMissing required field: {field}A required field was omitted from the request body (e.g., grant_type, location_id)Fix request
INVALID_REQUEST_ERRORInvalid parameter formatA query parameter has an invalid format (e.g., non-UUID path parameter, non-integer limit)Fix request

401 Unauthorized

Authentication failed. The access token is missing, invalid, or expired. Request a new token via POST /auth/token.

{
  "error": {
    "code": "AUTHENTICATION_ERROR",
    "message": "Invalid or expired access token.",
    "detail": "The provided Bearer token has expired. Request a new token via POST /auth/token.",
    "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "field": null
  }
}
CodeMessageWhenRetry?
AUTHENTICATION_ERRORMissing authorization headerNo Authorization header provided in the requestRe-authenticate
AUTHENTICATION_ERRORInvalid or expired access tokenThe Bearer token is expired or has been revokedRe-authenticate
AUTHENTICATION_ERRORInvalid client credentialsThe client_id or client_secret is incorrect on the token endpointFix credentials
AUTHENTICATION_ERRORMalformed authorization headerThe Authorization header does not follow the Bearer {token} formatFix request

403 Forbidden

The authenticated client does not have permission to access this resource. Verify that the target resource belongs to a location within your partner scope.

{
  "error": {
    "code": "AUTHENTICATION_ERROR",
    "message": "Insufficient permissions.",
    "detail": "Your API credentials do not have access to location 'd7a8fbb3-07d4-4e3c-b5f2-9a6c8b1e0f23'. Contact your account manager to request access.",
    "request_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "field": null
  }
}
CodeMessageWhenRetry?
AUTHENTICATION_ERRORInsufficient permissionsYour credentials do not have the required permissions for this operationContact support
AUTHENTICATION_ERRORLocation not in partner scopeThe target location is not associated with your developer accountContact account manager
AUTHENTICATION_ERRORResource belongs to another partnerAttempting to access a cart, order, or webhook owned by a different partnerFix request

404 Not Found

The requested resource does not exist. Verify the resource ID and that it belongs to a location your credentials can access.

{
  "error": {
    "code": "NOT_FOUND_ERROR",
    "message": "Resource not found.",
    "detail": "No location found with ID 'd7a8fbb3-07d4-4e3c-b5f2-9a6c8b1e0f23'.",
    "request_id": "d4e5f6a7-b8c9-0123-defa-234567890123",
    "field": null
  }
}
CodeMessageWhenRetry?
NOT_FOUND_ERRORCart not foundThe cart ID does not exist or the cart has been deletedFix request
NOT_FOUND_ERROROrder not foundThe order ID does not exist or belongs to another partnerFix request
NOT_FOUND_ERRORLocation not foundThe location ID does not exist or is not in your partner scopeFix request
NOT_FOUND_ERRORMenu item not foundThe menu item ID does not exist at this locationFix request

409 Conflict

The request conflicts with the current state of the resource. Common causes include modifying a checked-out cart, reusing an idempotency key with a different payload, or a price mismatch at checkout.

{
  "error": {
    "code": "CONFLICT_ERROR",
    "message": "Cart has already been checked out.",
    "detail": "Cart c1d2e3f4-a5b6-7890-cdef-1234567890ab is in CHECKED_OUT status and cannot be modified.",
    "request_id": "b3c4d5e6-f7a8-9012-cdef-345678901234",
    "field": null
  }
}
CodeMessageWhenRetry?
CONFLICT_ERRORCart has already been checked outAttempting to modify a cart with status CHECKED_OUT or ABANDONEDNo -- use the existing order
CONFLICT_ERRORIdempotency key conflictThe Idempotency-Key was previously used with a different request bodyUse a new UUID
CONFLICT_ERRORPromo code already appliedA promo code is already active on this cart. Remove the current code before applying a new one.No -- remove existing code first
CONFLICT_ERRORExpected total mismatchThe expected_total in the checkout request does not match the current cart total. The change_reasons array explains what changed (e.g., PROMO_EXPIRED, DISCOUNT_CHANGED, FEE_CHANGED, ITEM_PRICE_CHANGED, ITEM_UNAVAILABLE).Re-calculate and retry
CONFLICT_ERRORDuplicate webhook subscriptionA webhook subscription already exists for this URL and event type combinationNo -- use existing subscription

422 Unprocessable Entity

The request is well-formed but violates a business rule. Fix the issue described in the detail field and retry.

{
  "error": {
    "code": "INVALID_REQUEST_ERROR",
    "message": "Cart validation failed.",
    "detail": "Modifier group 'Bread Choice' requires exactly 1 selection but 0 were provided.",
    "request_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
    "field": "items[0].modifier_selections"
  }
}
CodeMessageWhenRetry?
INVALID_REQUEST_ERRORModifier validation failedModifier selections violate min_selections or max_selections constraints for a modifier groupNo -- adjust selections
INVALID_REQUEST_ERRORItem is not availableThe menu item is currently unavailable (out of stock, disabled, or outside sale hours)No -- remove item
INVALID_REQUEST_ERRORQuantity exceeds limitThe requested quantity exceeds the item's max_allowed_quantityNo -- reduce quantity
INVALID_REQUEST_ERRORCart is emptyAttempted to calculate prices or checkout with an empty cartNo -- add items first
INVALID_REQUEST_ERRORMissing handoff modeCheckout attempted without a handoff mode set on the cart or in the request bodyNo -- set handoff mode
INVALID_REQUEST_ERRORPayment declinedThe payment processor declined the transaction (insufficient funds, invalid card, etc.)No -- try a different payment method
INVALID_REQUEST_ERRORRefund exceeds refundable balanceThe refund amount exceeds total_paid - total_refunded on the orderNo -- reduce refund amount
INVALID_REQUEST_ERRORPayment requiredThe order total has not been fully covered by submitted paymentsNo -- submit additional payment
INVALID_REQUEST_ERRORInvalid tender for itemA payment method not listed in the item's allowed_tenders was used (planned feature)No -- use an allowed payment method
INVALID_REQUEST_ERRORInvalid delivery addressThe delivery address is missing required fields or has an invalid formatNo -- fix address fields
INVALID_REQUEST_ERRORPromo code not recognizedThe promo code does not exist in the system (rejection_reason: INVALID_CODE)No -- check code spelling
INVALID_REQUEST_ERRORPromo code expiredThe promo code has passed its expiration date (rejection_reason: EXPIRED)No -- code cannot be used
INVALID_REQUEST_ERRORPromo code already usedThis single-use promo code has already been redeemed (rejection_reason: ALREADY_USED)No -- code cannot be reused
INVALID_REQUEST_ERRORMinimum not met for promo codeThe cart subtotal is below the promo code's minimum purchase requirement (rejection_reason: MINIMUM_NOT_MET)No -- add more items
INVALID_REQUEST_ERRORPromo code not applicableNo eligible items in the cart for this promo code (rejection_reason: NOT_APPLICABLE)No -- add eligible items
INVALID_REQUEST_ERRORCustomer ID too longThe customer_id value exceeds the maximum length (255 characters)No -- shorten customer_id
INVALID_REQUEST_ERRORInvalid customer ID formatThe customer_id contains invalid characters (must be alphanumeric, hyphens, and underscores only)No -- fix format
INVALID_REQUEST_ERRORBelow minimum order amountThe cart subtotal is below the location's minimum for the selected handoff mode (server auto-applies SMALL_ORDER fee instead of blocking)No -- informational only (fee is auto-applied)

Promo code errors: See the Promotions, Fees & Discounts guide for the full rejection reason table with UX suggestions.

429 Too Many Requests

Rate limit exceeded. Wait for the duration specified in the Retry-After response header before making another request.

{
  "error": {
    "code": "RATE_LIMIT_ERROR",
    "message": "Rate limit exceeded.",
    "detail": "You have exceeded 100 requests per minute. Wait 60 seconds before retrying.",
    "request_id": "e5f6a7b8-c9d0-1234-efab-345678901234",
    "field": null
  }
}
CodeMessageWhenRetry?
RATE_LIMIT_ERRORRate limit exceededGlobal or per-endpoint rate limit exceededRetry with backoff -- use Retry-After header
RATE_LIMIT_ERRORToo many token requestsToken endpoint rate limit exceeded (cache tokens instead of re-authenticating per request)Retry with backoff -- implement token caching

500 Internal Server Error

An unexpected error occurred on the server. Retry with exponential backoff. If the problem persists, contact Tote Developer Support with the request_id.

{
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "An unexpected error occurred.",
    "detail": "Please retry your request. If the problem persists, contact developer@totepos.com with the request_id.",
    "request_id": "f6a7b8c9-d0e1-2345-fabc-456789012345",
    "field": null
  }
}
CodeMessageWhenRetry?
INTERNAL_ERRORAn unexpected error occurredServer-side error during request processingRetry with backoff
INTERNAL_ERRORService temporarily unavailableA downstream service is unavailable (e.g., payment processor, inventory service)Retry with backoff

See Also