Skip to content

Buying

A buy turns one or more active listings into a single signed transaction. You can buy a single listing or batch up to 20 per call.

The full sequence is preflight → submit. Preflight returns totals, selected payment inputs, and the PSBT the wallet must sign.

All endpoints require a bearer token. Tokens are issued only after verifying a funded payment address.

POST /collection/:slug/purchases/preflight

Section titled “POST /collection/:slug/purchases/preflight”

Builds the purchase PSBT.

FieldTypeRequiredDescription
walletBindingIdstring (UUID)yesChoose from walletBindings returned by /auth/verify or GET /me.
paymentPublicKeystringyesx-only or compressed hex public key for the payment address.
listingsarrayyesListings to buy. Min 1, max 20. No duplicate listingId or inscriptionId.
listings[].listingIdstring (UUID)yesThe listing to buy.
listings[].inscriptionIdstringyesMust match the listing’s inscription.
spendableUtxosarrayconditionalUp to 1000 candidate payment UTXOs. Required for API-created or non-Xverse bindings. Xverse bindings may omit it and use wallet-provider UTXO fallback.
spendableUtxos[].txidstringyesLowercase hex (64 chars).
spendableUtxos[].voutintegeryesNon-negative.
spendableUtxos[].valueSatsintegeryesPositive.
{
"walletBindingId": "55555555-5555-5555-5555-555555555555",
"paymentPublicKey": "abcdef...",
"listings": [
{
"listingId": "77777777-7777-7777-7777-777777777777",
"inscriptionId": "abc123...i0"
}
],
"spendableUtxos": [
{ "txid": "deadbeef...", "vout": 0, "valueSats": 100000 }
]
}
FieldTypeDescription
listingsarrayPer-listing breakdown.
listings[].listingIdstring (UUID)
listings[].inscriptionIdstring
listings[].priceSatsintegerSeller’s asking price.
listings[].inscriptionUtxoValueSatsintegerDust-paying value carried by the inscription UTXO.
listings[].listingFeeSatsintegerMarketplace listing fee component.
listings[].buyerFeeBpsintegerBuyer fee in basis points.
listings[].buyerFeeSatsintegerBuyer fee in sats.
listings[].sellerCreatorRoyaltySatsintegerCreator royalty paid by the seller.
listings[].buyerCreatorRoyaltySatsintegerCreator royalty paid by the buyer.
listings[].sellerReceiveSatsintegerWhat the seller nets after fees.
listings[].buyerPayTotalSatsintegerWhat the buyer pays for this listing all-in.
listings[].marketplaceRevenueSatsintegerMarketplace cut for this listing.
listings[].creatorRevenueSatsintegerCreator cut for this listing.
selectedPaymentUtxosarrayUTXOs the server chose to fund the package.
selectedPaymentUtxos[].txidstring
selectedPaymentUtxos[].voutinteger
selectedPaymentUtxos[].valueSatsinteger
targetFeeRateSatVbintegerTarget fee rate in sat/vB.
estimatedPackageVsizeintegerEstimated package vsize in vB.
estimatedNetworkFeeSatsintegerEstimated miner fee in sats.
cpfpFeeSatsintegerExtra fee for CPFP if any.
listingTransferFeeSatsintegerListing transfer fee component.
totalBuyerCostSatsintegerAll-in buyer cost across the package.
purchaseAnchorUtxoIdstring (UUID)Send back at submit.
stepsarrayOne PSBT step.
steps[].stepIndexinteger0.
steps[].signerAddressstringPayment address.
steps[].inputsToSignarraySame shape as listings.
steps[].psbtBase64stringThe unsigned PSBT.
expectedSettlementTxidstringThe settlement txid the server expects to broadcast.
expectedListingTransferTxidsstring[]One expected transfer txid per listing in listings, in the same order.
{
"listings": [
{
"listingId": "77777777-7777-7777-7777-777777777777",
"inscriptionId": "abc123...i0",
"priceSats": 50000,
"inscriptionUtxoValueSats": 546,
"listingFeeSats": 0,
"buyerFeeBps": 100,
"buyerFeeSats": 500,
"sellerCreatorRoyaltySats": 0,
"buyerCreatorRoyaltySats": 500,
"sellerReceiveSats": 49500,
"buyerPayTotalSats": 51000,
"marketplaceRevenueSats": 1000,
"creatorRevenueSats": 500
}
],
"selectedPaymentUtxos": [
{ "txid": "deadbeef...", "vout": 0, "valueSats": 100000 }
],
"targetFeeRateSatVb": 1,
"estimatedPackageVsize": 220,
"estimatedNetworkFeeSats": 220,
"cpfpFeeSats": 0,
"listingTransferFeeSats": 0,
"totalBuyerCostSats": 51220,
"purchaseAnchorUtxoId": "88888888-8888-8888-8888-888888888888",
"steps": [
{
"stepIndex": 0,
"signerAddress": "bc1q...",
"inputsToSign": [
{ "address": "bc1q...", "signingIndexes": [0] }
],
"psbtBase64": "<base64-psbt>"
}
],
"expectedSettlementTxid": "settle1...",
"expectedListingTransferTxids": ["transfer1..."]
}
  • 200: PSBT returned.
  • 400: invalid request body.
  • 401: missing or invalid bearer token.
  • 403: wallet not allowed.
  • 409: listing state changed under you.
  • 429: rate limited.
  • 503: upstream trading service temporarily unavailable.

