P2P Trades

To allow your users to trade their WAX ExpressTrade inventory from your app, you’ll need to use WAX All Access to authorize users and get a bearer token. Refer to OAuth Quickstart for more information.

Note: The SendOffer endpoint only allows trades from the authorized user (your API key for your items, or a bearer token for a user's items). If you try to use your API key to send items from another user's inventory, you'll receive the following message: "You have provided items (896091) that do not belong to you (6434082) in items_to_send."

To enable P2P trading:

  1. From your app, authorize User 1 and User 2 using WAX All Access. Refer to OAuth Quickstart for more information.

    Note: To use the WAX ExpressTrade OAuth endpoints, you might want to consider the following OAuth Scopes: identity, trades, trades_no_2fa.
  2. Get User Profiles, Get User Trade Inventory, and Get Trade URLs for User 1 and User 2 using their unique bearer tokens.

    
    curl -X GET \
      'https://api-trade.wax-sandbox.com/IUser/GetInventory/v2?app_id=1' \
      -H 'Authorization: Bearer 452589dfgghhjjkl4885521236985' \
      -H 'cache-control: no-cache' 
    
  3. Get Trade Inventory for User 1 and User 2. You can present this inventory from your app and allow users to select the items they’d like to trade.

  4. Allow User 1 or User 2 to send a trade offer using the SendOffer endpoint. For example, User 1 wants to trade item 984414 for User 2’s item 755146.

    
    curl -X GET \
      https://api-trade.wax-sandbox.com/ITrade/SendOffer/v2 \
      -H 'Authorization: Bearer 452589dfgghhjjkl4885521236985' \
      -H 'cache-control: no-cache' \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      --data-urlencode "items_to_send=984414" \
      --data-urlencode "items_to_receive=755146" \
      --data-urlencode "trade_url=https://trade.wax-sandbox.com/t/6434081/wi51dBJ1" \
      --data-urlencode "message=Let's make a trade."
    
  5. Get the offer status. Refer to Get Trade Offers for more information.