STEAMBOTICSDevelopersBack to dashboard

Integration guide

Connect your service, submit a trade and follow its full lifecycle. For exact fields and responses, see the Trade API and Management API references.

  1. Connect with a scoped API key
  2. Submit a persisted request
  3. Observe signed webhooks
  4. Reconcile the offer and settlement

Connect your service

An administrator creates a Trade API key under Workspace settings → API keys. Restrict it to the bots your service needs. Keep the key on your backend.

Replace YOUR_API_HOST with your server address. Direct access also requires your source IP to be allowed by the server firewall. All API paths start with /v1.

export BASE_URL="http://YOUR_API_HOST:3001/v1"
export TRADE_API_KEY="YOUR_SCOPED_TRADE_KEY"

curl "$BASE_URL/bots" \
  -H "Authorization: Bearer $TRADE_API_KEY"
Choose a ready bot. Check status: "active", hosted: true and loggedIn: true. Read /bots/{botId}/items?current=true and use present, tradable items in the free state. Steam checks still run when the operation executes.

Bot and offer lists use limit (up to 100) and offset. Partner inventory uses nextAssetId: pass it back as startAssetId until it is absent.

Create an offer

Use real item IDs from the relevant inventory. Supply a reachable webhook URL and at least one item across itemsToGive and itemsToReceive. The example below sends one bot item; replace its IDs and trade token before submitting.

# Generate once and save alongside your order. Reuse for the same request only.
export REQUEST_ID="$(uuidgen)"
export BOT_ID="bot-eu-1"

curl -X POST "$BASE_URL/bots/$BOT_ID/offers" \
  -H "Authorization: Bearer $TRADE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "idempotency-key: $REQUEST_ID" \
  -d '{
    "partnerSteamId": "76561198000000000",
    "tradeToken": "AbCd1234",
    "webhookUrl": "https://your-service.example/steam-events",
    "timeoutSeconds": 120,
    "itemsToGive": [{ "assetId": "53273940796", "amount": 1 }],
    "itemsToReceive": []
  }'

HTTP 202 · Request accepted

{
  "botId": "bot-eu-1",
  "requestId": "550e8400-e29b-41d4-a716-446655440000",
  "offerId": "01997363-9880-7000-8000-000000000001",
  "action": "offer.create",
  "status": "pending"
}
Accepted for processing is not a completed trade. Save the request ID and offer UUID. Never generate a new idempotency key merely because a response timed out. Reusing the original key with the same bot, action and payload lets the service identify the same request.

Steam Guard confirmation is automatic for created offers. One create request sends the offer and confirms it with the bot’s mobile authenticator when required. Delays or restarts resume the same offer; do not call /confirm as a routine second step. That endpoint remains available for manual recovery and incoming-offer confirmations. Steam email confirmation is not automated and is reported as STEAM_CONFIRMATION_REQUIRED.

timeoutSeconds sets the request deadline and the created offer’s cancellation deadline. A pending or uncertain Steam operation still needs reconciliation after a timeout.

Track progress

Poll the stored request while it is pending, running or reconciling. This endpoint reads local state; it does not issue another Steam operation.

curl "$BASE_URL/bots/$BOT_ID/requests/$REQUEST_ID" \
  -H "Authorization: Bearer $TRADE_API_KEY"
Identifier What it identifies
requestId Your idempotency UUID for one operation.
offerId The service’s offer UUID, shared by lifecycle webhooks.
tradeOfferId The Steam offer. Available once Steam has assigned it.
tradeId The Steam exchange after acceptance. Separate from the offer ID.

A successful create request means an offer was submitted and any required mobile confirmation finished. The result has needsConfirmation: false. Continue tracking offer.updated and offer.settlement-updated; acceptance, protection and settlement are separate stages.

Receive signed webhooks

The URL supplied when creating an offer receives lifecycle events. The operator must provide your service with its workspace signing secret through a secure channel. An administrator can reveal it in Workspace settings → Webhooks. Keep it on your backend; it is separate from your Trade API key.

