BuyCS2 Merchant API

REST API for the catalog, purchases, trade history and your wallet.

Ask for API access

Base URL and auth

Base URLhttps://api.buycs2.com
Authx-merchant-id and x-api-key headers, both from the merchant portal
FormatJSON. Send Accept-Encoding: gzip
MoneyUSD cents. 1500 = $15.00
TimeISO 8601 UTC
Paginglimit (default 50, max 500) and page. Lists return total
Example request
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 body
{ "error": "invalid_request", "message": "Missing required fields: itemId, assetId, price, tradeUrl" }
HTTPerrorMeaning
400invalid_requestMissing or invalid parameters
401unauthorizedInvalid credentials or inactive account
403ip_not_allowedRequest IP is not in your allowlist
404not_foundUnknown endpoint, or auth headers missing
429rate_limit_exceededRate limit reached. See retryAfter (seconds)
500internal_errorServer error. Retry later
503maintenance, service_unavailableTemporarily unavailable. Retry later

Rate limits

Each endpoint has its own limit per minute. Reaching the limit on one endpoint leaves the others available.

EndpointRequests per minute
GET /Items/GetAllItemsOnSale5
Every other endpoint120

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

GET/Items/GetAllItemsOnSale

Full catalog with current prices. Use WebSocket events or the refresh_catalog webhook to keep a local copy up to date.

Request

No parameters.

Response

200 OK
{
  "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
    }
  ]
}
FieldTypeDescription
totalItemsintegerItem count
totalValueintegerSum of prices
lastUpdatestringCatalog time
itemIdintegerItem id
assetIdstringSteam asset id
classId, instanceIdstringSteam class and instance ids
paintIndex, paintSeedinteger|nullPaint index and seed
rarityColorstring|nullRarity color, hex
market_hash_namestringMarket hash name
imgstring|nullImage URL
phasestring|nullDoppler phase
priceintegerPrice
floatnumber|nullFloat value
stickersarrayStickers and patches: name, img, slot, wear, wearPercent, rotation, offsetX, offsetY
keyChainsarrayCharms: name, img, slot, pattern, offsetX, offsetY, offsetZ
steamId, inspectInGamestring|nullHolder Steam id and inspect link, if enabled for your account
tradeUrlstring|nullHolder trade URL, if enabled for your account
sourceIdintegerStock source group

Errors

HTTPerrorMeaning
429rate_limit_exceededMore than 5 calls per minute
503catalog_unavailableCatalog not ready. Retry shortly

Search items

POST/Items/SearchItems

Look up items by name or id. Send one of the two fields.

Request

By name
{ "market_hash_name": ["AK-47 | Redline (Field-Tested)", "★ Karambit | Doppler (Factory New)"] }
By item id
{ "itemId": [12345, 67890] }
FieldTypeRequiredDescription
market_hash_namestring[]One ofUp to 10 names
itemIdinteger[]One ofUp to 500 ids

Response

Same as Get all items on sale, without lastUpdate. Items not on sale are left out.

Errors

HTTPerrorMeaning
400invalid_requestBoth or neither field, empty list, or invalid id

Buy item by id

POST/Items/Buy

Buys 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

Body
{
  "itemId": 123,
  "assetId": "12345678901",
  "price": 1500,
  "tradeUrl": "https://steamcommunity.com/tradeoffer/new/?partner=123&token=abc",
  "externalId": "order_abc123",
  "tradeDurationSeconds": 1800
}
FieldTypeRequiredDescription
itemIdintegerYesItem id
assetIdstringYesAsset id of that item
priceintegerYesExpected price. Must equal the current price
tradeUrlstringYesRecipient's trade URL
externalIdstringNoYour order id, unique
tradeDurationSecondsintegerNoOffer lifetime, 600 to 43200. Default 1800

Response

200 OK
{
  "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"
}
FieldTypeDescription
tradeIdstringTrade id
tradeUrl, assetIdstringFrom the request
market_hash_name, phase, floatstring, string|null, number|nullThe item
priceintegerPrice
externalIdstring|nullYour order id

Errors