Broadcasts the purchase package after the wallet has signed.

FieldTypeRequiredDescription
walletBindingIdstring (UUID)yes
paymentPublicKeystringyes
listingsarrayyesSame as preflight.
listings[].listingIdstring (UUID)yes
listings[].inscriptionIdstringyes
spendableUtxosarrayyesSame as preflight.
spendableUtxos[].txidstringyes
spendableUtxos[].voutintegeryes
spendableUtxos[].valueSatsintegeryes
purchaseAnchorUtxoIdstring (UUID)yesFrom preflight.
selectedPaymentUtxosarrayyes (min 1)The exact UTXOs from preflight.selectedPaymentUtxos.
selectedPaymentUtxos[].txidstringyes
selectedPaymentUtxos[].voutintegeryes
selectedPaymentUtxos[].valueSatsintegeryes
signedStepsarrayyesThe wallet-signed steps from preflight.
signedSteps[].stepIndexintegeryes
signedSteps[].signerAddressstringyes
signedSteps[].inputsToSignarrayyes
signedSteps[].psbtBase64stringyesThe signed PSBT.
{
"walletBindingId": "55555555-5555-5555-5555-555555555555",
"paymentPublicKey": "abcdef...",
"listings": [
{
"listingId": "77777777-7777-7777-7777-777777777777",
"inscriptionId": "abc123...i0"
}
],
"spendableUtxos": [
{ "txid": "deadbeef...", "vout": 0, "valueSats": 100000 }
],
"purchaseAnchorUtxoId": "88888888-8888-8888-8888-888888888888",
"selectedPaymentUtxos": [
{ "txid": "deadbeef...", "vout": 0, "valueSats": 100000 }
],
"signedSteps": [
{
"stepIndex": 0,
"signerAddress": "bc1q...",
"inputsToSign": [
{ "address": "bc1q...", "signingIndexes": [0] }
],
"psbtBase64": "<signed-base64-psbt>"
}
]
}
FieldTypeDescription
settlementTxidstringBroadcast settlement txid.
listingTransferTxidsstring[]One transfer txid per listing in listings, in the same order.
pendingSaleIdsstring[] (UUID)Pending sale records created by this purchase.
listingsarrayEchoes the listings that were purchased.
listings[].listingIdstring (UUID)
listings[].inscriptionIdstring
{
"settlementTxid": "settle1...",
"listingTransferTxids": ["transfer1..."],
"pendingSaleIds": ["99999999-9999-9999-9999-999999999999"],
"listings": [
{
"listingId": "77777777-7777-7777-7777-777777777777",
"inscriptionId": "abc123...i0"
}
]
}

Same as preflight.

spendableUtxos is the candidate set the server selects payment inputs from. API-created bindings use provider unknown, so they must send spendableUtxos. Xverse bindings may omit it at preflight and use wallet-provider UTXO fallback. At submit, send the exact selectedPaymentUtxos returned by preflight.

Rules:

  • No duplicate (txid, vout) pairs.
  • txid must be lowercase hex.
  • The cap on candidates is 1000 per call.