Trade API "The trade request should include offers"

I get the error {"errors":[{"code":8,"message":"The trade request should include offers.","userFacingMessage":"Something went wrong"}]}

(I am using python and the requests library-)

Here is my code:

data = {

    "offers": [

        {

            "userId": 435771547, # UserID of the person to send the trade to

            "userAssetIds": [ # The items you would like to request

                2409285794

            ],

            "robux": 0 # Amount of robux to request

        },

        {

            "userId": userId, # My userId

            "userAssetIds": [ # Items to give

                1380767576

            ],

            "robux": 0 # Amount of robux to give

        }

    ]

}

requested = requests.post("https://trades.roblox.com/v1/trades/send", data = data, cookies = cookie, headers = {

    "Content-Type": "application/json",

    "X-CSRF-TOKEN": token

})

Edit:

When I do print(requested.request.body) it prints offers=userId&offers=userAssetIds&offers=robux&offers=userId&offers=userAssetIds&offers=robux

1 Like

data = JSON.stringify({

    "offers": [

        {

            "userId": 435771547, # UserID of the person to send the trade to

            "userAssetIds": [ # The items you would like to request

                2409285794

            ],

            "robux": 0 # Amount of robux to request

        },

        {

            "userId": userId, # My userId

            "userAssetIds": [ # Items to give

                1380767576

            ],

            "robux": 0 # Amount of robux to give

        }

    ]

})

requested = requests.post("https://trades.roblox.com/v1/trades/send", body = data, cookies = cookie, headers = {

    "Content-Type": "application/json",

    "X-CSRF-TOKEN": token

})

maybe it will fix, sorry am not good at python

3 Likes