Skip to content
msMarketSDK

// guide

Orders

One buyer, one seller, one listing, a quantity, and a price fixed when the order is made. The order moves through a fixed set of states, and only the right party can move it.

Who acts

Every call comes from your server with a secret key. You say which of your users is acting by passing actor, a buyer id or a seller id. We trust that, and check only that the actor is a party to the order and may make that change now.

POST /v1/orders/{id}/claimrequest body
{ "actor": "sel_034XtPDs7UJ0TXzTsdaHZa" }

A buyer cannot order from a seller with the same external_id: that is one person on both sides.

States

Order states
statemeansfinal
awaiting_paymentCreated, payment not confirmed yet. Only when payments are on.no
committedThe buyer has committed to buy. The quantity is reserved.no
claimedOne party says the deal is done and waits for the other.no
disputedA party contested the claim. A dispute is open.no
completedThe deal is done.yes
cancelledThe deal did not happen.yes
expiredNobody acted in time.yes

An order in a final state never changes state again. A dispute opened after completion is recorded against the order without changing its state.

Every change an order can make

Order transitions
#fromtohowwho
1noneawaiting_paymentPOST /v1/orders, payments onbuyer
2nonecommittedPOST /v1/orders, payments offbuyer
3awaiting_paymentcommittedStripe confirms the paymentMarketSDK
4awaiting_paymentcancelledthe payment window passes; reason payment_expiredMarketSDK
5committedclaimedPOST /claimbuyer or seller
6committedcancelledPOST /back_out; reason backed_outbuyer or seller
7committedcancelledPOST /propose_cancel, then POST /accept_cancel by the other party; reason mutualboth
8committedexpiredthe commitment window passes with no claimMarketSDK
9claimedcompletedPOST /confirmthe party who did not claim
10claimedcompletedthe confirmation window passes; reason auto_confirmedMarketSDK
11claimeddisputedPOST /disputesthe party who did not claim
12disputedcompletedyour team decides against the party who disputedyour team
13disputedcancelledyour team decides against the claimant; reason disputeyour team
  • Anything not in this table is refused: 409 invalid_state, with a message naming the current state, or 403 actor_not_permitted when the change exists but this party may not make it.
  • A proposal to cancel by agreement that is declined, or not answered within the agreement window, changes nothing. The order stays committed.
  • Every change writes one order event: from, to, actor, reason, and time. Read them from GET /v1/orders/{id}/events. Each also sends a webhook.

Timers

Set them under marketplace in the dashboard. A value outside the limits is refused. When a timer passes, the order changes within five minutes, whether or not anyone reads it.

Order timers
timerdefaultlimitsstarts when
payment window30 minutes5 minutes to 24 hoursthe order awaits payment
commitment window14 days1 to 90 daysthe order is committed
agreement window48 hours1 hour to 7 daysa party proposes cancelling
confirmation window7 days1 to 30 daysthe order is claimed
review window30 days7 to 90 daysthe order completes
dispute window14 days0 to 60 daysthe order completes

The order shows when its current timer runs out as timer_expires_at.

Quantity

  • A listing has a quantity, 1 unless you say otherwise. Making an order reserves its quantity at once.
  • Two buyers racing for the last unit never both succeed. The loser gets 409 quantity_unavailable.
  • A cancelled or expired order gives its quantity back. A completed order uses it up; when none is left, the listing becomes sold.
  • A published listing with nothing available is left out of search.

Money, when payments are on

What each change does to the money
the orderthe money
becomes committedthe buyer's payment is taken and held on your Stripe account
completesreleased to the seller, less your platform fee
is cancelled or expiresrefunded to the buyer in full
has a dispute decidedas the decision says: released, refunded, or split

The details are in payments and payouts.

next: reputation