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 请求体字段实现幂等性:使用相同的 custom_id 重试会重放原始的购买,而不会再次扣款;重放的响应会携带 Idempotent-Replayed: true 响应头。
403 external_buy_disabled。Authorization: Bearer csb_pub_... 发送。
需要交易能力。 该密钥必须启用购买功能,且账户必须处于不可撤销状态干净。
请求体
partner 值(1–32 个字符)。与 token 一起构成商品交付的目标交易链接。token 值(1–32 个字符)。与 partner 一起构成目标交易链接。price_moved 被拒绝且不扣款。强烈建议使用。custom_id 重试会重放原始购买;重放响应会携带 Idempotent-Replayed: true。true,跳过已不再可用的商品而不会让整个请求失败。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[]。 |
| 409 | price_moved | 实时总价超过上限。返回中包含 quoted_max_usd、current_total_usd 以及 items[]。 |
| 409 | idempotency_in_progress | 具有该 custom_id 的请求仍在处理中。 |
| 409 | price_updating | 价格正在刷新;请稍后重试。 |
| 429 | rate_limit_exceeded | 请求过多。请按照 Retry-After 响应头中的秒数退避。 |
| 500 | order_failed | 购买无法完成。 |
GET /v1/balance 上的 settled_balance_usd,并始终发送 max_price_usd 作为超额扣款保护。授权
Send your key as a Bearer token on every request: Authorization: Bearer csb_pub_.... Generate keys in your CSBoard profile.
请求体
1–100 unique listing ids to buy.
1 - 100 elementsSteam trade URL partner value. With token, forms the destination trade URL.
1 - 32Steam trade URL token value. With partner, forms the destination trade URL.
1 - 32Total ceiling in USD. Order is rejected with price_moved if the live total exceeds it.
Idempotency key. A retry with the same value replays the original purchase.
1 - 128If true, skip items that are no longer available instead of failing the whole request.
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 响应
Purchase accepted and debited from settled balance.
Show child attributes
Show child attributes
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"
}
]
}
}