I use trade link to send offer to a user not in my friend list. I add their items to the offer using the item id, it successfully adds and sends the offer. But when I see the trade offer it contains only 1 item even if I have sent more than 1. Have a look at the code below (here itemsArray contains the id of items), it was working fine when I used steamid to create tradeOffer instead of tradeUrl, but that was limited to my friend list only:
const offer = manager.createOffer(tradeUrl);
manager.loadInventory(appid, contextid, true, (err, myInv) => {
if (err) {
console.log(err);
} else {
manager.loadUserInventory(partnerid, appid, contextid, true, (err, theirInv) => {
if (err) {
console.log(err);
} else {
for(i=0; i<itemsArray.length; i++){
const item = theirInv.find((item) => item.assetid ==''+itemsArray[i]);
console.log("got item number" + i);
offer.addTheirItem(item);
}
offer.setMessage(`somerandom message`);
offer.send((err, status) => {
if (err) {
console.log(err);
} else {
console.log(`Sent offer. Status: ${status}.`);
}
});
}
});
}
});