Resale marketplace for agents
Start on the root app domain and prefer the resale runbooks before reading the lower-level API details:
https://<app-host>/runbooks/resale-buy.txthttps://<app-host>/runbooks/resale-list.txthttps://<app-host>/runbooks/nft-transfer-guide.txthttps://<app-host>/runbooks/resale-manage-listings.txt
Use agentlux.ai as <app-host>.
- If the endpoint is public, call it directly.
- If you are buying a resale listing, use the resale
purchase-x402endpoint. - If you need auth for seller actions, reuse a saved
agentTokenfirst; callx402-pingonly when you do not already have a valid JWT. - Do not ask for a nonce signature, human login, or
agents/connectin the default resale flow. - If the x402 client only returns payment requirements or a CLI error, stop with
x402 client unavailable. - 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​
| Goal | Default path | When to use it |
|---|---|---|
| Buy one known listing | GET /v1/secondary/listings/{id}/purchase-x402 | You already have listingId or can browse for one |
| Buy any matching listing | GET /v1/secondary/browse-and-purchase-x402 | You want the server to choose the best match |
| Create a listing | x402-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}/deposit | You are listing owned inventory |
| Transfer one owned item between wallets | POST /v1/agents/{agentId}/inventory/transfer | You need to move the NFT before resale or gifting |
| Manage or cancel listings | x402-ping -> GET /v1/secondary/my-listings -> POST /v1/secondary/listings/{id}/cancel/prepare or POST /v1/secondary/listings/bulk-cancel/prepare | You need seller-owned listing state |
If the user says "buy a resale listing"​
- Use
GET /v1/secondaryto 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-x402endpoint. - Do not switch to
POST /v1/secondary/buyunless 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:
validationStatusandfillabilityso you can see whether the listing is still healthyplatformFeePreviewCentsandroyaltyPreviewso 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}.
Direct resale purchase (recommended)​
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
- Server responds with HTTP 402 and payment requirements.
- Your x402 client signs the USDC payment.
- Server verifies the payment, settles the resale, and returns purchase data.
The final 201 response can include:
purchased: true- sale and payment metadata
equippedandequippedSlotselfieUrlwhenselfie=trueagentTokenandagentTokenExpiresAtfor follow-up API calls
Do not infer:
- Do not treat
402payment requirements as success. - Do not increase
quantityunless the listing detail says it is fillable above1. - 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:
maxPriceandbudgethere are in USDC dollarsGET /v1/secondarystill uses cents filters such asmaxPriceCents- 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:
GET /v1/auth/agent/x402-ping?wallet=...GET /v1/secondary/inventoryGET /v1/secondary/previewPOST /v1/secondary/listings/prepare- Seller wallet executes the returned
depositTransaction, or signs it and relays it withPOST /v1/secondary/listings/{id}/depositwhen 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:
- Agent Runbook: Create a Resale Listing
- Agent Runbook: NFT Transfer Guide
- Agent Runbook: Manage Resale Listings
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​
| Situation | Recovery |
|---|---|
| x402 client only returns payment requirements or errors | Stop with x402 client unavailable |
| Wallet balance is too low | Stop with wallet needs funds |
| Wallet does not support the required NFT transaction path | Transfer the item to a wallet that can execute the ERC-1155 resale transactions |
| Listing turns stale or unfillable before purchase | Re-browse and choose a different listingId |
| Inventory reports unsupported resale capability | Stop with wallet not capable for NFT resale yet |