VNext Act Docs

Next Act x402 Quickstart

Next Act supports autonomous license purchases through x402 v2 on Solana.

How the flow works

text
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-RESPONSE

Prerequisites

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
1

Create a test project

powershell
cd C:\Users\YOU\Downloads
mkdir next-act-x402-test
cd next-act-x402-test
npm init -y
2

Install dependencies

The tested package set is:

powershell
npm install @x402/core@2.19.0 @x402/svm@2.19.0 @x402/fetch @solana/kit @scure/base
3

Create the buyer script

Create the file:

powershell
New-Item -ItemType File -Name "test-x402.mjs"

Copy examples/x402-buyer.mjs from this documentation bundle into that file.

The buyer should target:

text
https://nextact.fun/v1/agent-licenses

For local development, use:

text
http://localhost:3000/v1/agent-licenses
4

Set environment variables

powershell
$env:NEXT_ACT_API_KEY = "vos_live_YOUR_TEST_KEY"
$env:SVM_PRIVATE_KEY = "YOUR_THROWAWAY_DEVNET_BASE58_SECRET_KEY"
5

Run the purchase

powershell
node test-x402.mjs

The client will:

  1. POST the right ID to Next Act.
  2. Receive 402 Payment Required.
  3. Decode PAYMENT-REQUIRED.
  4. Create and sign the Solana payment.
  5. Retry the same request automatically.
  6. Receive the issued Next Act license.

Tested result

A successful private-beta devnet test returned:

  • HTTP status: 201

with a response shaped like:

json
{
  "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:

text
pending -> settled -> fulfilled

Current x402 fee policy

Next Act's standard checkout applies:

text
Gross license price
      ↓
2.5% Next Act platform fee
      ↓
97.5% net proceeds
      ↓
configured creator / collaborator revenue split

The 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 payTo recipient
  • 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-Key should 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.