Trading - Cancel Trade
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).
POST https://titleId.playfabapi.com/Client/CancelTrade
Request Header
| Name | Required | Type | Description |
|---|---|---|---|
| X-Authorization | True |
string |
This API requires a client session ticket, available from any Client Login function. |
Request Body
| Name | Required | Type | Description |
|---|---|---|---|
| TradeId | True |
string |
Trade identifier. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK | ||
| 400 Bad Request |
This is the outer wrapper for all responses with errors |
Security
X-Authorization
This API requires a client session ticket, available from any Client Login function.
Type:
apiKey
In:
header
Definitions
| Name | Description |
|---|---|
|
Api |
The basic wrapper around every failed API response |
|
Cancel |
|
|
Cancel |
|
|
Trade |
|
|
Trade |
ApiErrorWrapper
The basic wrapper around every failed API response
| Name | Type | Description |
|---|---|---|
| code |
integer |
Numerical HTTP code |
| error |
string |
Playfab error code |
| errorCode |
integer |
Numerical PlayFab error code |
| errorDetails |
object |
Detailed description of individual issues with the request object |
| errorMessage |
string |
Description for the PlayFab errorCode |
| status |
string |
String HTTP code |
CancelTradeRequest
| Name | Type | Description |
|---|---|---|
| TradeId |
string |
Trade identifier. |
CancelTradeResponse
| Name | Type | Description |
|---|---|---|
| Trade |
Details about trade which was just canceled. |
TradeInfo
| Name | Type | Description |
|---|---|---|
| AcceptedInventoryInstanceIds |
string[] |
Item instances from the accepting player that are used to fulfill the trade. If null, no one has accepted the trade. |
| AcceptedPlayerId |
string |
The PlayFab ID of the player who accepted the trade. If null, no one has accepted the trade. |
| AllowedPlayerIds |
string[] |
An optional list of players allowed to complete this trade. If null, anybody can complete the trade. |
| CancelledAt |
string |
If set, The UTC time when this trade was canceled. |
| FilledAt |
string |
If set, The UTC time when this trade was fulfilled. |
| InvalidatedAt |
string |
If set, The UTC time when this trade was made invalid. |
| OfferedCatalogItemIds |
string[] |
The catalogItem Ids of the item instances being offered. |
| OfferedInventoryInstanceIds |
string[] |
The itemInstance Ids that are being offered. |
| OfferingPlayerId |
string |
The PlayFabId for the offering player. |
| OpenedAt |
string |
The UTC time when this trade was created. |
| RequestedCatalogItemIds |
string[] |
The catalogItem Ids requested in exchange. |
| Status |
Describes the current state of this trade. |
|
| TradeId |
string |
The identifier for this trade. |
TradeStatus
| Value | Description |
|---|---|
| Invalid | |
| Opening | |
| Open | |
| Accepting | |
| Accepted | |
| Filled | |
| Cancelled |
Error Codes
| Name | Code |
|---|---|
| TradeAlreadyFilled | 1163 |
| TradeCancelled | 1162 |
| TradeDoesNotExist | 1161 |
| TradeStatusNotValidForCancelling | 1159 |
| TradeWaitForStatusTimeout | 1164 |