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
| Name | Type | Required | Description |
|---|---|---|---|
listingId (listing_id) | string | yes | From `marketList` or `myMarketList`. It exceeds 2^53, so it travels as a string — parsing it as a JSON number will corrupt it. |
price | integer | yes | The 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 }`.
| Field | Type | Meaning |
|---|---|---|
spent | integer | What was paid. |
remainingGold | integer | Spendable balance afterwards, gold plus spectral. |
Example response
{ "ok": true, "result": 1, "spent": 24000, "remainingGold": 157320 }
Errors
| Code | When |
|---|---|
action_failed | Not enough gold, exact payment could not be composed, the listing is gone, or the price no longer matches. |
plan_limit | Not 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.