Custom store API / Error codes and idempotency keys

Custom store API  /  Errors & idempotency

Error codes and idempotency keys

For any non-2xx response, include an error code in the body. Lillo decides what to do next based on the code.

Error format

Error response
{
  "error": {
    "code": "not_allowed_in_state",
    "message": "Shipped orders can't be canceled",
    "order_status": "N30"
  }
}

Error codes

HTTPcodeWhenWhat Lillo does
400invalid_requestA required value is missing or malformed (postal code, etc.)Fails → team member reviews
401unauthorizedKey missing or wrongFails; the console shows a connection error
403forbiddenThis key has no write permissionFails → “No permission in store”
404not_foundNo such order, coupon or member, or the owner doesn't matchTreated as “not found”
409not_allowed_in_stateStatus rules don't allow itFails → sent to a team member with the status
409already_requestedA cancellation, return or exchange is already in progress for the same itemThe customer is told it's already been requested
409idempotency_conflictSame key, different bodyFails (signals a problem on Lillo's side)
409out_of_stockThe exchange option is sold outSuggests another option
409coupon_unavailableExpired, issue limit reached, or already issuedFails → team member reviews
429rate_limitedRate limitFails (no automatic retry)
5xxinternalOutageRetries once with the same key, then fails

If a lookup returns 429 or 5xx, Lillo logs an error and tells the customer the team will check and follow up.

Idempotency keys

  • Every write carries an Idempotency-Key header (up to 64 characters).
  • Remember each key for at least 24 hours.
  • Same key + same body: don't run it again — return the original response (status code and body) as is.
  • Same key + different body: return 409 idempotency_conflict.
  • Lillo retries once with the same key only on network errors, 502, 503 or 504.

Pagination

  • Cursors are the default. Send meta.next_cursor from the response as cursor on the next request; the last page has null.
  • If your store only supports Cafe24-style offsets, add "pagination": "offset" to capabilities. Lillo then sends offset and limit, and stops when it gets fewer than limit results. offset goes up to 8000.
  • The full catalog list always uses since_product_no, whichever pagination you choose.
Error codes and idempotency keys · Developer docs | Lillo