API reference

Every route the gateway serves.

Generated from the OpenAPI 3.1 contract, version 1.0.0. Amounts are atomic integers carried as decimal strings. Reads answer 200, writes answer 201, and every write is rate limited.

status

What this gateway is, and whether it can verify a listing right now.

GET /api/ordex/health

The observed verification verdict, not the configuration. Reports configuration completeness and, separately, whether a Bitcoin listing can actually be verified right now: storage writable, both nodes answering, and the ord index within its accepted lag of Bitcoin Core.

StatusAnswersNotes
200HealthReportThe health report.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

GET /api/ordex/protocol

The protocol contract this gateway speaks.

StatusAnswersNotes
200ProtocolContractThe protocol contract.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

GET /api/ordex/catalog

The markets this gateway serves, and what it verifies for each. Every entry states its verification scope in plain language and its capabilities as booleans. An entry in the catalog never implies a working flow beyond what its capabilities state.

StatusAnswersNotes
200array of ProtocolTemplateThe protocol catalog.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

orders

The orderbook, one order, and its signed artifact.

GET /api/ordex/orders

One page of the orderbook. Paging is keyset, never offset. A request carrying an `offset` parameter is refused with 400, and a malformed cursor is a 400 rather than a silent restart from the first page.

ParameterInTypeNotes
protocol optionalquerystringOne catalog protocol id.
protocols optionalquerystringComma separated catalog ids. Applied before sorting and pagination.
group optionalquerystringA catalog group id, expanded to every protocol it contains.
token optionalquerystring
source optionalquerySource
state optionalquerystringAn order state from `OrderState`.
safety optionalquerystringA safety class from `PsbtInspection.safety`.
orderClass optionalquerystring
signature optionalquerystringA signature status from `SignatureStatus`.
side optionalquerystring
seller optionalquerystringRestricts the page to the listings one seller script owns.
assetInscriptionId optionalquerystringRestricts the page to orders claiming one inscription. Resolved through an index of order claims.
assetOutpoint optionalquerystringRestricts the page to orders claiming an asset at one `txid:vout`.
search optionalquerystring
sort optionalquerynewest | oldest | price_asc | price_desc | token_asc | protocol_asc | validation_newestEvery sort ends on the order id, which is unique, so the ordering is total and a cursor resumes exactly. An unpriced order sorts after every priced one in both price directions.
includeWithdrawn optionalquerystring
limit optionalquerystringPage size as a decimal string.
cursor optionalquerystringThe keyset resume point a previous page answered with.
StatusAnswersNotes
200OrderPageOne page of orders.
400ErrorResponseThe request is malformed or refused, with the exact reason in `message`.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

GET /api/ordex/orders/{id}

One order.

ParameterInTypeNotes
idpathstringThe order id.
StatusAnswersNotes
200OrderSummaryThe order, without its signed artifact.
404ErrorResponseNo order with this id.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

GET /api/ordex/orders/{id}/artifact

The signed artifact for one live listing. Deliberately its own rate limited request. A browse response carrying raw PSBTs would hand every public ask to anything that can read the market. Only a live listing hands over its artifact; any other state is refused with 400.

ParameterInTypeNotes
idpathstringThe order id.
StatusAnswersNotes
200OrderArtifactThe signed artifact and its current verification.
400ErrorResponseThe request is malformed or refused, with the exact reason in `message`.
404ErrorResponseNo order with this id.
429ErrorResponseRate limited. The envelope carries `code: ORDEX_RATE_LIMITED`.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

POST /api/ordex/orders/{id}/revalidate

Recheck one order against both authorities.

ParameterInTypeNotes
idpathstringThe order id.
StatusAnswersNotes
201OrderSummaryThe order after a fresh verification.
404ErrorResponseNo order with this id.
429ErrorResponseRate limited. The envelope carries `code: ORDEX_RATE_LIMITED`.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

activity

The appended lifecycle log.

GET /api/ordex/activity

The appended lifecycle log, newest first. Reads the appended transition log, so an entry is something that happened rather than a listing's current state restated after the fact.

ParameterInTypeNotes
orderId optionalquerystring
limit optionalquerystring
cursor optionalquerystring
StatusAnswersNotes
200ActivityPageOne page of lifecycle transitions.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

