lollipayDocs

Errors and rate limits

Every failed request returns the same JSON shape with a stable code. Here's what each code means and what to do about it.

Failed requests use a standard HTTP status and a JSON body with a machine-readable code:

400 Bad Request
{
  "ok": false,
  "error": {
    "code": "amount_mismatch",
    "message": "amount (5000) doesn't match the items total (4900).",
    "param": "amount"
  }
}
  • code is stable. Branch on it in your code.
  • message is for people. It's safe to log, but its wording can change.
  • param names the request field the error is about, like items[0].amount, when there is one.

Every response also carries a Request-Id header (req_…). Log it next to failures: searching for it in Dashboard → Developers → Logs shows that exact request and our response. Include it if you contact support.

Codes

StatusCodeWhat happened
400invalid_jsonThe body isn't a JSON object. Check Content-Type: application/json.
400invalid_requestA field is missing, the wrong type or out of range. See param.
400invalid_amountThe items add up to less than 99 or more than 100,000,000 minor units.
400amount_mismatchamount doesn't equal the items total.
400invalid_currencyLollipay doesn't support that currency.
400not_supportedThe field exists in the API design but isn't available yet, like coupon_code or items[].product_id.
401unauthorizedNo key, a revoked key, or an HMAC signature that doesn't match the request.
401invalid_signatureHMAC headers are missing or malformed.
401stale_signatureThe HMAC timestamp is more than 5 minutes off.
403forbiddenThe key is valid but lacks the permission the endpoint needs.
404store_not_foundThe store ID in the path isn't the key's store.
404checkout_not_foundNo session with that ID for this store and mode.
413payload_too_largeThe body is over 64 KB.
429rate_limitedToo many requests for this key. Wait for Retry-After.
500internal_errorSomething failed on our side. Retry with backoff.
503service_unavailableThe API is temporarily unavailable. Retry with backoff.

Retrying

  • Retry 429, 500 and 503 with exponential backoff (for example 1s, 2s, 4s, with jitter).
  • Don't retry other 4xx responses unchanged; fix the request first.
  • A retried create can open a second session. That's harmless (the unused one expires), but store the id of the session you redirect to, not the first one you created.

Rate limits

Each key can create 100 checkout sessions per minute. Past that, requests get 429 with a Retry-After header in seconds:

429 Too Many Requests
HTTP/1.1 429 Too Many Requests
Retry-After: 60
Content-Type: application/json

{ "ok": false, "error": { "code": "rate_limited", "message": "Too many checkout sessions for this key. Try again in a minute." } }

If you need more for a launch or a sale, contact support@lollipay.cc.

On this page