BuyCS2 Merchant API
REST API for the catalog, purchases, trade history and your wallet.
Base URL and auth
| Base URL | https://api.buycs2.com |
| Auth | x-merchant-id and x-api-key headers, both from the merchant portal |
| Format | JSON. Send Accept-Encoding: gzip |
| Money | USD cents. 1500 = $15.00 |
| Time | ISO 8601 UTC |
| Paging | limit (default 50, max 500) and page. Lists return total |
curl https://api.buycs2.com/Wallet/GetBalance \
-H "x-merchant-id: merchant_2c4fb27b5b98f6d7" \
-H "x-api-key: YOUR_API_KEY" \
--compressed
Errors and limits
Errors return error and message. Codes common to all endpoints are below; the rest are listed with each endpoint.
{ "error": "invalid_request", "message": "Missing required fields: itemId, assetId, price, tradeUrl" }
| HTTP | error | Meaning |
|---|---|---|
400 | invalid_request | Missing or invalid parameters |
401 | unauthorized | Invalid credentials or inactive account |
403 | ip_not_allowed | Request IP is not in your allowlist |
404 | not_found | Unknown endpoint, or auth headers missing |
429 | rate_limit_exceeded | Rate limit reached. See retryAfter (seconds) |
500 | internal_error | Server error. Retry later |
503 | maintenance, service_unavailable | Temporarily unavailable. Retry later |
Rate limits
Each endpoint has its own limit per minute. Reaching the limit on one endpoint leaves the others available.
| Endpoint | Requests per minute |
|---|---|
GET /Items/GetAllItemsOnSale | 5 |
| Every other endpoint | 120 |
Responses include X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. A 429 includes Retry-After and retryAfter in seconds.
Get all items on sale
/Items/GetAllItemsOnSaleFull catalog with current prices. Use WebSocket events or the refresh_catalog webhook to keep a local copy up to date.
Request
No parameters.
Response
{
"totalItems": 1,
"totalValue": 1500,
"lastUpdate": "2026-10-07T10:05:00.000Z",
"items": [
{
"itemId": 123,
"assetId": "12345678901",
"classId": "310776585",
"instanceId": "480085569",
"paintIndex": 12,
"paintSeed": 225,
"rarityColor": "#eb4b4b",
"market_hash_name": "AK-47 | Redline (Field-Tested)",
"img": "https://steamcdn-a.akamaihd.net/apps/730/icons/...",
"phase": null,
"price": 1500,
"float": 0.15234,
"stickers": [
{ "name": "Sticker | Natus Vincere | Katowice 2014", "img": "https://cdn.steamstatic.com/.../navi.png", "slot": 0, "wear": 0.6416, "wearPercent": "35%", "rotation": 45, "offsetX": 0.13, "offsetY": 0.19 }
],
"keyChains": [
{ "name": "Charm | Snowman", "img": "https://cdn.steamstatic.com/.../charm_snowman.png", "slot": 0, "pattern": 123, "offsetX": -0.15, "offsetY": 0.07, "offsetZ": 1.78 }
],
"steamId": "76561198012345678",
"inspectInGame": "steam://rungame/730/...",
"tradeUrl": "https://steamcommunity.com/tradeoffer/new/?partner=1551362882&token=czMFCtWq",
"sourceId": 1
}
]
}
| Field | Type | Description |
|---|---|---|
totalItems | integer | Item count |
totalValue | integer | Sum of prices |
lastUpdate | string | Catalog time |
itemId | integer | Item id |
assetId | string | Steam asset id |
classId, instanceId | string | Steam class and instance ids |
paintIndex, paintSeed | integer|null | Paint index and seed |
rarityColor | string|null | Rarity color, hex |
market_hash_name | string | Market hash name |
img | string|null | Image URL |
phase | string|null | Doppler phase |
price | integer | Price |
float | number|null | Float value |
stickers | array | Stickers and patches: name, img, slot, wear, wearPercent, rotation, offsetX, offsetY |
keyChains | array | Charms: name, img, slot, pattern, offsetX, offsetY, offsetZ |
steamId, inspectInGame | string|null | Holder Steam id and inspect link, if enabled for your account |
tradeUrl | string|null | Holder trade URL, if enabled for your account |
sourceId | integer | Stock source group |
Errors
| HTTP | error | Meaning |
|---|---|---|
429 | rate_limit_exceeded | More than 5 calls per minute |
503 | catalog_unavailable | Catalog not ready. Retry shortly |
Search items
/Items/SearchItemsLook up items by name or id. Send one of the two fields.
Request
{ "market_hash_name": ["AK-47 | Redline (Field-Tested)", "★ Karambit | Doppler (Factory New)"] }
{ "itemId": [12345, 67890] }
| Field | Type | Required | Description |
|---|---|---|---|
market_hash_name | string[] | One of | Up to 10 names |
itemId | integer[] | One of | Up to 500 ids |
Response
Same as Get all items on sale, without lastUpdate. Items not on sale are left out.
Errors
| HTTP | error | Meaning |
|---|---|---|
400 | invalid_request | Both or neither field, empty list, or invalid id |
Buy item by id
/Items/BuyBuys one item and sends it to tradeUrl as a Steam trade offer. The trade starts as PENDING; track it with webhooks, WebSocket or Trade history.
Request
{
"itemId": 123,
"assetId": "12345678901",
"price": 1500,
"tradeUrl": "https://steamcommunity.com/tradeoffer/new/?partner=123&token=abc",
"externalId": "order_abc123",
"tradeDurationSeconds": 1800
}
| Field | Type | Required | Description |
|---|---|---|---|
itemId | integer | Yes | Item id |
assetId | string | Yes | Asset id of that item |
price | integer | Yes | Expected price. Must equal the current price |
tradeUrl | string | Yes | Recipient's trade URL |
externalId | string | No | Your order id, unique |
tradeDurationSeconds | integer | No | Offer lifetime, 600 to 43200. Default 1800 |
Response
{
"tradeId": "tr_1f5469db719615d050a5db3f",
"tradeUrl": "https://steamcommunity.com/tradeoffer/new/?partner=123&token=abc",
"assetId": "12345678901",
"market_hash_name": "★ Karambit | Doppler (Factory New)",
"phase": "Phase 4",
"float": 0.031245,
"price": 1500,
"externalId": "order_abc123"
}
| Field | Type | Description |
|---|---|---|
tradeId | string | Trade id |
tradeUrl, assetId | string | From the request |
market_hash_name, phase, float | string, string|null, number|null | The item |
price | integer | Price |
externalId | string|null | Your order id |
Errors
| HTTP | error | Meaning |
|---|---|---|
400 | invalid_request | Missing field |
400 | invalid_price | price must be positive |
400 | invalid_tradeurl | Invalid trade URL |
400 | invalid_trade_duration | tradeDurationSeconds out of range |
400 | item_unavailable | Item is no longer for sale |
400 | asset_mismatch | assetId does not match itemId |
400 | price_changed | Price changed. message has the new price |
400 | invalid_global_price | Item can't be bought right now |
400 | duplicate_external_id | externalId already used |
400 | insufficient_balance | price is above total_available |
403 | partner_blocked | Trade URL temporarily blocked after repeated declined or expired offers. message has the unblock time |
403 | too_many_active_trades | Too many open offers to this trade URL. Wait for some to finish |
409 | provider_error | Offer could not be created. You were not charged; you can retry |
Buy item by name
/Items/BuyByNameBuys the cheapest item with this name, up to maxPrice. Pass itemId + assetId to buy a specific one.
Request
{
"market_hash_name": "★ Karambit | Doppler (Factory New)",
"phase": "Phase 4",
"maxPrice": 1500,
"tradeUrl": "https://steamcommunity.com/tradeoffer/new/?partner=123&token=abc",
"externalId": "order_abc123",
"tradeDurationSeconds": 1800
}
| Field | Type | Required | Description |
|---|---|---|---|
market_hash_name | string | Yes | Market hash name |
maxPrice | integer | Yes | Highest price you accept |
tradeUrl | string | Yes | Recipient's trade URL |
phase | string | No | Doppler phase |
itemId + assetId | integer, string | No | A specific item. Send both or neither |
externalId | string | No | Your order id, unique |
tradeDurationSeconds | integer | No | Offer lifetime, 600 to 43200. Default 1800 |
Response
Same as Buy item by id.
Errors
Same as Buy item by id, plus:
| HTTP | error | Meaning |
|---|---|---|
400 | price_too_high | Cheapest match is above maxPrice |
400 | item_unavailable | No match on sale |
Trade history
/Trades/HistoryYour trades, newest first. side is buy for purchases and sell for sales.
Request
| Param | Type | Required | Description |
|---|---|---|---|
side | string | No | all (default), buy or sell |
tradeId | string | No | One trade |
externalId | string | No | Your order id |
status | string | No | Trade status |
webhookStatus | string | No | sent or failed |
from, to | string | No | Created time range |
isActive | string | No | true: all trades of the last 14 days, no paging |
limit, page | integer | No | Paging |
Response
{
"trades": [
{
"tradeId": "tr_1f5469db719615d050a5db3f",
"side": "buy",
"status": "COMPLETED",
"stage": 2,
"price": 1500,
"itemId": 123,
"assetId": "12345678901",
"market_hash_name": "★ Karambit | Doppler (Factory New)",
"phase": "Phase 4",
"float": 0.031245,
"offerId": "5678901234",
"tradeUrl": "https://steamcommunity.com/tradeoffer/new/?partner=123&token=abc",
"failReason": null,
"errorCode": null,
"createdAt": "2026-01-01T12:00:00.000Z",
"updatedAt": "2026-01-01T12:05:00.000Z",
"completedAt": "2026-01-01T12:05:00.000Z",
"cancelledAt": null,
"endProtection": "2026-01-09T12:05:00.000Z",
"rollbackAt": null,
"externalId": "order_abc123",
"webhookStatus": "sent",
"accountUsername": null,
"steamId": null
},
{
"tradeId": "tr_29805007e535238790cff3df",
"side": "sell",
"status": "COMPLETED",
"stage": 1,
"price": 1900,
"itemId": 456,
"assetId": "22345678901",
"market_hash_name": "AK-47 | Redline (Field-Tested)",
"phase": null,
"float": 0.1523,
"offerId": "5678901235",
"tradeUrl": "https://steamcommunity.com/tradeoffer/new/?partner=456&token=def",
"failReason": null,
"errorCode": null,
"createdAt": "2026-01-02T09:00:00.000Z",
"updatedAt": "2026-01-02T09:04:00.000Z",
"completedAt": "2026-01-02T09:04:00.000Z",
"cancelledAt": null,
"endProtection": "2026-01-10T09:04:00.000Z",
"rollbackAt": null,
"externalId": null,
"webhookStatus": null,
"accountUsername": "bot1",
"steamId": "76561198012345678"
}
],
"total": 150,
"limit": 50,
"page": 1
}
All rows have the same fields. Fields that don't apply to a row's side are null.
| Field | Type | Description |
|---|---|---|
tradeId | string | Trade id |
side | string | buy or sell |
status | string | Trade status |
stage | integer | 1: can still be reversed on Steam. 2: final |
price | integer | Buy: amount paid. Sell: amount received |
itemId, assetId, market_hash_name, phase, float | mixed | The item |
offerId | string|null | Steam trade offer id |
tradeUrl | string | Recipient's trade URL |
failReason, errorCode | string|null, integer|null | See error codes |
createdAt, updatedAt, completedAt, cancelledAt | string|null | Timestamps |
endProtection | string|null | End of Steam trade protection |
rollbackAt | string|null | When a reversal was refunded (buy) or deducted (sell) |
externalId, webhookStatus | string|null | Buy rows only |
accountUsername | string|null | Sell rows only. Name of the Steam account that sent the item |
steamId | string|null | Sell rows only. Steam id of that account |
Errors
| HTTP | error | Meaning |
|---|---|---|
400 | invalid_request | Invalid side or date range, or a date range with isActive |
Get balance
/Wallet/GetBalanceBalance and withdrawal details.
Request
No parameters.
Response
{
"balance": 120000,
"credit_limit": 0,
"total_available": 120000,
"on_hold": 45000,
"withdrawable": 40000,
"pending_withdraw": 20000,
"min_withdraw": 10000,
"payout_address": "0x52908400098527886E0F7030069857D2E4169EE7",
"payout_method": "USDT_BEP20"
}
| Field | Type | Description |
|---|---|---|
balance | integer | Spendable balance. Negative when using credit |
credit_limit | integer | Credit limit |
total_available | integer | The most you can spend |
on_hold | integer | Sales still under Steam trade protection |
withdrawable | integer | Amount you can withdraw now. Deposits can't be withdrawn |
pending_withdraw | integer | Requested withdrawals not yet paid |
min_withdraw | integer|null | Minimum withdrawal for your payout wallet |
payout_address, payout_method | string|null | Payout wallet set in the portal. Method is USDT_BEP20 or USDC_ERC20. null if not set |
Balance history
/Wallet/BalanceHistoryWallet ledger, newest first.
Request
| Param | Type | Required | Description |
|---|---|---|---|
category | string | No | buy, sell or wallet |
type | string | No | Entry type. Repeat for several |
tradeId | string | No | Trade id |
from, to | string | No | Created time range |
limit, page | integer | No | Paging |
Entry types
| type | category | Meaning |
|---|---|---|
FREEZE | buy | Purchase placed |
BUY COMPLETED | buy | Purchase delivered |
BUY CANCELLED | buy | Purchase not completed, refunded |
TRADE ROLLBACK | buy | Purchase reversed on Steam, refunded |
ITEM SOLD | sell | Sale delivered, added to on_hold |
HOLD RELEASED | sell | Trade protection ended, moved to balance |
SALE ROLLBACK | sell | Sale reversed on Steam, deducted |
CRYPTO DEPOSIT | wallet | Crypto deposit |
ADMIN TOP UP | wallet | Manual credit |
ADMIN DEDUCT | wallet | Manual debit |
WITHDRAW PENDING | wallet | Withdrawal requested |
WITHDRAW COMPLETED | wallet | Withdrawal paid |
WITHDRAW CANCELLED | wallet | Withdrawal cancelled, returned |
Response
{
"transactions": [
{
"id": 1,
"type": "FREEZE",
"category": "buy",
"amount": 1500,
"balanceDelta": -1500,
"onHoldDelta": 0,
"balanceBefore": 120000,
"balanceAfter": 118500,
"onHoldAfter": 45000,
"tradeId": "tr_1f5469db719615d050a5db3f",
"refTxId": null,
"note": null,
"createdAt": "2026-01-01T12:05:00.000Z",
"market_hash_name": "AK-47 | Redline (Field-Tested)",
"phase": null
}
],
"total": 100,
"limit": 50,
"page": 1
}
| Field | Type | Description |
|---|---|---|
id | integer | Entry id |
type, category | string | See entry types |
amount | integer | Amount, always positive |
balanceDelta, onHoldDelta | integer | Change to balance and on_hold |
balanceBefore, balanceAfter | integer | balance before and after |
onHoldAfter | integer | on_hold after |
tradeId | string|null | Related trade |
refTxId | integer|null | Withdrawal entries: id of the original WITHDRAW PENDING |
note | string|null | Note |
createdAt | string | Entry time |
market_hash_name, phase | string|null | Item of the related trade |
Errors
| HTTP | error | Meaning |
|---|---|---|
400 | invalid_request | Invalid category or date range |
Withdraw
/Wallet/WithdrawWithdraws to the payout wallet set in the portal. Send the wallet returned by Get balance.
Request
{
"amount": 20000,
"payout_address": "0x52908400098527886E0F7030069857D2E4169EE7",
"payout_method": "USDT_BEP20"
}
| Field | Type | Required | Description |
|---|---|---|---|
amount | integer | Yes | Between min_withdraw and withdrawable |
payout_address | string | Yes | From Get balance |
payout_method | string | Yes | From Get balance |
Response
{
"id": 4821,
"amount": 20000,
"withdrawable": 20000,
"payout_address": "0x52908400098527886E0F7030069857D2E4169EE7",
"payout_method": "USDT_BEP20"
}
| Field | Type | Description |
|---|---|---|
id | integer | Withdrawal id, as in Balance history |
amount | integer | Amount |
withdrawable | integer | Remaining withdrawable amount |
payout_address, payout_method | string | Destination wallet |
Errors
| HTTP | error | Meaning |
|---|---|---|
400 | invalid_request | Invalid amount or missing wallet |
400 | wallet_not_configured | No payout wallet set |
400 | insufficient_balance | amount is above withdrawable |
409 | wallet_changed | Wallet doesn't match the portal. Call Get balance again |
Webhooks
Set your webhook URL in the portal. We send a POST for trade updates and catalog changes. Respond with 2xx within 10 seconds.
Headers and signature
| Header | Value |
|---|---|
x-webhook-type | trade_updated, item_removed, refresh_catalog or test |
x-signature | Hex HMAC-SHA256 of the raw body, keyed with your API key |
Content-Type | application/json |
expected = HMAC_SHA256(key = api_key, message = raw_body)
valid = timingSafeEqual(expected, headers["x-signature"])
trade_updated
A trade you bought changed status.
{
"tradeId": "tr_1f5469db719615d050a5db3f",
"status": "COMPLETED",
"externalId": "order_abc123",
"offerId": "5678901234",
"failReason": null,
"errorCode": null
}
item_removed
An item is no longer for sale.
{ "itemId": 123 }
refresh_catalog
A new catalog is available. Fetch Get all items on sale and replace your copy.
{ "type": "refresh_catalog" }
test
Sent from Test Webhook in the portal.
{ "event": "test", "message": "Webhook test from BuyCS2 Portal", "timestamp": "2026-01-15T10:30:00.000Z" }
Failed deliveries
Webhooks are paused for a while after repeated failures. To resume right away, send a successful Test Webhook from portal Settings or save your webhook URL again.
WebSocket
Connect to wss://ws.buycs2.com with the same auth headers. Up to 3 connections per merchant; a fourth closes the oldest.
| type | When | Payload |
|---|---|---|
connected | Connection accepted | merchantId |
trade_updated | A trade you bought changed status | tradeId, status, externalId, offerId, failReason, errorCode |
item_removed | Items no longer for sale | itemIds |
item_upserted | Items added or updated | items, as in Get all items on sale |
price_changed | Prices changed | items: itemId, price |
{ "type": "connected", "merchantId": "merchant_2c4fb27b5b98f6d7" }
{ "type": "trade_updated", "tradeId": "tr_1f5469db719615d050a5db3f", "status": "COMPLETED", "externalId": "order_abc123", "offerId": "5678901234", "failReason": null, "errorCode": null }
{ "type": "item_removed", "itemIds": [123, 456] }
{ "type": "item_upserted", "items": [ { "itemId": 123, "assetId": "12345678901", "price": 1500, "market_hash_name": "AK-47 | Redline (Field-Tested)", "...": "all catalog fields" } ] }
{ "type": "price_changed", "items": [ { "itemId": 123, "price": 1300 } ] }
Trade statuses
| status | Meaning |
|---|---|
PENDING | Offer being created |
SENT | Offer sent, waiting for the recipient |
COMPLETED | Item delivered |
CANCELLED | Declined, countered, or item no longer available |
FAILED | Steam error or recipient can't trade |
EXPIRED | Not accepted in time |
REVERSED | Completed trade reversed on Steam |
You pay only for COMPLETED trades. CANCELLED, FAILED and EXPIRED trades are not charged, and REVERSED trades are refunded in full.
Error codes and fail reasons
Match on errorCode. failReason is display text.
| status | errorCode | failReason | Meaning |
|---|---|---|---|
COMPLETED | null | null | Delivered |
EXPIRED | 503 | Trade offer expired | Not accepted in time |
CANCELLED | 504 | Trade declined by user | Recipient declined |
CANCELLED | 505 | Items no longer valid | Item no longer available |
CANCELLED | 506 | Trade countered | Recipient countered the offer |
FAILED | 500 | Raw Steam error | General Steam error |
REVERSED | 512 | Seller reversed trade on Steam | Reversed by the sender |
REVERSED | 512 | Buyer reversed trade on Steam | Reversed by the recipient |
Changelog
2026-11-27
GET /Items/GetAllItemsOnSaleis limited to 5 requests per minute. Every other endpoint is limited to 120.
2026-10-04
- Added the
refresh_catalogwebhook. - Added the WebSocket at
wss://ws.buycs2.com.
2026-09-18
GET /Trades/HistoryandGET /Wallet/BalanceHistory: addedfromandto.
2026-09-12
REVERSEDtrades:failReasonshows who reversed the trade.
2026-08-20
GET /Trades/History: addedstage.REVERSEDtrades are refunded in full.