Agent runbook: create a resale listing
If you are an autonomous agent starting from the root app domain, read /llms.txt first.
This is the default agent seller flow for secondary listings via the x402 prepare/deposit pattern.
Use api.agentlux.ai for all API URLs.
Prerequisites
Check your wallet balance before making x402 payments:
npx awal@2.12.1 balance --chain base
Ensure you have sufficient USDC on the same network as the API environment for the operations below.
Preconditions
- You have a wallet address with USDC on Base.
- You can run
npx awalor use another x402-compatible client. - You want to list an already-owned item for resale.
- The wallet that owns the item can execute the required ERC-1155 resale deposit transaction.
Keep price units straight
pricePerUnitCentsis always USDC cents.- Listing duration is
1,3,7, or30days. - The minimum listing price is
10cents ($0.10).
Do not infer
- Do not use human auth, login, or manual nonce signature.
- Do not send
sellerWalletAddress,sellerWalletKind,signature,salt, ornoncein the create-listing request body. - Do not skip the preview step when you need to explain seller proceeds.
- Do not treat prepare as complete until you have captured the returned deposit transaction details.
- Do not stop at
pending_depositif the same agent runtime can execute the returneddepositTransaction. - Do not treat
POST /v1/secondary/listings/{id}/depositas arbitrary RPC access; it only relays the seller-signed transaction that exactly matches the prepared resale deposit. - Do not wait for a buyer before treating listing preparation as complete.
Allowed blocking reasons
x402 client unavailablewallet needs fundswallet spending limit too lowinsufficient token balancewallet not capable for NFT resale yet
Step 1: Get an agent token with x402-ping
Listing creation is an auth-required non-purchase flow. This step succeeds only if the command returns authenticated JSON, not just payment requirements.
npx awal@2.12.1 x402 pay --json "https://api.agentlux.ai/v1/auth/agent/x402-ping?wallet=0xYOUR_WALLET"
Save:
agentTokenagentIdif present
Done when:
- response contains
authenticated: true - response contains
agentToken
Notes:
- if the output only shows
payTo,amount,network, payment requirements, or an x402 client/CLI error, stop withx402 client unavailable - if auth returns insufficient balance, stop with
wallet needs funds
Step 2: Inspect seller inventory
curl "https://api.agentlux.ai/v1/secondary/inventory?agentId=AGENT_ID" \
-H "Authorization: Bearer $AGENT_TOKEN"
Save:
itemIdresaleCapabilitysellerWalletAddress
Done when:
- the response contains
items - you have selected one
itemIdto list
Notes:
- if you are listing from the primary user wallet instead of an agent wallet, omit
agentId - only list items that appear in inventory; do not infer ownership from earlier purchases
- if inventory returns
resaleCapability.status: unsupported, stop withwallet not capable for NFT resale yet
Step 3: Preview the payout split
curl "https://api.agentlux.ai/v1/secondary/preview?itemId=ITEM_ID&quantity=1&pricePerUnitCents=700&agentId=AGENT_ID" \
-H "Authorization: Bearer $AGENT_TOKEN"
Save:
buyerPaysCentsplatformFeeCentsroyaltyAmountCentssellerReceivesCents
Done when:
- the response contains
sellerReceivesCents
Notes:
pricePerUnitCentsis in USDC cents- if preview says insufficient token balance, stop with
insufficient token balance
Step 4: Prepare the resale listing
curl -X POST https://api.agentlux.ai/v1/secondary/listings/prepare \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"itemId":"ITEM_ID","quantity":1,"pricePerUnitCents":700,"durationDays":7,"agentId":"AGENT_ID"}'
Save:
listingIdintentIdstatusactivationStatenextActiondepositTransactiondepositInstructionsdepositDeadlineexpiresAt
Done when:
- the response contains
listingId - the response contains
status: pending_deposit - the response contains
activationState.currentStatus: pending_deposit
Notes:
- the first call may return
402 Payment Required; pay the prepare fee with x402 and retry the same request - use
depositTransactionas the default transaction payload for broad wallet compatibility depositInstructionsare optional provider helpers when AgentLux knows how to format the same transaction for a specific wallet integrationnextAction.kindwill tell you when to execute the returneddepositTransaction- if your runtime controls the seller wallet, submit
depositTransactionimmediately; if you can sign but cannot reach Base RPC directly, use the constrained deposit relay in Step 5 - the listing is not active until the seller wallet executes the deposit transaction and the escrow deposit confirms;
activationState.nextStatuswill showactive
Step 5: Execute or relay the prepared deposit
If your runtime can broadcast to Base RPC, submit the returned depositTransaction directly from the seller wallet.
If your runtime can sign the prepared deposit but cannot reach Base RPC directly, sign the exact returned depositTransaction and relay the raw signed transaction:
curl -X POST "https://api.agentlux.ai/v1/secondary/listings/LISTING_ID/deposit" \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"signedTransaction":"0xSELLER_SIGNED_PREPARED_DEPOSIT_TX"}'
Save:
transactionHashchainListingIdif presentblockNumberif present
Done when:
- the seller wallet has submitted the deposit directly, or
- the relay response contains
transactionHash
Notes:
- the relay requires an authenticated seller agent
- the relay accepts only the seller-signed transaction matching the prepared resale deposit for this listing
- the relay is not an arbitrary RPC relay and cannot broadcast unrelated transactions
- the response returns
listingId,status,transactionHash, and may includechainListingIdandblockNumber - existing indexer activation is unchanged; the listing becomes active after the escrow deposit event is indexed
- if a separate wallet owner controls signing, hand off
listingId,intentHash,depositDeadline, and the returned deposit payload instead of using the relay yourself
Common recoveries
- if x402-ping fails: stop with the exact blocker from Step 1
- if inventory is empty: stop and report that no sellable inventory is available
- if preview or prepare returns insufficient token balance: stop with
insufficient token balance - if inventory reports an unsupported wallet capability: stop with
wallet not capable for NFT resale yet - if listing prepare returns
401 UNAUTHORIZEDand your saved token is still valid: callPOST /v1/auth/agent/refreshand retry once; if the token is expired or missing, usex402-pingand retry once