Operational Recipes
Follow one operation per step. Inspect request payloads, expected success envelopes, and common refusal codes side by side.
Recipe: Complete Public Ask Lifecycle
End-to-end operational recipe: build ask, publish signed PSBT, quote purchase, and preflight settlement.
Build Unsigned Public Ask
POST /api/ordex/orders/buildCreate the unsigned PSBT committing to the seller payment output.
import { OrdexClient } from '@bitcoinuniverse/ordex-sdk';
const client = new OrdexClient({ origin: 'http://localhost:8080' });
// Build Unsigned Public Ask
const res = await client.buildAsk({
"offeredOutpoint": {
"txid": "7b28f7a932b13c19e830e2f5b84c8a20984ef11320498a102938472910384729",
"vout": 0
},
"priceSats": "150000",
"sellerPaymentScriptHex": "001438924b8923489123049182309481230948120394",
"assetClaim": {
"protocol": "ordex",
"inscriptionId": "7b28f7a932b13c19e830e2f5b84c8a20984ef11320498a102938472910384729i0"
}
});
console.log('Result:', res);{
"orderId": "ord_pub_98a72f1029384b",
"status": "DRAFT",
"unsignedPsbtHex": "70736274ff010072..."
}MALFORMED_ORDERReturned if priceSats is not an exact decimal string or outpoint is invalid.
View Refusal Specification →Publish Signed Ask to Gateway
POST /api/ordex/orders/publishSubmit the seller-signed PSBT (SIGHASH_SINGLE | ANYONECANPAY) to the catalog.
import { OrdexClient } from '@bitcoinuniverse/ordex-sdk';
const client = new OrdexClient({ origin: 'http://localhost:8080' });
// Publish Signed Ask to Gateway
const res = await client.publishAsk({
"orderId": "ord_pub_98a72f1029384b",
"signedPsbtHex": "70736274ff01007202..."
});
console.log('Result:', res);{
"orderId": "ord_pub_98a72f1029384b",
"status": "OPEN",
"publishedAt": "2026-09-02T16:00:00Z"
}SELLER_OUTPUT_MISSINGReturned if seller signature does not commit to the matching payment index.
View Refusal Specification →Quote and Preflight Buyer Purchase
POST /api/ordex/orders/ord_pub_98a72f1029384b/preflightPreflight the final settlement transaction to verify sat-flow and output positioning.
import { OrdexClient } from '@bitcoinuniverse/ordex-sdk';
const client = new OrdexClient({ origin: 'http://localhost:8080' });
// Quote and Preflight Buyer Purchase
const res = await client.preflightOrder({
"buyerFundingOutpoints": [
{
"txid": "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"vout": 1,
"valueSats": "200000"
}
],
"buyerReceiveScriptHex": "0014aabbccddeeff00112233445566778899aabbccdd"
});
console.log('Result:', res);{
"ok": true,
"verdict": "PASS",
"sharedIndex": 0,
"networkFeeSats": "3500"
}SAT_FLOW_SHORTFALLReturned if buyer funding inputs do not cover seller payment plus required network fee.
View Refusal Specification →Was this documentation helpful?
Privacy-first feedback. Your feedback is never shared with third parties.