Reprice or delist up to 20 listings
const url = 'https://api.digirare.com/v1/listings/batch';const options = { method: 'POST', headers: {'x-session-token': '<x-session-token>', 'Content-Type': 'application/json'}, body: '{"action":"reprice_preflight","listings":[{"listing_id":"example","price_sats":1}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.digirare.com/v1/listings/batch \ --header 'Content-Type: application/json' \ --header 'x-session-token: <x-session-token>' \ --data '{ "action": "reprice_preflight", "listings": [ { "listing_id": "example", "price_sats": 1 } ] }'The batch form of the per-listing owner actions (whose routes and contracts are unchanged): 1..20 distinct listings, every one sold by the session address, ownership checked for every item before anything is composed or written. reprice_preflight runs the single reprice preflight’s checks per item and returns only freshly built UNSIGNED templates (never a stored signature); any refused item refuses the batch (the first refusal sets the status and code, refused_listings lists every refused item); it reserves nothing. reprice verifies every signed listing PSBT exactly as POST /v1/listings/{id}/reprice before anything is written, refusing the batch on any failure, then writes the single path’s guarded updates in one D1 batch; each overwrites the superseded seller half in the same statement, and a listing a buyer claimed between verification and write keeps its old price and is reported ok: false with state_changed (the single path’s 409). delist needs no signature and wipes each stored half in the delisting statement; a missing or foreign listing refuses the whole batch, and a listing no longer active is reported ok: false. Rate limited as an expensive write.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Distinct listing ids.
object
object
Distinct listing ids, each with its signed replacement listing PSBT.
object
object
Distinct listing ids.
object
Responses
Section titled “Responses”Reprice_preflight: templates in request order; reprice and delist: per-listing outcomes in request order
object
object
object
Mainnet P2TR or P2WPKH address. The SIGNING capability: every signature is verified by reconstructing a BIP-143/BIP-341 witness sighash.
Canonical compact Counterparty key. A subasset uses its A
object
object
Mainnet P2TR or P2WPKH address. The SIGNING capability: every signature is verified by reconstructing a BIP-143/BIP-341 witness sighash.
Example
{ "result": { "listings": [ { "protocol_version": "counterparty_attach_listing_v1", "listing": { "sighash": "SINGLE|ANYONECANPAY" } } ] }}Stable machine-readable failure
object
On 422 mempool_rejected from a broadcast: which deterministic node policy refused the bytes. Retrying the same bytes fails the same way. fee_floor: re-quote at a higher fee_rate. chain_too_long: too many unconfirmed ancestors; wait for a confirmation, then retry. truc: a version-3 (TRUC) package rule, such as spending an unconfirmed version-3 output; wait for a confirmation, then retry.
The node’s own reject reason, on mempool_rejected (422) and on state_changed (409) when a broadcast lost to a conflicting or replacing spend.
Present and true when mempool_policy is chain_too_long or truc.
On a checkout or accept completion refused as mempool_rejected: the journaled settlement ended and every listing, bid, and asset claim it held was released (its inputs were proven unspent). The quote or accept is replaced; request a new one.
Batch listing routes only: every refused item. The first sets the status and code.
One refused item in a batch refusal’s refused_listings array. Nothing in the batch was changed.
object
On 429 rate_limited: the exact seconds until the oldest counted request leaves the window; a retry then is admitted (also sent as Retry-After). Limited writes are bucketed per route scope in exact sliding 60-second windows: by session address when a valid x-session-token is present, otherwise by IP, with a per-IP ceiling across sessions. Expensive writes: 20, ceiling 120. Signed completions: 120, ceiling 600. Session minting (/auth/*): 60 per IP. A request refused by any bucket is counted by none.
Example
{ "code": "invalid_request", "mempool_policy": "fee_floor"}Stable machine-readable failure
object
On 422 mempool_rejected from a broadcast: which deterministic node policy refused the bytes. Retrying the same bytes fails the same way. fee_floor: re-quote at a higher fee_rate. chain_too_long: too many unconfirmed ancestors; wait for a confirmation, then retry. truc: a version-3 (TRUC) package rule, such as spending an unconfirmed version-3 output; wait for a confirmation, then retry.
The node’s own reject reason, on mempool_rejected (422) and on state_changed (409) when a broadcast lost to a conflicting or replacing spend.
Present and true when mempool_policy is chain_too_long or truc.
On a checkout or accept completion refused as mempool_rejected: the journaled settlement ended and every listing, bid, and asset claim it held was released (its inputs were proven unspent). The quote or accept is replaced; request a new one.
Batch listing routes only: every refused item. The first sets the status and code.
One refused item in a batch refusal’s refused_listings array. Nothing in the batch was changed.
object
On 429 rate_limited: the exact seconds until the oldest counted request leaves the window; a retry then is admitted (also sent as Retry-After). Limited writes are bucketed per route scope in exact sliding 60-second windows: by session address when a valid x-session-token is present, otherwise by IP, with a per-IP ceiling across sessions. Expensive writes: 20, ceiling 120. Signed completions: 120, ceiling 600. Session minting (/auth/*): 60 per IP. A request refused by any bucket is counted by none.
Example
{ "code": "invalid_request", "mempool_policy": "fee_floor"}