request = requests.get(f"https://api.mercadopago.com/v1/payments/{id}")
https://i.stack.imgur.com/Iqrsw.png
Is there a way to do this with requests?
CodePudding user response:
According to this https://www.mercadopago.com.ar/developers/en/reference/payments/_payments_id/get
you need to provide a header with your access token you get through OAUTH. And then once you get the access token, you can do
header = {"Authorization": "Bearer " "your access token"}
result = requests.get(f"https://api.mercadopago.com/v1/payments/{id}", headers=header)
which will return you a json result