Returns total commission amount for the payment by the given payment requisites.
curl -X POST \
'https://edge.qiwi.com/sinap/providers/99/onlineCommission' \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <API token>" \
-d '{
"account":"380995238345",
"paymentMethod":{
"type":"Account",
"accountId":"643"
},
"purchaseTotals":{
"total":{
"amount":10,
"currency":"643"
}
}
}'
POST /sinap/providers/99/onlineCommission HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer <API token>
Host: edge.qiwi.com
{
"account":"380995238345",
"paymentMethod":{
"type":"Account",
"accountId":"643"
},
"purchaseTotals":{
"total":{
"amount":10,
"currency":"643"
}
}
}
import requests
# Тарифные комиссии
def get_commission(api_access_token, to_account, prv_id, sum_pay):
s = requests.Session()
s.headers = {'content-type': 'application/json'}
s.headers['authorization'] = 'Bearer ' + api_access_token
postjson = {"account":"","paymentMethod":{"type":"Account","accountId":"643"}, "purchaseTotals":{"total":{"amount":"","currency":"643"}}}
postjson['account'] = to_account
postjson['purchaseTotals']['total']['amount'] = sum_pay
c_online = s.post('https://edge.qiwi.com/sinap/providers/'+prv_id+'/onlineCommission',json = postjson)
return c_online.json()['qwCommission']['amount']
ID — provider's identifier. Possible values:
- 99 — QIWI Wallet transfer.
- 1717 — Payment by bank requisites to commercial organization.
- Providers of bank wire transfer.
You can also search for a required identifier through API by keywords.
-
- Accept: application/json
- Content-type: application/json
- Authorization: Bearer ***
Required parameters in JSON body:
Name | Type | Description |
---|---|---|
account | String | User's identifier (phone number, card/account number, and other entity depending on provider) |
paymentMethod | Object | Object defining payment processing by QIWI Wallet. Includes the following parameters: |
paymentMethod.type | String | Payment method, Account only |
paymentMethod.accountId | String | QIWI Wallet account identifier, 643 only. |
purchaseTotals | Object | Object with payment requisites |
purchaseTotals.total | Object | Payment amount data: |
total.amount | Number | Amount (rubles and kopeks, divided by . ). Positive number, rounded down to 2 decimals. If you send more decimals, value will be rounded down to kopeks. |
total.currency | String | Currency (643 only, that is rubles) |
HTTP/1.1 200 OK
Content-Type: application/json
{
"providerId": 99,
"withdrawSum": {
"amount": 1011.01,
"currency": "643"
},
"enrollmentSum": {
"amount": 1001,
"currency": "643"
},
"qwCommission": {
"amount": 10.01,
"currency": "643"
},
"fundingSourceCommission": {
"amount": 0,
"currency": "643"
},
"withdrawToEnrollmentRate": 1
}
api_access_token = '975efd8e8376xxxb95fa7cb213xxx04'
# QIWI wallet transfer commission
print(get_commission(api_access_token,'+380000000000','99',5000))
# Card transfer commission
print(get_commission(api_access_token,'4890xxxxxxxx1698','22351',1000))
Commission rate returns in qwCommission.amount
field of the JSON response.
Provides auto-filled payment form on qiwi.com site.
Link example (click to see the form)
If you don't want to show your wallet number, use transfer to the wallet nickname:
Link example for nickname transfer (click to see the form)
To get payments to your QIWI Wallet, you can use also P2P-form.
GET /payment/form/99?extra%5B%27account%27%5D=79991112233&amountInteger=1&amountFraction=0&extra%5B%27comment%27%5D=test123¤cy=643 HTTP/1.1
Host: qiwi.com
URL https://qiwi.com/ID?{parameter}={value}
ID — provider's identifier. Only providers with payment requisites limited to fields.account
are accepted. Possible values:
- 99 — QIWI Wallet transfer.
- 99999 — QIWI Wallet nickname transfer.
- 1963 — Visa card transfer (issued by only Russian banks).
- 21013 — MasterCard card transfer (issued by only Russian banks).
- 31652 — MIR national payment system card transfer.
- 22351 — QIWI Virtual card transfer.
- 1717 — Payment by bank requisites to commercial organization.
You can also search for a required identifier through API by keywords.
Parameters in URL query to fill the form fields:
Name | Type | Description | Form field |
---|---|---|---|
amountInteger | Integer | Integer part of the payment amount (in rubles). If absent, the "Amount" field on the form will be empty. The number not greater than 99 999 (payment amount limit) | Amount |
amountFraction | Integer | Fractional part of the payment amount (kopeks). If absent, the "Amount" field on the form will be empty. | Amount |
currency | Constant string, 643 |
Payment currency code. Required if you send the payment amount in the link | - |
extra['comment'] | URL-encoded string | Payment comment. Use it only for ID=99 | Comment to the transfer |
extra['account'] | URL-encoded string | Field format is the same as fields.account of the corresponding payment request: for provider 99 - recipient's wallet number; for mobile network operators - phone number for top-up (without international prefix); for card transfer - recipient's card number without spaces, for other providers - user's identifier. For provider 99999 use nickname or number of the wallet and use appropriate value of extra['accountType'] parameter. |
Wallet number, phone number, user ID. |
blocked | Array[String] | Name of blocked (inactive) form field. User will not be able to change this field. Each parameter corresponds to respective form field and should be numbered starting from zero (blocked[0] , blocked[1] , and so on). If absent, user can change all form fields. Possible values:sum - "Payment amount" field, account - "Phone number/Account number" field,comment - "Comment" field.Example (for payment amount field): blocked[0]=sum |
- |
extra['accountType'] | URL-encoded string | Use only for ID=99999. The value determines transfer to QIWI wallet by nickname or wallet number.phone - for transfer to wallet numbernickname - for transfer to wallet nickname. If you don't want to show your wallet number on the form, use this value. |
curl -X GET \
"https://edge.qiwi.com/qw-nicknames/v1/persons/79111234567/nickname" \
--header "Accept: application/json" \
--header "Authorization: Bearer <API token>"
GET /qw-nicknames/v1/persons/79111234567/nickname HTTP/1.1
Accept: application/json
Authorization: Bearer <API token>
Host: edge.qiwi.com
-
- wallet - your wallet number without + sign
-
- Accept: application/json
- Authorization: Bearer ***
HTTP/1.1 200 OK
Content-Type: application/json
{
"canChange": true,
"canUse": true,
"description": "",
"nickname": "NICKNAME"
}
Successful response contains nickname of your wallet in JSON field nickname
.
curl -X POST \
'https://edge.qiwi.com/sinap/api/v2/terms/99/payments' \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <API token>" \
-d '{
"id":"11111111111111",
"sum": {
"amount":100,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"comment":"test",
"fields": {
"account":"+79121112233"
}
}'
POST /sinap/api/v2/terms/99/payments HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer <API token>
Host: edge.qiwi.com
{
"id":"11111111111111",
"sum": {
"amount":100.50,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"comment":"test",
"fields": {
"account":"+79121112233"
}
}
import requests
import time
# QIWI wallet transfer
def send_p2p(api_access_token, to_qw, comment, sum_p2p):
s = requests.Session()
s.headers = {'content-type': 'application/json'}
s.headers['authorization'] = 'Bearer ' + api_access_token
s.headers['User-Agent'] = 'Android v3.2.0 MKT'
s.headers['Accept'] = 'application/json'
postjson = {"id":"","sum":{"amount":"","currency":""},"paymentMethod":{"type":"Account","accountId":"643"}, "comment":"'+comment+'","fields":{"account":""}}
postjson['id'] = str(int(time.time() * 1000))
postjson['sum']['amount'] = sum_p2p
postjson['sum']['currency'] = '643'
postjson['fields']['account'] = to_qw
res = s.post('https://edge.qiwi.com/sinap/api/v2/terms/99/payments',json = postjson)
return res.json()
-
- Accept: application/json
- Content-type: application/json
- Authorization: Bearer ***
Send JSON object Payment in the request's body. Payment requisites in fields
object:
Name | Type | Description |
---|---|---|
fields.account | String | Required. Wallet number of the recipient |
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "150217833198900",
"terms": "99",
"fields": {
"account": "79121238345"
},
"sum": {
"amount": 100,
"currency": "643"
},
"transaction": {
"id": "11155897070",
"state": {
"code": "Accepted"
}
},
"source": "account_643",
"comment": "test"
}
print(send_p2p(mylogin,api_access_token,'+79261112233','comment',99.01))
{'comment': 'comment',
'fields': {'account': '+79261112233'},
'id': '1514296828893',
'source': 'account_643',
'sum': {'amount': 99.01, 'currency': '643'},
'terms': '99',
'transaction': {'id': '11982501857', 'state': {'code': 'Accepted'}}}
Successful response contains JSON-object PaymentInfo with accepted payment data.
Transfers funds to currency account in QIWI wallet with conversion from your QIWI wallet ruble account. Two transactions are created: conversion between accounts of your QIWI wallet, and transfer to another wallet. You can get currency rates from another API method.
curl -X POST \
'https://edge.qiwi.com/sinap/api/v2/terms/1099/payments' \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <API token>" \
-d '{
"id":"11111111111111",
"sum": {
"amount":100,
"currency":"398"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"comment":"test",
"fields": {
"account":"+79121112233"
}
}'
POST /sinap/api/v2/terms/1099/payments HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer <API token>
Host: edge.qiwi.com
{
"id":"11111111111111",
"sum": {
"amount":10.00,
"currency":"398"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"comment":"test",
"fields": {
"account":"+79121112233"
}
}
import requests
import time
# Conversion in QIWI wallet (currency as currency integer code as String)
def exchange(api_access_token, sum_exchange, currency, to_qw):
s = requests.Session()
currencies = ['398', '840', '978']
if currency not in currencies:
print('This currency not available')
return
s.headers = {'content-type': 'application/json'}
s.headers['authorization'] = 'Bearer ' + api_access_token
s.headers['User-Agent'] = 'Android v3.2.0 MKT'
s.headers['Accept'] = 'application/json'
postjson = {"id":"","sum":{"amount":"","currency":""},"paymentMethod":{"type":"Account","accountId":"643"}, "comment":"'+comment+'","fields":{"account":""}}
postjson['id'] = str(int(time.time() * 1000))
postjson['sum']['amount'] = sum_exchange
postjson['sum']['currency'] = currency
postjson['fields']['account'] = to_qw
res = s.post('https://edge.qiwi.com/sinap/api/v2/terms/1099/payments',json = postjson)
return res.json()
-
- Accept: application/json
- Content-type: application/json
- Authorization: Bearer ***
Send JSON object Payment in the request's body. Payment requisites in fields
object:
Name | Type | Description |
---|---|---|
fields.account | String | Required. Wallet number for the conversion |
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "150217833198900",
"terms": "99",
"fields": {
"account": "79121238345"
},
"sum": {
"amount": 100,
"currency": "398"
},
"transaction": {
"id": "11155897070",
"state": {
"code": "Accepted"
}
},
"source": "account_643",
"comment": "test"
}
Successful response contains JSON-object PaymentInfo with accepted payment data.
Returns current QIWI Bank currency rates and cross-rates.
curl "https://edge.qiwi.com/sinap/crossRates" \
--header "Accept: application/json" \
--header "Authorization: Bearer <API token>"
GET /sinap/crossRates HTTP/1.1
Accept: application/json
Authorization: Bearer <API token>
Host: edge.qiwi.com
import requests
# Currencies rate (currency pair codes in String)
def exchange(api_access_token, currency_to, currency_from):
s = requests.Session()
s.headers = {'content-type': 'application/json'}
s.headers['authorization'] = 'Bearer ' + api_access_token
s.headers['User-Agent'] = 'Android v3.2.0 MKT'
s.headers['Accept'] = 'application/json'
res = s.get('https://edge.qiwi.com/sinap/crossRates')
# all rates
rates = res.json()['result']
# requested rate
rate = [x for x in rates if x['from'] == currency_from and x['to'] == currency_to]
if (len(rate) == 0):
print('No rate for this currencies!')
return
else:
return rate[0]['rate']
-
- Accept: application/json
- Authorization: Bearer ***
HTTP/1.1 200 OK
Content-Type: application/json
{
"result": [
{
"set": "General",
"from": "398",
"to": "643",
"rate": 6.22665
},
{
"set": "General",
"from": "398",
"to": "756",
"rate": 412.0174305
},
...,
{
"set": "General",
"from": "980",
"to": "978",
"rate": 31.4680914
}
]
}
Successful response contains JSON array of currency rates in result
field. An element of the list corresponds to currency pair:
Response field | Type | Description |
---|---|---|
from | String | Base currency |
to | String | Quote currency |
rate | Number | Rate |
curl -X POST \
"https://edge.qiwi.com/sinap/api/v2/terms/1/payments" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <API token>" \
-d '{
"id":"11111111111111",
"sum": {
"amount":100,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"fields": {
"account":"9161112233"
}
}'
POST /sinap/api/v2/terms/1/payments HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer <API token>
Host: edge.qiwi.com
{
"id":"21131343",
"sum": {
"amount":1000,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"fields": {
"account":"9161112233"
}
}
import requests
import time
# Cell phone top-up
def send_mobile(api_access_token, prv_id, to_account, comment, sum_pay):
s = requests.Session()
s.headers['Accept'] = 'application/json'
s.headers['Content-Type'] = 'application/json'
s.headers['authorization'] = 'Bearer ' + api_access_token
postjson = {"id":"","sum": {"amount":"","currency":"643"},"paymentMethod": {"type":"Account","accountId":"643"},"comment":"","fields": {"account":""}}
postjson['id'] = str(int(time.time() * 1000))
postjson['sum']['amount'] = sum_pay
postjson['fields']['account'] = to_account
postjson['comment'] = comment
res = s.post('https://edge.qiwi.com/sinap/api/v2/terms/'+prv_id+'/payments', json = postjson)
return res.json()
-
- ID - QIWI provider identifier. How to get provider ID
-
- Accept: application/json
- Content-type: application/json
- Authorization: Bearer ***
Send JSON object Payment in the request's body. Payment requisites in fields
object:
Name | Type | Description |
---|---|---|
fields.account | String | Cell phone number to top-up (without 8 prefix) |
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "21131343",
"terms": "1",
"fields": {
"account": "9161112233"
},
"sum": {
"amount": 1000,
"currency": "643"
},
"source": "account_643",
"transaction": {
"id": "4969142201",
"state": {
"code": "Accepted"
}
}
}
send_mobile(api_access_token,'2','9670058909','123','1')
Successful response contains JSON-object PaymentInfo with accepted payment data.
Transfers money to Visa, MasterCard, or MIR credit cards.
Money transfers to Visa and MasterCard cards issued by foreign banks are suspended due to restrictions from the payment system.
Payment request for domestic card
curl -X POST \
"https://edge.qiwi.com/sinap/api/v2/terms/1963/payments" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <API token>" \
-d '{
"id":"21131343",
"sum":{
"amount":1000,
"currency":"643"
},
"paymentMethod":{
"type":"Account",
"accountId":"643"
},
"fields": {
"account":"4256********1231"
}
}'
Payment request for foreign card
curl -X POST \
"https://edge.qiwi.com/sinap/api/v2/terms/1960/payments" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <API token>" \
-d '{
"id":"21131343",
"sum":{
"amount":1000,
"currency":"643"
},
"paymentMethod":{
"type":"Account",
"accountId":"643"
},
"fields": {
"account": "402865XXXXXXXXXX",
"rec_address": "Ленинский проспект 131, 56",
"rec_city": "Москва",
"rec_country": "Россия",
"reg_name": "Виктор",
"reg_name_f": "Петров",
"rem_name": "Сергей",
"rem_name_f": "Иванов"
}
}'
POST /sinap/api/v2/terms/1963/payments HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer <API token>
Host: edge.qiwi.com
{
"id":"21131343",
"sum": {
"amount":1000,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"fields": {
"account":"4256XXXXXXXX1231"
}
}
POST /sinap/api/v2/terms/1960/payments HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer <API token>
Host: edge.qiwi.com
{
"id":"21131343",
"sum": {
"amount":1000,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"fields": {
"account": "402865XXXXXXXXXX",
"rec_address": "Ленинский проспект 131, 56",
"rec_city": "Москва",
"rec_country": "Россия",
"reg_name": "Виктор",
"reg_name_f": "Петров",
"rem_name": "Сергей",
"rem_name_f": "Иванов"
}
}
import requests
import time
# Card money transfer
def send_card(api_access_token, payment_data):
# payment_data - dictionary with all payment data
s = requests.Session()
s.headers['Accept'] = 'application/json'
s.headers['Content-Type'] = 'application/json'
s.headers['authorization'] = 'Bearer ' + api_access_token
postjson = {"id":"","sum": {"amount":"","currency":"643"},"paymentMethod": {"type":"Account","accountId":"643"},"fields": {"account":""}}
postjson['id'] = str(int(time.time() * 1000))
postjson['sum']['amount'] = payment_data.get('sum')
postjson['fields']['account'] = payment_data.get('to_card')
prv_id = payment_data.get('prv_id')
if payment_data.get('prv_id') in ['1960', '21012']:
postjson['fields']['rem_name'] = payment_data.get('rem_name')
postjson['fields']['rem_name_f'] = payment_data.get('rem_name_f')
postjson['fields']['reg_name'] = payment_data.get('reg_name')
postjson['fields']['reg_name_f'] = payment_data.get('reg_name_f')
postjson['fields']['rec_city'] = payment_data.get('rec_address')
postjson['fields']['rec_address'] = payment_data.get('rec_address')
res = s.post('https://edge.qiwi.com/sinap/api/v2/terms/' + prv_id + '/payments', json = postjson)
return res.json()
ID — QIWI provider identifier. Possible values:
- 1963 — Visa money transfer to cards issued by Russian banks only.
- 21013 — MasterCard money transfer to cards issued by Russian banks only.
- 1960 — Visa money transfer to credit cards issued by banks in Albania, Andorra, Argentina, Armenia, Australia, Austria, Azerbaijan, Belarus, Belgium, Benin, Bosnia and Herzegovina, Brazil, Bulgaria, China, Croatia, Cyprus, Czech Republic, Denmark, Egypt, Estonia, Finland, France, Georgia, Germany , Greece, Hong Kong (China), Hungary, Iceland, India, Indonesia, Israel, Italy, Japan, Kazakhstan, Kenya, Korea Republic, Kuwait, Kyrgyzstan, Latvia, Lithuania, Luxembourg, Macao, China, Macedonia, Madagascar, Malaysia, Maldives , Malta, Republic of Moldova, Monaco, Mongolia, Montenegro, Namibia, Netherlands, New Zealand, Nigeria, Norway, Oman, Paraguay, Poland, Portugal, Qatar, Romania, Saudi Arabia, Republic of Serbia, Singapore, Slovakia, Slovenia, South Africa, Spain, Sri Lanka, Sweden, Tajikistan, Tanzania, Thailand, Turkey, Turkmenistan, United Arab Emirates, United Kingdom, Uzbekistan, Vietnam, Zambia.
- 21012 — MasterCard money transfer to credit cards issued by banks in Albania, Argentina, Armenia, Australia, Austria, Azerbaijan, Bangladesh, Barbados, Belarus, Belgium, Benin, Bosnia and Herzegovina, Burkina Faso, Brazil, Bulgaria, Cambodia, Cameroon United Republic, Chile, China, Colombia, Congo, Costa Rica, Croatia, Cyprus, Czech Republic, Democratic Republic of the Congo, Denmark, Dominican Republic, Ecuador, El Salvador, Egypt, Estonia, Finland, France, Georgia, Germany, Ghana, Greece, Guatemala, Hong Kong, Hungary, India, Indonesia, Ireland, Israel, Italy, Japan, Jordan, Kazakhstan, Kenya, Korea, Kuwait, Kyrgyzstan, Latvia, Lebanon, Lithuania, Luxembourg, Macao, Macedonia, Madagascar, Malaysia, Maldives, Malta, Mexico, Moldova, Monaco, Mongolia, Montenegro, Morocco, Namibia, Nigeria, Nepal, Netherlands, New Zealand, Nigeria, Norway, Oman, Panama, Paraguay, Peru, Philippines, Poland, Portugal, Romania, Qatar, Russian Federation, Saudi Arabia, Senegal, Serbia Republic, Singapore, Slovakia, Slovenia, South Africa, Spain, W ri-Lanka, Sweden, Switzerland, Tajikistan, Tanzania, Thailand, Tunisia, Turkey, Turkmenistan, United Arab Emirates, United Kingdom, Uzbekistan, Vietnam, Zambia.
- 31652 — Transfer to MIR national payment system cards.
- 22351 — Transfer to QIWI Virtual Card.
-
- Accept: application/json
- Content-type: application/json
- Authorization: Bearer ***
Send JSON-object Payment in the request' body. Payment requisites in fields
object depend on the provider ID.
Name | Type | Description |
---|---|---|
fields.account | String | Recipient's card number (no spaces) |
Name | Type | Description |
---|---|---|
fields.account | String | Recipient's card number (no spaces) |
fields.rem_name | String | Sender's first name |
fields.rem_name_f | String | Sender's last name. Required for ID 1960 , 21012 only |
fields.rec_address | String | Sender's address (no zip code, only text) |
fields.rec_city | String | Sender's city |
fields.rec_country | String | Sender's country |
fields.reg_name | String | Recipient's first name |
fields.reg_name_f | String | Recipient's last name |
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "21131343",
"terms": "1963",
"fields": {
"account": "4256********1231"
},
"sum": {
"amount": 1000,
"currency": "643"
},
"source": "account_643",
"transaction": {
"id": "4969142201",
"state": {
"code": "Accepted"
}
}
}
payment_data = {'prv_id': '1963', 'to_card' : '41548XXXXXXXX008', 'sum': 100}
jss = send_card(token, payment_data)
Successful response contains JSON-object PaymentInfo with accepted payment data.
Makes money transfer to personal bank cards/accounts opened in Russian banks.
Makes money transfer to cards issued by Russian banks.
curl -X POST \
"https://edge.qiwi.com/sinap/api/v2/terms/464/payments" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <API token>" \
-d '{
"id":"21131343",
"sum": {
"amount":1000,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"fields": {
"account_type": "1",
"account":"4256********1231",
"exp_date": "0623"
}
}'
POST /sinap/api/v2/terms/464/payments HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer <API token>
Host: edge.qiwi.com
{
"id":"21131343",
"sum": {
"amount":1000,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"fields": {
"account":"4256********1231",
"account_type": "1",
"exp_date": "0623"
}
}
-
- ID - QIWI provider identifier. Possible values:
- 464 - Alfa Bank
- 804 - OTP Bank
- 810 - Rosselkhozbank
- 815 - Russkiy Standart
- 816 - VTB
- 821 - Promsvyazbank
- 870 - Sberbank
- 881 - Renaissance Credit
- 1134 - Moskovskiy Creditnyi Bank
- ID - QIWI provider identifier. Possible values:
-
- Accept: application/json
- Content-type: application/json
- Authorization: Bearer ***
Send JSON object Payment in the request's body. Payment requisites in fields
object:
Name | Type | Description |
---|---|---|
fields.account | String | Recipient's card number (no spaces) |
fields.exp_date | String | Card expiry date, as MMYY (for example, 0218 ). Parameter is required for ID 464 and 821. |
fields.account_type | String | Bank identifier type. For each bank specific value applies: ID 464 - 1 ID 084 - 1 ID 815 - 1 ID 810 - 5 ID 816 - 5 ID 821 - 7 ID 870 - 5 ID 1134 - 5 ID 881 - 1 . |
fields.mfo | String | Bank MFO (BIK) |
fields.lname | String | Recipient's last name |
fields.fname | String | Recipient's first name |
fields.mname | String | Recipient's middle name |
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "21131343",
"terms": "464",
"fields": {
"account": "4256********1231",
"account_type": "1",
"exp_date": "0423"
},
"sum": {
"amount": 1000,
"currency": "643"
},
"source": "account_643",
"transaction": {
"id": "4969142201",
"state": {
"code": "Accepted"
}
}
}
Successful response contains JSON-object PaymentInfo with accepted payment data.
Makes money transfer to personal accounts opened in Russian banks. You can use quick transfer service (within an hour if transaction is made from 9:00 until 19:30).
curl -X POST \
"https://edge.qiwi.com/sinap/api/v2/terms/816/payments" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <API token>" \
-d '{
"id":"21131343",
"sum": {
"amount":1000,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"fields": {
"account_type": "2",
"urgent": "0",
"lname": "Иванов",
"fname": "Иван",
"mname": "Иванович",
"mfo": "046577795",
"account":"40817***"
}
}'
POST /sinap/api/v2/terms/816/payments HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer <API token>
Host: edge.qiwi.com
{
"id":"21131343",
"sum": {
"amount":1000,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"fields": {
"account_type": "2",
"urgent": "0",
"lname": "Иванов",
"fname": "Иван",
"mname": "Иванович",
"mfo": "046577795",
"account":"40817***"
}
}
-
- ID - QIWI provider identifier. Possible values:
- 313 - HomeCredit Bank
- 464 - Alfa Bank
- 821 - Promsvyazbank
- 804 - OTP Bank
- 810 - Rosselkhozbank
- 816 - VTB
- 819 - Unicredit Bank
- 868 - QIWI Bank
- 870 - Sberbank
- 815 - Russkiy Standart
- 881 - Renaissance Credit
- 1134 - Moskovskiy Creditnyi Bank
- 27324 - Raiffeisen Bank
- ID - QIWI provider identifier. Possible values:
-
- Accept: application/json
- Content-type: application/json
- Authorization: Bearer ***
Send JSON object Payment in the request's body. Payment requisites in fields
object:
Name | Type | Description |
---|---|---|
fields.account | String | Recipient's bank account number |
fields.urgent | String | Quick transfer flag. For 0 - not used; for 1 - make quick transfer by Urgent transfer service of Central Bank of Russia. Extra commission is paid for quick transfer |
fields.mfo | String | Bank MFO (BIK) |
fields.account_type | String | Bank identifier type. For each bank specific value applies: ID 464 - 2 ID 804 - 2 ID 810 - 2 ID 815 - 2 ID 816 - 2 ID 821 - 9 ID 819 - 2 ID 868 - 2 ID 870 - 2 ID 1134 - 2 ID 27324 - 2 ID 810 - 2 ID 816 - 5 ID 821 - 9 ID 881 - 2 ID 313 - 6 . |
fields.lname | String | Recipient's last name |
fields.fname | String | Recipient's first name |
fields.mname | String | Recipient's middle name |
fileds.agrnum | String | Bank agreement number - for ID 313 |
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "21131343",
"terms": "464",
"fields": {
"account": "407121010910909011",
"account_type": "2"
},
"sum": {
"amount": 1000,
"currency": "643"
},
"source": "account_643",
"transaction": {
"id": "4969142201",
"state": {
"code": "Accepted"
}
}
}
Successful response contains JSON-object PaymentInfo with accepted payment data.
You can pay for services by user identifier. This request applies for QIWI providers with one user identifier and without requirement of account number online check.
curl -X POST \
"https://edge.qiwi.com/sinap/api/v2/terms/674/payments" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <API token>" \
-d '{
"id":"21131343",
"sum": {
"amount":100,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"fields": {
"account":"111000000"
}
}'
POST /sinap/api/v2/terms/674/payments HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer <API token>
Host: edge.qiwi.com
{
"id":"21131343",
"sum": {
"amount":100,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"fields": {
"account":"111000"
}
}
import requests
import time
# payment for service provider
def pay_simple_prv(api_access_token, prv_id, to_account, sum_pay):
s = requests.Session()
s.headers['Accept'] = 'application/json'
s.headers['Content-Type'] = 'application/json'
s.headers['authorization'] = 'Bearer ' + api_access_token
postjson = {"id":"","sum": {"amount":"","currency":"643"},"paymentMethod": {"type":"Account","accountId":"643"},"fields": {"account":""}}
postjson['id'] = str(int(time.time() * 1000))
postjson['sum']['amount'] = sum_pay
postjson['fields']['account'] = to_account
res = s.post('https://edge.qiwi.com/sinap/api/v2/terms/'+prv_id+'/payments', json = postjson)
return res.json()
-
- ID - QIWI provider identifier. Possible values:
- 674 - OnLime
- Other Internet providers
- 1239 - Podari zhizn Charitable Foundation
- Other charitable foundations identifiers
- Find a service provider identifier
- ID - QIWI provider identifier. Possible values:
-
- Accept: application/json
- Content-type: application/json
- Authorization: Bearer ***
Send JSON object Payment in the request's body. Payment requisites in fields
object:
Name | Type | Description |
---|---|---|
fields.account | String | User identifier |
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "21131343",
"terms": "674",
"fields": {
"account": "111000"
},
"sum": {
"amount": 100,
"currency": "643"
},
"source": "account_643",
"transaction": {
"id": "4969142201",
"state": {
"code": "Accepted"
}
}
}
Successful response contains JSON-object PaymentInfo with accepted payment data.
Makes payments for commercial services by their bank details.
curl -X POST \
"https://edge.qiwi.com/sinap/api/v2/terms/1717/payments" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer <API token>" \
--header "User-Agent: ***" \
-d '{
"id":"21131343",
"sum": {
"amount":1000,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"fields": {
"extra_to_bik":"044525201",
"requestProtocol":"qw1",
"city":"МОСКВА",
"name":"ПАО АКБ \"АВАНГАРД\"",
"to_bik":"044525201",
"urgent":"0",
"to_kpp":"772111001",
"is_commercial":"1",
"nds":"НДС не облагается",
"goal":" Оплата товара по заказу №090738231",
"from_name_p":"Николаевич",
"from_name":"Иван",
"from_name_f":"Михайлов",
"info":"Коммерческие организации",
"to_name":"ООО \"Технический Центр ДЕЛЬТА\"",
"to_inn":"7726111111",
"account":"40711100000012321",
"toServiceId":"1717"
}
}'
POST /sinap/api/v2/terms/1717/payments HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer <API token>
Host: edge.qiwi.com
User-Agent: ****
{
"id":"21131343",
"sum": {
"amount":1000,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"fields": {
"extra_to_bik":"044525201",
"requestProtocol":"qw1",
"city":"МОСКВА",
"name":"ПАО АКБ \"АВАНГАРД\"",
"to_bik":"044525201",
"urgent":"0",
"to_kpp":"772111001",
"is_commercial":"1",
"nds":"НДС не облагается",
"goal":" Оплата товара по заказу №090738231",
"from_name_p":"Николаевич",
"from_name":"Иван",
"from_name_f":"Михайлов",
"info":"Коммерческие организации",
"to_name":"ООО \"Технический Центр ДЕЛЬТА\"",
"to_inn":"7726111111",
"account":"40711100000012321",
"toServiceId":"1717"
}
}
-
- Accept: application/json
- Content-type: application/json
- Authorization: Bearer ***
Send JSON object Payment in the request's body. Payment requisites in fields
object:
Name | Type | Description |
---|---|---|
fields.name | String | Recipient's bank name (escape quotes with \ ) |
fields.extra_to_bik | String | Recipient's bank MFO (BIK) |
fields.to_bik | String | Recipient's bank MFO (BIK) |
fields.city | String | Recipient's city of placement |
fields.info | String | Constant, Коммерческие организации (in Russian) |
fields.is_commercial | String | Service info, constant 1 |
fields.to_name | String | Recipient's organization name (escape quotes with \ ) |
fields.to_inn | String | Organization's TIN |
fields.to_kpp | String | Organization's KPP (code for the reason in the tax service regisration) |
fields.nds | String | Value-added tax flag. If you pay for invoice and there is no VAT, then put the string НДС не облагается (in Russian). Otherwise, put the string В т.ч. НДС (in Russian). |
fields.goal | String | Payment appointment |
fields.urgent | String | Urgent payment (0 - no, 1 - yes). Urgent payment is made in 10 minutes or more. It is applicable for weekdays from 9:00 to 20:30, Moscow time zone. Extra fee for the service is 25 rubles. |
fields.account | String | Recipient's account number |
fields.from_name | String | Recipient's first name |
fields.from_name_p | String | Recipient's middle name |
fields.from_name_f | String | Recipient's last name |
fields.requestProtocol | String | Service info, constant qw1 |
fields.toServiceId | String | Service info, QIWI provider ID 1717 |
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "21131343",
"terms": "1717",
"fields": {
"extra_to_bik":"044525201",
"requestProtocol":"qw1",
"city":"МОСКВА",
"name":"ПАО АКБ \"АВАНГАРД\"",
"to_bik":"044525201",
"urgent":"0",
"to_kpp":"772111001",
"is_commercial":"1",
"nds":"НДС не облагается",
"goal":" Оплата товара по заказу №090738231",
"from_name_p":"Николаевич",
"from_name":"Иван",
"from_name_f":"Михайлов",
"info":"Коммерческие организации",
"to_name":"ООО \"Технический Центр ДЕЛЬТА\"",
"to_inn":"7726111111",
"account":"40711100000012321",
"toServiceId":"1717"
},
"sum": {
"amount": 1000,
"currency": "643"
},
"source": "account_643",
"transaction": {
"id": "10969142201",
"state": {
"code": "Accepted"
}
}
}
Successful response contains JSON-object PaymentInfo with accepted payment data.
Performs search of QIWI provider's ID for payment methods by keywords (for example, provider's name).
curl -X GET \
"https://edge.qiwi.com/search/v1/search?query=%D0%91%D0%B8%D0%BB%D0%B0%D0%B9%D0%BD+%D0%B4%D0%BE%D0%BC%D0%B0%D1%88%D0%BD%D0%B8%D0%B9+%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%BD%D0%B5%D1%82" \
--header "Accept: application/json" \
--header "Authorization: Bearer <API token>"
GET /search/v1/search?query=%D0%91%D0%B8%D0%BB%D0%B0%D0%B9%D0%BD+%D0%B4%D0%BE%D0%BC%D0%B0%D1%88%D0%BD%D0%B8%D0%B9+%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%BD%D0%B5%D1%82 HTTP/1.1
Accept: application/json
Authorization: Bearer <API token>
Host: edge.qiwi.com
import requests
# provider id by its name
def qiwi_com_search(search_phrase):
s = requests.Session()
search = s.get('https://edge.qiwi.com/search/v1/search', params={'query':search_phrase})
return search.json()['data']['items']
URL https://edge.qiwi.com/search/v1/search?query={value}
- query — keywords for provider's searching separated by spaces.
-
- Accept: application/json
- Authorization: Bearer ***
HTTP/1.1 200 OK
Content-Type: application/json
{
"items": [
{
"name": "МТС Домашний интернет, ТВ и Телефония РФ",
"description": "МТС Домашний интернет, ТВ и Телефония РФ",
"uri": null,
"data": {
"id": 23729,
"logoUrl": "https://static.qiwi.com/img/providers/logoBig/23729_l.png",
"siteUrl": "http://www.mts.ru/internet/mts_stream/",
"category": {
"name": "Интернет, ТВ, IP-телефония"
},
"type": "PROVIDER"
}
},
...
]
}
# Provider search: response parsing
prv = qiwi_com_search('Билайн домашний интернет')[0]['data']['id']
print(str(prv))
Successful JSON-response contains IDs of the found QIWI providers:
Response field | Type | Description |
---|---|---|
items | Array of objects | List of providers |
items[].data.id | Number | Provider's ID in the array's element |
{
"id":"21131343",
"sum": {
"amount":1000,
"currency":"643"
},
"paymentMethod": {
"type":"Account",
"accountId":"643"
},
"fields": {
"extra_to_bik":"044525201",
"requestProtocol":"qw1",
"city":"МОСКВА",
"name":"ПАО АКБ \"АВАНГАРД\"",
"to_bik":"044525201",
"urgent":"0",
"to_kpp":"772111001",
"is_commercial":"1",
"nds":"НДС не облагается",
"goal":" Оплата товара по заказу №090738231",
"from_name_p":"Николаевич",
"from_name":"Иван",
"from_name_f":"Михайлов",
"info":"Коммерческие организации",
"to_name":"ООО \"Технический Центр ДЕЛЬТА\"",
"to_inn":"7726111111",
"account":"40711100000012321",
"toServiceId":"1717"
}
}
Object describes payment data for QIWI Wallet provider.
Name | Type | Description |
---|---|---|
id | String | Required. Client transaction ID (max 20 digits). Must be unique for each transaction. Increment with each following transaction. To satisfy these requirements, set it to 1000*(Standard Unix time in seconds). |
sum | Object | Required. Payment amount data |
--- | -- | -- |
sum.amount | Number | Payment amount value (rubles and kopeks, separator . ). Positive number rounded down to 2 decimals. If you specify more decimals, our system will round the number down to the same precision. |
sum.currency | String | Payment currency (only rubles, 643 ) |
----- | ----- | ----- |
paymentMethod | Object | Required. QIWI wallet account to fund the payment |
----- | ----- | ----- |
paymentMethod.type | String | Constant, Account |
paymentMethod.accountId | String | Constant, 643 |
----- | ----- | ----- |
fields | Object | Required. Payment requisites. Object fields depend on provider ID. |
comment | String | Payment comment. Used for QIWI wallet transfer or conversion only |
{
"id": "150217833198900",
"terms": "99",
"fields": {
"account": "79121238345"
},
"sum": {
"amount": 100,
"currency": "643"
},
"transaction": {
"id": "11155897070",
"state": {
"code": "Accepted"
}
},
"source": "account_643",
"comment": "My comment"
}
Object describes QIWI wallet transaction data and returns in response from Payment API.
Name | Type | Description |
---|---|---|
id | Number | id parameter from the original request |
terms | String | QIWI provider ID used for the payment |
fields | Object | fields object from the original request. Card number returns in masked form |
sum | Object | sum object from the original request |
source | String | Always constant, account_643 |
comment | String | comment parameter from the original request (if exists in the request) |
transaction | Object | Object with QIWI transaction data |
--- | --- | --- |
transaction.id | String | QIWI transaction ID |
transaction.state | Object | Current state of the transaction |
--- | --- | --- |
state.code | String | Current status of the transaction. Only Accepted is returned (it means that the payment is accepted for processing). Actual transaction status can be obtained from Payments history API. |
Invoice is the universal request for payment or money transfer from user's QIWI wallet.
API provides operations of invoice creation (only P2P invoices for money transfer to another QIWI wallet), payment, rejection, and also method for requesting list of unpaid invoices issued to your QIWI wallet.
You can issue invoices to any QIWI wallet by using P2P invoices API. Use special P2P token for authorization in P2P invoices API.
Authorize on p2p.qiwi.com, or use the given request. You may also specify Invoice payment callbacks URL in this request.
The method returns P2P tokens in JSON format:
PublicKey
response field — token for using with Payment form;SecretKey
response field — token for this P2P API.
Use QIWI Wallet API token for authorization.
curl -X POST \
https://edge.qiwi.com/widgets-api/api/p2p/protected/keys/create \
-H 'Authorization: Bearer <API token>' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{"keysPairName":"Name","serverNotificationsUrl":"https://test.com"}'
POST /widgets-api/api/p2p/protected/keys/create HTTP/1.1
Host: edge.qiwi.com
Authorization: Bearer 3b7beb2044c4dd4a8f4588d4a6b6c93f
Content-Type: application/json
User-Agent: ****
{"keysPairName":"Name", "serverNotificationsUrl":"https://test.com"}
-
- Content-Type: application/json
- Authorization: Bearer QIWI Wallet API token
Send parameters in JSON-body:
Name | Type | Description |
---|---|---|
keysPairName | String | Name for the couple of P2P tokens |
serverNotificationsUrl | String | Invoice payment callbacks URL (optional) |
Returns only unpaid invoices issued to your wallet. Invoices are placed in the list in reverse chronological order.
By default, the list is paginated on 50 elements on each page. You can specify the number of elements on each page. You may use filters: invoice creation period of dates and starting invoice ID.
curl -X GET \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ***' \
'https://edge.qiwi.com/checkout-api/api/bill/search?statuses=READY_FOR_PAY&rows=50'
GET /checkout-api/api/bill/search?statuses=READY_FOR_PAY&rows=50 HTTP/1.1
Accept: application/json
Authorization: Bearer ***
Host: edge.qiwi.com
User-Agent: ****
-
- Accept: application/json
- Authorization: Bearer SecretKey
Send parameters in the request query URL:
Name | Type | Description |
---|---|---|
statuses | String | Unpaid invoice status. Only READY_FOR_PAY . Required parameter. |
rows | Integer | Maximum number of invoices to be returned, for list pagination. Integer number from 1 to 50. Default value is 50. |
min_creation_datetime | Long | Lower time limit for invoice search, Unix-time |
max_creation_datetime | Long | Greater time limit for invoice search, Unix-time |
next_id | Number | Starting invoice identifier for invoice search. Only invoices with IDs equal or smaller than this ID are returned. Use it for obtaining next invoices in the paginated list. |
next_creation_datetime | Long | Starting date for invoice search, Unix-time. Only invoices created before this date are returned. Use it for obtaining next invoices in the paginated list. |
HTTP/1.1 200 OK
Content-Type: application/json
{
"bills": [
{
"id": 1063702405,
"external_id": "154140605",
"creation_datetime": 1523025585000,
"expiration_datetime": 1523026003808,
"sum": {
"currency": 643,
"amount": 100
},
"status": "READY_FOR_PAY",
"type": "MERCHANT",
"repetitive": false,
"provider": {
"id": 480706,
"short_name": "Интернет-магазин цветов",
"long_name": "ООО «Цветы»",
"logo_url":"https://static.qiwi.com/img/providers/logoBig/480706_l.png"
},
"comment": "Пополнение счета 13515573",
"pay_url":"https://oplata.qiwi.com/form?shop=480706&transaction=102263702405"
}
]
}
Successful JSON response includes a list of unpaid invoices according to the conditions of the request:
Response field | Type | Description |
---|---|---|
bills | Array[Object] | List of invoices. List length is rows parameter from the original request, or 50, if it is absent |
bills[].id | Integer | QIWI Wallet invoice ID |
bills[].external_id | String | Merchant's invoice ID |
bills[].creation_datetime | Long | Date/time of the invoice creation, Unix-time |
bills[].expiration_datetime | Long | Date/time of the invoice expiration, Unix-time |
bills[].sum | Object | Invoice amount data |
--- | ---- | ---- |
sum.currency | Integer | Invoice currency |
sum.amount | Number | Invoice amount |
--- | ---- | ---- |
bills[].status | String | Constant, READY_FOR_PAY |
bills[].type | String | Constant, MERCHANT |
bills[].repetitive | Boolean | Service data |
bills[].provider | Object | Merchant information |
--- | ---- | ---- |
provider.id | Integer | QIWI identifier |
provider.short_name | String | Short name |
provider.long_name | String | Full name |
provider.logo_url | String | Logo URL |
--- | ---- | ---- |
bills[].comment | String | Invoice comment |
bills[].pay_url | String | URL to pay for the invoice on QIWI Payment Form |
Makes invoice payment immediately without SMS confirmation.
curl -X POST \
'https://edge.qiwi.com/checkout-api/invoice/pay/wallet' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ***' \
-d '{
"invoice_uid": "1063702405",
"currency": "643"
}'
POST /checkout-api/invoice/pay/wallet HTTP/1.1
Accept: application/json
Content-type: application/json
Authorization: Bearer ***
Host: edge.qiwi.com
User-Agent: ****
{
"invoice_uid": "1063702405",
"currency": "643"
}
-
- Accept: application/json
- Content-type: application/json
- Authorization: Bearer SecretKey
Required parameters in JSON body:
Name | Type | Description |
---|---|---|
invoice_uid | String | QIWI invoice ID, taken from bills[].id field of invoice data |
currency | String | Invoice currency, taken from bills[].sum.currency field of invoice data) |
HTTP/1.1 200 OK
Content-Type: application/json
{
"invoice_status": "PAID_STATUS",
"is_sms_confirm": false,
"WALLET_ACCEPT_PAY_RESULT": {}
}
Successful response contains JSON with paid invoice status:
Field | Type | Description |
---|---|---|
invoice_status | String | Invoice payment status, PAID_STATUS . Any other status means unsuccessful transaction. |
is_sms_confirm | String | SMS confirmation flag |
Rejects an unpaid invoice, which makes the invoice unavailable for payment.
curl -X POST \
'https://edge.qiwi.com/checkout-api/api/bill/reject' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ***' \
-d '{ "id": 1034353453 }'
POST /checkout-api/api/bill/reject HTTP/1.1
Accept: application/json
Authorization: Bearer ***
Content-type: application/json
Host: edge.qiwi.com
User-Agent: ****
{
"id": 1034353453
}
-
- Accept: application/json
- Content-type: application/json
- Authorization: Bearer SecretKey
Required parameter in JSON body:
Name | Type | Description |
---|---|---|
id | Integer | Invoice ID to reject, taken from bills[].id field of invoice data |
HTTP/1.1 200 OK
Successful response has HTTP code 200
.