Skip to content
ZargoLogix

Pagination, limits and errors

The rules every list endpoint and every error follows.

Formats

Pagination

List endpoints return one page at a time, newest first:

List response
{
  "data": [ ... ],
  "has_more": true,
  "next_cursor": "cm2abc123"
}
ParameterTypeDescription
limitintegerItems per page, 1 to 100. Default 25. A missing or invalid value falls back to the default instead of failing.
cursorstringPass the previous response's next_cursor to get the next page. Stop when has_more is false.
Getting the next page
curl -H "Authorization: Bearer zlx_live_YOUR_KEY" \
  "https://api.zargologix.com/v1/shipments?limit=50&cursor=cm2abc123"

Staying in sync

To mirror ZargoLogix data in your own system, poll with updated_since (shipments) or created_since (invoices and quotes) and de-duplicate by id. A record that changes while you are paging can appear on two pages, so always upsert by id rather than inserting. For instant updates instead of polling, use webhooks.

Rate limits

Each key has a per-minute request limit (120 by default; ZargoLogix can set a different limit for a particular key). The limit that applies to you is always in the response headers:

HeaderTypeMeaning
X-RateLimit-LimitintegerRequests allowed per one-minute window.
X-RateLimit-RemainingintegerRequests left in the current window.
X-RateLimit-ResetintegerSeconds until the window resets (not a timestamp).

Over the limit you get 429 rate_limited with a Retry-After header (seconds). Wait that long, then retry. Counts are shared across all of a key's requests, however many servers send them.

Errors

Every error has the same shape:

400 Bad Request
{
  "error": {
    "code": "invalid_parameter",
    "message": "status must be one of: DRAFT, PENDING_APPROVAL, APPROVED, ..."
  }
}

Use code in your program. The message is for people and may change.

CodeStatusMeaning
invalid_parameter400A filter value is not valid, for example an unknown status or a date that is not ISO 8601.
unauthorized401Missing or invalid API key.
key_revoked401The key was revoked.
key_expired401The key has expired.
insufficient_scope403The key does not have the scope this endpoint needs.
not_found404No record matches the id you asked for.
rate_limited429Too many requests. See Retry-After.
internal_error500Something went wrong on our side. Retry after a moment; if it persists, check the system status page.