Skip to Content
DocsProtocolErrors & Edge Cases

Errors & Edge Cases

This page documents the common HTTP and profile-specific errors that can occur when implementing or using the FX402 R402 profile.

Each error includes a short description and recovery strategy.


⚠️ HTTP-Level Errors

CodeMeaningRecovery
402 Payment RequiredResource is gated; client must pay according to R402 spec.Display tiers and prompt user to complete payment.
400 Bad RequestInvalid or missing payment data (malformed JSON, wrong tier).Retry with corrected payload.
401 UnauthorizedMissing or invalid JWT receipt.Request new payment or verify JWT signature.
403 ForbiddenAccess expired or rights not sufficient.Renew rental or upgrade to a longer tier.
404 Not FoundResource not recognized.Verify resource identifier or endpoint URL.
409 ConflictDuplicate payment attempt detected.Retry after nonce refresh.
410 GoneResource permanently removed.Stop retrying; asset retired.
429 Too Many RequestsRate limit exceeded.Backoff and retry after delay.
500 Internal Server ErrorUnexpected server failure.Retry later or contact operator.
502 / 503 / 504Upstream facilitator or blockchain node unavailable.Retry with exponential backoff.

🧩 R402-Specific Errors

CodeFieldDescriptionSuggested Action
R402_INVALID_TIERtier_idThe requested tier does not exist or has expired.Refresh tiers and prompt user to reselect.
R402_INVALID_PROOFpayment_proofInvalid or unverifiable transaction proof.Ensure transaction finalized on-chain.
R402_EXPIRED_RECEIPTreceiptThe license has expired.Prompt for renewal.
R402_MISMATCHED_RESOURCEresourceReceipt does not match requested asset.Check resource ID and retry.
R402_UNSUPPORTED_CHAINpay_to.chainPayment chain unsupported by the server.Switch to supported chain (e.g., Solana).
R402_DUPLICATE_NONCEnonceThe same nonce was reused.Request new pricing payload.
R402_FACILITATOR_ERRORfacilitatorVerification service unavailable or invalid signature.Retry later or fallback to honor mode.
R402_TIER_EXPIREDusage.tiersTier pricing expired or updated.Refresh metadata and display new prices.

🧱 Common Edge Cases

1. Payment Succeeds but Resource Fails to Unlock

Cause: network delay between blockchain confirmation and facilitator verification.
Fix: retry after short delay; facilitator will reconcile once transaction confirmed.

2. JWT Receipt Lost or Corrupted

Cause: local storage cleared or user switched device.
Fix: facilitator can re-issue a receipt based on transaction proof.

3. Out-of-Sync Metadata

Cause: cached r402 metadata mismatched with live server.
Fix: always refresh before payment; ignore cached tiers older than 24h.

4. Clock Drift / Expiration Issues

Cause: client clock offset makes valid_until appear expired.
Fix: use network time (NTP or server timestamp) for comparison.


🧭 Developer Tips

  • Always validate both HTTP status and R402 error codes.
  • Log every 402 interaction for auditability.
  • Implement exponential backoff for all facilitator requests.
  • Never expose private facilitator signing keys in client apps.

Last updated on