Next Act x402 Quickstart
Next Act supports autonomous license purchases through x402 v2 on Solana.
How the flow works
Agent
↓ POST /v1/agent-licenses
Next Act
↓ 402 + PAYMENT-REQUIRED
x402 client
↓ signs Solana payment
Next Act / facilitator
↓ verifies + settles
Next Act
↓ issues LIC-...
Agent
← 201 + PAYMENT-RESPONSEPrerequisites
You need:
- Node.js 20+
- a Next Act API key with
licenses:write - a throwaway Solana devnet wallet
- enough devnet USDC for the license
- enough devnet SOL for transaction fees if required by the client flow
- access to the Next Act API at
https://nextact.fun
Create a test project
cd C:\Users\YOU\Downloads
mkdir next-act-x402-test
cd next-act-x402-test
npm init -yInstall dependencies
The tested package set is:
npm install @x402/core@2.19.0 @x402/svm@2.19.0 @x402/fetch @solana/kit @scure/baseCreate the buyer script
Create the file:
New-Item -ItemType File -Name "test-x402.mjs"Copy examples/x402-buyer.mjs from this documentation bundle into that file.
The buyer should target:
https://nextact.fun/v1/agent-licensesFor local development, use:
http://localhost:3000/v1/agent-licensesSet environment variables
$env:NEXT_ACT_API_KEY = "vos_live_YOUR_TEST_KEY"
$env:SVM_PRIVATE_KEY = "YOUR_THROWAWAY_DEVNET_BASE58_SECRET_KEY"Run the purchase
node test-x402.mjsThe client will:
- POST the right ID to Next Act.
- Receive
402 Payment Required. - Decode
PAYMENT-REQUIRED. - Create and sign the Solana payment.
- Retry the same request automatically.
- Receive the issued Next Act license.
Tested result
A successful private-beta devnet test returned:
- HTTP status:
201
with a response shaped like:
{
"object": "agent_license",
"x402": true,
"quote_id": "XQ-A9B77CB8E9D7",
"payment": {
"status": "settled",
"network": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
"transaction": "SOLANA_TRANSACTION_SIGNATURE"
},
"license": {
"public_id": "LIC-...",
"status": "active"
},
"already_fulfilled": false
}The x402 settlement response also confirms the payer, Solana transaction, and devnet network.
x402 quote semantics
Each purchase request requires a unique Idempotency-Key.
The persisted quote binds:
- right
- asset
- price
- creator payout wallet
- license terms
- network
- x402 payment requirements
Normal retry behavior reuses the stored quote rather than creating a second purchase.
Quote state:
pending -> settled -> fulfilledCurrent x402 fee policy
Next Act's standard checkout applies:
Gross license price
↓
2.5% Next Act platform fee
↓
97.5% net proceeds
↓
configured creator / collaborator revenue splitThe current x402 devnet MVP is different.
It uses a single payTo recipient and sends the full license price directly to the creator payout wallet. It does not collect the normal Next Act 2.5% platform fee and does not currently execute the generalized multi-recipient collaborator split used by standard checkout.
Private-beta limitations
The current x402 path is intentionally narrow:
- Solana devnet only
- single
payTorecipient - no Next Act platform fee
- no generalized collaborator revenue split
- external settlement occurs before final database fulfillment, so a crash window still exists between those steps
- the same
Idempotency-Keyshould be reused to recover a settled quote if fulfillment fails
Next
For the complete standard checkout flow, read the SDK Quickstart.
For the fastest working agent example, read Buy a Next Act License in 5 Minutes.
Before V1 freeze, the main x402 product decision is the production payout model: how Next Act should collect its platform fee while supporting creator and collaborator payouts in an agent-native payment flow.
