How can i purchase an item using roblox's API?

so i am trying to make a simple script that lets me buy some roblox items using python and for some reason its just not working. it says the reason is “invalid arguments”

session = requests.Session()
session.cookies['.ROBLOSECURITY'] = Cookie

response = session.post(f'https://economy.roblox.com/v1/purchases/products/{id}',data={'expectedCurrency': 1, 'expectedPrice': 0, 'expectedSellerId': 1},headers={"X-CSRF-TOKEN": xc})

thats what i am currently doing to try buy the item.

Response:

text:
{"purchased":false,"reason":"InvalidArguments","productId":9560392730,"statusCode":500,"title":"Invalid Parameter","errorMsg":"Invalid arguments.","showDivId":"TransactionFailureView"}

Please post this in a Python forum maybe?

1 Like

its not rly a python issue. anyone who has done work with purchasing items using the api should be able to help

1 Like

You need the “product-id” to purchase it, why you have to do it, I have no idea and how it works, I have no idea.

You can find the id in the HTML of the item page and then purchase it by putting it where {id} is in the url.

I don’t know anywhere else you can find it, it is up to you to find a better alternative.