Event Meaning
request.completed An associated operation finished. Inspect status, result and error.
request.attention-required An uncertain operation needs attention. Preserve the original request.
offer.updated The observed Steam offer state changed.
offer.settlement-updated The exchange’s settlement observation changed.
{
  "version": 1,
  "eventId": "550e8400-e29b-41d4-a716-446655440001",
  "type": "offer.updated",
  "botId": "bot-eu-1",
  "offerId": "01997363-9880-7000-8000-000000000001",
  "timestamp": 1790149800000,
  "tradeOfferId": "9341407016",
  "state": 3,
  "previousState": 2,
  "revision": 2
}

Verify before processing

The signature is a hex HMAC-SHA256 over timestamp + "." + rawBody. Read x-webhook-timestamp in milliseconds and x-webhook-signature. Use the unmodified request bytes.

import { createHmac, timingSafeEqual } from 'node:crypto';

// Pass the ORIGINAL request bytes, before JSON parsing.
export function verifyWebhook(rawBody, headers, secret, now = Date.now()) {
  const timestamp = headers.get('x-webhook-timestamp') ?? '';
  const signature = headers.get('x-webhook-signature') ?? '';
  if (!/^\d+$/.test(timestamp) || !/^[a-f0-9]{64}$/.test(signature)) return false;
  const sentAt = Number(timestamp); // milliseconds
  if (!Number.isSafeInteger(sentAt) || Math.abs(now - sentAt) > 300_000) return false;
  const expected = createHmac('sha256', secret)
    .update(timestamp + '.')
    .update(rawBody)
    .digest();
  return timingSafeEqual(expected, Buffer.from(signature, 'hex'));
}
// After verification: parse JSON, deduplicate eventId and persist the event.
// Return 2xx only after durable acceptance; process business effects idempotently.

Delivery is retried on network failures and non-2xx responses. Deduplicate by eventId; do not assume delivery order. For offer events, use revision to prevent an older event from replacing newer state. Use event IDs for deduplication, not timestamps.

Understand states

Request, Steam offer and settlement are three separate states that answer different questions.

Request

Did the requested operation execute?

pending → running → succeeded

reconciling means the bot is verifying the Steam outcome or completing a created offer’s mobile confirmation. rejected and expired describe a failed request, not necessarily an untouched Steam offer.

Steam offer

What does Steam report about the offer?

Active · Accepted · On hold

Offer state 3 is accepted. State 11 is escrow / on hold. Neither is an instruction to mark final settlement complete.

Settlement

Has the exchange passed settlement checks?

trade_protection · completed · reversed

completed requires seven days rounded up to the full UTC hour, a one-minute buffer, and a fresh Steam Complete response for the same trade.

Time alone does not settle a trade. After the rounded CS2 protection window, a successful Steam exchange check must still report Complete. A reversal, pending response or provider error cannot complete the settlement.

Settlement and inventory availability are independent. Exchange assets carry the original sender IDs; use current inventory IDs for outgoing offers. No receiver-ID mapping or matching by item name is required. Legacy verifying records are rechecked automatically after upgrade.

API timestamps use Unix milliseconds. protectionUntil is calculated from the Steam exchange initiation time plus seven days for CS2. It is not an authoritative per-item unlock time. An offer’s local created_at or updated_at can reflect synchronization.

Handle errors

Response Next step
400 · Invalid request Correct the request fields. Check required IDs, item amounts and webhook URL.
401 · Unauthorized Check the Bearer token and whether its key was revoked.
403 · Forbidden Check key scope and bot access. Inventory may also be private; inspect the error code.
404 · Not found Verify the bot and request identifiers. A missing request after a lost response can be retried with its original key and identical payload.
409 · Conflict Check the current resource state and idempotency payload. Do not replace a pending request to bypass the conflict.
429 · Busy or rate limited Back off, honor Retry-After when present, and preserve the same request key.
5xx / connection lost The outcome may be uncertain. Look up the original request before retrying a mutation.