Protocol and reference
Error codes
Every public HTTP error code. Generated from @px402-tech/types.
An error body is { "error": { "code", "message", "traceId", "retryable" } }. Keep the trace id when you report a
problem. Local SDK errors start with SDK_ and never reach a server; see wallet commands.
“Retry: Yes” does not mean “pay again”. A payment already made is retried with the same signature or idempotency key.
Payments
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
VALIDATION_FAILED | 400 | No | Request failed validation |
PAYMENT_HEADER_INVALID | 400 | No | PAYMENT-SIGNATURE is not decodable or has the wrong scheme or network |
PAYMENT_REQUIRED | 402 | Yes | Payment required; challenge issued |
NONCE_UNKNOWN | 402 | Yes | Payment challenge not found |
NONCE_EXPIRED | 402 | Yes | Payment challenge expired |
NONCE_ALREADY_USED | 409 | No | Payment challenge already used |
NONCE_ROUTE_MISMATCH | 402 | Yes | Payment challenge was issued for another route |
TRANSFER_NOT_FOUND | 402 | Yes | Transfer not found or not confirmed yet |
TRANSFER_NOT_TO_RECEIVER | 402 | No | Transfer has no output for this receiver |
TRANSFER_AMOUNT_TOO_LOW | 402 | No | Transfer amount is below the price |
TRANSFER_WRONG_ASSET | 402 | No | Transfer asset is not the required asset |
TRANSFER_TOO_OLD | 402 | No | Transfer is older than the payment challenge |
TRANSFER_ALREADY_CLAIMED | 409 | No | Transfer already claimed for another challenge |
CLAIM_BINDING_MISSING | 402 | No | Claim is missing the required binding |
CLAIM_SENDER_PROOF_INVALID | 402 | No | Sender proof does not verify |
CLAIM_MEMO_MISMATCH | 402 | No | Transfer memo does not match the challenge |
HELIUS_UNAVAILABLE | 503 | Yes | Upstream read failed or throttled |
HANDLER_FAILED | 500 | Yes | Paid handler failed; retry with the same payment |
RATE_LIMITED | 429 | Yes | Too many requests |
UNAUTHORIZED | 401 | No | Missing or invalid owner token |
TRACE_NOT_FOUND | 404 | No | Trace not found |
ROUTE_NOT_FOUND | 404 | No | No paid route here |
INVALID_CURSOR | 400 | No | Invalid cursor |
DECRYPTION_FAILED | 503 | Yes | On-demand decryption failed |
RECEIVER_KEY_UNAVAILABLE | 503 | No | Receiver key unavailable |
CLAIM_IN_PROGRESS | 409 | Yes | Another attempt for this payment is running; retry shortly |
CLAIM_LAPSED | 409 | No | The retry window for this payment has closed; it is a refund case |
UPSTREAM_FAILED | 503 | Yes | The provider did not answer; retry with the same payment |
REQUEST_TOO_LARGE | 413 | No | Request body too large |
INTERNAL | 500 | Yes | Internal error |
Hosted wallet
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
WALLET_FRESH_LOGIN_REQUIRED | 403 | No | Log in again: this action needs a fresh Turnkey login |
WALLET_PROVIDER_NOT_ALLOWED | 403 | No | This agent may not pay that provider |
WALLET_AGENT_LIMIT | 409 | No | Hosted agent limit reached |
WALLET_AGENT_ADDRESS_TAKEN | 409 | No | Another active hosted agent uses this address |
WALLET_AGENT_NOT_PENDING | 409 | No | The agent is not waiting for activation |
WALLET_AGENT_REVOKED | 409 | No | The agent is revoked |
WALLET_AGENT_NOT_ACTIVE | 409 | No | The agent is not active |
WALLET_ACTIVATION_FAILED | 409 | No | The Turnkey delegation does not match what px402 requires |
WALLET_ROUTE_NOT_PAYABLE | 409 | No | That route cannot be paid right now |
WALLET_CAP_EXCEEDED | 409 | No | The payment would pass one of the agent’s caps |
WALLET_PRICE_ABOVE_MAX | 409 | No | The route price is above maxPriceBase |
WALLET_NOTHING_TO_WITHDRAW | 409 | No | The agent holds nothing to withdraw |
WALLET_WITHDRAW_ADDRESS_UNSET | 409 | No | Set a withdraw address first |
WALLET_WITHDRAW_PARTIAL | 409 | Yes | Part of the balance moved; withdraw again for the rest |
WALLET_AGENT_BUSY | 409 | Yes | The agent is busy; retry shortly |
WALLET_SIGNING_DENIED | 409 | No | Turnkey denied the signature |
WALLET_PAY_URL_INVALID | 400 | No | The URL must be https with no credentials or custom port |
WALLET_WITHDRAW_ADDRESS_INVALID | 400 | No | The address cannot receive a withdrawal |
WALLET_WITHDRAW_ADDRESS_PROOF_INVALID | 400 | No | The signature does not prove control of the address; get a new challenge and sign again |
WALLET_SIGNATURE_QUOTA_EXHAUSTED | 429 | No | Your monthly hosted signature quota is used up |
WALLET_SIGNATURE_BUDGET_EXHAUSTED | 503 | No | Hosted signing is paused: a service-wide signing limit has been reached |
WALLET_TURNKEY_BUSY | 503 | Yes | The signer is busy; retry shortly |
WALLET_SIGNER_UNAVAILABLE | 503 | Yes | The signer could not be reached |
WALLET_PAY_FAILED | 500 | No | The payment failed |
WALLET_MANDATE_INVALID | 400 | No | The mandate signature or fields are not valid |
WALLET_MANDATE_MISSING | 409 | No | This agent has no live mandate; sign one before paying |
WALLET_MANDATE_EXPIRED | 409 | No | The mandate has expired; sign a new one |
WALLET_EXPORT_INVALID | 400 | No | The export authorization is not valid |
WALLET_NOT_ENCLAVE | 409 | No | That action is only for a sealed agent |
MCP connector
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
MCP_GRANT_REVOKED | 401 | No | This connection was signed out; connect again |
MCP_CAPS_NOT_LOWER | 409 | No | Caps can only be lowered here; raise them in the dashboard |
MCP_AGENT_AMBIGUOUS | 400 | No | More than one agent has that label; use the agent id |
Provider platform
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
PLATFORM_AUTH_REQUIRED | 401 | No | Missing or invalid Turnkey proof |
NOT_FOUND | 404 | No | Not found |
ALREADY_EXISTS | 409 | No | Already exists |
STATE_CONFLICT | 409 | No | Not allowed in the current state |
DNS_CHECK_FAILED | 409 | Yes | The TXT record was not found on every resolver |
DNS_UNAVAILABLE | 503 | Yes | DNS lookup failed; try again |
PLATFORM_NOT_INVITED | 403 | No | Joining px402 needs an unused invite code |
PLATFORM_ACCOUNT_BLOCKED | 403 | No | This account is blocked; contact px402 to restore it |
PLATFORM_DOMAIN_LIMIT | 409 | No | Domain limit reached for this organization |
PLATFORM_INVITE_LIMIT | 409 | No | You have made all the invite codes you may |