Skip to main content
Test the whole payment path of Step 1, Payments, in the sandbox. Then continue to Step 2. The examples use http://localhost:3000/api/widgets as the protected endpoint.

Step 1: Confirm the challenge

Start your server. Call the paid endpoint without a payment.
An endpoint without a price must return 200.

Step 2: Read the challenge with the CLI

The CLI reads the challenge. It does not pay.
Confirm the price, the currency, and the payment options. To read a raw header, use inflow x402 decode or inflow mpp decode.

Step 3: Pay with the CLI

The CLI uses production by default. Your server runs in the sandbox, so add --sandbox to each command.
1

Install the CLI and unlock the vault

See Install the CLI. Run inflow vault unlock yourself, in your own terminal.
2

Log in to the sandbox

Open the verification URL in your browser. Approve the login.
3

Check the sandbox balance

4

Pay the endpoint

Approve the payment when the CLI asks. The result contains the response body from your endpoint.
To use an API key instead, set INFLOW_API_KEY to a sandbox key. Keep --sandbox on each command. See Authenticate.

Step 4: Pay with a buyer example

Run a buyer example from the inflow-node repository. The MPP buyer example works only with the sandbox. It accepts a key from a sandbox Developer account or a sandbox Seller account.
Start mpp-seller-express or mpp-seller-hono, or your own MPP server. Then run the buyer in a second terminal.
The default target is http://localhost:3000/api/widgets. To change it, set TARGET_URL in .env.A successful payment prints this output.
mpp-buyer-fetch replaces the global fetch with a payment-aware wrapper. For the explicit path, read mpp-buyer-manual.

Step 5: Check the result

  • The pay command returns status 200 and the real body from your endpoint.
  • The payment appears in the sandbox dashboard.
  • The amount matches your price.

Troubleshooting

Tokens stay in the environment that issued them. Log in again with --sandbox.
Run inflow mpp supported --sandbox or inflow x402 supported --sandbox. Compare the result with the inspect output from step 2.
The buyer and the server use different protocols. An MPP buyer cannot pay an x402 endpoint. Run inflow inspect on the endpoint first.
For server errors such as 403 SELLER_ACCOUNT_REQUIRED, see Errors.

Next step

Step 2: Enable agent enrollment

Let agents enroll with your service and get credentials.
Last modified on October 15, 2026