LiveCourier
  • Features
  • Pricing
  • Developers
  • About
  • Contact
  • Start Free Trial

Errors & Rate Limits

Error codes, rate limiting policy, and troubleshooting.

← Back to Developers

Overview

The API uses standard HTTP status codes and a consistent error format. Rate limiting protects the system and ensures fair usage.

Error Response Format

All errors return this structure:

{
  "ok": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable description",
    "details": { "field": "validation error" }
  }
}

The details field only appears on validation errors with field-specific messages.

Error Codes

Authentication Errors

HTTPCodeCauseFix
401UNAUTHORIZEDMissing or invalid tokenCheck the Authorization: Bearer <token> header, or generate a new token if the old one was revoked
400MISSING_TENANTMissing X-Tenant headerAdd X-Tenant: CLIENT_ID - the Client ID is on Settings → API / Web Services
404TENANT_NOT_FOUNDX-Tenant value doesn't match any active clientDouble-check the Client ID value and try again
403FORBIDDENToken valid but lacks the required permissionUpdate the API user's permissions

Validation Errors

HTTPCodeCauseFix
400VALIDATION_ERRORMissing or invalid fieldsCheck the details object for specific field errors

Example:

{
  "ok": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Validation failed.",
    "details": {
      "sender.company": "Sender company is required.",
      "package.weight": "Weight must be greater than 0."
    }
  }
}

Resource Errors

HTTPCodeCauseFix
404NOT_FOUNDShipment, pickup, or service doesn't existCheck the AWB/ID and try again
409CONFLICTBusiness logic violationCheck the message - e.g., can't cancel a delivered shipment

Rate Limiting

HTTPCodeCauseFix
429RATE_LIMITEDToo many requests in the current windowWait until the Retry-After time, then retry

Plan & Feature Errors

HTTPCodeCauseFix
403TRIAL_EXPIREDTrial period endedUpgrade the subscription plan
403PLAN_UPGRADE_REQUIREDCurrent plan doesn't include API accessUpgrade to a plan that includes REST API

Server Errors

HTTPCodeCauseFix
500INTERNAL_ERRORUnexpected server errorRetry after a brief delay. If persistent, contact the operator.

Rate Limiting

Limits

SettingValue
Default limit60 requests per minute
Window1-minute rolling window
ScopePer API user (not per token)
Custom limitConfigurable per user by the administrator

Response Headers

Every API response includes rate limit headers:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the current window
X-RateLimit-ResetUnix timestamp when the current window resets

When Rate Limited

HTTP/1.1 429 Too Many Requests
Retry-After: 45
X-RateLimit-Limit: 60
X-RateLimit-Reset: 1711324800

{
  "ok": false,
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded. Try again in 45 seconds."
  }
}

Wait until the Retry-After seconds have elapsed before retrying.

Best Practices

  • Batch operations - create multiple shipments in sequence rather than parallel bursts.
  • Cache service lists - services rarely change; fetch once and cache locally.
  • Respect Retry-After - do not send repeated requests after a 429; use exponential backoff.
  • Monitor headers - watch X-RateLimit-Limit to stay under the threshold.

Troubleshooting

"UNAUTHORIZED" on every request

  • Verify the Authorization header format: Bearer <token> (with a space after "Bearer").
  • Confirm the token hasn't been revoked.
  • Ensure requests go to https://api.livecourier.com/v1/ - tenant subdomains don't serve the API.
  • Tokens don't expire; if yours stopped working it was revoked or the API user was deactivated/deleted.

"MISSING_TENANT" or "TENANT_NOT_FOUND"

  • Every request needs the X-Tenant header alongside Authorization.
  • Copy the Client ID from Settings → API / Web Services or the customer detail page.

"FORBIDDEN" despite valid token

  • The API user lacks the required permission for this endpoint.
  • Ask the administrator to update permissions in the customer's API Access section.
  • Check whether the subscription plan includes API access.

"VALIDATION_ERROR" on shipment creation

  • Read the details object - it lists exactly which fields are invalid.
  • Required fields: sender.company, sender.country, recipient.company, recipient.country, package.weight, and service_id or service_code.
  • Country codes must be 2-letter ISO codes (US, CA, GB, etc.).
  • Weight must be a positive number.

Rate quote returns no rates

  • Verify the service has rate tables and zone tables configured.
  • Check that origin/destination fall within configured zones.
  • If the API user is linked to a customer, verify the customer has access to the requested service.

Label download returns error

  • The shipment must exist and not be cancelled.
  • If using a carrier service (FedEx), the carrier submission must have succeeded.
  • Internal labels are generated for non-carrier services automatically.

Tips

  • Always check the ok field first - true means success, false means error.
  • Log the full error response during development for debugging.
  • The code field is machine-readable (use it for programmatic error handling); message is human-readable.
  • All timestamps in responses use ISO 8601 format.
LiveCourier

Courier management software trusted by logistics companies since 2004.

Product

  • Features
  • Pricing
  • Developers

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

Support

  • Contact Us
© 2004 - 2026 LiveCourier. All rights reserved. Built with 20+ years of courier industry experience.