API
ReferenceTrading

Buy listings

POST
/public/v1/purchase

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

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    }  ]}