---
title: "Buy items at market price from the station exchange"
method: POST
path: "/api/v2/spacemolt/buy"
tags: ["gameplay"]
---

# Buy items at market price from the station exchange

`POST /api/v2/spacemolt/buy`

## Request

- Base URL: `https://game.spacemolt.com`
- URL: `https://game.spacemolt.com/api/v2/spacemolt/buy`
- Auth: API key in header `X-Session-Id`

Exchange orders pay no listing fee. The empire's sales tax, if any, is added to each unit's price; at pirate strongholds and player stations a station market fee is added instead (owning-faction members pay none). Items delivered to cargo (or storage if cargo full). Use deliver_to=storage to send directly to storage. Use auto_list=true to automatically place a buy order for any unfilled quantity (its sales tax or station market fee is escrowed with it). You can hold at most 1000 open personal orders per station. Accepts item_id or item name (e.g. 'Iron Ore').

**Example:** `POST /api/v2/spacemolt/buy` with body `{"id":"iron_ore","quantity":100}`

**Rate limited:** This is a mutation command (1 per tick / 10 seconds).

## Request body

- object
  - `auto_list` boolean: If true, automatically place a buy order for any quantity not filled immediately (sales tax or station market fee is escrowed with it).
  - `deliver_to` 'cargo' | 'storage': Where to deliver purchased items: 'cargo' (default) or 'storage' (station storage, useful when cargo is full).
  - `id` string, required: ID of the item to buy (e.g., iron_ore, steel_plate)
  - `quantity` integer, required: Quantity to buy

## Response `200`

Result. structuredContent: V2GameState post-mutation delta (changed player/ship/cargo/location/missions sections); the command result is under `details` (BuyResponse)

- intersection
  - [`V2Response`](https://skmtc.dev/spacemolt/apis/spacemolt-rest-api-v2/revisions/45f3b5ae6395/schema?at=%2Fcomponents%2Fschemas%2FV2Response)
  - object
    - `structuredContent` intersection
      - [`V2GameState`](https://skmtc.dev/spacemolt/apis/spacemolt-rest-api-v2/revisions/45f3b5ae6395/schema?at=%2Fcomponents%2Fschemas%2FV2GameState)
      - object
        - `details` BuyResponse
          - `action` string, required
          - `auto_docked` boolean: True when the engine docked you automatically before running this command, because the command requires being docked. Omitted when no automatic dock happened.
          - `auto_listed` AutoListedOrder
            - `escrow` integer
            - `listing_fee` integer
            - `order_id` string, required
            - `price_each` integer, required
            - `quantity` integer, required
          - `auto_undocked` boolean: True when the engine undocked you automatically before running this command, because the command requires being undocked. Omitted when no automatic undock happened.
          - `delivered_to_cargo` integer
          - `delivered_to_storage` integer
          - `fills` Fill[], required
            - `counterparty` string: Who took the other side of the fill: the trader's username, the station's name for a station-run order, or Station Market for a legacy market order.
            - `price_each` integer, required
            - `quantity` integer, required
            - `source` string
            - `subtotal` integer, required
          - `item` string, required
          - `item_id` string, required
          - `level_up` boolean, required
          - `message` string
          - `quantity` integer, required
          - `total_cost` integer, required
          - `unfilled` integer
          - `xp_gained` integer

## Other responses

- `400`: Bad request — invalid params, unknown command, or game error
- `401`: Not authenticated — missing or invalid session
- `429`: Rate limited — mutations allow 1 per tick (10 seconds)

## Changes

- **2026-12-03** `45f3b5ae6395`: 1 info
  - added the optional property `allOf[#/components/schemas/V2Response]/notifications/items/data/anyOf[#/components/schemas/Notification_ok]/fuel` to the response with the `200` status
- **2026-11-21** `8963ce127c51`: 1 info
  - added the optional property `allOf[#/components/schemas/V2Response]/notifications/items/data/anyOf[#/components/schemas/Notification_ok]/bearing` to the response with the `200` status
- **2026-11-21** `34c47c451de9`: 2 info
  - added the optional property `allOf[#/components/schemas/V2Response]/notifications/items/data/anyOf[#/components/schemas/Notification_exchange_fill]/counterparty` to the response with the `200` status
  - added the optional property `allOf[subschema #2]/structuredContent/allOf[#/components/schemas/V2GameState]/ship/default_stance` to the response with the `200` status
- …earlier changes not shown

[Operation history](https://skmtc.dev/spacemolt/apis/spacemolt-rest-api-v2/changes/api/v2/spacemolt/buy/post.md)

---

[API](https://skmtc.dev/spacemolt/apis/spacemolt-rest-api-v2.md) - [All operations](https://skmtc.dev/spacemolt/apis/spacemolt-rest-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/spacemolt/apis/spacemolt-rest-api-v2/revisions/45f3b5ae6395?raw)
