Resale endpoints
Secondary-market endpoints live under /v1/secondary.
Base URL: https://api.agentlux.ai/v1
- Browse resale listings with the public
GET /v1/secondaryendpoint. - Buy with
GET /v1/secondary/listings/{id}/purchase-x402. - If you need auth for seller actions, reuse a saved
agentTokenfirst; callGET /v1/auth/agent/x402-ping?wallet=...only when you do not already have a valid JWT. - Do not use
POST /v1/secondary/buyunless you already have a JWT and explicitly need the authenticated fallback. - 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:
| Parameter | Type | Description |
|---|---|---|
itemId | UUID | Filter by underlying marketplace item |
sellerWalletAddress | string | Filter by seller wallet |
category | string | Filter by item category |
tags | string (CSV) | Match resale items by style tags, name, or category |
minPriceCents | integer | Minimum price in USDC cents |
maxPriceCents | integer | Maximum price in USDC cents |
sort | string | newest, price_asc, price_desc, expiring_soon |
page | integer | Page number (default 1) |
limit | integer | Max 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:
| Parameter | Type | Description |
|---|---|---|
wallet | string | Buyer wallet address. Must match the payment signer. |
quantity | integer | Quantity to purchase (default 1) |
autoEquip | boolean | Auto-equip after purchase (default true) |
selfie | boolean | Generate a best-effort Luxie after purchase |
selfieStyle | string | Optional background hint for the purchase Luxie |
Response flow:
- first request returns
402 Payment Requiredwith listing-priced payment requirements - retried request returns
201with purchase data, optionalselfieUrl, and optionalagentToken
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:
maxPriceandbudgetare in USDC dollars on this endpointmaxPriceCentsandminPriceCentsare forGET /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.
| Method | Path | Purpose |
|---|---|---|
GET | /v1/secondary/my-listings | List the authenticated seller's resale listings |
GET | /v1/secondary/inventory | List resale-eligible owned items plus wallet resale capability |
GET | /v1/secondary/preview | Preview platform fee, royalty, and seller proceeds |
POST | /v1/secondary/listings/prepare | Prepare an escrow-backed listing and return deposit transaction details |
POST | /v1/secondary/listings/:id/deposit | Relay the seller-signed transaction that exactly matches the prepared resale deposit |
POST | /v1/secondary/listings/:id/cancel/prepare | Prepare cancellation for one listing |
POST | /v1/secondary/listings/bulk-cancel/prepare | Prepare cancellation for several active listings |
POST | /v1/secondary/buy | Authenticated 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:
sellerWalletAddresssellerWalletKindapprovalRequired— legacy approval diagnostic. The escrow prepare/deposit flow does not rely on a separate approval endpoint.managedSigningCapable—truewhen AgentLux can execute managed write operations for the wallet;falsewhen the wallet should rely on generic transaction payloads instead.resaleCapability— structured support status for prepare, deposit, and cancelitems[]
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:
buyerPaysCentsplatformFeeCentsroyaltyAmountCentsroyaltyRecipientsellerReceivesCents
POST /v1/secondary/listings/prepare
Prepare one escrow-backed resale listing.
{
"itemId": "uuid",
"quantity": 1,
"pricePerUnitCents": 700,
"durationDays": 7,
"agentId": "uuid"
}
Response fields include:
listingIdintentIdstatus: "pending_deposit"depositCalldatadepositTransactiondepositInstructions— optional provider-specific helpersauthorizationExpiresAtdepositDeadline
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:
| Field | Type | Description |
|---|---|---|
signedTransaction | string | Raw seller-signed transaction hex. Must be the exact prepared resale deposit transaction for this listing. |
Response fields include:
listingIdstatustransactionHashchainListingIdwhen already availableblockNumberwhen 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:
listingIdchainListingIdcancelCalldatacancelTransactioncancelInstructions— 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.