selling

Building, publishing, and withdrawing a listing.

POST /api/ordex/orders/build

Build the unsigned seller half. Composes the one input, one output PSBT a seller signs `SIGHASH_SINGLE | SIGHASH_ANYONECANPAY`. The asset and outpoint are verified against the node and the ord index before anything is composed.

Request body: BuildAskRequest

StatusAnswersNotes
201BuildAskResultThe unsigned seller half and its inspection.
400ErrorResponseThe request is malformed or refused, with the exact reason in `message`.
429ErrorResponseRate limited. The envelope carries `code: ORDEX_RATE_LIMITED`.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

POST /api/ordex/orders/publish

Take the signed seller half and publish it.

Request body: PublishAskRequest

StatusAnswersNotes
201OrderSummaryThe published order after verification.
400ErrorResponseThe request is malformed or refused, with the exact reason in `message`.
429ErrorResponseRate limited. The envelope carries `code: ORDEX_RATE_LIMITED`.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

GET /api/ordex/orders/{id}/ownership-challenge

The message a listing owner signs before managing it.

ParameterInTypeNotes
idpathstringThe order id.
StatusAnswersNotes
200OwnershipChallengeThe challenge to sign with the key that owns the offered output.
404ErrorResponseNo order with this id.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

POST /api/ordex/orders/{id}/withdraw

Remove a listing, proved by the key owning the output it sells. Withdrawal is discovery, not cancellation. It stops this gateway publishing the listing; it cannot unpublish a signed artifact already distributed elsewhere. Only spending the offered output makes such an artifact unusable.

ParameterInTypeNotes
idpathstringThe order id.

Request body: OwnershipProof

StatusAnswersNotes
201OrderSummaryThe withdrawn order.
400ErrorResponseThe request is malformed or refused, with the exact reason in `message`.
404ErrorResponseNo order with this id.
429ErrorResponseRate limited. The envelope carries `code: ORDEX_RATE_LIMITED`.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

buying

Quoting and preflighting a purchase.

POST /api/ordex/orders/{id}/quote

Compose the buyer half and state the exact terms. The caller names its own outputs and nothing else. Value and script are read from Bitcoin Core, never from the request, so a buyer cannot make a purchase look cheaper by describing their own funding wrongly. Each named output is checked against the ord index first: an output holding an asset is not spare change, and an unexamined output is unknown rather than empty.

ParameterInTypeNotes
idpathstringThe order id.

Request body: QuoteRequest

StatusAnswersNotes
201QuoteThe unsigned buyer half and the exact economics. A fee or a royalty of zero is stated as zero rather than omitted.
400ErrorResponseThe request is malformed or refused, with the exact reason in `message`.
404ErrorResponseNo order with this id.
429ErrorResponseRate limited. The envelope carries `code: ORDEX_RATE_LIMITED`.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

POST /api/ordex/orders/{id}/preflight

Verify a signed purchase and ask the node whether it would accept it. Takes either `finalTxHex` or the `signedPsbt` a wallet actually answers with. Given a PSBT it finalises only inputs the buyer already signed: it creates no signature and changes no input, output, or amount, and an unsigned input is an error rather than a guess. It rechecks the order against the chain, binds the transaction to the order, proves the sat flow invariant, then asks the node itself. The gateway does not broadcast; that is the buyer's own deliberate step.

ParameterInTypeNotes
idpathstringThe order id.

Request body: PreflightRequest

StatusAnswersNotes
201PreflightResultThe verdict, with the exact bytes checked so a buyer broadcasts those and no others.
400ErrorResponseThe request is malformed or refused, with the exact reason in `message`.
404ErrorResponseNo order with this id.
429ErrorResponseRate limited. The envelope carries `code: ORDEX_RATE_LIMITED`.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

interoperability

Importing and exporting portable signed orders.

POST /api/ordex/orders/import

Take a signed artifact and verify it. A source may supply signed order evidence, but it never overrides what the node and the ord index prove. The claims travel as evidence and the authorities decide the state.

Request body: ImportRequest

