K
K
kolomiec_artiom2020-04-07 14:47:23
Qiwi
kolomiec_artiom, 2020-04-07 14:47:23

How to invoice qiwi checkout in python using their API?

Hello! I'm trying to issue an invoice to QIWI according to this documentation: https://developer.qiwi.com/en/bill-payments/#create

My code:

headers={'Accept': 'application/json',
               'Authorization': 'Bearer SECRET_KEY',
               }
params={'billId': 'не знаю, что тут',
               'amount.value': 100.00,
               'amount.currency': 'RUB',    
              }
requests.get(URL, 
                    params=params, 
                    headers=headers)


I don’t really understand what billId should equal and where the request should eventually be sent. I would be grateful for your answer!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kolomiec_artiom, 2020-04-07
@kolomiec_artiom

Either I'm a fool, or the skis don't go

By trial and error, I was able to write a program that issues an invoice:
headers={'Authorization': 'Bearer SECRET_KEY',
         'Accept': 'application/json',
         'Content-Type': 'application/json',
         }

params={'amount': {'value': 59.21, 
                   'currency': 'RUB',
                   },
        'comment': 'Text comment', 
        'expirationDateTime': '2020-04-13T14:30:00+03:00', 
        'customer': {}, 
        'customFields': {},        
        }
params = json.dumps(params)

g = requests.put('https://api.qiwi.com/partner/bill/v1/bills/<уникальный номер счета>',
                  headers=headers,
                  data=params,
                  )

Again, I do not exclude that I am a fool in this situation, but as for me, the documentation is completely untrue

A
Andrew, 2020-04-07
@deepblack

Send request here:

https://api.qiwi.com/partner/bill/v1/bills/<тут_billId>

billId - must be unique within your system (shop or whatever)
It's all there in the documentation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question