Documentation

OpenTrade

Opens a new outstanding trade. Note that a given item instance may only be in one open trade at a time.

Request Details

OpenTradeRequest
Request Properties
AllowedPlayerIds List<String>

Players who are allowed to accept the trade. If null, the trade may be accepted by any player. If empty, the trade may not be accepted by any player.

OfferedInventoryInstanceIds List<String>

Player inventory items offered for trade. If not set, the trade is effectively a gift request

RequestedCatalogItemIds List<String>

Catalog items accepted for the trade. If not set, the trade is effectively a gift.

POST https://{{TitleID}}.playfabapi.com/Client/OpenTrade
    Content-Type: application/json
    X-Authentication: <user_session_ticket_value>
{
  "OfferedInventoryInstanceIds": [
    "1359447",
    "635691"
  ],
  "RequestedCatalogItemIds": [
    "rare_hat_7"
  ]
}
        

Response Details

OpenTradeResponse
Result Properties
Trade TradeInfo

The information about the trade that was just opened.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "Trade": {
      "Status": "Opening",
      "TradeId": "D819CEC225EA9948C351",
      "OfferingPlayerId": "CD803BF233CE76CC",
      "OfferedInventoryInstanceIds": [
        "1359447",
        "635691"
      ],
      "RequestedCatalogItemIds": [
        "rare_hat_7"
      ],
      "OpenedAt": "2015-04-07T09:04:28Z"
    }
  }
}

Authentication

SessionTicket

Possible Error Codes

Name Code
TradeAcceptedCatalogItemInvalid 1170
TradeAllowedUsersInvalid 1171
TradeInventoryItemDoesNotExist 1172
TradeInventoryItemExpired 1165
TradeInventoryItemInvalidStatus 1169
TradeInventoryItemIsAssignedToCharacter 1157
TradeInventoryItemIsBundle 1158
TradeInventoryItemIsConsumed 1173
TradeInventoryItemIsStackable 1174