402 Payment Required with no payment options
Symptom: Your client receives a402 response but the accepts array is empty or missing.
Cause: The facilitator’s /accepts endpoint could not enrich your payment requirements. This usually means the facilitator does not support the scheme, network, or asset you configured.
Fix:
- Check your
acceptsconfiguration against the facilitator’s supported list:GET https://facilitator.corbits.dev/supported - Ensure you are using the
"exact"scheme. The Corbits hosted facilitator only supports"exact". - Verify the network name matches exactly (e.g.,
"devnet","base-sepolia").
”Invalid payment” or settlement failure
Symptom: The client sends a valid-looking payment header (X-PAYMENT or PAYMENT-SIGNATURE) but the facilitator rejects it.
Possible causes:
| Cause | Fix |
|---|---|
| Stale blockhash (Solana) | The payment proof was constructed too long ago. Reduce the time between receiving requirements and submitting payment. |
| Insufficient token balance | The payer wallet does not have enough of the required token. Fund the wallet. |
| Wrong network | The client is signing for a different network than the server expects. Check network in your requirements and wallet configuration. |
| Amount mismatch | The payment amount does not match maxAmountRequired. Ensure the client is using the exact amount from the requirements. |
| Expired proof | maxTimeoutSeconds elapsed between proof construction and settlement. Retry the flow. |
”Facilitator unreachable” or network errors
Symptom: The middleware throws a network error when contacting the facilitator. Fix:- Confirm the
facilitatorURLis correct. The default ishttps://facilitator.corbits.dev. - Check that your server can reach the facilitator (firewall, DNS, proxy settings).
- If running your own facilitator, verify it is running and the
/supportedendpoint responds.
Client does not retry after 402
Symptom: The client receives402 Payment Required but does not make a second request with payment.
Possible causes:
- No wallet configured. The client needs at least one wallet added via
payer.addLocalWallet()before callingpayer.fetch(). - No compatible payment method. The client’s wallet does not support any of the schemes/networks in the
acceptsarray. For example, a Solana wallet cannot fulfill an EVM-only requirement. - Using plain
fetchinstead ofpayer.fetch. The standardfetchAPI does not handle 402 responses. Use@faremeter/ridesor@faremeter/fetch.
”Module not found” for @faremeter/* packages
Symptom: Import errors when requiring faremeter packages.
Fix:
- Install the specific sub-package you need. Faremeter uses scoped sub-path imports:
- Use the correct import path. For example, use
@faremeter/info/solananot@faremeter/info:
Solana: “Transaction simulation failed”
Symptom: The facilitator returns an error mentioning transaction simulation failure. Common causes:- Insufficient SOL for fees. The facilitator’s fee payer account needs SOL to cover transaction fees. If you are running your own facilitator, fund the fee payer keypair.
- Token account does not exist. The
payToaddress must have an associated token account for the asset. Create one if it does not exist. - Wrong mint address. Double-check that the mint address in your facilitator handler matches the token you intend to accept.
EVM: “Execution reverted”
Symptom: The facilitator returns an EVM execution revert error during settlement. Common causes:- Insufficient token allowance or balance. The payer must hold enough of the ERC-20 token.
- Wrong chain ID. Ensure the chain configuration in your facilitator handler matches the network the client is signing for.
- Contract address mismatch. The EIP-712 domain parameters must match the actual token contract on the target chain.
Debugging tips
- Enable logging. Use
@faremeter/logsto get structured logs from both client and server: - Check the facilitator response. The facilitator returns detailed error messages in its JSON response body. Log the full response when debugging settlement failures.
- Test with devnet first. Always develop against
devnet(Solana) orbase-sepolia(EVM) before switching to mainnet. - Inspect the payment header. Base64-decode the
X-PAYMENT(v1) orPAYMENT-SIGNATURE(v2) header value to see the raw payment payload and verify the structure matches expectations.