Struggling to send trade requests with APIs in NodeJS

This is what I currently have:

axios(`https://trades.roblox.com/v1/trades/send`, {
            method: 'POST',
            headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': token, cookie: '.ROBLOSECURITY=' + process.env.COOKIE + ';' },
            body: JSON.stringify({
                offers: [
                    {
                        userId: id,
                        userAssetIds: send,
                        robux: 0,
                    },
                    {
                        userId: userid,
                        userAssetIds: recieve,
                        robux: 0,
                    },
                ],
            }),
        })

And this is the error I’ve got now:
image

Help!

You are not supposed to use ItemID, you are supposed to use the UAID. To get the UAID you need to fetch the users inventory using the Inventory API(Inventory Api) and use the “userAssetId” and not the “assetId” as each limited item has it’s own unique UAID.

Side Note: I see the that your are trying to create a trade bot, this will be hard to create with JS because JS is single thread meaning you can’t really have multiple works top run multiple process at the same time. Unless you use the worker_thread library thats already in node.js, however I’m unaware on how to use it currently.

1 Like