Documentation

AcceptTrade

Accepts an open trade (one that has not yet been accepted or cancelled), if the locally signed-in player is in the allowed player list for the trade, or it is open to all players. If the call is successful, the offered and accepted items will be swapped between the two players' inventories.

Request Details

AcceptTradeRequest
Request Properties
AcceptedInventoryInstanceIds List<String>

Items from the accepting player's inventory in exchange for the offered items in the trade. In the case of a gift, this will be null.

OfferingPlayerId (required) String

Player who opened the trade.

TradeId (required) String

Trade identifier.

POST https://{{TitleID}}.playfabapi.com/Client/AcceptTrade
    Content-Type: application/json
    X-Authentication: <user_session_ticket_value>
{
  "OfferingPlayerId": "CD803BF233CE76CC",
  "TradeId": "D819CEC225EA9948C351",
  "AcceptedInventoryInstanceIds": [
    "95C1797ADDAC24DC0383",
    "0F7793DF55CCEAF21B84"
  ]
}
        

Response Details

AcceptTradeResponse
Result Properties
Trade TradeInfo

Details about trade which was just accepted.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "Trade": {
      "Status": "Filled",
      "TradeId": "D819CEC225EA9948C351",
      "OfferingPlayerId": "CD803BF233CE76CC",
      "OfferedInventoryInstanceIds": [
        "1359447",
        "635691"
      ],
      "OfferedCatalogItemIds": [
        "gun_1",
        "skin_3"
      ],
      "RequestedCatalogItemIds": [
        "rare_hat_7"
      ],
      "AcceptedPlayerId": "461535E1EF4150A86889",
      "AcceptedInventoryInstanceIds": [
        "95C1797ADDAC24DC0383",
        "0F7793DF55CCEAF21B84"
      ],
      "OpenedAt": "2015-04-07T09:04:28Z",
      "FilledAt": "2015-04-07T09:20:53Z"
    }
  }
}

Authentication

SessionTicket

Possible Error Codes

Name Code
TradeAcceptedCatalogItemInvalid 1170
TradeAcceptedItemsMismatch 1175
TradeAcceptingUserNotAllowed 1156
TradeAllowedUsersInvalid 1171
TradeAlreadyFilled 1163
TradeCancelled 1162
TradeDoesNotExist 1161
TradeInventoryItemDoesNotExist 1172
TradeInventoryItemExpired 1165
TradeInventoryItemInvalidStatus 1169
TradeInventoryItemIsAssignedToCharacter 1157
TradeInventoryItemIsBundle 1158
TradeInventoryItemIsConsumed 1173
TradeInventoryItemIsStackable 1174
TradeStatusNotValidForAccepting 1160
TradeWaitForStatusTimeout 1164