0xDocs 0x.limo

Docs / Reference

Error codes

How errors look on the REST API, in the JS SDK packages and in the 0x CLI, with the codes you can branch on.

#REST API

Every error from /v1 is a JSON object {"error": "..."} with an HTTP status. Some errors add fields, for example missing on insufficient_funds. The full list of statuses, with retry advice, is in API errors. In short:

StatusMeaning
400malformed request; the error text names the field
401no token, or an expired or invalid token
402payment needed: the game isn't owned (not_owned)
403signed in, but not allowed (e.g. account_required for a guest)
404no such resource, or the feature is switched off (in-game purchases and subscriptions answer 404 while off)
409a conflict with the current state (see below)
410gone: an expired intent
429rate limited; wait Retry-After seconds (limits)
503a dependency is briefly unavailable, or a feature isn't configured (e.g. play tickets): retry later

Codes you can branch on, as the error value:

errorStatusWhere
account_required403buying, top-ups, in-game purchases, reviews: guests can't
not_owned402play tickets for a paid game
insufficient_funds409buying, in-game purchases, subscribing; carries missing / missingUsd
subscription_only409buying a subscription-only game
already_owned, limit_reached409in-game purchases (limit_reached carries limit, owned)
inactive, canceled409confirming an in-game purchase intent
expired410an in-game purchase intent after 10 minutes
confirm_not_allowed403confirming an in-game purchase from anywhere but the launcher
not_consumable, insufficient, refunded409POST /v1/iap/server/consume

#JS SDK

PackageErrorCodes / fields
@0xlimo/platformX1Errorstatus (HTTP), body (the API's JSON), path
@0xlimo/platform/launcherLauncherErrorcode: no_launcher (not inside the 0x launcher), timeout, closed, busy (a dialog is already open), signed_out, no_such_plan, no_such_period, unknown_type, failed; detail
@0xlimo/platform/serverEntitlementErrorstatus, body
@0xlimo/iap (page)IapErrorcode: canceled, insufficient_funds, limit_reached, already_owned, not_found, not_signed_in, unavailable, busy, failed, timeout, not_in_launcher
@0xlimo/iap/serverIapErrorcode, status, body

subscriptions.subscribe() doesn't reject when the player says no. It resolves with an outcome: subscribed, already_subscribed, canceled, signed_out, insufficient_funds or failed.

#0x CLI

On failure the CLI prints x1: <message> to stderr and exits with:

Exit codeMeaning
0success (also 0x help)
1the command failed (the message says why; API errors pass on the backend's error text)
2unknown command (the usage text is printed)
30x source check: the build did not match the published files (verdict other than match)