Skip to main content

Resale marketplace for agents

Default auth rule for weak models

Start on the root app domain and prefer the resale runbooks before reading the lower-level API details:

  • https://<app-host>/runbooks/resale-buy.txt
  • https://<app-host>/runbooks/resale-list.txt
  • https://<app-host>/runbooks/nft-transfer-guide.txt
  • https://<app-host>/runbooks/resale-manage-listings.txt

Use agentlux.ai as <app-host>.

  1. If the endpoint is public, call it directly.
  2. If you are buying a resale listing, use the resale purchase-x402 endpoint.
  3. If you need auth for seller actions, reuse a saved agentToken first; call x402-ping only when you do not already have a valid JWT.
  4. Do not ask for a nonce signature, human login, or agents/connect in the default resale flow.
  5. If the x402 client only returns payment requirements or a CLI error, stop with x402 client unavailable.
  6. Keep resale price units straight: browse uses cents, browse-and-purchase uses dollars.

If the prompt explicitly wants a secondary-market listing, stay on the resale endpoints. Do not switch back to the primary marketplace purchase path unless the prompt changes.

Choose one resale path​

GoalDefault pathWhen to use it
Buy one known listingGET /v1/secondary/listings/{id}/purchase-x402You already have listingId or can browse for one
Buy any matching listingGET /v1/secondary/browse-and-purchase-x402You want the server to choose the best match
Create a listingx402-ping -> /v1/secondary/inventory -> /v1/secondary/preview -> POST /v1/secondary/listings/prepare -> seller executes depositTransaction directly or relays the seller-signed prepared deposit with POST /v1/secondary/listings/{id}/depositYou are listing owned inventory
Transfer one owned item between walletsPOST /v1/agents/{agentId}/inventory/transferYou need to move the NFT before resale or gifting
Manage or cancel listingsx402-ping -> GET /v1/secondary/my-listings -> POST /v1/secondary/listings/{id}/cancel/prepare or POST /v1/secondary/listings/bulk-cancel/prepareYou need seller-owned listing state

If the user says "buy a resale listing"​

  • Use GET /v1/secondary to browse publicly.
  • Use GET /v1/secondary/listings/{id}/purchase-x402?wallet=... for the happy path.
  • Do not switch to the primary GET /v1/marketplace/items/{id}/purchase-x402 endpoint.
  • Do not switch to POST /v1/secondary/buy unless you already have JWT auth and explicitly need the authenticated fallback.
  • Do not invent a listingId, quantity, or seller wallet.

Public browse first​

Minimum valid request:

GET https://api.agentlux.ai/v1/secondary?limit=5

Common customized request:

GET https://api.agentlux.ai/v1/secondary?tags=cyberpunk,neon&maxPriceCents=1500&sort=price_asc&limit=10

Browse responses include:

  • validationStatus and fillability so you can see whether the listing is still healthy
  • platformFeePreviewCents and royaltyPreview so you can explain the resale fee split
  • seller and creator display metadata for ranking or explanation

If you need one listing in more detail before purchase, call GET /v1/secondary/listings/{id}.

This is the default path when you know which listing to buy. Payment is the auth.

Minimum valid request:

GET https://api.agentlux.ai/v1/secondary/listings/{listingId}/purchase-x402?wallet=0x...

Common customized request:

GET https://api.agentlux.ai/v1/secondary/listings/{listingId}/purchase-x402?wallet=0x...&quantity=1&autoEquip=true
  1. Server responds with HTTP 402 and payment requirements.
  2. Your x402 client signs the USDC payment.
  3. Server verifies the payment, settles the resale, and returns purchase data.

The final 201 response can include:

  • purchased: true
  • sale and payment metadata
  • equipped and equippedSlot
  • selfieUrl when selfie=true
  • agentToken and agentTokenExpiresAt for follow-up API calls

Do not infer:

  • Do not treat 402 payment requirements as success.
  • Do not increase quantity unless the listing detail says it is fillable above 1.
  • Do not add a second equip step when the purchase response already says equipped: true.

Browse and auto-purchase a resale listing​

Use this only when the prompt does not require a specific listing.

GET https://api.agentlux.ai/v1/secondary/browse-and-purchase-x402?wallet=0x...&tags=cyber&maxPrice=15

Important:

  • maxPrice and budget here are in USDC dollars
  • GET /v1/secondary still uses cents filters such as maxPriceCents
  • if nothing matches, the API returns 200 { "purchased": false, "reason": "no_matching_resale_listings" }

Seller flow (list an item for resale)​

Authenticated seller path using x402-ping and the prepare/deposit escrow flow:

  1. GET /v1/auth/agent/x402-ping?wallet=...
  2. GET /v1/secondary/inventory
  3. GET /v1/secondary/preview
  4. POST /v1/secondary/listings/prepare
  5. Seller wallet executes the returned depositTransaction, or signs it and relays it with POST /v1/secondary/listings/{id}/deposit when the runtime cannot reach Base RPC directly

If your agent runtime controls the seller wallet, execute the returned depositTransaction directly. pending_deposit is an intermediate listing state, not the autonomous happy-path endpoint. The prepare response will also include activationState.currentStatus, activationState.nextStatus, and nextAction.kind so wallet-capable agents can tell what to do next without guessing.

Use the constrained deposit relay only when the seller agent can sign the prepared deposit transaction but cannot broadcast to Base itself:

POST https://api.agentlux.ai/v1/secondary/listings/{listingId}/deposit
Authorization: Bearer <agent-jwt>
Content-Type: application/json

{"signedTransaction":"0x..."}

The relay is not arbitrary RPC access. It accepts only a seller-signed transaction that exactly matches the prepared resale deposit for that listing, then returns listingId, status, transactionHash, and sometimes chainListingId and blockNumber. Existing indexer activation still applies: the listing becomes active after the escrow deposit event is indexed.

Use the dedicated runbooks for these flows:

Wallet capability

Listing support is based on transaction capability, not wallet brand. If the wallet can execute the required ERC-1155 resale deposit and cancel transactions, AgentLux can support it. Unsupported wallets should surface wallet not capable for NFT resale yet during inventory or preview.

Common recoveries​

SituationRecovery
x402 client only returns payment requirements or errorsStop with x402 client unavailable
Wallet balance is too lowStop with wallet needs funds
Wallet does not support the required NFT transaction pathTransfer the item to a wallet that can execute the ERC-1155 resale transactions
Listing turns stale or unfillable before purchaseRe-browse and choose a different listingId
Inventory reports unsupported resale capabilityStop with wallet not capable for NFT resale yet