Trading - Open Trade

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

POST https://titleId.playfabapi.com/Client/OpenTrade

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 Type Description
AllowedPlayerIds

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

string[]

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

RequestedCatalogItemIds

string[]

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

Responses

Name Type Description
200 OK

OpenTradeResponse

400 Bad Request

ApiErrorWrapper

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
ApiErrorWrapper

The basic wrapper around every failed API response

OpenTradeRequest
OpenTradeResponse
TradeInfo
TradeStatus

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

OpenTradeRequest

Name Type Description
AllowedPlayerIds

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

string[]

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

RequestedCatalogItemIds

string[]

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

OpenTradeResponse

Name Type Description
Trade

TradeInfo

The information about the trade that was just opened.

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

TradeStatus

Describes the current state of this trade.

TradeId

string

The identifier for this trade.

TradeStatus

Name Type Description
Accepted

string

Accepting

string

Cancelled

string

Filled

string

Invalid

string

Open

string

Opening

string

Error Codes

Name Code
TradeAcceptedCatalogItemInvalid 1170
TradeAcceptedCatalogItemIsNotTradable 1182
TradeAcceptedItemIsBundle 1167
TradeAllowedUsersInvalid 1171
TradeInventoryItemDoesNotExist 1172
TradeInventoryItemExpired 1165
TradeInventoryItemInvalidStatus 1169
TradeInventoryItemIsAssignedToCharacter 1157
TradeInventoryItemIsBundle 1158
TradeInventoryItemIsConsumed 1173
TradeInventoryItemIsNotTradable 1181
TradeInventoryItemIsStackable 1174
TradeMissingOfferedAndAcceptedItems 1166
TradeWaitForStatusTimeout 1164