Jump to content


Automatically redeeming steam gifts (from trade offers)

node.js node-steamcommunity

  • Please log in to reply
1 reply to this topic

#1 Royalgamer06


    Advanced Member

  • Member
  • PipPipPip
  • 94 posts

Posted 29 July 2018 - 10:38 AM

Okay, forgive me, but I am a bit confused about this. I've tried looking for better examples or documentation, but it didn't clear things up for me.

I have a few questions:

  1. Is the id property of a gift object (e.g. an item from gifts from the gifts event) the same as an assetid of an CEconItem? You seem to use these terms interchangeably in your documentation, but I am not sure.
  2. Without knowing the answer of the first question, can/should you use community.redeemGift with the gift.id as first parameter?
  3. Let say I am doing the thing question 2 is asking about, in the gifts event. Why is it that after sending a trade offer where I'd receive a steam gift, not automatically redeem a steam gift when offer is accepted? *
  4. What should I do for the scenario mentioned in question 3, or if I receive a trade offer with 1 or more steam gifts, which I accept (using trade offer manager)? *

* I realized that the gifts event is only for when gifts are sent directly to me, and not via trade offers (as they get sent to inventory).

So, in case of trade offers, after accepting a trade with trade offer manager, I should use offer.getReceivedItems to check if they contain steam gifts and redeem them?

How do I do that exactly? I assume I check for some property of CEconItem item of the received items to see if it's a steam gift and then use community.redeemGift(item.assetid, ...)? But which property and what value? **


** Found out I should check for property type (https://github.com/D.../CEconItem#type) with value  Gift.

Should I only call offer.getReceivedItems after trade offer has been accepted AND confirmed? Or can you do it also for unconfirmed accepted?

Edited by Royalgamer06, 29 July 2018 - 11:34 AM.

#2 Dr. McKay

Dr. McKay


  • Administrator
  • 2,166 posts

Posted 29 July 2018 - 08:24 PM

getReceivedItems can only be called when the offer is accepted and confirmed.

Also tagged with one or more of these keywords: node.js, node-steamcommunity

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users