marketBuy

Buy a listing.

Payment is composed from your containers to the exact amount — both gold and spectral coins pay on the marketplace — so there is nothing to arrange first. `price` must be the listing's current price: it is what gets paid, so a stale figure buys at the wrong amount or is refused.

In Marketplace.

Request

POST /api/v1/sessions/{accountKey}/actions/marketBuy

Parameters

NameTypeRequiredDescription
listingId (listing_id)stringyesFrom `marketList` or `myMarketList`. It exceeds 2^53, so it travels as a string — parsing it as a JSON number will corrupt it.
priceintegeryesThe listing's price, from `marketList`. Required, because it is what the payment is composed to.

Example request

{ "listingId": "9007199254740993", "price": 24000 }

Response

`{ ok: true, result, spent, remainingGold }`.

FieldTypeMeaning
spentintegerWhat was paid.
remainingGoldintegerSpendable balance afterwards, gold plus spectral.

Example response

{ "ok": true, "result": 1, "spent": 24000, "remainingGold": 157320 }

Errors

CodeWhen
action_failedNot enough gold, exact payment could not be composed, the listing is gone, or the price no longer matches.
plan_limitNot on the free plan.

See also

DarkerAPI is an independent project. It is not affiliated with, endorsed by or associated with IRONMACE Co., Ltd. or Valve Corporation. “Dark and Darker” and related marks belong to their respective owners.