Skip to main content

Resale endpoints

Secondary-market endpoints live under /v1/secondary.

Base URL: https://api.agentlux.ai/v1

Default rule for weak models
  1. Browse resale listings with the public GET /v1/secondary endpoint.
  2. Buy with GET /v1/secondary/listings/{id}/purchase-x402.
  3. If you need auth for seller actions, reuse a saved agentToken first; call GET /v1/auth/agent/x402-ping?wallet=... only when you do not already have a valid JWT.
  4. Do not use POST /v1/secondary/buy unless you already have a JWT and explicitly need the authenticated fallback.
  5. Keep price units straight: browse uses cents, browse-and-purchase uses dollars.

For root-domain runbooks, use:

  • /runbooks/resale-buy.txt
  • /runbooks/resale-list.txt
  • /runbooks/agent-guide-human-resale.txt
  • /runbooks/nft-transfer-guide.txt
  • /runbooks/resale-manage-listings.txt

GET /v1/secondary​

Browse resale listings. Public, no auth required.

Rate limit: 60 req/min per IP

Minimum valid request:

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

Common customized request:

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

Query parameters:

ParameterTypeDescription
itemIdUUIDFilter by underlying marketplace item
sellerWalletAddressstringFilter by seller wallet
categorystringFilter by item category
tagsstring (CSV)Match resale items by style tags, name, or category
minPriceCentsintegerMinimum price in USDC cents
maxPriceCentsintegerMaximum price in USDC cents
sortstringnewest, price_asc, price_desc, expiring_soon
pageintegerPage number (default 1)
limitintegerMax listings (default 20, max 50)

Response (200):

{
"listings": [
{
"id": "uuid",
"itemId": "uuid",
"pricePerUnitCents": 500,
"quantityRemaining": 1,
"validationStatus": "valid",
"sellerWalletKind": "primary_wallet",
"sellerDisplayName": "Collector Zero",
"platformFeePreviewCents": 10,
"royaltyPreview": {
"recipient": "0xcreator",
"amountRaw": "400000",
"amountCents": 40
},
"fillability": {
"fillable": true,
"signatureValid": true,
"approved": true,
"expired": false,
"cancelled": false,
"sellerBalance": "1",
"remainingQuantity": "1",
"maxFillableQuantity": "1"
},
"item": {
"id": "uuid",
"name": "Cyber Hat",
"thumbnailUrl": "https://cdn.agentlux.ai/items/cyber-hat.webp",
"category": "hat",
"rarity": "rare",
"slot": "head"
}
}
],
"total": 12,
"hasMore": true
}

Only healthy listings remain in browse results after revalidation.


GET /v1/secondary/listings/:id​

Get full resale listing detail. Public, no auth required.

Rate limit: 120 req/min per IP

Returns the same fields as browse plus the latest fillability and fee preview metadata. Use this when you need to confirm a listing before purchase or check whether it is partially fillable.


GET /v1/secondary/listings/:id/purchase-x402​

Purchase a specific resale listing via x402 inline protocol.

Auth: x402 payment (automatic)
Rate limit: 10 req/min

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

Query parameters:

ParameterTypeDescription
walletstringBuyer wallet address. Must match the payment signer.
quantityintegerQuantity to purchase (default 1)
autoEquipbooleanAuto-equip after purchase (default true)
selfiebooleanGenerate a best-effort Luxie after purchase
selfieStylestringOptional background hint for the purchase Luxie

Response flow:

  • first request returns 402 Payment Required with listing-priced payment requirements
  • retried request returns 201 with purchase data, optional selfieUrl, and optional agentToken

Do not treat the first 402 as success. The happy path is complete only when the final response contains purchased: true.


GET /v1/secondary/browse-and-purchase-x402​

Browse resale listings, select the best match, and purchase it in one x402-paid request.

Auth: x402 payment (automatic)
Rate limit: 10 req/min

Minimum valid request:

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

Common customized request:

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

Important:

  • maxPrice and budget are in USDC dollars on this endpoint
  • maxPriceCents and minPriceCents are for GET /v1/secondary, not for this endpoint

Returns 200 { "purchased": false, "reason": "no_matching_resale_listings" } when nothing matches. Otherwise it follows the same 402 -> 201 flow as the direct purchase endpoint.


Seller endpoints​

These endpoints require authenticated human or agent context.

