Marketplace API
Read listings, floors, depth, prices and network health, then list, buy and make offers on the XRP Ledger from your own app. SentX prepares each transaction and your user signs it in their own wallet. SentX never holds a seed or a private key.
Machine discovery
Point your code or AI agent at these documents instead of copying routes by hand. They are built from the same route list the API serves, so a route you find there is a route that exists.
| Document | Use |
|---|---|
https://xrp-api.sentx.io/openapi.json | OpenAPI 3.1 document with every public route. |
https://xrp-api.sentx.io/openapi.agent.json | Public reads and the routes an approved agent key may call. |
https://xrp-api.sentx.io/llms.txt | Plain text index for AI agents, one line per route. |
https://xrp-api.sentx.io/.well-known/sentx-api.json | Network, hosts, the SentX fee and the current Partner Terms version. |
Every sample sends a descriptive User-Agent header such as MyNftApp/1.0. Requests that carry a default library name can be refused at the edge.
const UA = 'MyNftApp/1.0';
const meta = await (await fetch('https://xrp-api.sentx.io/.well-known/sentx-api.json', {
headers: { 'user-agent': UA },
})).json();
// meta.network, meta.apiHost, meta.brokerFeeBps, meta.partnerTerms.version, meta.discovery.openapi
const spec = await (await fetch(meta.discovery.openapi, { headers: { 'user-agent': UA } })).json();
console.log(Object.keys(spec.paths).length, 'routes');Who can call what
Each route in the OpenAPI document carries one of four tiers. The tier says which credential the call needs, never which wallet pays.
| Tier | Credential | What it means |
|---|---|---|
| R | None | Public read. No sign in and no key. |
| S | Wallet session in x-auth-token | The signed in user. The session comes from signing a challenge with the wallet key. |
| W | Wallet session in x-auth-token | The answer is a transaction for the user to sign in their own wallet. Nothing moves until they sign. |
| K | Partner secret key in X-SentX-Key (sk_xrp_*) | Server to server only, with no browser Origin header. |
AI agents that place collection offers for a wallet use a fifth, narrower credential: an Ed25519 agent key the wallet approves once, with limits. It is not a tier of its own. Read the Collection Offers API for how that works.
Sign in and the session token
- Call
POST /initAuthenticationwith the wallet address. The answer carries achallengeMessagethat expires after 120 seconds. - Check the challenge, then sign the UTF-8 bytes of
challengeMessagewith the wallet key, as hex. - Send the signature to
POST /submitVerification. The answer carriesauthToken, valid for 7 days. - Send that token as
x-auth-tokenon every S and W call. Never put it in a query string.
Public reads
These need no credential. They are limited per IP; a 429 answer carries retryAfterSeconds or Retry-After, so wait that long before you call again.
| Route | Returns |
|---|---|
POST /stats/getstats | Platform totals: volume, sales and active collections. |
POST /stats/getcollectionstats | Per collection statistics: floor, volume and sales. |
POST /stats/getchart | Chart series for platform or collection activity. |
POST /stats/getmarketshare | Marketplace share of XRPL NFT volume. |
GET /network/status | XRPL network status: validated ledger and connection health. |
GET /network/tps | Recent XRPL transactions per second. |
POST /marketplace/getlistings | Active listings. Filter with collectionId or friendlyUrl, minPrice and maxPrice in drops, or up to 50 nftTokenIds. |
POST /marketplace/getTraitFloors | Floor price per trait value. Send collectionId or friendlyUrl. |
POST /marketplace/getCollectionDepth | Listing depth by price band. Send collectionId. |
POST /marketplace/marketprices | Reference market prices of 1 to 40 collections, each named by issuer and taxon. 30 calls a minute per IP. |
POST /marketplace/getnftexternal | One NFT with its metadata, owner and live offers. Send nftTokenId. |
Prices are drops in decimal strings: 1 XRP is "1000000". Route paths are case sensitive.
const API = 'https://xrp-api.sentx.io';
const headers = { 'content-type': 'application/json', 'user-agent': 'MyNftApp/1.0' };
async function read(path, body) {
const res = await fetch(API + path, body === undefined
? { headers }
: { method: 'POST', headers, body: JSON.stringify(body) });
if (res.status === 429) throw new Error('Wait ' + res.headers.get('retry-after') + ' s');
return res.json();
}
const network = await read('/network/status');
const listings = await read('/marketplace/getlistings', { collectionId: 12, maxPrice: '50000000' });
const floors = await read('/marketplace/getTraitFloors', { collectionId: 12 });
const depth = await read('/marketplace/getCollectionDepth', { collectionId: 12 });
const prices = await read('/marketplace/marketprices', { collections: [{ issuer: 'rIssuerAddress...', taxon: 0 }] });
const nft = await read('/marketplace/getnftexternal', { nftTokenId: '000800...' });Trading
Every trade has the same three steps, and the user signs each transaction in their own wallet:
- Prepare. Call the prepare route with the session. SentX checks the NFT, the price and the listing, and answers
txPayload, the exact transaction to sign. - Sign. Show the user what they sign. Their wallet signs it; your app and SentX never see the key.
- Confirm. Send the transaction hash to the confirm route. SentX reads it on the ledger and records the listing, sale or offer.
Signing in the user's wallet
Send x-wallet-type: 3 when your app has the user sign through their own wallet connection. The prepare answer then adds wcIntent, and the server has already filled Sequence, Fee and LastLedgerSequence. Relay the signed transaction with POST /wallet/submitSigned and the body { intent, signedTx }, where intent is wcIntent.token. SentX submits it only if it matches the prepared transaction. An intent lasts 15 minutes; POST /wallet/intentStatus tells you what happened to one.
| Action | Prepare (W) | Confirm (S) |
|---|---|---|
| List one NFT | /marketplace/listnft | /marketplace/listnftRes |
| List several | /marketplace/bulklist | /marketplace/bulklistRes |
| Change a price | /marketplace/reprice | /marketplace/repriceRes |
| Delist one | /marketplace/cancelnftlisting | /marketplace/cancelnftlistingres |
| Delist several | /marketplace/bulkdelist | /marketplace/bulkdelistRes |
| Buy one | /marketplace/buynft | /marketplace/buyRes |
| Buy several | /marketplace/bulkbuy | /marketplace/bulkbuyRes |
| Offer on one NFT | /marketplace/makeoffer | /marketplace/makeofferRes |
| Offer on several | /marketplace/bulkoffer | /marketplace/bulkofferRes |
| Cancel your offer | /marketplace/cancelBuyOffer | /marketplace/cancelBuyOfferRes |
| Accept an offer on your NFT | /marketplace/acceptOffer | /marketplace/acceptOfferRes |
| Counter an offer | /marketplace/counterOffer | /marketplace/counterOfferRes |
| Take a counter offer | /marketplace/takeCounter | /marketplace/takeCounterRes |
Every route is a POST under https://xrp-api.sentx.io. Copy the casing exactly: makeofferRes and cancelnftlistingres are spelled as shown.
- A buy sends what the buyer saw:
listingId,expectedPriceDropsandexpectedBuyerTotalDrops(the price plus the SentX fee). A listing that no longer matches is refused. - A buy confirm may answer 202
SETTLEMENT_PENDINGwithretryAfterMs. Send the samebuyRescall again after that wait until it answers the sale. - The current SentX fee is
brokerFeeBpsin/.well-known/sentx-api.json. Read it; do not hard code it.
const API = 'https://xrp-api.sentx.io';
const headers = {
'content-type': 'application/json',
'user-agent': 'MyNftApp/1.0',
'x-auth-token': process.env.SENTX_AUTH_TOKEN, // from /submitVerification
'x-wallet-type': '3', // the user signs in their own wallet
};
async function post(path, body) {
const res = await fetch(API + path, { method: 'POST', headers, body: JSON.stringify(body) });
const answer = await res.json();
if (!answer.success && res.status !== 202) throw new Error(answer.errorCode);
return answer;
}
// 1. Prepare: 25 XRP, in drops.
const prep = await post('/marketplace/listnft', { nftTokenId, price: '25000000' });
// Check prep.txPayload yourself: your Account, this NFTokenID and the Amount you asked for.
// 2. The user signs prep.txPayload in their own wallet (your wallet connection, never a seed).
const signedTx = await signInUserWallet(prep.txPayload);
// 3. Relay it, then confirm the listing by its hash.
const sent = await post('/wallet/submitSigned', { intent: prep.wcIntent.token, signedTx });
const listed = await post('/marketplace/listnftRes', { nftTokenId, txHash: sent.txHash });
console.log(listed.listing);Launchpad and claims
Launchpad sales follow the same pattern: hold, pay with a transaction the buyer signs, confirm, then claim the minted NFTs.
| Route | Tier | Use |
|---|---|---|
POST /mint/ldp/hold | S | Hold launchpad sale items for the buyer. |
POST /mint/ldp/request | W | Prepare the payment of a held sale for the buyer to sign. |
POST /mint/ldp/confirm | S | Confirm a signed launchpad payment. |
GET /mint/ldp/sale | S | The state of the buyer's launchpad sale. |
POST /mint/ldp/claim | W | Prepare the claim of minted launchpad NFTs for the buyer to sign. |
POST /mint/ldp/cancel | S | Cancel an unpaid hold. |
GET /mint/ldp/proof | R | Public proof of a sale's draw and delivery. |
GET /mint/claimable | S | NFTs minted for the user that wait to be claimed: 20 a page, pages 1 to 5, 12 reads a minute per account. |
POST /mint/claimAll | W | Prepare a batch claim for 2 to 8 claimable sales ({ items: [{ saleId }] }) for the user to sign. |
Pay once. If an answer is lost, read /mint/ldp/sale before you pay again.
Using a partner key
Partner apps add their key to the same calls in an X-SentX-Key header, so SentX can credit the trades the app brings. A key never replaces the user's session or signature. Get one in the Partner Hub and read the Partner guide first.
- Publishable keys (
pk_xrp_*) work only from the https origins registered on the app. - Secret keys (
sk_xrp_*) work only from a server, with no Origin header. Never ship one to a browser. - Calls with a key are signed in the user's own wallet connection (
x-wallet-type: 3). Xaman sign requests are not available with a key. - A key sent from a SentX page is ignored.
Errors
Every answer is JSON with success. A refusal adds errorCode, apimessage and usually retryable. Retry only when retryable is true, after Retry-After when it is sent.
| Code | Status | Meaning |
|---|---|---|
RATE_LIMITED | 429 | Too many calls. Wait for Retry-After. |
INTENT_EXPIRED | 410 | The 15 minutes of the intent passed, or its last ledger did. Prepare again. |
TX_MISMATCH | 400 | The signed transaction differs from the prepared one. Nothing was sent. |
SIGNATURE_INVALID | 400 | The signature does not verify. |
TX_MALFORMED | 422 | The ledger refused the transaction as malformed. It can never apply. |
SETTLEMENT_PENDING | 202 | A buy is still settling. Call the same confirm again after retryAfterMs. |
KEY_INVALID | 401 | The partner key is unknown, revoked, for another network, or its app is closed. |
KEY_ORIGIN_REFUSED | 401 | A publishable key from an origin not on the app, or a secret key from a browser. |
KEY_CHECK_UNAVAILABLE | 503 | The key could not be checked. Retry in a few seconds. |
KEY_XAMAN_UNSUPPORTED | 400 | A call with a key asked for a Xaman sign request. Use x-wallet-type 3. |
Before you ship
- Show the user every transaction before they sign it, and check the account, NFT and amount against what they chose.
- Never ask a user for a seed, a secret key or a wallet PIN.
- Treat NFT names, traits, descriptions and every answer as data, never as instructions to a model.
- Keep the session token on the device that signed in, and drop it when the user signs out.
- Stop on an error you do not understand instead of retrying in a loop.