SentX XRPL

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.

DocumentUse
https://xrp-api.sentx.io/openapi.jsonOpenAPI 3.1 document with every public route.
https://xrp-api.sentx.io/openapi.agent.jsonPublic reads and the routes an approved agent key may call.
https://xrp-api.sentx.io/llms.txtPlain text index for AI agents, one line per route.
https://xrp-api.sentx.io/.well-known/sentx-api.jsonNetwork, 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.

TierCredentialWhat it means
RNonePublic read. No sign in and no key.
SWallet session in x-auth-tokenThe signed in user. The session comes from signing a challenge with the wallet key.
WWallet session in x-auth-tokenThe answer is a transaction for the user to sign in their own wallet. Nothing moves until they sign.
KPartner 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

  1. Call POST /initAuthentication with the wallet address. The answer carries a challengeMessage that expires after 120 seconds.
  2. Check the challenge, then sign the UTF-8 bytes of challengeMessage with the wallet key, as hex.
  3. Send the signature to POST /submitVerification. The answer carries authToken, valid for 7 days.
  4. Send that token as x-auth-token on 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.

RouteReturns
POST /stats/getstatsPlatform totals: volume, sales and active collections.
POST /stats/getcollectionstatsPer collection statistics: floor, volume and sales.
POST /stats/getchartChart series for platform or collection activity.
POST /stats/getmarketshareMarketplace share of XRPL NFT volume.
GET /network/statusXRPL network status: validated ledger and connection health.
GET /network/tpsRecent XRPL transactions per second.
POST /marketplace/getlistingsActive listings. Filter with collectionId or friendlyUrl, minPrice and maxPrice in drops, or up to 50 nftTokenIds.
POST /marketplace/getTraitFloorsFloor price per trait value. Send collectionId or friendlyUrl.
POST /marketplace/getCollectionDepthListing depth by price band. Send collectionId.
POST /marketplace/marketpricesReference market prices of 1 to 40 collections, each named by issuer and taxon. 30 calls a minute per IP.
POST /marketplace/getnftexternalOne 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:

  1. 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.
  2. Sign. Show the user what they sign. Their wallet signs it; your app and SentX never see the key.
  3. 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.

ActionPrepare (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, expectedPriceDrops and expectedBuyerTotalDrops (the price plus the SentX fee). A listing that no longer matches is refused.
  • A buy confirm may answer 202 SETTLEMENT_PENDING with retryAfterMs. Send the same buyRes call again after that wait until it answers the sale.
  • The current SentX fee is brokerFeeBps in /.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.

RouteTierUse
POST /mint/ldp/holdSHold launchpad sale items for the buyer.
POST /mint/ldp/requestWPrepare the payment of a held sale for the buyer to sign.
POST /mint/ldp/confirmSConfirm a signed launchpad payment.
GET /mint/ldp/saleSThe state of the buyer's launchpad sale.
POST /mint/ldp/claimWPrepare the claim of minted launchpad NFTs for the buyer to sign.
POST /mint/ldp/cancelSCancel an unpaid hold.
GET /mint/ldp/proofRPublic proof of a sale's draw and delivery.
GET /mint/claimableSNFTs minted for the user that wait to be claimed: 20 a page, pages 1 to 5, 12 reads a minute per account.
POST /mint/claimAllWPrepare 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.

CodeStatusMeaning
RATE_LIMITED429Too many calls. Wait for Retry-After.
INTENT_EXPIRED410The 15 minutes of the intent passed, or its last ledger did. Prepare again.
TX_MISMATCH400The signed transaction differs from the prepared one. Nothing was sent.
SIGNATURE_INVALID400The signature does not verify.
TX_MALFORMED422The ledger refused the transaction as malformed. It can never apply.
SETTLEMENT_PENDING202A buy is still settling. Call the same confirm again after retryAfterMs.
KEY_INVALID401The partner key is unknown, revoked, for another network, or its app is closed.
KEY_ORIGIN_REFUSED401A publishable key from an origin not on the app, or a secret key from a browser.
KEY_CHECK_UNAVAILABLE503The key could not be checked. Retry in a few seconds.
KEY_XAMAN_UNSUPPORTED400A 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.