Steam Web API/IEconService: Difference between revisions
Tony Paloma (talk | contribs) (→ETradeOfferState: Proper enum names. Added k_ETradeOfferStateInEscrow) |
Tony Paloma (talk | contribs) m (→ETradeOfferState: grammar: partys' -> parties') |
||
Line 28: | Line 28: | ||
| k_ETradeOfferStateCanceledBySecondFactor || 10 || '''Either party''' canceled the offer via email/mobile. The offer is visible to both parties, even if the sender canceled it before it was sent. | | k_ETradeOfferStateCanceledBySecondFactor || 10 || '''Either party''' canceled the offer via email/mobile. The offer is visible to both parties, even if the sender canceled it before it was sent. | ||
|- | |- | ||
| k_ETradeOfferStateInEscrow || 11 || The trade has been placed on hold. The items involved in the trade have all been removed from both | | k_ETradeOfferStateInEscrow || 11 || The trade has been placed on hold. The items involved in the trade have all been removed from both parties' inventories and will be automatically delivered in the future. | ||
|} | |} | ||
Revision as of 15:27, 30 November 2015
The IEconService interface provides methods related to inventory and trading. See the Steam Web API page for more information about Web APIs.
Common Values
ETradeOfferState
These are the different states for a trade offer:
Name | Value | Comment |
k_ETradeOfferStateInvalid | 1 | Invalid |
k_ETradeOfferStateActive | 2 | This trade offer has been sent, neither party has acted on it yet. |
k_ETradeOfferStateAccepted | 3 | The trade offer was accepted by the recipient and items were exchanged. |
k_ETradeOfferStateCountered | 4 | The recipient made a counter offer |
k_ETradeOfferStateExpired | 5 | The trade offer was not accepted before the expiration date |
k_ETradeOfferStateCanceled | 6 | The sender cancelled the offer |
k_ETradeOfferStateDeclined | 7 | The recipient declined the offer |
k_ETradeOfferStateInvalidItems | 8 | Some of the items in the offer are no longer available (indicated by the missing flag in the output) |
k_ETradeOfferStateCreatedNeedsConfirmation | 9 | The offer hasn't been sent yet and is awaiting email/mobile confirmation. The offer is only visible to the sender. |
k_ETradeOfferStateCanceledBySecondFactor | 10 | Either party canceled the offer via email/mobile. The offer is visible to both parties, even if the sender canceled it before it was sent. |
k_ETradeOfferStateInEscrow | 11 | The trade has been placed on hold. The items involved in the trade have all been removed from both parties' inventories and will be automatically delivered in the future. |
CEcon_Asset
- appid
- contextid
- assetid - either assetid or currencyid will be set
- currencyid - either assetid or currencyid will be set
- classid - together with instanceid, uniquely identifies the display of the item
- instanceid - together with classid, uniquely identifies the display of the item
- amount - the amount offered in the trade, for stackable items and currency
- missing - a boolean that indicates the item is no longer present in the user's inventory
CEcon_TradeOffer
Both GetTradeOffers and GetTradeOffer return this structure:
- tradeofferid - a unique identifier for the trade offer
- accountid_other - your partner in the trade offer
- message - a message included by the creator of the trade offer
- expiration_time - unix time when the offer will expire (or expired, if it is in the past)
- trade_offer_state - see ETradeOfferState above
- items_to_give - array of CEcon_Asset, items you will give up in the trade (regardless of who created the offer)
- items_to_receive - array of CEcon_Asset, items you will receive in the trade (regardless of who created the offer)
- is_our_offer - boolean to indicate this is an offer you created.
- time_created - unix timestamp of the time the offer was sent
- time_updated - unix timestamp of the time the trade_offer_state last changed.
- from_real_time_trade - boolean to indicate this is an offer automatically created from a real-time trade.
GetTradeOffers (v1)
This API gets a list of trade offers (up to a maximum of 500 sent or 1000 received regardless of time_historical_cutoff) for the account associated with the WebAPI key. You cannot call this API for accounts other than your own.
Input
Either get_sent_offers or get_received_offers (or both) must be set. active_only and historical_only are optional, if neither is passed it is equivalent to both being set.
- get_sent_offers - return the list of offers you've sent to other people.
- get_received_offers - return the list of offers you've received from other people.
- get_descriptions - return item display information for any items included in the returned offers.
- language - needed if get_descriptions is set, the language to use for item descriptions.
- active_only - return only trade offers in an active state (offers that haven't been accepted yet), or any offers that have had their state change since time_historical_cutoff.
- historical_only - return trade offers that are not in an active state.
- time_historical_cutoff - a unix time value. when active_only is set, inactive offers will be returned if their state was updated since this time. Useful to get delta updates on what has changed. WARNING: If not passed, this will default to the time your account last viewed the trade offers page. To avoid this behavior use a very low or very high date.
Output
- trade_offers_sent - if get_sent_offers was set, this will be an array of CEcon_TradeOffer values that you have sent.
- trade_offers_received - if get_received_offers was set, this will be an array of CEcon_TradeOffer values that have been sent to you.
- descriptions - if get_descriptions was set, this will be a list of item display information. This is associated with the data in the items_to_receive and items_to_give lists via the classid / instanceid identifier pair.
GetTradeOffer (v1)
This API gets details about a single trade offer. The trade offer must have been sent to or from the account associated with the WebAPI key. You cannot call this API for accounts other than your own.
If you try to retrieve a trade that is not within your 500 previous sent trades of previous 1000 received trade, no offer will be returned.
Input
- tradeofferid - the trade offer identifier
- language - the language to use for item display information.
Output
- offer - A CEcon_TradeOffer representing the offer
- descriptions - if language was set, this will be a list of item display information. This is associated with the data in the items_to_receive and items_to_give lists via the classid / instanceid identifier pair.
DeclineTradeOffer (v1)
Decline a trade offer that was sent to you. The trade offer must have been sent to the account associated with the WebAPI key. You cannot call this API for accounts other than your own. This accepts only POST requests.
Input
- tradeofferid - the trade offer identifier
Output
(just the usual success/error fields)
CancelTradeOffer (v1)
Cancel a trade offer that you sent. The trade offer must have been sent by the account associated with the WebAPI key. You cannot call this API for accounts other than your own. This accepts only POST requests.
Input
- tradeofferid - the trade offer identifier
Output
(just the usual success/error fields)