StatusAnswersNotes
201OrderSummaryThe imported order after verification.
400ErrorResponseThe request is malformed or refused, with the exact reason in `message`.
429ErrorResponseRate limited. The envelope carries `code: ORDEX_RATE_LIMITED`.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

POST /api/ordex/orders/openordex-event

Take a signed OpenOrdex event and verify it. Accepts a kind 802 Nostr event carrying a signed PSBT, verifies the event signature, then verifies the order exactly as a direct import.

Request body: NostrEvent

StatusAnswersNotes
201OrderSummaryThe imported order after verification.
400ErrorResponseThe request is malformed or refused, with the exact reason in `message`.
429ErrorResponseRate limited. The envelope carries `code: ORDEX_RATE_LIMITED`.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

GET /api/ordex/orders/{id}/nostr-envelope

The unsigned kind 802 event announcing this listing. The gateway never holds Nostr keys. The customer's own NIP-07 signer signs this envelope, the browser publishes it, and the signed event can then be handed back through the OpenOrdex import route.

ParameterInTypeNotes
idpathstringThe order id.
StatusAnswersNotes
200NostrEnvelopeThe unsigned event envelope.
404ErrorResponseNo order with this id.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

operator

Separately authenticated moderation.

POST /api/ordex/admin/orders/{id}/withdraw

Operator moderation, separately authenticated.

ParameterInTypeNotes
idpathstringThe order id.

Request body: object

StatusAnswersNotes
201OrderSummaryThe withdrawn order.
401ErrorResponseOperator credentials missing, invalid, or not configured.
404ErrorResponseNo order with this id.
defaultErrorResponseThe request failed. The envelope states the status, a human readable message, and the request id.

Schemas

The shapes the routes above exchange, exactly as the contract states them.

AtomicSats

An exact non-negative atomic amount as a decimal string. Never floating point, never grouped, never padded.

string, matching ^(0|[1-9][0-9]*)$

Network

mainnet | regtest | signet

Source

Where order evidence arrived from. Source is provenance, never proof; the node and the ord index decide the state.

openordex-nostr802 | ord-offers | direct-import

OrderClass

ASK_ANYONECANPAY | BID_FULLY_FUNDED | UNSUPPORTED

OrderState

Every state is reachable. A mempool conflict can return to LIVE when the conflicting spend is replaced or dropped; a confirmed spend does not come back short of a reorg. SETTLED is narrower than SPENT: the offered output was spent by a transaction observed carrying this order's exact payout.

PENDING_NODE | PENDING_ORD | LIVE | MEMPOOL_CONFLICTED | SPENT | SETTLED | REJECTED | WITHDRAWN

Actionability

What a customer may do right now. A LIVE order whose verification has aged past its freshness bound is REVIEW_ONLY, not HANDOFF_READY.

REVIEW_ONLY | HANDOFF_READY | BLOCKED

SignatureStatus

NONE | VALID | INVALID | UNAVAILABLE

OrderSide

ASK | BID

Outpoint

FieldTypeNotes
txidstring
voutinteger

AssetClaim

FieldTypeNotes
inscriptionIdstring
outpointOutpoint
inscriptionNumber optionalintegerRead from the local ord index during verification, never from a claim.

SourceEvidence

FieldTypeNotes
sourceSource
sourceIdstring
observedAtstring
eventId optionalstring
eventPubkey optionalstring
signatureVerified optionalboolean
claimedPriceSats optionalAtomicSats
claimedAsset optionalAssetClaim

PsbtInspection

FieldTypeNotes
psbtVersioninteger
unsignedTxidstring
digeststring
inputCountinteger
outputCountinteger
inputOutpointsarray of Outpoint
inputWitnessUtxosarray of object or null
outputValuesSatsarray of AtomicSats
outputScriptsHexarray of string
hasProprietaryFieldsboolean
hasUnknownFieldsboolean
signatureStatusSignatureStatus
orderClassOrderClass
safetyPUBLIC_RACEABLE | TARGETED_REVIEW | UNSUPPORTED
reasonsarray of string

Validation

