POST /v1/market/buy — 购买并交付到 Steam 交易链接
一次最多购买 100 件商品,并直接交付到您提供的任意 Steam 交易链接,使用已结算余额支付。专为批发与自动化交付而设计。
curl --request POST \
--url https://csboard.com/v1/market/buy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"item_ids": [
"itm_8841201",
"itm_8841340"
],
"partner": "447383001",
"token": "Ab3xZ9Qp",
"max_price_usd": 30,
"custom_id": "batch-2026-06-29-01",
"skip_unavailable": false
}
'import requests
url = "https://csboard.com/v1/market/buy"
payload = {
"item_ids": ["itm_8841201", "itm_8841340"],
"partner": "447383001",
"token": "Ab3xZ9Qp",
"max_price_usd": 30,
"custom_id": "batch-2026-06-29-01",
"skip_unavailable": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
item_ids: ['itm_8841201', 'itm_8841340'],
partner: '447383001',
token: 'Ab3xZ9Qp',
max_price_usd: 30,
custom_id: 'batch-2026-06-29-01',
skip_unavailable: false
})
};
fetch('https://csboard.com/v1/market/buy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://csboard.com/v1/market/buy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'item_ids' => [
'itm_8841201',
'itm_8841340'
],
'partner' => '447383001',
'token' => 'Ab3xZ9Qp',
'max_price_usd' => 30,
'custom_id' => 'batch-2026-06-29-01',
'skip_unavailable' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://csboard.com/v1/market/buy"
payload := strings.NewReader("{\n \"item_ids\": [\n \"itm_8841201\",\n \"itm_8841340\"\n ],\n \"partner\": \"447383001\",\n \"token\": \"Ab3xZ9Qp\",\n \"max_price_usd\": 30,\n \"custom_id\": \"batch-2026-06-29-01\",\n \"skip_unavailable\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://csboard.com/v1/market/buy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"item_ids\": [\n \"itm_8841201\",\n \"itm_8841340\"\n ],\n \"partner\": \"447383001\",\n \"token\": \"Ab3xZ9Qp\",\n \"max_price_usd\": 30,\n \"custom_id\": \"batch-2026-06-29-01\",\n \"skip_unavailable\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://csboard.com/v1/market/buy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"item_ids\": [\n \"itm_8841201\",\n \"itm_8841340\"\n ],\n \"partner\": \"447383001\",\n \"token\": \"Ab3xZ9Qp\",\n \"max_price_usd\": 30,\n \"custom_id\": \"batch-2026-06-29-01\",\n \"skip_unavailable\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"purchase_id": "pur_01J9Z3K8Q2",
"steam_id": "76561198000000000",
"created_at": "2026-06-29T17:12:04Z",
"custom_id": "batch-2026-06-29-01",
"skins": [
{
"name": "AK-47 | Redline (Minimal Wear)",
"price": 14.37,
"status": "delivering",
"return_reason": null,
"steam_trade_offer_id": "5512345678"
}
]
}
}partner 和 token 字段组成。购买只能使用您的已结算(不可撤销)余额,因此适用于批发量与自动化交付工作流。
为每笔提取保存一个 custom_id。成功响应最多缓存 24 小时,重放时会返回 Idempotent-Replayed: true 响应头。如果响应丢失,请用已保存的标识符查询订单。订单创建前,查询可能返回空结果。请保持待处理状态,直到核实原订单。
403 external_buy_disabled。Authorization: Bearer csb_pub_... 发送。
需要交易能力。 该密钥必须启用购买功能,且账户必须处于不可撤销状态干净。
请求体
item_ids 所属的游戏:730 CS2(默认)、570 Dota 2、252490 Rust。请使用读取这些 id 时(GET /v1/listings)所用的同一个 appId。Dota 2 和 Rust 每个订单最多 10 个 id,并进入队列,因此每个皮肤最初返回 pending。响应字段
示例请求
curl -X POST https://csboard.com/v1/market/buy \
-H "Authorization: Bearer csb_pub_..." \
-H "Content-Type: application/json" \
-d '{
"item_ids": ["itm_8841201", "itm_8841340"],
"partner": "447383001",
"token": "Ab3xZ9Qp",
"max_price_usd": 30.00,
"custom_id": "batch-2026-06-29-01",
"skip_unavailable": false
}'
示例响应
{
"data": {
"purchase_id": "pur_01J9Z3K8Q2",
"steam_id": "76561198000000000",
"created_at": "2026-06-29T17:12:04Z",
"custom_id": "batch-2026-06-29-01",
"skins": [
{
"name": "AK-47 | Redline (Minimal Wear)",
"price": 14.37,
"status": "delivering",
"return_reason": null,
"steam_trade_offer_id": "5512345678"
}
]
}
}
错误代码
| HTTP 状态码 | 代码 | 含义 |
|---|---|---|
| 400 | invalid_request | 请求体格式错误(例如 item_ids 为空或超过 100)。 |
| 400 | unsupported_item | 一个或多个商品无法通过此端点交付(例如 ss_live_* id)。 |
| 400 | invalid_trade_url | partner + token 无法组成有效的 Steam 交易链接。 |
| 400 | unsupported_game | 您的密钥无法使用该 appId。包含 supported_app_ids。 |
| 400 | too_many_items | 一个订单中 Dota 2 或 Rust 的 id 超过 10 个。包含 max_items。 |
| 401 | invalid_api_key | API 密钥缺失或无效。 |
| 402 | insufficient_settled_balance | 已结算余额低于订单总额。返回中包含 required_usd 和 settled_usd。 |
| 402 | insufficient_balance | 余额低于订单总额。 |
| 403 | external_buy_disabled | 熔断开关已关闭;此端点当前已禁用。 |
| 403 | trading_not_enabled | 该密钥未启用购买功能。 |
| 403 | account_restricted | 此端点要求账户处于不可撤销状态干净。 |
| 409 | item_unavailable | 一个或多个商品已不再可用。返回中包含 unavailable_ids[],CS2 购买还可能包含 unknown_ids[]。参见下方 不可用的商品。 |
| 409 | price_moved | 实时总价超过上限。返回中包含 quoted_max_usd、current_total_usd 以及 items[]。 |
| 409 | idempotency_in_progress | 具有该 custom_id 的请求仍在处理中。 |
| 409 | price_updating | 价格正在刷新;请稍后重试。 |
| 429 | rate_limit_exceeded | 超过每分钟 250 个购买订单(bucket: "buy_orders"),或超过密钥的交易限制(bucket: "trading")。请按照 Retry-After 响应头中的秒数退避。 |
| 500 | order_failed | 请先确认原订单是否已创建,再决定是否重新购买。 |
| 504 | upstream_timeout | 市场响应超时。请保持待处理状态,用已保存的标识符查询订单。Node.js 对账示例(英文)。 |
GET /v1/balance 上的 settled_balance_usd,并始终发送 max_price_usd 作为超额扣款保护。不可用的商品
挂单可能在您读取之后、购买之前离开目录。409 item_unavailable 的响应体会在 unavailable_ids 中列出所有缺失的 id。购买 CS2(不传 appId 或传 730)时,它还可能带有 unknown_ids:缺失的 id 中我们完全没有记录的那些。要么它不是 CSBoard 的挂单 id,要么该挂单离开目录已超过一小时。最常见的混淆是把 Steam 资产 id(asset id)当成挂单 id——CSBoard 的挂单 id 从不全由数字组成,请发送 /v1/listings 或流中某一行的 id。
{
"code": "item_unavailable",
"detail": "One or more items are no longer available. 1 of the ids are not known here (`unknown_ids`): not a listing id, or a listing gone for over an hour. Steam asset ids are not listing ids: send the `id` of a row from /v1/listings or the stream.",
"unavailable_ids": ["31846262931"],
"unknown_ids": ["31846262931"]
}
GET /v1/listings/stream 的 gone 事件。授权
Send your key as a Bearer token on every request: Authorization: Bearer csb_pub_.... Generate keys in your CSBoard profile. Calls made with a key are metered only by that key's own limits — there is no per-IP limit on top — and every answer carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and X-RateLimit-Bucket for the bucket the call spent. See Rate limits.
请求体
Sticky per-account setting (not per-order). Send true once to switch your key into auto-claim mode: every held order is then auto-released the moment its hold clears (your bot must auto-accept the Steam trade offer within ~15 minutes). Send false to switch back to manual claiming via POST /orders/{id}/claim. Omit to leave the setting unchanged.
Game the item_ids belong to: 730 = CS2 (the default), 570 = Dota 2, 252490 = Rust. Send the same appId you read the ids with from GET /listings. Dota 2 and Rust take up to 10 ids per order. A game this key may not buy in answers 400 unsupported_game — tradable in GET /games tells you in advance.
730, 570, 252490 curl --request POST \
--url https://csboard.com/v1/market/buy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"item_ids": [
"itm_8841201",
"itm_8841340"
],
"partner": "447383001",
"token": "Ab3xZ9Qp",
"max_price_usd": 30,
"custom_id": "batch-2026-06-29-01",
"skip_unavailable": false
}
'import requests
url = "https://csboard.com/v1/market/buy"
payload = {
"item_ids": ["itm_8841201", "itm_8841340"],
"partner": "447383001",
"token": "Ab3xZ9Qp",
"max_price_usd": 30,
"custom_id": "batch-2026-06-29-01",
"skip_unavailable": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
item_ids: ['itm_8841201', 'itm_8841340'],
partner: '447383001',
token: 'Ab3xZ9Qp',
max_price_usd: 30,
custom_id: 'batch-2026-06-29-01',
skip_unavailable: false
})
};
fetch('https://csboard.com/v1/market/buy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://csboard.com/v1/market/buy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'item_ids' => [
'itm_8841201',
'itm_8841340'
],
'partner' => '447383001',
'token' => 'Ab3xZ9Qp',
'max_price_usd' => 30,
'custom_id' => 'batch-2026-06-29-01',
'skip_unavailable' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://csboard.com/v1/market/buy"
payload := strings.NewReader("{\n \"item_ids\": [\n \"itm_8841201\",\n \"itm_8841340\"\n ],\n \"partner\": \"447383001\",\n \"token\": \"Ab3xZ9Qp\",\n \"max_price_usd\": 30,\n \"custom_id\": \"batch-2026-06-29-01\",\n \"skip_unavailable\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://csboard.com/v1/market/buy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"item_ids\": [\n \"itm_8841201\",\n \"itm_8841340\"\n ],\n \"partner\": \"447383001\",\n \"token\": \"Ab3xZ9Qp\",\n \"max_price_usd\": 30,\n \"custom_id\": \"batch-2026-06-29-01\",\n \"skip_unavailable\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://csboard.com/v1/market/buy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"item_ids\": [\n \"itm_8841201\",\n \"itm_8841340\"\n ],\n \"partner\": \"447383001\",\n \"token\": \"Ab3xZ9Qp\",\n \"max_price_usd\": 30,\n \"custom_id\": \"batch-2026-06-29-01\",\n \"skip_unavailable\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"purchase_id": "pur_01J9Z3K8Q2",
"steam_id": "76561198000000000",
"created_at": "2026-06-29T17:12:04Z",
"custom_id": "batch-2026-06-29-01",
"skins": [
{
"name": "AK-47 | Redline (Minimal Wear)",
"price": 14.37,
"status": "delivering",
"return_reason": null,
"steam_trade_offer_id": "5512345678"
}
]
}
}