Answer the question
In order to leave comments, you need to log in
QIWI API error 400?
I'm trying to issue an invoice using the QIWI API. Everything seems to be licked from the documentation .
So far, I am limited to creating a form for 1p.
My code:
import requests
import json
import uuid
def test():
payment_id = uuid.uuid4()
secret_qiwi_key = 'eyJ2ZXJzaW9uIjoiUDJQIiwiZGF0YSI6eyJwYXlpbl9tZXJjaGFudF9zaXRlX3VpZCI6InpmemZ6Zi05OSIsInVzZXJfaWQiOiIrNzkxMjM0NTY3ODkiLCJzZWNyZXQiOiJ3fnBTQC1me2Fvbjd8Vmo4SnI1KXk/bURGRDRQZH5zODtTUU9aU3RSRFAwVXYrR2RTXTtyNWgqMj1zdilJZ08yIn19'
url = f'https://api.qiwi.com/partner/bill/v1/bills/{payment_id}'
headers = {
'content-type': 'application/json',
'accept': 'application/json',
'authorization': f'Bearer {secret_qiwi_key}'
}
data = {
'amount':{
'currency': 'RUB',
'value': '1.00'
},
"expirationDateTime": "2029-11-11T24:59:59+03:00",
}
resp = requests.put(url=url, data=data, headers=headers)
return resp, payment_id
q = test()
print(f' [{q[0].ok} {q[0].status_code}] {q[0].content}')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question