FieldTypeNotes
checkedAtstring
nodeStatusUNCONFIGURED | READY | UNAVAILABLE | OUTPOINT_MISSING | OUTPOINT_SPENT
ordStatusNOT_REQUESTED | UNCONFIGURED | VERIFIED | MISMATCH | UNAVAILABLE
nodeTip optionalobject
reasonsarray of string

Settlement

Chain settlement the gateway actually observed, never an assumption.

FieldTypeNotes
txidstring
observedAtstring
confirmationsinteger
confirmedAt optionalstring

VerificationView

Read-time freshness of the last verification. Age is published with every order so staleness is visible rather than implied.

FieldTypeNotes
checkedAtstring
ageSecondsnumber
maxAgeSecondsnumber
staleboolean

Withdrawal

FieldTypeNotes
withdrawnAtstring
reason optionalstring

OrderSummary

What a list or detail response carries. The signed artifact is deliberately absent; it is released only through its own rate limited route while the order is live.

FieldTypeNotes
idstring
networkNetwork
inspectionPsbtInspection
assetsarray of AssetClaim
sourcesarray of SourceEvidence
stateOrderState
actionabilityActionability
validationValidation
sellerScriptHex optionalstringThe output script of the PSBT input being sold. Only the key behind it can have created this listing, so it is the identity every seller management action is checked against.
settlement optionalSettlement
protocolId optionalstringUser supplied discovery metadata. It never substitutes for chain verification.
token optionalstring
side optionalOrderSide
quotedPriceSats optionalAtomicSats
withdrawal optionalWithdrawal
createdAtstring
updatedAtstring

OrderPage

FieldTypeNotes
ordersarray of OrderSummary
totalinteger
limitinteger
nextCursorstringKeyset resume point for the next page. Empty when this page is last.
hasMorebooleanDerived from nextCursor, never from a total that concurrent writes can move.

ActivityEntry

FieldTypeNotes
idstring
orderIdstring
fromStateOrderState or nullNull for the first transition an order makes.
toStateOrderState
reasonstring
actorstringWho caused the transition: the reconciler, the seller, an operator, or an import.
observedAtstring

ActivityPage

FieldTypeNotes
entriesarray of ActivityEntry
limitinteger
nextCursorstring
hasMoreboolean

OrderArtifact

FieldTypeNotes
orderIdstring
psbtstringThe signed artifact, base64.
verificationVerificationView
stateOrderState
actionabilityActionability

ImportRequest

FieldTypeNotes
psbtstring
source optionalSource
sourceId optionalstring
asset optionalAssetClaim
claimedPriceSats optionalstring or number
protocolId optionalstring
token optionalstring
side optionalOrderSide
quotedPriceSats optionalstring or number

QuoteRequest

What a buyer names when asking the gateway to price a purchase. The buyer names its own outputs and nothing else.

FieldTypeNotes
assetReceiveAddress optionalstringWhere the buyer receives the asset. Never the payment address.
paymentAddress optionalstringWhere the buyer's change and merged padding return.
paddingUtxos optionalarray of objectOutputs placed ahead of the offered one, so the asset reaches the buyer.
fundingUtxos optionalarray of object
feeRateSatsPerVb optionalstring or number

Quote

Everything a buyer needs to decide, and the unsigned half their wallet will be asked to sign. Every amount is atomic sats as a string.

FieldTypeNotes
orderIdstring
networkNetwork
psbtstring
sellerIndexintegerThe index the seller's input and payment output share.
assetAssetClaim or null
assetReceiveAddressstring
paymentAddressstring
sellerPaymentScriptHexstring
assetValueSatsAtomicSats
sellerProceedsSatsAtomicSats
marketplaceFeeSatsAtomicSats
creatorRoyaltySatsAtomicSats
networkFeeSatsAtomicSats
feeRateSatsPerVbstring
estimatedVbytesstring
changeSatsAtomicSats
paddingSatsAtomicSatsPadding the buyer supplies and receives back, so it is not a cost.
totalBuyerCostSatsAtomicSats
inputOutpointsarray of Outpoint
outputScriptsHexarray of string
outputValuesSatsarray of AtomicSats
checkpointobject
observedAtstring
expiresAtstring

PreflightRequest

Either the final transaction hex or the signed PSBT a wallet actually answers with.

FieldTypeNotes
finalTxHex optionalstring
signedPsbt optionalstring

