V
V
Vasiliy_Ivanov2022-03-28 16:42:02
Python
Vasiliy_Ivanov, 2022-03-28 16:42:02

How to issue an invoice for payment with QIWI API?

I'm trying to issue an invoice for payment:

headers = {
    'accept': 'application/json',
    'content-Type': 'application/json',
    'authorization': f'Bearer {token}'
}

form = {
    'amount': {
        'currency': 'RUB',
        'value': '5.00',
    },
    'comment': 'На арбуз!',
    'expirationDateTime': '2022-03-28T20:00:00+00:30'
}

bill_id = 'cc961e8dd4d64f02b7372297e51fb48e'
url = f'https://api.qiwi.com/partner/bill/v1/bills/{bill_id}'
resp = requests.put(url, json=form, headers=headers)
print(resp)

Error:
Response [401]
What am I doing wrong? Help me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TheAndrey7, 2022-03-28
@TheAndrey7

Send your request to https://httpbin.org/ instead of QIWI. This will allow you to see if your request is being formed correctly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question