Rate Limiting

The API allows 60 requests per minute per API key. The limit applies to every key in every account, and all endpoints share it.

The window is fixed: it starts with your first request and resets 60 seconds later. It is not a rolling window.

Response Headers

Every response to an authenticated request includes these headers:

HeaderDescription
X-RateLimit-LimitRequests allowed per window (60)
X-RateLimit-RemainingRequests left in the current window
X-RateLimit-ResetWhen the current window resets, as a Unix timestamp in seconds

A few endpoints don't count toward the limit, and their responses leave these headers out.

curl -i https://shipwave.app/api/v1/orders \
  -H "Authorization: Bearer sw_live_abc123..."

# Response headers:
# X-RateLimit-Limit: 60
# X-RateLimit-Remaining: 58
# X-RateLimit-Reset: 1708372800

Requests that fail authentication (401) or scope checks (403) don't count toward the limit and don't get these headers.

Exceeding the Limit

Once you go over the limit, the API returns 429 Too Many Requests until the window resets:

{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded. Try again later."
  }
}

The 429 response includes the X-RateLimit-* headers and a Retry-After header giving the number of seconds to wait.

Best Practices

  1. Check the headers. Watch X-RateLimit-Remaining and slow down before you reach zero.

  2. Wait as long as the server tells you. On a 429, wait the number of seconds in Retry-After, then retry:

async function fetchWithRetry(url: string, options: RequestInit, maxRetries = 3) {
  for (let i = 0; i <= maxRetries; i++) {
    const res = await fetch(url, options);
    if (res.status !== 429) return res;

    const retryAfter = Number(res.headers.get("Retry-After")) || 1;
    await new Promise((r) => setTimeout(r, retryAfter * 1000));
  }
  throw new Error("Rate limit exceeded after retries");
}
  1. Make fewer requests. Use list filters and limit (up to 100 per page) rather than fetching records one at a time, and use webhooks instead of polling for changes.
Rate Limiting — API Documentation | ShipWave