POST
Buyer purchases multiple marketplace listings (partial-success batch)

Authorizations

X-InStockRx-Api-Key
string
header
required

Scoped partner API key. Send the whole key, e.g. ik_live_a1b2c3…, on every request.

Headers

X-Pharmacy-Id
string<uuid>

Which pharmacy in your group you are acting as. Required whenever your group holds more than one pharmacy — omitting it is then 400 missing-pharmacy-context. With exactly one pharmacy it may be omitted, but send it anyway: the call starts failing the day a second pharmacy is added.

Idempotency-Key
string

Makes this request safe to retry. A retry carrying the same key replays the original response rather than acting twice, and is marked X-Idempotent-Replay: true. The same key with a different body is 409. Records are kept for 24 hours.

Required string length: 1 - 255

Body

application/json

Body for POST /marketplace-listings/checkout. The buyer groups listings into bundles up front (one bundle per shipment from one seller). Each bundle is processed independently — partial success is possible.

paymentMethod
object
required

Tagged reference to a stored payment method. Today only type = Dwolla is accepted on purchase calls. Forward-compatible: if a new rail is added in a future minor revision, partners that hardcode Dwolla will keep working; partners that surface the rail to their users can add it without an SDK upgrade.

bundles
object[]
required
Required array length: 1 - 50 elements
buyersMessage
string
Maximum string length: 500
referralCode
string
Maximum string length: 64

Response

Always 200 on a syntactically valid request — even if every bundle failed. The envelope's allSucceeded field tells the caller whether any bundle landed.

allSucceeded
boolean
required
bundles
object[]
required