HTTPerrorMeaning
400invalid_requestMissing field
400invalid_priceprice must be positive
400invalid_tradeurlInvalid trade URL
400invalid_trade_durationtradeDurationSeconds out of range
400item_unavailableItem is no longer for sale
400asset_mismatchassetId does not match itemId
400price_changedPrice changed. message has the new price
400invalid_global_priceItem can't be bought right now
400duplicate_external_idexternalId already used
400insufficient_balanceprice is above total_available
403partner_blockedTrade URL temporarily blocked after repeated declined or expired offers. message has the unblock time
403too_many_active_tradesToo many open offers to this trade URL. Wait for some to finish
409provider_errorOffer could not be created. You were not charged; you can retry

Buy item by name

POST/Items/BuyByName

Buys the cheapest item with this name, up to maxPrice. Pass itemId + assetId to buy a specific one.

Request

Body
{
  "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
}
FieldTypeRequiredDescription
market_hash_namestringYesMarket hash name
maxPriceintegerYesHighest price you accept
tradeUrlstringYesRecipient's trade URL
phasestringNoDoppler phase
itemId + assetIdinteger, stringNoA specific item. Send both or neither
externalIdstringNoYour order id, unique
tradeDurationSecondsintegerNoOffer lifetime, 600 to 43200. Default 1800

Response

Same as Buy item by id.

Errors

Same as Buy item by id, plus:

HTTPerrorMeaning
400price_too_highCheapest match is above maxPrice
400item_unavailableNo match on sale

Trade history

GET/Trades/History

Your trades, newest first. side is buy for purchases and sell for sales.

Request

ParamTypeRequiredDescription
sidestringNoall (default), buy or sell
tradeIdstringNoOne trade
externalIdstringNoYour order id
statusstringNoTrade status
webhookStatusstringNosent or failed
from, tostringNoCreated time range
isActivestringNotrue: all trades of the last 14 days, no paging
limit, pageintegerNoPaging

Response

