Sync with Waxpeer session to auto-fill API key

How to set up trade websocket

wss://wssex.waxpeer.com

Breaking changes due to Steam API update

Now in order to go online and sell items safely you need to implement the following logic:

  1. Make sure that you have enabled the collection of user data on the website under the "Sell items" tab (by default it is enabled).
  2. Going online now requires a valid Steam access token because the API key functionality has been limited. You need to send it once an hour or immediately after a refresh (the token is active only 24 hours after refreshing in Steam).
  3. We categorically recommend not to make a mobile confirmation for a created trade until you send its trade id using the callback method.
  4. Online may be delayed until the access token is verified. The trade socket has a new user_change event, in which can_p2p indicates whether you are online.
  5. Custom clients must specify the source parameter on the authentification event (auth) without which the account will not be able to get online (example: "source": "myAwesomeProject").

We categorically recommend not to make a mobile confirmation for a created trade until you send its trade id using the callback . If that POST fails, do not confirm.

You can see an example of the implementation steps here.

How to set up trade websocket

  1. Connect to websocket via any websocket library. Such as WS, Socket.IO client for Node.js
  2. Send a ping command once per 25 seconds to keep the connection alive
  3. Send your authentication object command to let our system recognize you
  4. Be ready to react to the following object name events:
    • send-trade (create trade)
    • cancelTrade (cancel trade)
    • accept_withdraw (accept incoming trade)
  5. Don’t forget to confirm trade on mobile
We recommend sending the trade only once

Authentification

You can now go online and sell from limited Steam accounts (Except Rust game). One from STEAM_API, WAX_API, ACCESS_TOKEN is required!

Event parameters

NameTypeDescription
sourcestringyour project name
namestringalways “auth”
steamidstringsteamid64
apiKeystringOPTIONAL. API key of your Steam account
waxAPIstringOPTIONAL. API key of your Waxpeer account
accessTokenstringOPTIONAL. Access token of your Steam account (NOT encoded)
tradeurlstringyour tradelink
Example
{
  "source": "myAwesomeProject",
  "name": "auth",
  "steamid": "76561199059254XXX",
  "apiKey": "54###A171A5C7B08CA287A###228C029",
  "waxApi": "####124b4bd3847e33331f0e49194b9c798f613d5e732d17c4f5823f7f9c6a##",
  "accessToken": "eyAidHlwIjogIkpXVCIsICJhbGciOiAiRWREU0EiIH0.eyAiaXfsd23123123.2B9wKjf2323-S3i3ctdCg",
  "tradeurl": "https://steamcommunity.com/tradeoffer/new/?partner=1234567890&token=asd1-5zF"
}

Ping

Send a ping command once per 25 seconds to keep the connection alive

Event parameters

NameTypeDescription
namestringalways “ping”
Example
{
  "name": "ping"
}

Pong

Event notifying that a ping command has been received

Event parameters

NameTypeDescription
namestringalways “pong”
msgstringalways “1”
Example
{
  "name": "pong",
  "data": {
    "msg": "1"
  }
}

Online change event

Indicates whether you are online or not when it is changed by p2p controller

Event parameters

NameTypeDescription
namestringalways ”user_change”
can_p2pbooleantrue/false
Example
{
  "name": "user_change",
  "data": {
    "can_p2p": true
  }
}

Create trade

Event for trade creation with all necessary data

Event parameters

NameTypeDescription
namestringalways “send-trade”
waxidstringtrade UUID in our system
wax_idstringtrade ID in our system
tradelinkstringSteam partner tradelink
partnerstringSteam partner id64
send_untilstringwhen trade will be canceled on Waxpeer if it has not been created before that time
Example
{
  "name": "send-trade",
  "data": {
    "waxid": "d25s5f63-190s-46b4-8184-b9ec3d326932",
    "wax_id": "1234567",
    "json_tradeoffer": {
      "newversion": true,
      "version": 2,
      "me": {
        "assets": [
          {
            "appid": 730,
            "contextid": "2",
            "amount": 1,
            "assetid": "27509261111"
          }
        ],
        "currency": [],
        "ready": false
      },
      "them": {
        "assets": [
          {
            "appid": 730,
            "contextid": "2",
            "amount": 1,
            "assetid": "27509261111"
          }
        ],
        "currency": [],
        "ready": false
      }
    },
    "tradelink": "https://steamcommunity.com/tradeoffer/new/?partner=1234567890&token=asd1-5zF",
    "partner": "76561199059254XXX",
    "created": "2022-11-02T16:00:59.921Z",
    "now": "2022-11-02T16:01:16.311Z",
    "send_until": "2022-11-02T16:05:59.921Z"
  }
}

After send-trade, POST /v1/steam-trade with the Steam trade id before mobile confirmation. Do not confirm if that POST fails.

Cancel trade

Event for canceling a trade on Waxpeer

This event is mandatory. We reserve the right to cancel a trade on our side if you do not react to this event for a long time

After a recent update STEAM no longer supports trade cancellation via API, so please use https://steamcommunity.com/tradeoffer/TRADE_ID/cancel with cookies

Event parameters

NameTypeDescription
namestringalways “cancelTrade”
seller_steamidstringseller Steam id64
trade_idstringSteam trade ID to be canceled
Example
{
  "name": "cancelTrade",
  "data": {
    "trade_id": "5521581234",
    "seller_steamid": "76561199059254XXX"
  }
}

Accept withdraw

Event for accepting incoming withdrawal trade from Waxpeer

Event parameters

NameTypeDescription
namestringalways “accept_withdraw”
seller_steamidstringseller Steam id64
trade_idstringSteam trade ID to be canceled
Example
{
  "name": "accept_withdraw",
  "data": {
    "tradeid": "5521581234",
    "partner": "76561199059254XXX"
  }
}

Socket.IO

Socket.IO is a JavaScript library that enables real-time, bidirectional communication between the server and the client. Website events (new listings, wallet, steamTrade) use wss://waxpeer.com/socket.io/?EIO=4&transport=websocket. Trade sending uses the trade websocket above, not Socket.IO.

For full documentation on subscribing to game item events, wallet changes, Steam trade updates, and payments, see the dedicated Socket.IO Guide.