PreflightResult

FieldTypeNotes
finalTxHex optionalstringThe exact bytes checked, so a buyer broadcasts those and no others.
orderIdstring
allowedboolean
rejectReason optionalstring
txid optionalstring
vsize optionalinteger
feesSats optionalAtomicSats
checkedAtstring

BuildAskRequest

FieldTypeNotes
protocolIdstring
tokenstring
quotedPriceSatsstring or number
sellerPaymentAddressstring
asset optionalAssetClaim
outpoint optionalOutpoint

BuildAskResult

FieldTypeNotes
psbtstring
inspectionPsbtInspection
outpointOutpoint
nodeTipobject
protocolIdstring
builderProfileOPEN_ASK | EXTERNAL_PSBT | EXTERNAL_SETTLEMENT

PublishAskRequest

FieldTypeNotes
psbtstringThe seller half, now signed by the seller's own wallet.

OwnershipChallenge

The message a seller signs to prove they own a listing's source UTXO.

FieldTypeNotes
orderIdstring
addressstring
messagestring
windowStartstring
expiresAtstring

OwnershipProof

FieldTypeNotes
address optionalstring
signature optionalstring
reason optionalstring

NostrEnvelope

FieldTypeNotes
kindconstant 802
created_atinteger
tagsarray of array of string
contentstring
noticestring

NostrEvent

FieldTypeNotes
idstring
pubkeystring
created_atinteger
kindinteger
tagsarray of array of string
contentstring
sigstring

ProtocolCapabilities

What a protocol can truthfully do today. An entry in the catalog never implies a working flow beyond these booleans.

FieldTypeNotes
browseboolean
createListingboolean
verifyAssetSemanticsbooleanTrue when the local ord index proves the asset's current location, not only that its UTXO is unspent.
reviewOnlyHandoffboolean
externalSettlementboolean
sourceIngestionboolean
mediaResolutionboolean

ProtocolTemplate

FieldTypeNotes
idstring
labelstring
routestring
familybitcoin | dogecoin | counterparty
capabilityPSBT_HANDOFF | EXTERNAL_SETTLEMENT
builderProfileOPEN_ASK | EXTERNAL_PSBT | EXTERNAL_SETTLEMENT
assetRequirementINSCRIPTION | OUTPOINT | NONE
templateLabelstring
templateGuidancestring
verificationScopestringPlain language scope of what verification proves for this protocol. Never softened to look more capable.
capabilitiesProtocolCapabilities
groupIdstring
groupLabelstring
groupOrderinteger
displayOrderinteger
aliasOf optionalstringSet when this id is a catalog alias of another protocol. Aliases stay filterable but are not offered as a separate market leaf.

ListingReadiness

Whether a Bitcoin listing can actually be verified right now. Observed, never inferred from the presence of a URL.

FieldTypeNotes
readyboolean
reasonnot_configured | storage_unavailable | core_unavailable_or_syncing | ord_unreachable | ord_index_behind | observation_timed_out or null
coreHeightinteger or null
ordHeightinteger or null
lagBlocksinteger or null
maxLagBlocksinteger
storageWritableboolean
checkedAtstring

HealthReport

FieldTypeNotes
okboolean
serviceconstant "ordex"
enabledboolean
defaultEnabledboolean
networkNetwork
statusactive | degraded | disabled
featureFlagconstant "ORDEX_ENABLED"
coreConfiguredboolean
ordConfiguredboolean
configurationCompleteboolean
signsOrBroadcastsconstant false
spendsFundsconstant false
supportedSourcesarray of Source
storageWritableboolean
readyForBitcoinListingsboolean
maxVerificationAgeSecondsnumber
listingReadinessListingReadiness

ProtocolContract

FieldTypeNotes
nameconstant "Ordex"
settlementstring
sourceOfTruthstring
supportedProfilesarray of string
orderTemplatesobject
safetyobject
nostrobject

ErrorResponse

The error envelope every route answers with. Rate limited requests additionally carry `code: ORDEX_RATE_LIMITED`.

FieldTypeNotes
statusCodeinteger
errorstring
messagestring or array of string
requestId optionalstring
code optionalstring