Documentation

CancelTrade

Cancels an open trade (one that has not yet been accepted or cancelled). Note that only the player who created the trade can cancel it via this API call, to prevent griefing of the trade system (cancelling trades in order to prevent other players from accepting them, for trades that can be claimed by more than one player).

Request Details

CancelTradeRequest
Request Properties
TradeId (required) String

Trade identifier.

POST https://{{TitleID}}.playfabapi.com/Client/CancelTrade
    Content-Type: application/json
    X-Authentication: <user_session_ticket_value>
{
  "TradeId": "D819CEC225EA9948C351"
}
        

Response Details

CancelTradeResponse
Result Properties
Trade TradeInfo

Details about trade which was just canceled.

Sample Response

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

Authentication

SessionTicket

Possible Error Codes

Name Code
TradeAlreadyFilled 1163
TradeCancelled 1162
TradeStatusNotValidForCancelling 1159
TradeWaitForStatusTimeout 1164