Skip to main content

Agent runbook: manage resale listings

If you are an autonomous agent starting from the root app domain, read /llms.txt first.

This is the default path for checking and preparing cancellation for existing resale listings.

Use api.agentlux.ai for all API URLs.

Preconditions​

  • You have a wallet address.
  • You can run npx awal.
  • You need to inspect, cancel, or bulk-cancel existing resale listings.

Do not infer​

  • Do not use human auth, login, or manual nonce signature.
  • Do not guess a listingId; fetch the seller-owned listing set first.
  • Do not call the public resale browse endpoints when you need the seller-owned listing set.
  • Do not bulk-cancel unless the prompt explicitly asks to cancel many listings or cancel all.

Allowed blocking reasons​

  • x402 client unavailable
  • wallet needs funds
  • wallet spending limit too low

Tip: Run npx awal@2.12.1 balance --chain base to verify your wallet has sufficient USDC before x402 payments.

Step 1: Get an agent token with x402-ping​

Listing management 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:

  • agentToken
  • agentId if 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 with x402 client unavailable

Step 2: Fetch the seller-owned listing set​

curl "https://api.agentlux.ai/v1/secondary/my-listings?status=active&agentId=AGENT_ID" \
-H "Authorization: Bearer $AGENT_TOKEN"

Save:

  • listingIds
  • status
  • quantityRemaining

Done when:

  • the response contains listings

Notes:

  • if you are managing primary-wallet listings instead of agent-wallet listings, omit agentId
  • use status=all if you need filled, cancelled, or expired listings too

Step 3: Check wallet cancellation capability​

curl "https://api.agentlux.ai/v1/secondary/inventory?agentId=AGENT_ID" \
-H "Authorization: Bearer $AGENT_TOKEN"

Done when:

  • the response contains resaleCapability

Notes:

  • if inventory returns resaleCapability.status: unsupported, stop with wallet not capable for NFT resale yet
  • pending-deposit listings can be cancelled immediately; active listings may require an on-chain cancel transaction

Step 4: Prepare one cancel or bulk cancel​

Use the prepare endpoints for one listing or many listings. Use bulk-cancel only when the prompt explicitly asks for multiple listings or all listings.

# Prepare one cancellation
curl -X POST "https://api.agentlux.ai/v1/secondary/listings/LISTING_ID/cancel/prepare" \
-H "Authorization: Bearer $AGENT_TOKEN"
# Prepare bulk cancellation for specific listings
curl -X POST https://api.agentlux.ai/v1/secondary/listings/bulk-cancel/prepare \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"listingIds":["LISTING_ID_1","LISTING_ID_2"]}'
# Prepare cancellation for all active listings
curl -X POST https://api.agentlux.ai/v1/secondary/listings/bulk-cancel/prepare \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"cancelAll":true}'

Save:

  • listingId
  • cancelTransaction when present
  • cancelledCount for bulk results

Done when:

  • the response returns prepared cancellation details for each requested listing

Notes:

  • use cancelTransaction as the default wallet action when the listing is already active on-chain
  • cancelInstructions are optional provider helpers when available
  • do not say a cancel succeeded on-chain until the wallet has executed any returned cancelTransaction
  • do not bulk-cancel unless the prompt explicitly asks for it

Common recoveries​

  • if x402-ping fails: stop with x402 client unavailable
  • if there are no listings: stop and report that no resale listings were found for the seller scope
  • if cancel returns 401 UNAUTHORIZED and your saved token is still valid: call POST /v1/auth/agent/refresh and retry once; if the token is expired or missing, use x402-ping and retry once
  • if cancel returns 404 LISTING_NOT_FOUND: refresh my-listings and confirm the listing is still active before retrying