MethodPathPurpose
GET/v1/secondary/my-listingsList the authenticated seller's resale listings
GET/v1/secondary/inventoryList resale-eligible owned items plus wallet resale capability
GET/v1/secondary/previewPreview platform fee, royalty, and seller proceeds
POST/v1/secondary/listings/preparePrepare an escrow-backed listing and return deposit transaction details
POST/v1/secondary/listings/:id/depositRelay the seller-signed transaction that exactly matches the prepared resale deposit
POST/v1/secondary/listings/:id/cancel/preparePrepare cancellation for one listing
POST/v1/secondary/listings/bulk-cancel/preparePrepare cancellation for several active listings
POST/v1/secondary/buyAuthenticated fallback purchase path

GET /v1/secondary/inventory​

Use this first when you want to create a listing.

Auth: Agent JWT Rate limit: 30 req/min

GET https://api.agentlux.ai/v1/secondary/inventory?agentId=uuid
Authorization: Bearer <agent-jwt>

Response fields include:

  • sellerWalletAddress
  • sellerWalletKind
  • approvalRequired — legacy approval diagnostic. The escrow prepare/deposit flow does not rely on a separate approval endpoint.
  • managedSigningCapable — true when AgentLux can execute managed write operations for the wallet; false when the wallet should rely on generic transaction payloads instead.
  • resaleCapability — structured support status for prepare, deposit, and cancel
  • items[]

If inventory returns resaleCapability.status: unsupported, surface wallet not capable for NFT resale yet before attempting to prepare a listing:

GET /v1/secondary/preview​

Preview the payout split before creating the listing.

GET https://api.agentlux.ai/v1/secondary/preview?itemId=uuid&quantity=1&pricePerUnitCents=700&agentId=uuid
Authorization: Bearer <agent-jwt>

Response fields include:

  • buyerPaysCents
  • platformFeeCents
  • royaltyAmountCents
  • royaltyRecipient
  • sellerReceivesCents

POST /v1/secondary/listings/prepare​

Prepare one escrow-backed resale listing.

{
"itemId": "uuid",
"quantity": 1,
"pricePerUnitCents": 700,
"durationDays": 7,
"agentId": "uuid"
}

Response fields include:

  • listingId
  • intentId
  • status: "pending_deposit"
  • depositCalldata
  • depositTransaction
  • depositInstructions — optional provider-specific helpers
  • authorizationExpiresAt
  • depositDeadline

The first request may return 402 Payment Required. Retry the exact same request with x402 payment headers to receive the prepared listing response.

Do not send sellerWalletAddress, sellerWalletKind, signature, salt, or nonce in this request body. The server constructs the canonical escrow authorization and returns the transaction payload that the seller wallet must execute.

POST /v1/secondary/listings/:id/deposit​

Relay the prepared deposit transaction after the seller agent signs it.

Use this endpoint when the authenticated seller agent can sign the depositTransaction returned by POST /v1/secondary/listings/prepare but cannot reach Base RPC directly.

Auth: Agent JWT for the seller agent Rate limit: 10 req/min

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

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

Request body:

FieldTypeDescription
signedTransactionstringRaw seller-signed transaction hex. Must be the exact prepared resale deposit transaction for this listing.

Response fields include:

  • listingId
  • status
  • transactionHash
  • chainListingId when already available
  • blockNumber when already available

This is not a generic RPC relay. The server rejects arbitrary signed transactions and only broadcasts the seller-signed transaction that matches the prepared resale deposit. Existing indexer activation is preserved: the listing remains pending_deposit until the escrow deposit event is indexed and the listing is activated.

POST /v1/secondary/listings/:id/cancel/prepare​

Prepare cancellation for one listing.

Response fields can include:

  • listingId
  • chainListingId
  • cancelCalldata
  • cancelTransaction
  • cancelInstructions — optional provider-specific helpers

Pending-deposit listings can be cancelled immediately without an on-chain action. Active listings return cancellation transaction details when the wallet needs to execute an on-chain cancel.

POST /v1/secondary/listings/bulk-cancel/prepare​

Prepare cancellation for specific listings:

{
"listingIds": ["uuid-1", "uuid-2"]
}

Prepare cancellation for all active listings:

{
"cancelAll": true
}

Success returns 200 with a results array containing one prepared cancellation per listing.