API
ReferenceTrading

Buy listings

Open raw markdownFor pasting into AI assistants
POST
/public/v1/purchase

Buys the listings named in the request in a single atomic call. Nothing is bought unless every line succeeds.

Every listing holds one copy, so each line's amount must be 1. To buy several copies of an item, send one line per listing; amount above 1 fails with LISTING_OUT_OF_STOCK.

max_price is a ceiling in cents, not an exact match: a listing that got cheaper between your quote and this call still fills, one that got more expensive fails with LISTING_PRICE_CHANGED. Set it high to opt out.

This does not read or modify your cart, so a bot and a browser session on the same account never interfere with each other.

Private listings are not in any feed and are bought by passing the private_token from the share link on that line. Without it the line comes back as LISTING_NOT_FOUND, the same as an id that does not exist.

AuthorizationBearer <token>

API key generated from your account settings on the website. Send as Authorization: Bearer csd_....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/public/v1/purchase" \  -H "Content-Type: application/json" \  -d '{    "items": [      {        "listing_id": 1,        "amount": 1,        "max_price": 1      }    ]  }'
{  "order_id": 1,  "created_at": "2019-08-24T14:15:22Z",  "items": [    {      "order_item_id": 1,      "app_id": 1,      "market_hash_name": "string",      "steam_asset_id": "string",      "price": -9007199254740991,      "amount": -9007199254740991    }  ]}