200 OK
{
  "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.

FieldTypeDescription
tradeIdstringTrade id
sidestringbuy or sell
statusstringTrade status
stageinteger1: can still be reversed on Steam. 2: final
priceintegerBuy: amount paid. Sell: amount received
itemId, assetId, market_hash_name, phase, floatmixedThe item
offerIdstring|nullSteam trade offer id
tradeUrlstringRecipient's trade URL
failReason, errorCodestring|null, integer|nullSee error codes
createdAt, updatedAt, completedAt, cancelledAtstring|nullTimestamps
endProtectionstring|nullEnd of Steam trade protection
rollbackAtstring|nullWhen a reversal was refunded (buy) or deducted (sell)
externalId, webhookStatusstring|nullBuy rows only
accountUsernamestring|nullSell rows only. Name of the Steam account that sent the item
steamIdstring|nullSell rows only. Steam id of that account

Errors

HTTPerrorMeaning
400invalid_requestInvalid side or date range, or a date range with isActive

Get balance

GET/Wallet/GetBalance

Balance and withdrawal details.

Request

No parameters.

Response

200 OK
{
  "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"
}
FieldTypeDescription
balanceintegerSpendable balance. Negative when using credit
credit_limitintegerCredit limit
total_availableintegerThe most you can spend
on_holdintegerSales still under Steam trade protection
withdrawableintegerAmount you can withdraw now. Deposits can't be withdrawn
pending_withdrawintegerRequested withdrawals not yet paid
min_withdrawinteger|nullMinimum withdrawal for your payout wallet
payout_address, payout_methodstring|nullPayout wallet set in the portal. Method is USDT_BEP20 or USDC_ERC20. null if not set

Balance history

GET/Wallet/BalanceHistory

Wallet ledger, newest first.

Request

ParamTypeRequiredDescription
categorystringNobuy, sell or wallet
typestringNoEntry type. Repeat for several
tradeIdstringNoTrade id
from, tostringNoCreated time range
limit, pageintegerNoPaging

Entry types

typecategoryMeaning
FREEZEbuyPurchase placed
BUY COMPLETEDbuyPurchase delivered
BUY CANCELLEDbuyPurchase not completed, refunded
TRADE ROLLBACKbuyPurchase reversed on Steam, refunded
ITEM SOLDsellSale delivered, added to on_hold
HOLD RELEASEDsellTrade protection ended, moved to balance
SALE ROLLBACKsellSale reversed on Steam, deducted
CRYPTO DEPOSITwalletCrypto deposit
ADMIN TOP UPwalletManual credit
ADMIN DEDUCTwalletManual debit
WITHDRAW PENDINGwalletWithdrawal requested
WITHDRAW COMPLETEDwalletWithdrawal paid
WITHDRAW CANCELLEDwalletWithdrawal cancelled, returned

Response

200 OK
{
  "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
}
FieldTypeDescription
idintegerEntry id
type, categorystringSee entry types
amountintegerAmount, always positive
balanceDelta, onHoldDeltaintegerChange to balance and on_hold
balanceBefore, balanceAfterintegerbalance before and after
onHoldAfterintegeron_hold after
tradeIdstring|nullRelated trade
refTxIdinteger|nullWithdrawal entries: id of the original WITHDRAW PENDING
notestring|nullNote
createdAtstringEntry time
market_hash_name, phasestring|nullItem of the related trade

Errors

HTTPerrorMeaning
400invalid_requestInvalid category or date range

Withdraw

POST/Wallet/Withdraw

Withdraws to the payout wallet set in the portal. Send the wallet returned by Get balance.

Request

Body
{
  "amount": 20000,
  "payout_address": "0x52908400098527886E0F7030069857D2E4169EE7",
  "payout_method": "USDT_BEP20"
}
FieldTypeRequiredDescription
amountintegerYesBetween min_withdraw and withdrawable
payout_addressstringYesFrom Get balance
payout_methodstringYesFrom Get balance

Response

200 OK
{
  "id": 4821,
  "amount": 20000,
  "withdrawable": 20000,
  "payout_address": "0x52908400098527886E0F7030069857D2E4169EE7",
  "payout_method": "USDT_BEP20"
}
FieldTypeDescription
idintegerWithdrawal id, as in Balance history
amountintegerAmount
withdrawableintegerRemaining withdrawable amount
payout_address, payout_methodstringDestination wallet

Errors

HTTPerrorMeaning
400invalid_requestInvalid amount or missing wallet
400wallet_not_configuredNo payout wallet set
400insufficient_balanceamount is above withdrawable
409wallet_changedWallet 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

HeaderValue
x-webhook-typetrade_updated, item_removed, refresh_catalog or test
x-signatureHex HMAC-SHA256 of the raw body, keyed with your API key
Content-Typeapplication/json
Verify
expected = HMAC_SHA256(key = api_key, message = raw_body)
valid = timingSafeEqual(expected, headers["x-signature"])

trade_updated

A trade you bought changed status.

Body
{
  "tradeId": "tr_1f5469db719615d050a5db3f",
  "status": "COMPLETED",
  "externalId": "order_abc123",
  "offerId": "5678901234",
  "failReason": null,
  "errorCode": null
}

item_removed

An item is no longer for sale.

Body
{ "itemId": 123 }

refresh_catalog

A new catalog is available. Fetch Get all items on sale and replace your copy.

Body
{ "type": "refresh_catalog" }

test

Sent from Test Webhook in the portal.

Body
{ "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.

typeWhenPayload
connectedConnection acceptedmerchantId
trade_updatedA trade you bought changed statustradeId, status, externalId, offerId, failReason, errorCode
item_removedItems no longer for saleitemIds
item_upsertedItems added or updateditems, as in Get all items on sale
price_changedPrices changeditems: itemId, price
Frames
{ "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

statusMeaning
PENDINGOffer being created
SENTOffer sent, waiting for the recipient
COMPLETEDItem delivered
CANCELLEDDeclined, countered, or item no longer available
FAILEDSteam error or recipient can't trade
EXPIREDNot accepted in time
REVERSEDCompleted 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.

statuserrorCodefailReasonMeaning
COMPLETEDnullnullDelivered
EXPIRED503Trade offer expiredNot accepted in time
CANCELLED504Trade declined by userRecipient declined
CANCELLED505Items no longer validItem no longer available
CANCELLED506Trade counteredRecipient countered the offer
FAILED500Raw Steam errorGeneral Steam error
REVERSED512Seller reversed trade on SteamReversed by the sender
REVERSED512Buyer reversed trade on SteamReversed by the recipient

Changelog

2026-11-27

  • GET /Items/GetAllItemsOnSale is limited to 5 requests per minute. Every other endpoint is limited to 120.

2026-10-04

  • Added the refresh_catalog webhook.
  • Added the WebSocket at wss://ws.buycs2.com.

2026-09-18

  • GET /Trades/History and GET /Wallet/BalanceHistory: added from and to.

2026-09-12

  • REVERSED trades: failReason shows who reversed the trade.

2026-08-20

  • GET /Trades/History: added stage.
  • REVERSED trades are refunded in full.