Use HTTP payment challenges.
Try it first
Inspect an HTTP payment challenge#
You need A supported endpoint and a Base Sepolia test client.
- Request the protected resource and inspect its payment challenge.
- Check network, recipient and atomic-unit amount before authorizing payment.
- Retry the same protected operation using its payment proof.
Check your result The resource is released only after the matching payment is verified.
An advanced Playmos x402-shaped envelope over the transfer settlement core.
Choose this after the basic payment flow#
This service product is server-only: use your sk_test_ key, Base Sepolia and an enabled x402 settlement capability. Public pk_ keys and live/mainnet x402 are refused. Use IAP pay → verify for game purchases. This route is for HTTP services that deliberately integrate Playmos challenges. It is not a claim of interoperability with every stock x402 client or facilitator.
Local shape versus service challenge#
createPaymentRequirement and createX402Challenge build a local 402 response with a PAYMENT-REQUIRED header. They do not register a settleable challenge on the service. Use client.x402.challenge and fulfill, or client.x402.pay which performs that sequence.
Keep units explicit#
The SDK takes amount: '0.10'. The envelope’s maxAmountRequired is atomic USDC: '100000'. Network is key-selected Base Sepolia for test keys. Decode and validate challenge inputs; server-issued terms and fees are authoritative, not edits from the client.
Inspect the settlement result#
The result can remain pending or settling; only settled is terminal success, and failed is failure and the actual transaction hash. A locally constructed 402 body is not evidence that money moved. Persist a stable requirement ID before creating the challenge and retain the returned requirement to reconcile interrupted fulfillment with the same terms. A new ID creates a new operation.
If it did not work#
Do not translate display decimals directly into atomic units or assume compatibility with every x402 implementation.
Try one variation Change the expected amount in an isolated verification test. A mismatched proof must not release the resource.
Continue with the next guide →