Overview
Doc version 1.22 | Edit on GitHub
The Payments protocol provides a payment processing solutions that helps you accept payments in fast and secure way. The protocol gives your customers flexibility to pay the way they want, including:
- Debit or credit cards, like Visa, Mastercard, and Mir.
- QIWI Wallet.
- Faster Payments Systems (SBP).
- Mobile phone account.
Terms and Abbreviations
API Key — String for merchant authorization in API according to OAuth 2.0 standard RFC 6749 RFC 6750.
Payment token — String linked to the card data for payments without entering card details.
API: Application Programming Interface — a set of ready-made methods provided by the application (system) for use in external software products.
REST: Representational State Transfer — a software architectural pattern for Network Interaction between distributed application components.
JSON: JavaScript Object Notation — a lightweight data-interchange format based on JavaScript RFC 7159.
3DS: 3-D Secure — protection protocol to authenticate card holder while making a payment transaction over the Internet. QIWI supports both 3DS 1.0 version and 3DS 2.0 version of the protocol.
RSP, Merchant — Retail Service Provider.
MPI: Merchant Plug-In — programming module performing 3DS customer authentication.
PCI DSS: Payment Card Industry Data Security Standard – a proprietary information security standard for storing, processing and transmitting credit card data established by Visa, MasterCard, American Express, JCB, and Discover.
How to Get Started
To start using Protocol, you need to complete the following steps.
Step 1. Leave request to integrate on b2b.qiwi.com
After processing the requests, our personnel contact you to discuss possible ways of integration, collect the necessary documents and start integration process.
Step 2. Get access to your Account
Upon connecting to the Payment Protocol, we provide you the unique site identifier (siteId
) and access to your Account in our system. We send the Account credentials to your e-mail address specified on registration.
Step 3. Issue API access key for the integration
API access key is used for interaction with API. Issue API access key in Settings section of your Account.
Step 4. Test the interaction
During integration process, your siteId
identifier is in test mode. You can proceed test operations without debiting credit card. See Test and Production Mode for details.
When integration on your side is completed, we turn your siteId
to production mode. In the production mode cards are debited.
Ways of Integration
Payment protocol provides several ways of integration:
Available Payment Methods
Method | Payment through QIWI Form | Payment through merchant form |
---|---|---|
Credit/debit card* | ✓ | ✓** |
Payment by payment token | ✓ | ✓ |
Faster Payments System | ✓ | ✓ |
QIWI Wallet Balance | ✓ | ✓*** |
Mobile phone account | × | ✓ |
*
— default payment method, other methods are available upon request.
**
— PCI DSS certification is required.
***
— by issuing a payment token for QIWI wallet
Operation Types
The following operations are available in the protocol:
- An Invoice — an electronic document that the merchant has issued to the customer. Contains information about the amount and number of the customer order. It is not a financial entity and has a limited lifespan. Billing is required to obtain a URL to the QIWI payment form.
- Payment — a cash write-off transaction from the customer in favour of the merchant. The actual write-off occurs only after confirmation (see Capture). When working through the QIWI payment form, Payment is an attempt to pay the bill (see Invoice).
- Complete — the completion of 3DS verification of the customer. It is used when working through the Merchant Payment Form.
- Confirmation (Capture) — confirmation of authorization (charging) of the funds. Only single successful payment confirmation is possible.
- Refund — refund to the customer on a successful payment. Financial operation of debiting money from the merchant in favor of the customer. If there was no confirmation for Payment operation, you will receive the Reversal flag in the response to Refund operation request and the money from the customer's account will not be transferred to the Merchant's account (the acquiring fee is also not withheld).
Payment processing and settlements scheme
Merchant participant qb as QIWI participant ips as Payment system participant ipscust as Bank of
Customer
Issuer or bank-sender customer->>store:Payment start store->>qb:Payment operation qb->>ips:Payment authorization ips->>ipscust:Payment authorization rect rgb(255, 238, 223) Note over ipsstore, ipscust:Settlements ipscust->>ips:₽₽₽ ips->>qb:₽₽₽ qb->>ipsstore:₽₽₽ end
Interaction format
The Payment protocol API is built on the REST architecture, where data and methods are considered as resources accessed via calling Uniform Resource Identifiers (URIs).
API uses HTTPS-requests for calling its methods. API endpoint has URL:
https://api.qiwi.com/partner/
API requests' parameters are transferred as the request body JSON data. Parameters in HTTP GET-requests are placed in URL query.
It is necessary to put Accept: application/json
header into the request headers as API always responds in JSON format.
The API methods provide logical idempotence, i. e. repeating a method multiple times is equivalent to doing it once. However, the response may change (for example, the state of an invoice may change between requests).
Authorization
Request with authorization
curl -X PUT \
https://api.qiwi.com/partner/v1/sites/{site_id}/payments/{payment_id} \
--oauth2-bearer <API Key>
Authorization header
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
For the requests authorization OAuth 2.0 standard is used in accordance with RFC 6750. Always put API access key value into Authorization
HTTP-header as
Bearer <API Key>
How to Test Operations
During integration, your siteId
identifier is in test mode. You can proceed operations without debiting credit card. You can also request a switch to test mode for any of your siteId
, or add a new siteId
to test mode through your manager in QIWI Support.
For testing purposes, the same protocol URLs are used.
Test mode is not supported for QIWI Wallet balance payments.
You don't need to re-release the API access key when you go into the production mode.
If necessary, change the permanent URL for notifications from a test notification (such as https://your-shop-test.ru/callbacks
) to a production one (such as https://your-shop-prod.ru/callbacks
) in your Account Profile.
Card payment
To test various payment methods and responses, use different expiry dates:
Month of card expiry date | Result |
---|---|
02 |
Operation is treated as unsuccessful |
03 |
Operation is processed successfully with 3 seconds timeout |
04 |
Operation is processed unsuccessfully with 3 seconds timeout |
All other values | Operation is treated as successful |
CVV in testing mode may be arbitrary (any 3 digits).
You can also check payment token issue. Issue scheme in the test mode is the same as in production mode. It is described in Card payment token issue section.
Test card numbers
- Mir:
2200000000000004
,2200000000000012
,2200000000000020
,2200000000000038
,2200000000000046
,2200000000000053
,2200000000000061
,2200000000000079
,2200000000000087
,2200000000000095
,2200000000000103
,2200000000000111
- Visa:
4256000000000003
,4256000000000011
,4256000000000029
,4256000000000037
,4256000000000045
,4256000000000052
,4256000000000060
,4256000000000078
,4256000000000086
,4256000000000094
,4256000000000102
,4256000000000110
- Mastercard:
5236000000000005
,5236000000000013
,5236000000000021
,5236000000000039
,5236000000000047
,5236000000000054
,5236000000000062
,5236000000000088
,5236000000000096
,5236000000000104
,5236000000000112
,5236000000000120
- UnionPay:
6056000000000000
,6056000000000018
,6056000000000026
,6056000000000034
,6056000000000042
,6056000000000059
,6056000000000067
,6056000000000075
,6056000000000083
,6056000000000091
,6056000000000109
,6056000000000117
Test 3-D Secure operations
- Create a payment link via API, or without it.
- Use any card from Test Card Numbers list.
- For 3-D Secure in test mode CVV should be
849
or use a cardholder name that contains the string3ds
. - Confirm or reject the transaction on the form.
Test limits
- You may use only Russian ruble (
643
code) for the currency (amount.currency
). -
Restrictions on the amount and number of operations:
- Maximum allowed amount of a single transaction is 10 rubles.
- Maximum number of transactions is 100 per day. All transactions within the current day (by Moscow timezone) with each transaction' amount not more than 10 rubles are taken into account.
Payment through Faster Payments System
In test mode, you can use only QR-code issue and its status request. To test various responses, use different payment amounts (amount.value
field):
200
— QR-code is successfully created.- For any other amounts the payment would be unsuccessful with
DECLINED
status.
When requesting FPS payment status in the test mode the following statuses are returned:
CREATED
— Payment created.DECLINED
— Payment declined.EXPIRED
— Payment QR-code lifetime is expired.
Payment Through QIWI Form
When you integrate payments through the QIWI form, the only available payment method is by bank cards. The following payment methods are enabled on demand:
- Card payment token.
- Faster Payments System.
- QIWI Wallet.
To create invoice for a payment, use API to issue an invoice or simply redirect customer to the QIWI Form by the direct link with the invoice data.
Payment process
One-step payment — all payment methods
Two-step payment — only cards activate qb qb->>store:Response with QIWI Payment form URL
("payUrl" parameter) store->>customer:Redirecting customer to payUrl customer->>qb:Open Payment form,
choose payment method,
enter details for chosen method qb->>customer:Customer authentication:
3-D Secure for cards customer->>qb:Authentication qb->>ips:Request for funds charging activate ips ips->>qb:Operation status qb->>store:Notification with operation status rect rgb(255, 238, 223) Note over qb, customer: "successUrl" parameter is applied to QIWI Payment form URL qb->>customer: Return to the merchant site on successful payment end store->>qb: Check operation status
API: Payment status request qb->>store: Operation status rect rgb(255, 238, 223) Note over store, ips:Two-step payment store->>qb:Payment confirmation
API: Payment confirmation request qb->>ips:Confirming card charging deactivate ips qb->>store:Notification on payment confirmation store->>qb: Check operation status
API: Payment confirmation status request qb->>store: Operation status end deactivate qb deactivate store
QIWI Payment Form integration without API
For merchants, this is the way to integrate without API methods implementation.
Invoice parameters are included into the Payment Form URL — see examples and parameters list below. When the form is opened, the customer is automatically billed for the order.
When paying an invoice issued this way the payment is authorized without the participation of the merchant. As the two-step payment scheme is used (authorization and confirmation), you need to confirm payment in your Account Profile. By default, the service waits for the payment confirmation in 72 hours. When time is up the payment is confirmed automatically.
GET →
Link to the form with payment amount
https://oplata.qiwi.com/create?publicKey=5nAq6abtyCz4tcDj89e5w7Y5i524LAFmzrsN6bQTQ3ceEvMvCq55ToeErzhvK6rVkQLaCrYUQcYF5QkS8nCrjnPsLQgsLxqrpQgJ7hg2ZHmEHXFjaG8qjvgcep&extras[cf1]=Order_123&extras[cf3]=winnie@pooh.ru&readonly_extras=cf1&comment=some%20comment&amount=100.00
Link to the form without payment amount (it is filled in by the customer)
https://oplata.qiwi.com/create?publicKey=5nAq6abtyCz4tcDj89e5w7Y5i524LAFmzrsN6bQTQ3ceEvMvCq55ToeErzhvK6rVkQLaCrYUQcYF5QkS8nCrjnPsLQgsLxqrpQgJ7hg2ZHmEHXFjaG8qjvgcep&extras[cf1]=Order_123&extras[cf3]=winnie@pooh.ru&readonly_extras=cf1
URL https://oplata.qiwi.com/create?publicKey={key}&{parameter}={value}
Parameters
Invoice parameters put to the URL query.
Parameter | Description | Type |
---|---|---|
publicKey | Required. Merchant identification key. For each siteId the unique key is produced. You can get the key in your Account Profile in Settings section. |
String |
billId | Unique invoice identifier in the merchant's system. It must be generated on your side with any means. Arbitrary sequence of digits and letters, _ and - symbols as well. If not used, on each URL opening a new invoice is created. |
URL-encoded string String(200) |
amount | Amount of customer order rounded down to 2 digits (always in rubles) | Number(6.2) |
currency | Currency code for the purchase. Possible values: RUB , EUR , USD . Default value RUB |
String(3) |
phone | Customer phone number (international format) | URL-encoded string |
Customer e-mail | URL-encoded string | |
comment | Comment to the invoice | URL-encoded string String(255) |
successUrl | URL for a customer return to the merchant site after the successful payment. URL should be UTF-8 encoded. | URL-encoded string |
paymentMethod | Payment method suggested to the customer on the QIWI form. Possible values: CARD , SBP , QIWI_WALLET . If the method is not enabled for the merchant, an available method is suggested. By default, CARD . |
String |
extras[cf1] | Extra field to add any information to invoice data | URL-encoded string |
extras[cf2] | Extra field to add any information to invoice data | URL-encoded string |
extras[cf3] | Extra field to add any information to invoice data | URL-encoded string |
extras[cf4] | Extra field to add any information to invoice data | URL-encoded string |
extras[cf5] | Extra field to add any information to invoice data | URL-encoded string |
extras[themeCode] | Extra field with code style of the Payment form | URL-encoded string |
readonly_extras | List of the extra fields which customer cannot edit on the invoice pay form | String, separator of the field names , . Example: cf1,cf3 |
By default, the customer is automatically authenticated after the invoice is paid. Authentication is also automatically completed.
API invoice issue and QIWI payment form
Invoice creation when payment is put on hold (two-step payment)
PUT /partner/payin/v1/sites/{siteId}/bills/893794793973 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"amount": {
"currency": "RUB",
"value": 42.24
},
"billPaymentMethodsType": [
"QIWI_WALLET",
"SBP"
],
"comment": "Spasibo",
"expirationDateTime": "2019-09-13T14:30:00+03:00",
"customFields": {}
}
Notification with paymentId
"payment": {
"type": "PAYMENT",
"paymentId": "824c7744-1650-4836-abaa-842ca7ca8a74", <== paymentId necessary for confirmation
"createdDateTime": "2022-07-27T12:43:35+03:00",
"status": {
"value": "SUCCESS",
"changedDateTime": "2022-07-27T12:43:47+03:00"
},
"amount": {
"value": 1.00,
"currency": "RUB"
},
"paymentMethod": {
"type": "CARD",
"maskedPan": "512391******6871",
"cardHolder": null,
"cardExpireDate": "3/2030"
},
"tokenData": {
"paymentToken": "cc123da5-2fdd-4685-912e-8671597948a3",
"expiredDate": "2030-03-01T00:00:00+03:00"
},
"customFields": {
"cf2": "dva",
"cf1": "1",
"cf4": "4",
"cf3": "tri",
"cf5": "5",
"full_name": "full_name",
"phone": "phone",
"contract_id": "contract_id",
"comment": "test",
"booking_number": "booking_number"
},
"paymentCardInfo": {
"issuingCountry": "643",
"issuingBank": "Tinkoff Bank",
"paymentSystem": "MASTERCARD",
"fundingSource": "UNKNOWN",
"paymentSystemProduct": "TNW|TNW|Mastercard® New World—Immediate Debit|TNW|Mastercard New World-Immediate Debit"
},
"merchantSiteUid": "test-00",
"customer": {
"email": "darta@mail.ru",
"account": "11235813",
"phone": "79850223243"
},
"gatewayData": {
"type": "ACQUIRING",
"eci": "2",
"authCode": "0123342",
"rrn": "001239598011"
},
"billId": "191616216126154",
"flags": [
"AFT"
]
},
"type": "PAYMENT",
"version": "1"
}
Payment confirmation
PUT /partner/payin/v1/sites/{siteId}/payments/804900/captures/bxwd8096 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
Invoice creation when payment is processed without customer authentication (one-step payment)
PUT /partner/payin/v1/sites/23044/bills/893794793973 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"amount": {
"currency": "RUB",
"value": 100.00
},
"expirationDateTime": "2018-04-13T14:30:00+03:00",
"flags": [
"SALE"
]
}
The payment protocol supports both a two-step payment with holding funds on the customer's card and a one-step payment without the authentication of the customer.
In two-step payment scenario:
-
Create an invoice using the API request Invoice with parameters:
- The API access key.
- The amount of the invoice (
amount
). - The date before which the invoice must be paid (
expirationDateTime
). - (optional) Other invoice data:
- Customer data (
customer
,address
). - Comment on the invoice (
comment
). - Other information (
customFields
).
- Customer data (
To limit payment methods accessible for the customer on the Payment form, specify them in
billPaymentMethodsType
API parameter. Listed methods should be enabled forsiteId
of the API request. - Redirect the customer to QIWI Payment form using URL from
payUrl
parameter of the API response, or use Popup JavaScript library to open the form in a popup window. - Get
paymentId
identifier of the payment:- From server notification after successful holding of funds.
- From the response to the Invoice payments list request.
- Send API request Payment confirmation with received
paymentId
identifier. - Wait for the payment confirmation. Either you receive a notification, or send Capture status API request in cycle to get an information about the capture.
The reimbursement is formed only after the payment confirmation.
In one-step payment scenario:
-
Create an invoice using the API request Invoice with parameters:
- The API access key.
- The amount of the invoice (
amount
). - The date before which the invoice must be paid (
expirationDateTime
). - The flag for one-step scenario
"flags":["SALE"]
. - (optional) Other invoice data:
- Customer data (
customer
,address
). - Comment on the invoice (
comment
). - Other information (
customFields
).
- Customer data (
To limit payment methods accessible for the customer on the Payment form, specify them in
billPaymentMethodsType
API parameter. Listed mods should be enabled forsiteId
of the API request. - Redirect the customer to QIWI Payment form using URL from
payUrl
parameter of the API response, or use Popup JavaScript library to open the form in a popup window. - Wait for the payment completion. Either you receive a notification, or send Invoice status API request in cycle to get an information about the payment.
Payment token
Invoice payable with payment token
PUT /partner/payin/v1/sites/test-02/bills/1815 HTTP/1.1
Accept: application/json
Authorization: Bearer 7uc4b25xx93xxx5d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"amount": {
"currency": "RUB",
"value": 100.00
},
"comment": "Text comment",
"expirationDateTime": "2018-04-13T14:30:00+03:00",
"customer": {
"account": "token234"
},
"customFields": {
"cf1": "Some data"
}
}
}
The payment tokens are used for charging a customer balance without entering card details or QIWI Wallet number. By default, the use of payment tokens is disabled. Contact your manager in QIWI Support to enable that.
See details of the issue of a payment token in this section.
To create an invoice payable with payment token, send in API request Invoice the following data:
- API access key.
- Amount of the invoice (
amount
). - Last date of payment for the invoice (
expirationDateTime
). - Customer identifier for which the payment token was issued, in
customer.account
parameter. Payment by payment token is not possible without this parameter. - Other information about the invoice (
comment
,customFields
).
Then redirect the customer to QIWI Payment form using URL from payUrl
parameter of the API response, or use Popup JavaScript library to open the form in a popup window. If one or more payment tokens have been issued for the customer, the Payment form would display their linked cards.
To use the payment token, the customer chooses a card from the drop-down list. Card data or 3-D Secure authentication is not required.
To charge funds on a payment token without the customer's participation, use the API method Payment. See details in section Using payment token for the merchant's payment form.
Redirect to QIWI Form
Response with payUrl parameter
HTTP/1.1 200 OK
Content-Type: application/json
{
"siteId": "test-01",
"billId": "gg",
"amount": {
"currency": "RUB",
"value": 42.24
},
"status": {
"value": "WAITING",
"changedDateTime": "2019-08-28T16:26:36.835+03:00"
},
"customFields": {},
"comment": "Spasibo",
"creationDateTime": "2019-08-28T16:26:36.835+03:00",
"expirationDateTime": "2019-09-13T14:30:00+03:00",
"payUrl": "https://oplata.qiwi.com/form/?invoice_uid=78d60ca9-7c99-481f-8e51-0100c9012087"
}
After invoice creation in API, the URL of the QIWI Form is taken from payUrl
field of the API response.
Example of the URL with "successUrl" parameter
https://oplata.qiwi.com/form?invoiceUid=606a5f75-4f8e-4ce2-b400-967179502275&successUrl=https://example.com/payments/#introduction
You can add the following parameter to the URL:
Parameter | Description | Type |
---|---|---|
successUrl | URL for a customer return to the merchant site after the successful payment. Redirect proceeds after the successful 3DS authentication. URL should be UTF-8 encoded. | URL-encoded string |
lang | Interface language of the QIWI form. By default, ru |
ru , en |
paymentMethod | Payment method suggested to the customer on the QIWI form. If the method is not enabled for the merchant, some available method is suggested. By default, CARD . |
CARD , SBP , QIWI_WALLET |
Example of event listener for iframe
window.addEventListener('message', function (event) {
switch (event.data) {
case 'INITIALIZED':
// Form loaded
break;
case 'PAYMENT_ATTEMPT':
// Payment attempt
break;
case 'PAYMENT_SUCCEEDED':
// Payment successful
break;
case 'PAYMENT_FAILED':
// Payment failed
break;
}
}, false)
By default, 3-D Secure is required on the QIWI Form.
When opening URL of the QIWI Form in <iframe>
, use additional parameter allow
:
<iframe allow="payment" src="<payUrl link> ..." />
You can use postMessage
method to listen events in the Form.
Possible values of the Form state:
INITIALIZED
— Form loaded.PAYMENT_ATTEMPT
— Payment attempt was performed.PAYMENT_SUCCEEDED
— Payment successfully processed.PAYMENT_FAILED
— Payment failed.INITIALIZATION_FAILED
— Error on the Form loading.
Checkout Popup Library
The library helps to use QIWI Payment Form in a popup. It has two methods:
To install the library, add the following script into your web-page:
<script src='https://oplata.qiwi.com/popup/v2.js'></script>
Create invoice
Create new invoice
params = {
publicKey: '5nAq6abtyCz4tcDj89e5w7Y5i524LAFmzrsN6bQTQ3c******',
amount: 10.00,
phone: '79123456789',
email: 'test@example.com',
account: 'account1',
comment: 'Payment',
customFields: {
data: 'data'
},
lifetime: '2022-04-04T1540'
}
QiwiCheckout.createInvoice(params)
.then(data => {
// ...
})
.catch(error => {
// ...
})
To create invoice and open its payment form in a popup, call method QiwiCheckout.createInvoice
. Method has the following parameters:
Parameter | Description | Format |
---|---|---|
publicKey | Required. Merchant identification key. For each siteId the unique key is produced. You can get the key in your Account Profile in Settings section. |
String |
amount | Required. Amount of the invoice rounded down on two decimals | Number(6.2) |
phone | Phone number of the client to which the invoice is issuing (international format) | String |
E-mail of the client where the invoice payment link will be sent | String | |
account | Client identifier in merchant’s system | String |
comment | Invoice commentary | String(255) |
customFields | Additional invoice data. Obtain full list of data fields in the description of the same parameter in invoice API request | Object |
lifetime | Invoice payment’s due date. If the invoice is not paid before that date, it assigns final status and becomes void | URL-encoded string YYYY-MM-DDThhmm |
Open invoice
Open an existing invoice in popup
params = {
payUrl: '<URL of the invoice Pay form>'
}
QiwiCheckout.openInvoice(params)
.then(data => {
// ...
})
.catch(error => {
// ...
})
To open existing invoice payment form in a popup, call method QiwiCheckout.openInvoice
. Method has single parameter:
Parameter | Description | Type |
---|---|---|
payUrl | Required. URL of the invoice Pay form | String |
Customization of QIWI Payment Form
Example of calling Custom Payment form
PUT /partner/payin/v1/sites/23044/bills/893794793973 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"amount": {
"currency": "RUB",
"value": 100.00
},
"comment": "Text comment",
"expirationDateTime": "2018-04-13T14:30:00+03:00",
"customer": {},
"customFields": {
"themeCode":"merchant01-style01"
}
}
Add your style, customizable logo, background, and color of the buttons to the Payment form on the QIWI side. To do so, contact QIWI Support and provide the following information:
- Unique alias for the Payment form (latin letters, digits, and
-
dash symbol). - Merchant name to be displayed on the Form.
- Logo in PNG or SVG format with 48x48 size or proportionally larger.
- Color of buttons, in HEX.
Some optional data are also used:
- Offer reference.
To use your Custom Payment form:
-
Send the alias for the Payment form in
"themeCode"
field ofcustomFields
object of API request Invoice:"themeCode":"merchant01-theme01"
.URL received in
payUrl
field of the API response points to the Custom Payment form. -
Send the alias for the Payment form in direct call of the form in
extras[themeCode]
parameter:...&extras[themeCode]=merchant01-theme01
.
Example of the customized Payment form:
Payment Through Merchant Web Form
Bank Card payment method is available for integration by default. The following payment methods are enabled on demand:
Payment process
enter card data activate store store->>qb:API: Payment request
One-step payment — all payment methods
Two-step payment — only cards activate qb qb->>store:Operation status, 3DS data or
QR code for Faster Payment System rect rgb(255, 238, 223) Note over customer, ips:3-D Secure store->>customer:Redirecting customer to acsUrl
or to the bank app (Fast Payments System) activate ips ips->>customer:Customer authentication:
3DS — cards,
Faster Payment System — confirming the operation in the card issuer app customer->>ips:Authentication ips->>store:Result of the authentication (PaRes) store->>qb:API: Completing customer authentication request end qb->>ips:Request for charging funds activate ips ips->>qb:Operation status qb->>store:Notification on the status of the operation store->>qb: Check operation status
API: Payment status request qb->>store: Operation status rect rgb(255, 238, 223) Note over store, ips:Two-step payment store->>qb:API: Payment confirmation request qb->>ips:Confirming card charging deactivate ips qb->>store:Notification on the payment confirmation store->>qb: Check operation status
API: Payment confirmation status request qb->>store: Operation status end deactivate qb deactivate store
To create a payment, send the following data in API request Payment:
- API access key;
- amount of payment;
- payment method;
- other information for payment creation.
Bank card payment
The payment protocol supports both a two-step payment with holding funds on the customer's card, and a one-step payment without the authentication of the customer.
Payment creation
Example of a payment with subsequent funds hold (two-step)
PUT /partner/payin/v1/sites/test-01/payments/1811 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"amount": {
"currency": "RUB",
"value": 1.00
},
"paymentMethod" : {
"type" : "CARD",
"pan" : "4444443616621049",
"expiryDate" : "12/19",
"cvv2" : "123",
"holderName" : "unknown cardholder"
}
}
Example of a payment with immediate client charging (one-step payment)
PUT /partner/payin/v1/sites/test-01/payments/1811 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"amount": {
"currency": "RUB",
"value": 1.00
},
"paymentMethod" : {
"type" : "CARD",
"pan" : "4444443616621049",
"expiryDate" : "12/19",
"cvv2" : "123",
"holderName" : "unknown cardholder"
},
"flags": [ "SALE" ]
}
To start payment with subsequent hold of funds on the client card (two-step payment), send the following data in API request Payment:
- API access key;
- payment amount data;
- payment method parameters in
paymentMethod
object:type
—CARD
;pan
— card number;expiryDate
– card expiry date inMM/YY
format;cvv2
— card CVV2/CVC2;holderName
– card holder name (Latin letters);
- other information about the payment.
When the customer card was previously tokenized on your side, the following parameters in paymentMethod
should be included:
cardTokenPaymentType
– parameter for correct processing of transactions in the payment systems. Allowed values:FIRST_PAYMENT
— when you are going to save the card data on your side;INITIATED_BY_CLIENT
— transaction on the saved card initiated by a client;INITIATED_BY_MERCHANT
— transaction on the saved card initiated by the merchant;RECURRING_PAYMENT
— recurring operation on the saved card;INSTALLMENT
— repeated operation on the saved card in accordance with payment schedule for credit repayment.
firstTransaction
– JSON-object with transaction identifier info where card was saved. Contains fields:paymentId
– unique payment identifier in RSP information system;trnId
– unique payment identifier in NSPK information system.
For the two-step payment (default option), the reimbursement is formed only after the order confirmation.
To make one-step payment without the funds holding, include the "flags":["SALE"]
parameter in the API request Payment. If you do not pass this parameter, the funds holding for the payment is made and service waits for confirmation of the payment.
Awaiting the customer authentication (3-D Secure)
Example of response with customer authentication requirement
{
"paymentId": "1811",
"billId": "autogenerated-a29ea8c9-f9d9-4a60-87c2-c0c4be9affbc",
"createdDateTime": "2019-08-15T13:28:26+03:00",
"amount": {
"currency": "RUB",
"value": 1.00
},
"capturedAmount": {
"currency": "RUB",
"value": 0.00
},
"refundedAmount": {
"currency": "RUB",
"value": 0.00
},
"paymentMethod": {
"type": "CARD",
"maskedPan": "444444******1049",
"rrn": "123",
"authCode": "181218",
"type": "CARD"
},
"status": {
"value": "WAITING",
"changedDateTime": "2019-08-15T13:28:26+03:00"
},
"requirements" : {
"threeDS" : {
"pareq" : "eJyrrgUAAXUA+Q==",
"acsUrl" : "https://test.paymentgate.ru/acs/auth/start.do"
}
}
}
Redirecting for 3-D Secure authentication
<form name="form" action="{ACSUrl}" method="post" >
<input type="hidden" name="TermUrl" value="{TermUrl}" >
<input type="hidden" name="MD" value="{MD}" >
<input type="hidden" name="PaReq" value="{PaReq}" >
</form>
Finishing customer authentication
POST /partner/payin/v1/sites/test-01/payments/1811/complete HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"threeDS": {
"pares": "eJzVWFevo9iyfu9fMZrzaM0QjWHk3tIiGptgooE3cgabYMKvv3jvTurTc3XOfbkaJMuL...."
}
}
If bank requires 3-D Secure authentication of the customer, the payment response contains the requirements.threeDS
JSON-object with fields:
acsUrl
— 3-D Secure authentication server URL to redirect to the issuer's confirmation page;pareq
— an encrypted 3-D Secure authentication request.
To proceed with additional authentication from the issuer, send a POST form to the 3-D Secure authentication server URL with parameters:
TermUrl
— customer redirection URL after successful 3-D Secure authentication;MD
— a unique transaction identifier;PaReq
— thepareq
value from the response to the payment request.
To maintain backward compatibility, using 3-D Secure 1.0 or 3-D Secure 2.0 does not affect your integration with the API.
The customer's information is passed to the card payment system. The issuer bank either grants permission to charge funds without authentication (frictionless flow) or decides whether to authenticate with a single-time password (challenge flow). After the authentication is passed, the customer is redirected to TermUrl
URL with the encrypted result of the authentication in the PaRes
parameter.
To complete the authentication of the customer, pass on the API request Completing customer authentication:
- unique RSP ID;
- payment number (
paymentId
option) from the response to the payment request; - 3-D Secure verification value (
PaRes
value)
Confirm payment
Notification example
{
"payment":{
"paymentId":"804900", <==paymentId required for 'capture'
"type":"PAYMENT",
"createdDateTime":"2020-11-28T12:58:49+03:00",
"status":{
"value":"SUCCESS",
"changedDateTime":"2020-11-28T12:58:53+03:00"
},
"amount":{
"value":100.00,
"currency":"RUB"
},
"paymentMethod":{
"type":"CARD",
"maskedPan":"444444XXXXXX4444",
"rrn":null,
"authCode":null,
"type":"CARD"
},
"merchantSiteUid":"test-00",
"customer":{
"phone":"75167693659"
},
"gatewayData":{
"type":"ACQUIRING",
"eci":"6",
"authCode":"181218"
},
"billId":"autogenerated-a51d0d2c-6c50-405d-9305-bf1c13a5aecd",
"flags":[]
},
"type":"PAYMENT",
"version":"1"
}
Capture example
PUT /partner/payin/v1/sites/{siteId}/payments/804900/captures/bxwd8096 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
The capture step is required only for two-step payments with holding funds.
To confirm payment:
- Get
paymentId
of the payment:- From notification after successful holding funds.
- From the response to Payment status API request.
- Send API request Confirm payment with received
paymentId
value.
Payment token
Using payment token in a payment request
PUT /partner/payin/v1/sites/test-02/payments/1815 HTTP/1.1
Accept: application/json
Authorization: Bearer 7uc4b25xx93xxx5d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"amount": {
"currency": "RUB",
"value": 2000.00
},
"paymentMethod" : {
"type": "TOKEN",
"paymentToken" : "66aebf5f-098e-4e36-922a-a4107b349a96"
},
"customer": {
"account": "token324"
}
}
The payment tokens are used for charging a customer balance without entering card details or QIWI Wallet number. By default, the use of payment tokens is disabled. Contact your manager in QIWI Support to enable that.
When using payment token for the payment, customer does not have to enter its card data and proceed with 3-D Secure authentication.
The issue of a payment token is described in this section.
To pay for the customer order with its payment token, send the following data in API request Payment:
- API access key;
- payment amount data;
- payment method parameters in
paymentMethod
object:type
–TOKEN
;paymentToken
– payment token string;
- customer identifier in the RSP system for which the payment token was issued, in
customer.account
parameter (without this parameter, you cannot pay with the payment token.); - other information about the payment.
When the customer card was previously tokenized on your side, the following parameters in paymentMethod
should be included:
cardTokenPaymentType
– parameter for correct processing of transactions in the payment systems. Allowed values:INITIATED_BY_CLIENT
— transaction on the saved card initiated by a client;INITIATED_BY_MERCHANT
— transaction on the saved card initiated by the merchant;RECURRING_PAYMENT
— recurring operation on the saved card;INSTALLMENT
— repeated operation on the saved card in accordance with payment schedule for credit repayment.
firstTransaction
– JSON-object with transaction identifier info where card was saved. Contains fields:paymentId
– unique payment identifier in RSP information system;trnId
– unique payment identifier in NSPK information system.
Faster Payments System
Payment protocol supports charging funds from the customer by Faster Payments System (FPS). With FPS, payment can be made to commercial organizations, including QR coded ones.
By default, FPS payment method is turned off. To use this method, contact your manager in QIWI Support.
Receiving QR code
Example of request for FPS payment
{
"amount": {
"value": 100.00,
"currency": "RUB"
},
"qrCode": {
"type": "DYNAMIC",
"ttl": 999,
"image": {
"mediaType": "image/png",
"width": 300,
"height": 300
}
},
"paymentPurpose": "Flower for my girlfriend",
"redirectUrl": "http://someurl.com"
}
Example of response with QR code
{
"qrCodeUid": "Test12",
"amount": {
"currency": "RUB",
"value": "100.00"
},
"qrCode": {
"type": "DYNAMIC",
"ttl": 999,
"image": {
"mediaType": "image/png",
"width": 300,
"height": 300,
"content": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAA"
},
"payload": "https://qr.nspk.ru/AD10006M8KH234K782OQM0L13JI31LQDtype=02bank=100000000009&sum=200&cur=RUB&crc=C63A",
"status": "CREATED"
},
"createdOn": "2022-08-11T20:10:32+03:00"
}
When paying with Faster Payment System a customer scans a QR code and receives a payment link to open and make payment in her bank application.
To create a QR code for the payment, send the API request Faster Payment System QR code with specific parameters:
- Unique QR code API request identifier.
qrCode
object with QR code parameters:qrCode.type
—DYNAMIC
.qrCode.ttl
— code lifetime (minutes). The QR code is deactivated after the period ends. Default value is 72 hours.qrCode.image
— QR code image size and type.
amount
— payment amount.paymentPurpose
— payment details. If it is empty customer bank app displays merchant's store title.
In the response, the JSON object qrCode
contains the data of the QR code:
image.content
— base64-encoded QR code. After decryption, you get an image to show to the customer.payload
— URL-based QR for customer redirection to its bank app.
FPS payment status
When payment status becomes final, the notification will be sent with the corresponding QR code API request identifier in qrCodeUid
field. Payment status can be determined with paymentId
identifier from the same notification by the API request.
QR code status
Example of response for FPS QR code status request
{
"qrCodeUid": "Test",
"amount": {
"currency": "RUB",
"value": "1.00"
},
"qrCode": {
"type": "DYNAMIC",
"ttl": 999,
"payload": "https://qr.nspk.ru/AD10006M8KH234K782OQM0L13JI31LQDtype=02bank=100000000009&sum=200&cur=RUB&crc=C63A",
"status": "PAYED"
},
"payment": {
"paymentUid": "A22231710446971300200933E625FCB3",
"paymentStatus": "COMPLETED"
},
"createdOn": "2022-08-11T20:10:32+03:00"
}
To get QR code information you can use the Faster Payment System QR Code Status API request. Response contains QR code details including its current status so you can check if it is still a valid one.
FPS token payment
Request body for payment with FPS token
{
"tokenizationAccount": "customer123",
"token": "c5ba4a05-21c9-4a36-af7a-b709b4caa4d6"
}
See details about FPS payment token issue in this section.
Use Payment by FPS token API method with the following parameters:
token
— FPS payment token;tokenizationAccount
— client identifier for which the token was issued.
Testing operations
See information in this section.
Payment from mobile phone account
Purchases from a mobile phone account occur without entering card data. After merchant initiates payment, customer receives SMS from their mobile network operator. SMS contains the information about corresponding purchase. Customer approves or rejects the payment by the response SMS.
By default, this payment method is turned off. To use this method, contact your manager in QIWI Support.
How to send a payment
Payment example
{
"paymentMethod": {
"type": "MOBILE_COMMERCE",
"phone": "+79111111111"
},
"amount": {
"value": 5900.00,
"currency": "RUB"
},
"flags": [
"SALE"
],
"customer": {
"account": "79111111111",
"email": "test@qiwi.com",
"phone": "79111111111"
}
}
When sending payment, put into paymentMethod
object in Payment API request the following data:
type
—MOBILE_COMMERCE
.phone
— phone number, from which to make a payment. Number should be in international format with+
sign.
Server Notifications
Notification
POST <callback-path> HTTP/1.1
Accept: application/json
Content-type: application/json
Signature: J4WNfNZd***V5mv2w=
Host: <callback-url>
{
"payment": {
...
},
"type": "PAYMENT",
"version": "1"
}
QIWI server notification is an incoming HTTP POST request. The JSON-formatted notification message in the request body contains payment/invoice data encoded in UTF-8 codepage.
The Protocol supports the following notification types for API events:
PAYMENT
— sends when a payment operation is made;CAPTURE
— sends when a payment confirmation is made;REFUND
— sends when a refund for payment is made;CHECK_CARD
— sends when a card verification is made;TOKEN
— sends when a Faster Payments System payment token is issued and applied for payment operations.
Specify the notification server address in your Account Profile in Settings section.
To put different notification address for a separate operation, use the following parameters in the API requests:
callbackUrl
— in the Payment, Payment confirmation, Refund API requests.customFields.invoice_callback_url
— in the Invoice API request.
The URL for notifications should start with https
, as notifications are sent by HTTPS to port 443.
The site certificate must be issued by a trusted certification center (e.g. Comodo, Verisign, Thawte, etc.)
To make sure the notification is from QIWI, we recommend you to accept messages only from the following IP addresses belonging to QIWI:
- 79.142.16.0/20
- 195.189.100.0/22
- 91.232.230.0/23
- 91.213.51.0/24
To treat notification as successfully delivered, we need your notification server to respond with HTTP code 200 OK
.
Notification Authorization
Notification headers example
POST /qiwi-notify.php HTTP/1.1
Accept: application/json
Content-Type: application/json
Signature: j4wnfnzd***v5mv2w=
Host: example.com
The notification contains a digital signature of the request data which RSP should verify on its side to secure from notification fraud.
The UTF-8 encoded digital signature is placed into HTTP header Signature
of the notification message.
To validate the signature, HMAC integrity check with SHA256-hash is used.
Implement the following algorithm to verify notification signature:
-
Join values of some parameters from the notification with the pipe "|" character as a separator. For example:
parameters = {payment.paymentId}|{payment.createdDateTime}|{payment.amount.value}
where
{*}
– notification parameter value. All values must be converted to UTF-8 encoded string representation.Signature should be verified for those notification fields:
PAYMENT
type:payment.paymentId|payment.createdDateTime|payment.amount.value
REFUND
type:refund.refundId|refund.createdDateTime|refund.amount.value
CAPTURE
type:capture.captureId|capture.createdDateTime|capture.amount.value
CHECK_CARD
type:checkPaymentMethod.requestUid|checkPaymentMethod.checkOperationDate
TOKEN
type:token.merchantSiteUid|token.account|token.status.value|token.status.changedDateTime
-
Calculate hash HMAC value with SHA256 algorithm (signature string and secret key should be UTF8-encoded):
hash = HMAC(SHA256, secret, parameters)
where:
secret
– HMAC hash key. It is the server notification key in Settings section of the Merchant Account Profile.parameters
– string from step 1.
-
Compare the notification signature from
Signature
HTTP-header with the result of step 2. If there is no difference, the validation is successful.
Frequency of notification sending
QIWI notification service sorts unsuccessful notifications on the following queues:
- One attempt on waiting 5 seconds
- One attempt on waiting 1 minutes
- Three attempts on waiting 5 minutes
Resend time may be increased.
PAYMENT Notification Format
HEADERS
- Signature: XXX
- Accept: application/json
- Content-type: application/json
PAYMENT notification body
{
"payment": {
"paymentId": "A22170834426031500000733E625FCB3",
"customFields": {},
"type": "PAYMENT",
"createdDateTime": "2022-08-05T11:34:42+03:00",
"status": {
"value": "SUCCESS",
"changedDateTime": "2022-08-05T11:34:44+03:00"
},
"amount": {
"value": 5,
"currency": "RUB"
},
"paymentMethod": {
"type": "SBP",
"phone": "79111112233"
},
"merchantSiteUid": "test-00",
"customer": {
"phone": "0",
"bankAccountNumber": "4081710809561219555",
"bic": "044525974",
"lastName": "IVANOV",
"firstName": "IVAN",
"middleName": "IVANOVICH",
"simpleAddress": "",
"bankMemberId": "100000000008"
},
"billId": "autogenerated-6cd20922-b1d0-4e67-ba61-e2b7310c4006",
"flags": [
"SALE"
]
},
"type": "PAYMENT",
"version": "1"
}
PAYMENT notification body for a split payments
{
"payment": {
"paymentId": "134d707d-fec4-4a84-93f3-781b4f8c24ac",
"customFields": {
"comment": "My comment"
},
"paymentCardInfo": {
"issuingCountry": "643",
"issuingBank": "Unknown",
"paymentSystem": "VISA",
"fundingSource": "UNKNOWN",
"paymentSystemProduct": "Unknown"
},
"type": "PAYMENT",
"createdDateTime": "2021-02-05T11:29:38+03:00",
"status": {
"value": "SUCCESS",
"changedDateTime": "2021-02-05T11:29:39+03:00"
},
"amount": {
"value": 3,
"currency": "RUB"
},
"paymentMethod": {
"type": "TOKEN",
"paymentToken": "1620161e-d498-431b-b006-c52bb78c6bf2",
"maskedPan": "425600******0003",
"cardHolder": "CARD HOLDER",
"cardExpireDate": "11/2022"
},
"merchantSiteUid": "test-00",
"customer": {
"email": "glmgmmxr@qiwi123.com",
"account": "sbderxuftsrt",
"phone": "13387571067",
"country": "yccsnnfjgthu",
"city": "sqdvseezbpzo",
"region": "shbvyjgspjvu"
},
"gatewayData": {
"type": "ACQUIRING",
"authCode": "181218",
"rrn": "123"
},
"billId": "autogenerated-19cf2596-62a8-47f2-8721-b8791e9598d0",
"flags": [],
"paymentSplits": [
{
"type": "MERCHANT_DETAILS",
"siteUid": "Obuc-00",
"splitAmount": {
"value": 2,
"currency": "RUB"
},
"splitCommissions": {
"merchantCms": {
"value": 0.2,
"currency": "RUB"
},
"userCms": null
},
"orderId": "dressesforwhite",
"comment": "Purchase 1"
},
{
"type": "MERCHANT_DETAILS",
"siteUid": "Obuc-01",
"splitAmount": {
"value": 1,
"currency": "RUB"
},
"splitCommissions": {
"merchantCms": {
"value": 0.02,
"currency": "RUB"
},
"userCms": null
},
"orderId": "shoesforvalya",
"comment": "Purchase 2"
}
]
},
"type": "PAYMENT",
"version": "1"
}
Notification field | Description | Type | When present |
---|---|---|---|
payment | Payment information | Object | Always |
payment. type |
Operation type | String(200) | Always |
payment. paymentId |
Payment operation identifier in RSP's system | String(200) | Always |
payment. createdDateTime |
System date of the operation creation | URL-encoded stringYYYY-MM-DDThh:mm:ss |
Always |
payment. billId |
Corresponding invoice ID for the operation | String(200) | Always |
payment. qrCodeUid |
QR-code issue operation identifier in RSP's system | String | In case of operation with Faster Payment System |
payment. amount |
Object | Operation amount data | Always |
payment. amount. value |
Operation amount rounded down to two decimals | Number(6.2) | Always |
payment. amount. currency |
Operation currency (Code: Alpha-3 ISO 4217) | String(3) | Always |
payment. status |
Operation status data | Object | Always |
payment. status. value |
Operation status value | String | Always |
payment. status. changedDatetime |
Date of operation status update | URL-encoded stringYYYY-MM-DDThh:mm:ssZ |
Always |
payment. status. reasonCode |
Rejection reason code | String(200) | In case of operation rejection |
payment. status. reasonMessage |
Rejection reason description | String(200) | In case of operation rejection |
payment. status. errorCode |
Error code | Number | In case of error |
payment. paymentMethod |
Payment method data | Object | Always |
payment. paymentMethod. type |
Payment method type: CARD — bank card, TOKEN — payment token, SBP — Fast Payments System, QIWI_WALLET — QIWI Wallet balance |
String | Always |
payment. paymentMethod. paymentToken |
Card payment token | String | When payment token is used for the payment |
payment. paymentMethod. maskedPan |
Masked card PAN | String | When card or payment token is used for the payment |
payment. paymentMethod. rrn |
Payment RRN (ISO 8583) | Number | When card or payment token is used for the payment |
payment. paymentMethod. authCode |
Payment Auth code | Number | When card or payment token is used for the payment |
payment. paymentMethod. phone |
Phone number linked to the customer's card, or QIWI Wallet number | String | When paying through Fast Payments System, or from QIWI Wallet balance |
payment. paymentCardInfo |
Card information | Object | Always |
payment. paymentCardInfo. issuingCountry |
Issuer country code | String(3) | Always |
payment. paymentCardInfo. issuingBank |
Issuer name | String | Always |
payment. paymentCardInfo. paymentSystem |
Card's payment system | String | Always |
payment. paymentCardInfo. fundingSource |
Card's type (debit/credit/..) | String | Always |
payment. paymentCardInfo. paymentSystemProduct |
Card's category | String | Always |
payment. merchantSiteUid |
Merchant ID | String | Always |
payment. customer |
Customer data | Object | Always |
payment. customer. phone |
Customer phone number | String | Always |
payment. customer. |
Customer e-mail | String | Always |
payment. customer. account |
Customer ID in RSP system | String | Always |
payment. customer. ip |
Customer IP address | String | Always |
payment. customer. country |
Customer country from address string | String | Always |
payment. customer. bankAccountNumber |
Payer's bank account number | String | When paying through Fast Payments System |
payment. customer. bic |
Issuer BIC | String | When paying through Fast Payments System |
payment. customer. lastName |
Customer's last name | String | When paying through Fast Payments System |
payment. customer. firstName |
Customer's first name | String | When paying through Fast Payments System |
payment. customer. middleName |
Customer's middle name | String | When paying through Fast Payments System |
payment. customer. simpleAddress |
Customer's address | String | When paying through Fast Payments System |
payment. customer. inn |
Customer's TIN | String | When paying through Fast Payments System |
payment. customer. bankMemberId |
Customer's bank identifier | String | When paying through Fast Payments System |
payment. customFields |
Fields with additional information for the operation | Object | Always |
payment. customFields. cf1 |
Extra field with some information to operation data | String(256) | Always |
payment. customFields. cf2 |
Extra field with some information to operation data | String(256) | Always |
payment. customFields. cf3 |
Extra field with some information to operation data | String(256) | Always |
payment. customFields. cf4 |
Extra field with some information to operation data | String(256) | Always |
payment. customFields. cf5 |
Extra field with some information to operation data | String(256) | Always |
payment. flags |
Additional API commands | Array of Strings. Possible elements: SALE , REVERSAL |
Always |
payment. tokenData |
Payment token data | Object | When payment token issue was requested |
payment. tokenData. paymentToken |
Card payment token | String | When payment token issue was requested |
payment. tokenData. expiredDate |
Payment token expiration date. ISO-8601 Date format:YYYY-MM-DDThh:mm:ss±hh:mm |
String | When payment token issue was requested |
payment. chequeData |
Fiscal receipt description | ChequeData | When data for a fiscal receipt were sent in the operation payload |
payment. paymentSplits |
Split payments description | Array(Objects) | For split payments |
payment. paymentSplits. type |
Data type. Always MERCHANT_DETAILS |
String | For split payments |
payment. paymentSplits. siteUid |
Merchant ID | String | For split payments |
payment. paymentSplits. splitAmount |
Merchant reimbursement | Object | For split payments |
payment. paymentSplits. splitAmount. value |
Amount of reimbursement | Number | For split payments |
payment. paymentSplits. splitAmount. currency |
Text code of reimbursement currency, by ISO | String(3) | For split payments |
payment. paymentSplits. splitCommissions |
Commission data | Object | For split payments |
payment. paymentSplits. splitCommissions. merchantCms |
Commission from merchant | Object | For split payments |
payment. paymentSplits. splitCommissions. merchantCms. value |
Amount of commission | Number | For split payments |
payment. paymentSplits. splitCommissions. merchantCms. currency |
Text code of commission currency, by ISO | String(3) | For split payments |
payment. paymentSplits. orderId |
Order number | String | For split payments |
payment. paymentSplits. comment |
Comment for the order | String | For split payments |
payment. settlementAmount |
Merchant's settlement data | Object | If payment currency and merchant settlement currency are different |
payment. settlementAmount. value |
Merchant's settlement amount | Number(6.2) | If payment currency and merchant settlement currency are different |
payment. settlementAmount. currency |
Merchant's settlement currency identifier (Alpha-3 ISO 4217 code) | String(3) | If payment currency and merchant settlement currency are different |
type | Notification type (PAYMENT ) |
String(200) | Always |
version | Notification version | String | Always |
CAPTURE Notification Format
HEADERS
- Signature: XXX
- Accept: application/json
- Content-type: application/json
CAPTURE notification body
{
"capture": {
"paymentId": "A22170834426031500000733E625FCB3",
"captureId": "B33180934426031511100733DG332XTQ1",
"customFields": {},
"type": "CAPTURE",
"createdDateTime": "2022-08-06T11:34:42+03:00",
"status": {
"value": "SUCCESS",
"changedDateTime": "2022-08-06T12:55:44+03:00"
},
"amount": {
"value": 5,
"currency": "RUB"
},
"paymentMethod": {
"type": "CARD",
"maskedPan": "54************47",
"cardHolder": null,
"cardExpireDate": "12/2024"
},
"merchantSiteUid": "test-00",
"customer": {},
"billId": "autogenerated-6cd20922-b1d0-4e67-ba61-e2b7310c4006",
"flags": []
},
"type": "CAPTURE",
"version": "1"
}
Notification field | Description | Type | |
---|---|---|---|
capture | Capture information | Object | |
capture. type |
Operation type | String(200) | |
capture. paymentId |
Payment operation identifier in RSP's system | String(200) | |
capture. captureId |
Capture operation identifier in RSP's system | String(200) | |
capture. createdDateTime |
System date of the operation creation | URL-encoded stringYYYY-MM-DDThh:mm:ss |
|
capture. amount |
Object | Operation amount data | |
capture. amount. value |
Operation amount rounded down to two decimals | Number(6.2) | |
capture. amount. currency |
Operation currency (Code: Alpha-3 ISO 4217) | String(3) | |
capture. billId |
Corresponding invoice ID for the operation | String(200) | |
capture. status |
Operation status data | Object | |
capture. status. value |
Operation status value | String | |
capture. status. changedDatetime |
Date of operation status update | URL-encoded stringYYYY-MM-DDThh:mm:ssZ |
|
capture. status. reasonCode |
Rejection reason code | String(200) | |
capture. status. reasonMessage |
Rejection reason description | String(200) | |
capture. status. errorCode |
Error code | Number | |
capture. paymentMethod |
Payment method data | Object | |
capture. paymentMethod. type |
Payment method type | String | |
capture. paymentMethod. maskedPan |
Masked card PAN | String | |
capture. paymentMethod. rrn |
Payment RRN (ISO 8583) | Number | |
capture. paymentMethod. authCode |
Payment Auth code | Number | |
capture. merchantSiteUid |
Merchant ID | String | |
capture. customer |
Customer data | Object | |
capture. customer. phone |
Customer phone number | String | |
capture. customer. |
Customer e-mail | String | |
capture. customer. account |
Customer ID in RSP system | String | |
capture. customer. ip |
Customer's IP address | String | |
capture. customer. country |
Customer country from address string | String | |
capture. customFields |
Fields with additional information for the operation | Object | |
capture. customFields. cf1 |
Extra field with some information to operation data | String(256) | |
capture. customFields. cf2 |
Extra field with some information to operation data | String(256) | |
capture. customFields. cf3 |
Extra field with some information to operation data | String(256) | |
capture. customFields. cf4 |
Extra field with some information to operation data | String(256) | |
capture. customFields. cf5 |
Extra field with some information to operation data | String(256) | |
capture. settlementAmount |
Merchant's settlement data | Object | If payment currency and merchant settlement currency are different |
capture. settlementAmount. value |
Merchant's settlement amount | Number(6.2) | If payment currency and merchant settlement currency are different |
capture. settlementAmount. currency |
Merchant's settlement currency identifier (Alpha-3 ISO 4217 code) | String(3) | If payment currency and merchant settlement currency are different |
capture. flags |
Additional API commands | Array of Strings. Possible elements: SALE , REVERSAL |
|
type | Notification type (CAPTURE ) |
String(200) | |
version | Notification version | String |
REFUND Notification Format
HEADERS
- Signature: XXX
- Accept: application/json
- Content-type: application/json
REFUND notification body for a split payments refund
{
"refund": {
"paymentId": "A22170834426031500000733E625FCB3",
"refundId": "42f5ca91-965e-4cd0-bb30-3b64d9284048",
"type": "REFUND",
"createdDateTime": "2021-02-05T11:31:40+03:00",
"status": {
"value": "SUCCESS",
"changedDateTime": "2021-02-05T11:31:40+03:00"
},
"amount": {
"value": 3,
"currency": "RUB"
},
"paymentMethod": {
"type": "TOKEN",
"paymentToken": "1620161e-d498-431b-b006-c52bb78c6bf2",
"maskedPan": null,
"cardHolder": null,
"cardExpireDate": null
},
"merchantSiteUid": "test-00",
"customer": {
"email": "glmgmmxr@qiwi123.com",
"account": "sbderxuftsrt",
"phone": "13387571067",
"country": "yccsnnfjgthu",
"city": "sqdvseezbpzo",
"region": "shbvyjgspjvu"
},
"gatewayData": {
"type": "ACQUIRING",
"authCode": "181218",
"rrn": "123"
},
"billId": "autogenerated-19cf2596-62a8-47f2-8721-b8791e9598d0",
"flags": [
"REVERSAL"
],
"refundSplits": [
{
"type": "MERCHANT_DETAILS",
"siteUid": "Obuc-00",
"splitAmount": {
"value": 2,
"currency": "RUB"
},
"splitCommissions": {
"merchantCms": {
"value": 0,
"currency": "RUB"
},
"userCms": null
},
"orderId": "dressesforwhite",
"comment": "Some purchase"
},
{
"type": "MERCHANT_DETAILS",
"siteUid": "Obuc-01",
"splitAmount": {
"value": 1,
"currency": "RUB"
},
"splitCommissions": {
"merchantCms": {
"value": 0.02,
"currency": "RUB"
},
"userCms": null
},
"orderId": "shoesforvalya",
"comment": "Some purchase 2"
}
]
},
"type": "REFUND",
"version": "1"
}
Notification field | Description | Type | When present |
---|---|---|---|
refund | Refund information | Object | Always |
refund. type |
Operation type | String(200) | Always |
refund. paymentId |
Original payment operation identifier in RSP's system | String(200) | Always |
refund. refundId |
Refund operation identifier in RSP's system | String(200) | Always |
refund. createdDateTime |
System date of the operation creation | URL-encoded stringYYYY-MM-DDThh:mm:ss |
Always |
refund. amount |
Object | Operation amount data | Always |
refund. amount. value |
Operation amount rounded down to two decimals | Number(6.2) | Always |
refund. amount. currency |
Operation currency (Code: Alpha-3 ISO 4217) | String(3) | Always |
refund. billId |
Corresponding invoice ID for the operation | String(200) | Always |
refund. status |
Operation status data | Object | Always |
refund. status. value |
Operation status value | String | Always |
refund. status. changedDatetime |
Date of operation status update | URL-encoded stringYYYY-MM-DDThh:mm:ssZ |
Always |
refund. status. reasonCode |
Rejection reason code | String(200) | In case of operation rejection |
refund. status. reasonMessage |
Rejection reason description | String(200) | In case of operation rejection |
refund. status. errorCode |
Error code | Number | In case of error |
refund. paymentMethod |
Payment method data | Object | Always |
refund. paymentMethod. type |
Payment method type | String | Always |
refund. paymentMethod. maskedPan |
Masked card PAN | String | IAlways |
refund. paymentMethod. rrn |
Payment RRN (ISO 8583) | Number | Always |
refund. paymentMethod. authCode |
Payment Auth code | Number | Always |
refund. merchantSiteUid |
Merchant ID | String | Always |
refund. customer |
Customer data | Object | Always |
refund. customer. phone |
Customer phone number | String | Always |
refund. customer. |
Customer e-mail | String | Always |
refund. customer. account |
Customer ID in RSP system | String | Always |
refund. customer. ip |
Customer IP address | String | Always |
refund. customer. country |
Customer country from address string | String | Always |
refund. customFields |
Fields with additional information for the operation | Object | Always |
refund. customFields. cf1 |
Extra field with some information to operation data | String(256) | Always |
refund. customFields. cf2 |
Extra field with some information to operation data | String(256) | Always |
refund. customFields. cf3 |
Extra field with some information to operation data | String(256) | Always |
refund. customFields. cf4 |
Extra field with some information to operation data | String(256) | Always |
refund. customFields. cf5 |
Extra field with some information to operation data | String(256) | Always |
refund. flags |
Additional API commands | Array of Strings. Possible elements: SALE , REVERSAL |
Always |
refund. chequeData |
Fiscal receipt description | ChequeData | When data for a fiscal receipt were sent in the operation payload |
refund. refundSplits |
Refund of split payments description | Array(Objects) | For refund split payments |
refund. refundSplits. type |
Data type. Always MERCHANT_DETAILS |
String | For refund split payments |
refund. refundSplits. siteUid |
Merchant ID | String | For refund split payments |
refund. refundSplits. splitAmount |
Data on cancelled reimbursement for the merchant | Object | For refund split payments |
refund. refundSplits. splitAmount. value |
Amount of cancelled reimbursement | Number | For refund split payments |
refund. refundSplits. splitAmount. currency |
Text code of cancelled reimbursement currency, by ISO | String(3) | For refund split payments |
refund. refundSplits. splitCommissions |
Commission data | Object | For refund split payments |
refund. refundSplits. splitCommissions. merchantCms |
Commission from the merchant | Object | For refund split payments |
refund. refundSplits. splitCommissions. merchantCms. value |
Commission amount | Number | For refund split payments |
refund. refundSplits. splitCommissions. merchantCms. currency |
Text code of commission currency, by ISO | String(3) | For refund split payments |
refund. refundSplits. orderId |
Order number | String | For refund split payments |
refund. refundSplits. comment |
Comment to the order | String | For refund split payments |
refund. settlementAmount |
Merchant's settlement data | Object | If payment currency and merchant settlement currency are different |
refund. settlementAmount. value |
Merchant's settlement amount | Number(6.2) | If payment currency and merchant settlement currency are different |
refund. settlementAmount. currency |
Merchant's settlement currency identifier (Alpha-3 ISO 4217 code) | String(3) | If payment currency and merchant settlement currency are different |
type | Notification type (REFUND ) |
String(200) | Always |
version | Notification version | String | Always |
CHECK_CARD Notification Format
HEADERS
- Signature: XXX
- Accept: application/json
- Content-type: application/json
CHECK_CARD notification example
{
"checkPaymentMethod": {
"status": "SUCCESS",
"isValidCard": true,
"threeDsStatus": "PASSED",
"cardInfo": {
"issuingCountry": "RUS",
"issuingBank": "Альфа-банк",
"paymentSystem": "MASTERCARD",
"fundingSource": "PREPAID",
"paymentSystemProduct": "TNW|TNW|Mastercard® New World—Immediate Debit|TNW|Mastercard New World-Immediate Debit"
},
"createdToken": {
"token": "7653465767c78-a979-5bae621db96f",
"name": "54**********47",
"expiredDate": "2022-12-30T00:00:00+03:00",
"account": "acc1"
},
"requestUid": "uuid1-uuid2-uuid3-uuid4",
"paymentMethod": {
"type": "CARD",
"maskedPan": "54************47",
"cardHolder": null,
"cardExpireDate": "12/2022"
},
"checkOperationDate": "2021-08-16T14:15:07+03:00",
"merchantSiteUid": "test-00"
},
"type": "CHECK_CARD",
"version": "1"
}
Notification field | Description | Type |
---|---|---|
checkPaymentMethod | Card verification result | Object |
checkPaymentMethod. checkOperationDate |
System date of the operation | URL-encoded stringYYYY-MM-DDThh:mm:ssZ |
checkPaymentMethod. requestUid |
Card verification operation identifier | String(200) |
checkPaymentMethod. status |
Card verification status | String |
checkPaymentMethod. isValidCard |
true means card can be charged |
Bool |
checkPaymentMethod. threeDsStatus |
Information on customer authentication status. Possible values: PASSED (3-D Secure passed), NOT_PASSED (3-D Secure not passed), WITHOUT (3-D Secure not required) |
String |
checkPaymentMethod. paymentMethod |
Payment method data | Object |
checkPaymentMethod. paymentMethod. type |
Payment method type | String |
checkPaymentMethod. paymentMethod. maskedPan |
Masked card PAN | String |
checkPaymentMethod. paymentMethod. cardExpireDate |
Card expiration date (MM/YY) | String |
checkPaymentMethod. paymentMethod. cardHolder |
Cardholder name | String |
checkPaymentMethod. cardInfo |
Card information | Object |
checkPaymentMethod. cardInfo. issuingCountry |
Issuer country code | String(3) |
checkPaymentMethod. cardInfo. issuingBank |
Issuer name | String |
checkPaymentMethod. cardInfo. paymentSystem |
Card's payment system | String |
checkPaymentMethod. cardInfo. fundingSource |
Card's type (debit/credit/..) | String |
checkPaymentMethod. cardInfo. paymentSystemProduct |
Card's category | String |
checkPaymentMethod. createdToken |
Payment token data | Object |
checkPaymentMethod. createdToken. token |
Card payment token | String |
checkPaymentMethod. createdToken. name |
Masked card PAN for which payment token issued | String |
checkPaymentMethod. createdToken. expiredDate |
Payment token expiration date. ISO-8601 Date format:YYYY-MM-DDThh:mm:ss±hh:mm |
String |
checkPaymentMethod. createdToken. account |
Customer account for which payment token issued | String |
checkPaymentMethod. merchantSiteUid |
Merchant ID | String |
type | Notification type | String(200) |
version | Notification version | String |
TOKEN Notification format
HEADERS
- Signature: XXX
- Accept: application/json
- Content-type: application/json
Notification about successful FPS token issue
{
"token": {
"status": {
"value": "CREATED",
"changedDateTime": "2023-01-01T10:00:00+03:00"
},
"merchantSiteUid": "test-00",
"account": "test",
"value": "d28a4ff8-548d-4536-927d-fc01123bebbf",
"expiredDate": "2029-01-01T10:00:00+03:00",
"tokenizationSource": {
"type": "QR_CODE",
"uid": "100220001"
},
"bankMemberId": "100000000008"
},
"type": "TOKEN",
"version": "1"
}
Notification on unsuccessful FPS token issue
{
"token": {
"status": {
"value": "REJECTED",
"changedDateTime": "2023-01-01T10:00:00+03:00"
},
"merchantSiteUid": "test-00",
"account": "test",
"tokenizationSource": {
"type": "QR_CODE",
"uid": "14012000011"
}
},
"type": "TOKEN",
"version": "1"
}
Notification field | Description | Type | When present |
---|---|---|---|
token | Token data | Object | Always |
token. status |
Operation status data | Object | Always |
token. status. value |
Status value | String | Always |
token. status. changedDateTime |
Status change data | URL-encoded stringYYYY-MM-DDThh:mm:ssZ |
Always |
token. status. rejectReason |
Rejection reason | String | When operation is rejected |
token. merchantSiteUid |
Merchant site ID | String | Always |
token. account |
Client identifier specified in payment token request | String | Always |
token. value |
Payment token value | String | When operation is successful |
token. expiredDate |
Payment token expiration date. Date format is according to ISO-8601: YYYY-MM-DDThh:mm:ss±hh:mm |
String | When operation is successful |
token. tokenizationSource |
Tokenization source data | Object | Always |
token. tokenizationSource. type |
Tokenization source type | String | Always |
token. tokenizationSource. uid |
Tokenization source ID | String | Always |
token. bankMemberId |
Client's bank identifier | String | В случае успешной операции |
type | Notification type | String | Always |
version | Notification version | String | Always |
Refunds and Reversals
Refund and reversal operations are available in the following conditions:
- Refunds are only available for successfully completed payment transactions.
- Reversal of the transaction is possible for two-step payment operations and only for those without received confirm (CAPTURE).
When the payment is refunded, the QIWI commission fee for the payment is not refunded. An exception is if the reversal operation is performed when the payment is refunded. In this case, there is no financial transaction (charging funds from the customer's account) and there is no commission fee.
Refunds on paid invoices
To make a refund on the paid invoice, use the API request Refund.
Refunds on processed payments
A refund on the payment is only possible for a successful payment. The refund can be both partial and complete. In the first case, the entire amount of the accepted payment is refunded. In the second case, only a part of the amount of payment is refunded. Before you request a refund for the payment, check that the payment has been successfully completed and is in SUCCESS
status.
To make a refund on a payment, use the API request Refund.
Split Payments
Split payments is a solution developed for marketplaces. Split payments provides a way to pay multiple service providers, making one charging operation from the customer's card.
To connect to split payments, contact your manager in QIWI Support and request access to the solution.
Integration with QIWI Payment form
To send split payments, send in API request Invoice a JSON-arraysplits
with merchants data.
Data format
Example of invoice request with split payments
curl --location \
--request PUT \
'https://api.qiwi.com/partner/payin/v1/sites/Obuc-02/bills/eqwptt' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"amount": {
"value": "3.00",
"currency": "RUB"
},
"expirationDateTime": "2021-12-31T23:59:59+03:00",
"comment": "My comment",
"splits": [
{
"type": "MERCHANT_DETAILS",
"siteUid": "Obuc-00",
"splitAmount": {
"value": 2.00,
"currency": "RUB"
},
"orderId": "dressesforwhite",
"comment": "Some purchase 1"
},
{
"type": "MERCHANT_DETAILS",
"siteUid": "Obuc-01",
"splitAmount": {
"value": 1.00,
"currency": "RUB"
},
"orderId": "shoesforvalya",
"comment": "Some purchase 2"
}
]
}'
Response example with invoice and split payments
{
"billId": "eqwptt",
"invoiceUid": "44b2ef2a-edc6-4aed-87d3-01cf37ed2732",
"amount": {
"currency": "RUB",
"value": "3.00"
},
"expirationDateTime": "2021-12-31T23:59:59+03:00",
"status": {
"value": "CREATED",
"changedDateTime": "2021-02-05T10:21:17+03:00"
},
"comment": "My comment",
"flags": [
"TEST"
],
"payUrl": "https://oplata.qiwi.com/form?invoiceUid=44b2ef2a-edc6-4aed-87d3-01cf37ed2732",
"splits": [
{
"type": "MERCHANT_DETAILS",
"siteUid": "Obuc-00",
"splitAmount": {
"currency": "RUB",
"value": "2.00"
},
"orderId": "dressesforwhite",
"comment": "Some purchase 1"
},
{
"type": "MERCHANT_DETAILS",
"siteUid": "Obuc-01",
"splitAmount": {
"currency": "RUB",
"value": "1.00"
},
"orderId": "shoesforvalya",
"comment": "Some purchase 2"
}
]
}
JSON-array splits
format:
Name | Type | Description |
---|---|---|
splits | Array | Merchants data array |
type | String | Data type. Always MERCHANT_DETAILS (merchant details) |
siteUid | String | Merchant ID |
splitAmount | Object | Merchant reimbursement data |
value | Number | Amount of reimbursement rounded down to two decimals |
currency | String(3) | Text code of reimbursement currency, by ISO. Only RUB value |
orderId | String | Order number (optional) |
comment | String | Comment for the order (optional) |
In JSON-object splits
of the response the data on split payments are present:
Response field | Type | Description |
---|---|---|
splits | Array | Array with split payments data |
type | String | Data type. Always MERCHANT_DETAILS |
siteUid | String | Merchant ID |
splitAmount | Object | Merchant reimbursement data |
value | String | Amount of reimbursement |
currency | String(3) | Text code of reimbursement currency, by ISO |
orderId | String | Order number |
comment | String | Comment for the order |
Integration with Merchant's form
To send split payment, send in API request Payment a JSON-array
paymentSplits
with merchants data.
Data format
{
"paymentMethod": "...",
"customer": "....",
"deviceData": "...",
"paymentSplits": [
{
"type":"MERCHANT_DETAILS",
"siteUid":"shop_mst-01",
"splitAmount": {
"value":300.00,
"currency":"RUB"
},
"orderId":"dasdad444ll4ll",
"comment":"Flowers"
},
{
"type":"MERCHANT_DETAILS",
"siteUid":"shop_mst-02",
"splitAmount": {
"value":200.00,
"currency":"RUB"
},
"orderId":"sdadada887sdDDDDd",
"comment":"Watermelon"
}
]
}
Response with split payments
{
"paymentId": "23",
"billId": "autogenerated-2a8fcfab-45cb-43b9-81bd-edf65e0ef874",
"createdDateTime": "2020-10-12T15:29:12+03:00",
"amount": {
"currency": "RUB",
"value": "100.00"
},
"capturedAmount": {
"currency": "RUB",
"value": "100.00"
},
"refundedAmount": {
"currency": "RUB",
"value": "0.00"
},
"paymentMethod": "..",
"status": "..",
"paymentCardInfo": "..",
"paymentSplits": [
{
"type": "MERCHANT_DETAILS",
"siteUid": "shop_mst-01",
"splitAmount": {
"currency": "RUB",
"value": "30.00"
},
"splitCommissions": {
"merchantCms": {
"currency": "RUB",
"value": "10.00"
}
},
"orderId": "313fh1f23j13k1k",
"comment": "Some goods"
},
{
"type": "MERCHANT_DETAILS",
"siteUid": "shop_mst-02",
"splitAmount": {
"currency": "RUB",
"value": "20.00"
},
"splitCommissions": {
"merchantCms": {
"currency": "RUB",
"value": "10.00"
}
},
"orderId": "sdadada887sdDDDDd",
"comment": "Watermelon"
},
{
"type": "MERCHANT_DETAILS",
"siteUid": "shop_mst-03",
"splitAmount": {
"currency": "RUB",
"value": "50.00"
},
"splitCommissions": {
"merchantCms": {
"currency": "RUB",
"value": "10.00"
}
},
"orderId": "dasdad444ll4ll",
"comment": "Flowers"
}
]
}
JSON-array paymentSplits
format:
Name | Type | Description |
---|---|---|
paymentSplits | Array | Merchants data array |
type | String | Data type. Always MERCHANT_DETAILS (merchant details) |
siteUid | String | Merchant ID |
splitAmount | Object | Merchant reimbursement data |
value | Number | Amount of reimbursement rounded down to two decimals |
currency | String(3) | Text code of reimbursement currency, by ISO. Only RUB value |
orderId | String | Order number (optional) |
comment | String | Comment for the order (optional) |
In JSON-object paymentSplits
of the response the data on split payments and commissions are present:
Response field | Type | Description |
---|---|---|
paymentSplits | Array | Array with split payments data |
type | String | Data type. Always MERCHANT_DETAILS |
siteUid | String | Merchant ID |
splitAmount | Object | Merchant reimbursement data |
value | String | Amount of reimbursement |
currency | String(3) | Text code of reimbursement currency, by ISO |
splitCommissions | Object | Commission data (optional) |
merchantCms | Object | Commission from the merchant |
value | String | Amount of the commission |
currency | String(3) | Text code of the commission currency, by ISO |
orderId | String | Order number |
comment | String | Comment for the order |
Refunds on split payments
After a successful authorization of the card charging, a refund is available for the split payment transaction. Both partial and complete refunds are supported.
Example of refund request
PUT /partner/payin/v1/sites/test-01/payments/23/refunds/1 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"amount": {
"value": 100.00,
"currency": "RUB"
},
"refundSplits": [
{
"type": "MERCHANT_DETAILS",
"siteUid": "shop_mst-01",
"splitAmount": {
"value": 30.00,
"currency": "RUB"
},
"orderId": "sdadada887sdDDDDd",
"comment": "Watermelon"
},
{
"type": "MERCHANT_DETAILS",
"siteUid": "shop_mst-02",
"splitAmount": {
"value": 20.00,
"currency": "RUB"
},
"orderId": "313fh1f23j13k1k",
"comment": "Some goods"
},
{
"type": "MERCHANT_DETAILS",
"siteUid": "shop_mst-03",
"splitAmount": {
"value": 50.00,
"currency": "RUB"
},
"orderId": "dasdad444ll4ll",
"comment": "Flowers"
}
]
}
Example of response
{
"refundId": "1",
"createdDateTime": "2020-10-12T15:32:29+03:00",
"amount": {
"currency": "RUB",
"value": "100.00"
},
"status": {
"value": "COMPLETED",
"changedDateTime": "2020-10-12T15:32:30+03:00"
},
"refundSplits": [
{
"type": "MERCHANT_DETAILS",
"siteUid": "shop_mst-02",
"splitAmount": {
"currency": "RUB",
"value": "20.00"
},
"splitCommissions": {
"merchantCms": {
"currency": "RUB",
"value": "10.00"
}
},
"orderId": "sdadada887sdDDDDd",
"comment": "Watermelon"
},
{
"type": "MERCHANT_DETAILS",
"siteUid": "shop_mst-01",
"splitAmount": {
"currency": "RUB",
"value": "30.00"
},
"splitCommissions": {
"merchantCms": {
"currency": "RUB",
"value": "10.00"
}
},
"orderId": "313fh1f23j13k1k",
"comment": "Some goods"
},
{
"type": "MERCHANT_DETAILS",
"siteUid": "shop_mst-03",
"splitAmount": {
"currency": "RUB",
"value": "50.00"
},
"splitCommissions": {
"merchantCms": {
"currency": "RUB",
"value": "10.00"
}
},
"orderId": "dasdad444ll4ll",
"comment": "Flowers"
}
]
}
To send split payments refund, send in API request Refund a JSON-arrayrefundSplits
with refunds information. Put the total amount of the refund and the refund amount for each split.
JSON-array refundSplits
format:
Name | Type | Description |
---|---|---|
refundSplits | Array | Merchants refunds data array |
type | String | Data type. Always MERCHANT_DETAILS (merchant details) |
siteUid | String | Merchant ID |
splitAmount | Object | Merchant cancelled reimbursement data |
value | Number | Amount of cancelled reimbursement |
currency | String(3) | Text code of cancelled reimbursement currency, by ISO. Only RUB value |
orderId | String | Order number (optional) |
comment | String | Comment for the order (optional) |
In JSON-object refundSplits
of the response the data on accepted refunds are present:
Response field | Type | Description |
---|---|---|
refundSplits | Array | Array with refunds data |
type | String | Data type. Always MERCHANT_DETAILS |
siteUid | String | Registered merchant ID |
splitAmount | Object | Merchant cancelled reimbursement data |
value | String | Amount of cancelled reimbursement |
currency | String(3) | Text code of cancelled reimbursement currency, by ISO |
splitCommissions | Object | Commission data (optional) |
merchantCms | Object | Commission from the merchant |
value | String | Amount of the commission |
currency | String(3) | Text code of the commission currency, by ISO |
orderId | String | Order number |
comment | String | Comment for the order |
Notifications on split payments and refunds
Notifications for split payments and split payment refunds are formed similarly to the API requests described above:
- The JSON-array
paymentSplits
with merchants' payment data is added to the PAYMENT type notification body. - The JSON-array
refundSplits
with refund data is added to the REFUND type notification body.
Payment Token
In Payment protocol card and QIWI Wallet payment tokens generation is supported. The tokens can be used for debiting cards or QIWI Wallet without entering card/wallet details. On issuing payment token, card details are stored securely on QIWI side.
Features
By default, the issue of payment tokens is disabled. Contact your manager in QIWI Support to enable that.
Card payment token issue
Example of request with invoice and payment token issue
PUT /partner/payin/v1/sites/23044/bills/893794793973 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"amount": {
"currency": "RUB",
"value": 10.00
},
"expirationDateTime": "2021-04-13T14:30:00+03:00",
"customer": {
"account":"token32"
},
"customFields": {},
"flags":["BIND_PAYMENT_TOKEN"]
}
Example of payment request with payment token issue
PUT /partner/payin/v1/sites/test-01/payments/test-022 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"amount": {
"currency": "RUB",
"value": 2211.24
},
"customer": {
"account": "token324",
"phone": "79022222222"
},
"flags":["BIND_PAYMENT_TOKEN"]
}
Example of response with payment token
{
"paymentId": "test-022",
"billId": "autogenerated-c4479bb1-c916-4fba-8445-802592fa8d51",
"createdDateTime": "2020-03-26T12:22:12+03:00",
"amount": {
"currency": "RUB",
"value": 2211.24
},
"capturedAmount": "..",
"refundedAmount": "..",
"paymentMethod": "..",
"createdToken": {
"token": "66aebf5f-098e-4e36-922a-a4107b349a96",<= payment token
"name": "411111******1111"
},
"customer": {
"account": "token324",
"phone": "79022222222"
},
"status": ".."
}
To issue a payment token, you may use one of the following methods:
-
Without payment (preferred method).
Use API request Card verification or Invoice issuing. Include the following extra parameters: *
account
field with a unique customer ID in the RSP system: * either intokenizationData
object, in case of Card verification request; * or incustomer
object, in case of Invoice issuing request. *"flags":["CHECK_CARD", "BIND_PAYMENT_TOKEN"]
field, in case of Invoice issuing request.To secure card data, use different
account
values for different clients.You will receive the card payment token details after complete card verification:
- In the
createdToken
field of the final response. - In the CHECK_CARD notification.
You can always request a card verification status — in the response you will receive a
createdToken
object with payment token details.See Customer Card Verification section for details.
- In the
-
During payment process.
Include additional options in the API request Payment or Invoice, depending on which API you use: *
"flags": ["BIND_PAYMENT_TOKEN"]
is a flag for issuing a payment token. *customer.account
is a unique customer ID in the RSP system.To secure card data, use different
account
values for different clients.You will receive the card payment token details:
- In the synchronous API response to the payment request or payment authorization completion request in the
createdToken
field. - In the PAYMENT notification after payment is completed successfully, in the
tokenData
field.
- In the synchronous API response to the payment request or payment authorization completion request in the
FPS payment token issue
Request body for the FPS payment token issue
{
"qrCodeUid": "Test123",
"qrCode": {
"type": "TOKEN",
"image": {
"mediaType": "image/png",
"width": 300,
"height": 300
}
},
"tokenizationPurpose": "Описание с деталями привязки счета",
"tokenizationAccount": "3e2322",
"flags": ["CREATE_TOKEN"]
}
Response body for the FPS payment token issue
{
"qrCodeUid": "Test123",
"qrCode": {
"type": "TOKEN",
"ttl": 10,
"image": {
"mediaType": "image/png",
"width": 300,
"height": 300,
"content": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAA"
},
"payload": "https://qr.nspk.ru/AD10006M8KH234K782OQM0L13JI31LQDб",
"status": "CREATED"
},
"tokenizationPurpose": "Описание с деталями привязки счета",
"flags": ["CREATE_TOKEN"],
"token": {
"status": "CREATED",
"value": "a4a312345-6789-1234-a567-89a1234567a0",
"expiredDate": "2023-08-11T10:10:32+03:00"
},
"createdOn": "2022-08-11T20:10:32+03:00"
}
Request body for FPS QR code issue with token creation
{
"qrCodeUid": "Test123",
"amount": {
"value": 100.00,
"currency": "RUB"
},
"qrCode": {
"type": "DYNAMIC",
"image": {
"mediaType": "image/png",
"width": 300,
"height": 300
}
},
"tokenizationPurpose": "Описание с деталями привязки счета",
"tokenizationAccount": "3e2322",
"redirectUrl": "http://someurl.com"
"flags": ["CREATE_TOKEN"]
}
Response body for FPS QR code issue with token creation
{
"qrCodeUid": "Test123",
"amount": {
"value": 100.00,
"currency": "RUB"
},
"qrCode": {
"type": "DYNAMIC",
"ttl": 10,
"image": {
"mediaType": "image/png",
"width": 300,
"height": 300,
"content": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAA"
},
"payload": "https://qr.nspk.ru/AD10006M8KH234K782OQM0L13JI31LQDб",
"status": "CREATED"
},
"redirectUrl": "http://someurl.com",
"tokenizationPurpose": "Описание с деталями привязки счета",
"flags": ["CREATE_TOKEN"],
"token": {
"status": "CREATED",
"value": "a4a312345-6789-1234-a567-89a1234567a0",
"expiredDate": "2023-08-11T10:10:32+03:00"
},
"createdOn": "2022-08-11T20:10:32+03:00"
}
To create a Faster Payment System (FPS) payment token, use one of the following options:
-
Without payment.
Use Faster Payment System QR Code API request with data:
qrCode
object with QR code parameters:qrCode.type
—TOKEN
.qrCode.image
— type and size of the QR code image.
tokenizationAccount
— unique client identifier in merchant's system."flags":["CREATE_TOKEN"]
. *tokenizationPurpose
— token description.
-
Payment with account binding.
Use Faster Payment System QR Code API request with data:
qrCode
object with QR code parameters:qrCode.type
—DYNAMIC
.qrCode.image
— type and size of the QR code image.
amount
— payment amount.tokenizationAccount
— unique client identifier in merchant's system."flags":["CREATE_TOKEN"]
.tokenizationPurpose
— token description.
To secure card data, use different tokenizationAccount
parameters for different clients.
FPS payment token is received in token
parameter of the response and in the TOKEN notification.
See details on how to make payments by the FPS token in this section.
QIWI Wallet payment token issue
Example of a request with QIWI Wallet payment token issue initiation
POST /partner/payin-tokenization-api/v1/sites/test-01/token-requests HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"requestId": "asd1232q77w1e3212",
"phone": "79022222222",
"accountId": "token324"
}
Response
{
"requestId": "asd1232q77w1e3212",
"status": {
"value": "WAITING_SMS"
}
}
Example of a request with providing QIWI Wallet payment token
PUT /partner/payin-tokenization-api/v1/sites/test-01/token-requests/complete HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"requestId": "asd1232q77w1e3212",
"smsCode": "1223"
}
Response
{
"requestId": "asd1232q77w1e3212",
"status": {
"value": "CREATED"
},
"token": {
"value": "589c04b5-47dd-41af-9682-b3eb91",<= payment token
"expiredDate": "2021-11-08T14:23:54+03:00"
}
}
To issue a QIWI Wallet payment token, make the following API requests:
-
Requesting the initiation of the QIWI Wallet's payment token issue.
Make POST request to the URL:
/payin-tokenization-api/v1/sites/{siteId}/token-requests
where
{siteId}
— merchantsiteId
identifier.In the JSON-body of the request specify the parameters:
requestId
— a unique query identifier (1 to 36 characters). The uniqueness means that the ID should differ from the identifiers of all previously created RSP requests for the issue of a payment token within onesiteId
.phone
— QIWI Wallet number of the customer.accountId
— unique customer identifier in merchant's system. To secure card data, use differentaccountId
values for different clients.
-
A one-time SMS will be sent to the customer's phone. Include it in the following request to complete the issue of the payment token of the wallet.
Make POST request to the URL:
/payin-tokenization-api/v1/sites/{siteId}/token-requests/complete
where
{siteId}
— merchantsiteId
identifier.In the JSON-body of the request specify the parameters:
requestId
— the identifier from the initiation request for payment token issue.smsCode
— a code from SMS sent to the customer.
In response, you get payment token data:
token.value
— a QIWI Wallet payment tokentoken.expiredDate
— expiration date of a payment token, inYYYY-MM-DDThh:mm:ss+DMZ
format.
Removal of the payment token
Delete payment token
DELETE /partner/payin/v1/sites/test-01/tokens HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"token": "66aebf5f-098e-4e36-922a-a4107b349a96",
"customerAccountId": "token324"
}
The method disables a payment token. It applies both to the card payment token and the QIWI wallet payment token.
To disable a payment token, make a DELETE request to the URL:
/partner/payin/v1/sites/{siteId}/tokens
In the JSON-body of the request specify the parameters:
customerAccountId
is a unique customer ID in your system linked to a payment token.token
is a payment token to stop.
A successful response means that the payment token for the specified customer is no longer valid.
Customer Card Verification
Merchant can use a verification service to check for customer's card details, its validity and availability for purchases. Funds on cardholder's account are not debited until card recurring is confirmed or payment transaction is initiated.
If card verification is passed successfully, payment token can be issued for the card.
By default, access to the verification service is disabled. Contact your manager in QIWI Support to enable that.
How to use service with QIWI Payment Form
Request to issue invoice with card verification
PUT /partner/payin/v1/sites/site-01/bills/892323232111 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd1xxxx356f9
Content-type: application/json
Host: api.qiwi.com
{
"expirationDateTime": "2023-09-14T14:30:00+03:00",
"customer": {
"account":"test-123"
},
"flags": ["CHECK_CARD","BIND_PAYMENT_TOKEN"]
}
Successful response body
{
"siteId": "site-01",
"billId": "892323232111",
"amount": {
"value": "0.00",
"currency": "RUB"
},
"status": {
"value": "CREATED",
"changedDateTime": "2021-08-13T15:43:41"
},
"creationDateTime": "2021-08-13T15:43:41",
"expirationDateTime": "2023-09-14T14:30:00",
"payUrl": "https://oplata.qiwi.com/validation/card?invoiceUid=fxxxxx-854c-4e56-xxxx-eb49aef2xxxx"
}
Notification with card verification result
{
"checkPaymentMethod":{
"status":"SUCCESS",
"isValidCard":true,
"threeDsStatus":"WITHOUT",
"cardInfo":{
"issuingCountry":"0",
"issuingBank":"not present",
"paymentSystem":"VISA",
"fundingSource":"UNKNOWN",
"paymentSystemProduct":"UNKNOWN"
},
"createdToken":{
"token":"xxxxxxx-a53a-4de1-8aa4-xxxxxxx",
"name":"411111******1111",
"expiredDate":"2021-11-30T00:00:00+03:00",
"account":"some_account"
},
"requestUid":"uuuuuu-84f6-4044-9dd1-ddddddddd",
"paymentMethod":{
"type":"CARD",
"maskedPan":"411111******1111",
"cardHolder":"",
"cardExpireDate":"11/2021"
},
"checkOperationDate":"2021-08-13T15:44:01+03:00",
"merchantSiteUid":"test-00"
},
"type":"CHECK_CARD",
"version":"1"
}
- Send invoice request with additional parameter
"flags":["CHECK_CARD", "BIND_PAYMENT_TOKEN"]
. For payment token generation, setcustomer.account
parameter with unique customer identifier in the merchant's system. Do not specify invoice amount in the request (amount
parameter). - Extract
billId
parameter from the response — it is used on step 4. Redirect customer to the Payment Form — reference URL taken frompayUrl
field of the response. - On the Payment Form, customer provides card details and submits it for verification. On the form, 3-D Secure authentication performs for customer.
-
When card verification finishes, you get CHECK_CARD notification with the result, or you can request current status of the verification — put there
billId
identifier from step 2 as a unique identifier of the card verification. Result includes:- information about whether card is accessible for purchases in
isValidCard
field (true
— card can be charged); - payment token data in
createdToken
field: returned when payment token issue requested in step 1 andisValidCard=true
.
- information about whether card is accessible for purchases in
How to use service with API
Request with card verification
PUT /partner/payin/v1/sites/site-01/validation/card/requests/acd7bf20-22e2-4cbf-a218-38d90e9f29b9 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"cardData": {
"pan": "1111222233334444",
"expiryDate": "12/34",
"cvv2": "123",
"holderName": "Super Man"
},
"tokenizationData": {
"account": "cat_girl"
}
}
Successful response body
{
"requestUid": "acd7bf20-22e2-4cbf-a218-38d90e9f29b9",
"status": "SUCCESS",
"isValidCard": true,
"threeDsStatus": "WITHOUT",
"checkOperationDate": "2021-07-29T16:30:00+03:00",
"cardInfo": {
"issuingCountry": "RUS",
"issuingBank": "Qiwi bank",
"paymentSystem": "VISA",
"fundingSource": "DEBIT",
"paymentSystemProduct": "Platinum..."
},
"createdToken": {
"token": "1a77343a-dd8a-11eb-ba80-0242ac130004",
"name": "111122******4444",
"expiredDate": "2034-12-01T00:00:00+03:00",
"account": "cat_girl"
}
}
Response with 3DS authentication
{
"requestUid": "acd7bf20-22e2-4cbf-a218-38d90e9f29b9",
"status": "WAITING_3DS",
"requirements": {
"pareq": "Some string pareq",
"acsUrl": "http://xxxxxxx"
}
}
Response with verification error
{
"requestUid": "acd7bf20-22e2-4cbf-a218-38d90e9f29b9",
"status": "ERROR"
}
Request to finish 3DS in card verification
POST /partner/payin/v1/sites/site-01/validation/card/requests/acd7bf20-22e2-4cbf-a218-38d90e9f29b9/complete HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"pares": "Some string pares"
}
Response
{
"requestUid": "acd7bf20-22e2-4cbf-a218-38d90e9f29b9",
"status": "SUCCESS",
"isValidCard": true,
"threeDsStatus": "PASSED",
"checkOperationDate": "2021-07-29T16:30:00+03:00",
"cardInfo": {
"issuingCountry": "RUS",
"issuingBank": "Qiwi bank",
"paymentSystem": "VISA",
"fundingSource": "DEBIT",
"paymentSystemProduct": "Platinum..."
},
"createdToken": {
"token": "1a77343a-dd8a-11eb-ba80-0242ac130004",
"name": "111122******4444",
"expiredDate": "2034-12-01T00:00:00+03:00",
"account": "cat_girl"
}
}
- Send "Card verification" API request. Put in the request:
- Unique verification identifier (
requestUid
field in the request URL). - Card data (
cardData
in the request body). Required parameters — PAN, card expiration date, and CVV2.
For payment token generation, set
tokenizationData.account
parameter to unique customer's identifier in the merchant's system. - Unique verification identifier (
- In the response, card verification result returns in
isValidCard
field (true
means card can be charged). WhenisValidCard=true
and payment token issue requested in step 1 JSON objectcreatedToken
is returned with payment token data.
To make sure that the cardholder themselves entered card number, you can use 3-D Secure additional authentication in the card verification service. Contact QIWI Support to enable or disable 3-D Secure (3DS) procedure. If 3DS is enabled, you receive "requirements"
object with ACS URL for customer redirect (in this case, status
field has "WAITING_3DS"
value).
Verification scenario is similar to payment operation:
- Redirect customer to authentication page.
- Finish 3-D Secure by "Complete 3DS on card verification" request. Specify the same
requestUid
from the initial card verification request. - If 3-D Secure check is finished successfully,
isValidCard
field contains information about card validity (true
means card can be charged). WhenisValidCard=true
and payment token issue requested in the original "Card verification" request JSON objectcreatedToken
is returned with payment token data.
When verification finishes, you get CHECK_CARD notification with the result, or you can always get current card verification status by API request.
Card verification statuses
Status | Description |
---|---|
INIT | Reference URL to card verification form awaiting for customer action |
SUCCESS | Card verification is successful |
ERROR | Card erification error |
WAITING_3DS | Awaiting 3-D Secure authentication completion |
Acts
The act on accepted payments for RSP is formed monthly on the second working day of the month.
The act is first sent to an email specified at the registration of the RSP in the service. After confirmation by a partner, the authorized person of QIWI Bank signs the Act in the document system with electronic signature. The signed Act is sent to the legal address of the partner.
Reports
The report with the list of daily operations is sent after 14:00 MSK on weekdays. It contains information only about successful payments processed by the bank. The report is fully compliant with the Act.
The report is sent to the email, specified at the registration of the RSP in the service, in the zip-archive attached in the letter.
The report format
Sample report fragment
BANK_DATA_DOC;BANK_VALUE_DOC;BANK_AGR_CODE;SUM_BANK;TRANS_DATE;TRANSACTION_ID;SUM;COMMISSION;USER_INFO;ID;MERCH;MERCH_SITE;PARENT_TRANSACTION_ID;BILL;PURPOSE;MERCHANT_SITE_NAME;PAYMENT_METHOD_TYPE;MMVB;CLIENT_AMOUNT;CLIENT_CUR_CODE;SETTLEMENT_AMOUNT;PAYMENTDETAILS
27.08.2020;27.08.2020;3456144;-25676786,28;;;25676786,28;;;;;;;;SETTLEMENT;;;null;;;;
27.08.2020;27.08.2020;34562014;243767,27;26.08.2020 9:59;659720;2165,46;25;533669******4030;68860745;hthi;hthi-26;;autogenerated-67cd0dfb-ca5a-0baf-b0e0-735a880c0dac;payment;site;Bank card;null;2165,46;643;25664068,85;Perevod denezhnyh sredstv po Dogovory 2019-09-24 00:00:00. Commission rub. NDS Not applicable.
27.08.2020;27.08.2020;34562014;243767,27;26.08.2020 10:01;660540;1530;25;536809******4077;68860893;hthi;hthi-26;;autogenerated-90870507-acd9-0056-80f7-d050560fba09;payment;site;Bank card;null;1530;643;25664068,85;Perevod denezhnyh sredstv po Dogovory 2019-09-24 00:00:00. Commission rub. NDS Not applicable.
27.08.2020;27.08.2020;34562014;243767,27;26.08.2020
File with report has CSV format.
Report field | Description |
---|---|
BANK_DATA_DOC | The date of the document affecting the balance of the bank account is drawn up by the Act at the end of the month |
BANK_VALUE_DOC | The date of the actual change in the balance of the bank account |
BANK_AGR_CODE | Bank code, unique document number |
SUM_BANK | Amount of document operations |
TRANS_DATE | The date of the operation |
TRANSACTION_ID | Operation number |
SUM | Amount of the operation |
COMMISSION | Commission for the operation from the merchant |
USER_INFO | Masked card number or phone number (in case of QIWI Wallet payment) |
ID | paymentId operation number on the merchant's side |
MERCH | Merchant ID |
MERCH_SITE | Merchant siteId identifier |
PARENT_TRANSACTION_ID | Refunds include the number of the original payment operation |
BILL | Invoice ID |
PURPOSE | Bank operation type: CHARGEBACK/ REVERT_CHARGEBACK/ Payment/ Refund/ OPERATION+/ OPERATION-/ SETTLEMENT |
MERCHANT_SITE_NAME | Merchant site URL |
PAYMENT_METHOD_TYPE | Payment method: Bank card/ QIWI_WALLET/ SBP |
MMVB | Currency rate of MOEX at the time of payment for transactions with foreign currency |
CLIENT_AMOUNT | The amount of charging from the customer |
CLIENT_CUR_CODE | Currency of charging from the customer |
SETTLEMENT_AMOUNT | The amount of the payment order sent to the partner's checking account |
PAYMENTDETAILS | The purpose of a payment order sent to the partner's checking account (Example: Transfer of accepted funds under the Contract' xxx from yyy. VAT is not subject to/taxed. ) |
Reimbursement
By default, we make reimbursement for processed operations to merchants once every two days when 10,000 rubles reached. If you need a custom schedule for reimbursements, contact your personal manager in QIWI Support.
QIWI holds a commission for each confirmed operation. If operation is cancelled before the confirmation, commission will not hold. If partial refund is made before the confirmation, commission will be recalculated.
Statuses, Types of the Operations, and Error Codes
Error codes
The Payment Protocol uses the following HTTP-codes of errors for API requests:
Error Code | Meaning |
---|---|
400 | Bad Request — Your request is invalid (error in request' data or format). |
401 | Unauthorized — Your API access key is wrong. |
403 | Forbidden — Access to API is forbidden. |
404 | Not Found — The specified resource could not be found. |
405 | Method Not Allowed — You tried to create a payment with an invalid method. |
406 | Not Acceptable — Your request' data format isn't JSON. |
410 | Gone — The resource requested has been removed from our servers. |
429 | Too Many Requests — You are sending requests too frequently. |
500 | Internal Server Error — We had a problem with our server. Try again later. If response body is empty, repeat the request with the same parameters. If the body is non-empty, make payment status request/invoice status request. |
502 | Bad Gateway — No connection to service |
503 | Service Unavailable — We're temporarily offline for maintenance. Please try again later. |
Operation types
Operation type is returned in {operation}.type
field of the notification.
Operation type | Description |
---|---|
PAYMENT | The payment. There can be field flag: [ "SALE" ] (one-step payment) or flag: [ "AUTH" ] (two-step payment with holding funds) in the notification. |
CAPTURE | Operation of the payment confirmation. |
REFUND | Operation of the refund. There can be field flag: [ "REVERSAL" ] in the notification. It means that there was no financial operation (charging from customer's account) and commission fee would not be hold. |
Operation statuses
Operation status reflects its current state.
API responses
API returns synchronous status of the operation in the field status.value
of the response.
Status in notifications is in the field {operation}.status.value
.
In the following table all possible statuses and corresponding operation types, where each status is used.
Operation status | Operation type | Status description |
---|---|---|
PAYMENT | WAITING | Awaiting for 3DS authentication |
PAYMENT | DECLINED | Request for authorization is rejected (in synchronous responses) |
PAYMENT | DECLINE | Request for authorization is rejected (in asynchronous responses) |
REFUND | DECLINE | Request for refund is rejected |
CAPTURE | DECLINE | Request for payment confirmation is rejected |
CAPTURE | DECLINED | Request for payment confirmation is rejected (in API response to the status request) |
PAYMENT | COMPLETED | Request for authorization is successfully processed |
REFUND | COMPLETED | Request for refund is successfully processed |
CAPTURE | COMPLETED | Request for payment confirmation is successfully processed |
Notifications
Status in notifications is in the field {operation}.status.value
.
In the following table all possible statuses and corresponding operation types, where each status is used.
Operation type | Operation status | Status description |
---|---|---|
PAYMENT | DECLINE | Request for authorization is rejected |
REFUND | DECLINE | Request for refund is rejected |
CAPTURE | DECLINE | Request for payment confirmation is rejected |
PAYMENT | SUCCESS | Request for authorization is successfully processed |
REFUND | SUCCESS | Request for refund is successfully processed |
CAPTURE | SUCCESS | Request for payment confirmation is successfully processed |
API errors reference
API errors describe a reason for rejection of the operation. API errors are present:
- in API responses — field
status.reason
; - in notifications — field
status.reasonCode
.
Some API errors are accompanied by details with recommended troubleshooting in the status.psErrorCode
field.
API error | Description |
---|---|
INVALID_STATE | Incorrect transaction status |
INVALID_AMOUNT | Incorrect payment amount |
INVALID_RECEIVER_DATA | Error on transmitting receiver data |
DECLINED_BY_MPI | Rejected by MPI |
DECLINED_BY_FRAUD | Rejected by fraud monitoring |
REATTEMPT_NOT_PERMITTED | Re-attempting authorization request is forbidden due to a Payment system rules |
REATTEMPT_NOT_PERMITTED_BY_PS | Operation rejected by Payment system. Error details with recommended troubleshooting are in the status.psErrorCode field. Re-attempting the operation is not possible for the card |
GATEWAY_INTEGRATION_ERROR | Acquirer integration error |
GATEWAY_TECHNICAL_ERROR | Technical error on acquirer side |
ACQUIRING_MPI_TECH_ERROR | Technical error on 3DS authentication |
ACQUIRING_GATEWAY_TECH_ERROR | Technical error |
ACQUIRING_ACQUIRER_ERROR | Technical error |
ACQUIRING_AUTH_TECHNICAL_ERROR | Error on funds authorization |
ACQUIRING_ISSUER_NOT_AVAILABLE | Issuer error. Issuer is not available at the moment |
ACQUIRING_SUSPECTED_FRAUD | Issuer error. Fraud suspicion |
ACQUIRING_LIMIT_EXCEEDED | Issuer error. Some limit exceeded |
ACQUIRING_NOT_PERMITTED | Issuer error. Operation not allowed |
ACQUIRING_INCORRECT_CVV | Issuer error. Incorrect CVV |
ACQUIRING_EXPIRED_CARD | Issuer error. Incorrect card expiration date |
ACQUIRING_INVALID_CARD | Issuer error. Verify card data |
ACQUIRING_INSUFFICIENT_FUNDS | Issuer error. Not enough funds |
ACQUIRING_UNKNOWN | Unknown error |
BILL_ALREADY_PAID | Invoice is already paid |
PAYIN_PROCESSING_ERROR | Payment processing error |
PAYMENT_EXPIRED_3DS | 3-D Secure authentication not passed |
QW_LIMIT_ERROR | Exceeded limits for QIWI Wallet (monthly, daily, etc) |
QW_IDENTIFICATION_ERROR | QIWI Wallet identification required or identification level is not enough for the customer |
QW_AUTH_ERROR | The current authentication level does not match the required |
QW_INSUFFICIENT_FUNDS | Insufficient funds |
QW_AMOUNT_ERROR | Forbidden payment amount in QIWI Wallet (amount is less than the minimum allowed amount or larger than the maximum allowed amount, or daily limit exceeded or zero amount) |
QW_REGISTRATION_ERROR | QIWI Wallet registration error |
QW_AGENT_ERROR | QIWI Wallet agent is blocked |
QW_ACCOUNT_ERROR | QIWI Wallet account is blocked |
QW_IDENTIFICATION_STATUS_ERROR | Attempt to transfer limited amount in another currency in QIWI Wallet |
QW_CURRENCY_ERROR | Currency error in QIWI Wallet (currency not found, wallet with that currency is not found) |
QW_PAYMENT_ERROR | QIWI Wallet payment error |
QW_PROVIDER_ERROR | QIWI Wallet provider is blocked |
QW_SMS_CONFIRM_EXPIRED | SMS code is expired in QIWI Wallet |
TRY_AGAIN_LATER | Repeat the request later |
Error detail codes
Error detail code with recommended action from a Payment system is returned in the status.psErrorCode
field of the response.
Code | Corresponding API error | Error details and recommended troubleshooting |
---|---|---|
03 | REATTEMPT_NOT_PERMITTED_BY_PS | Operation with this MCC forbidden by the card issuer |
04 | REATTEMPT_NOT_PERMITTED_BY_PS | Card blocked |
05 | ACQUIRING_NOT_PERMITTED | The transaction was rejected due to other reasons |
12 | REATTEMPT_NOT_PERMITTED_BY_PS | Operation of that type forbidden by Rules and Standards of a Payment system |
13 | ACQUIRING_NOT_PERMITTED | Incorrect amount. Repeat the operation with a different amount |
14 | ACQUIRING_NOT_PERMITTED | Incorrect card number. Enter correct number or use another card |
15 | REATTEMPT_NOT_PERMITTED_BY_PS | There is no issuer for the card |
30 | ACQUIRING_NOT_PERMITTED | Operation rejected. Contact QIWI support to get additional information |
33 | REATTEMPT_NOT_PERMITTED_BY_PS | Card is not available for use |
41 | REATTEMPT_NOT_PERMITTED_BY_PS | Card is not available for use |
43 | REATTEMPT_NOT_PERMITTED_BY_PS | Card is not available for use |
51 | ACQUIRING_INSUFFICIENT_FUNDS | The Client might be recommended to repeat the operation after account replenishment |
54 | ACQUIRING_EXPIRED_CARD | The expiration date of the card is missing or transmitted incorrectly |
57 | REATTEMPT_NOT_PERMITTED_BY_PS | This type of operation is not available for the card |
58 | REATTEMPT_NOT_PERMITTED_BY_PS | This type of operation is not available for the acquirer |
61 | ACQUIRING_LIMIT_EXCEEDED | The Client may be recommended to try the transaction again on another day — after the Issuer resets the limit on the total amount of transactions of this type |
62 | REATTEMPT_NOT_PERMITTED_BY_PS | The transaction is not available due to restrictions on the card or account of the Cardholder |
63 | ACQUIRING_NOT_PERMITTED | The transaction was rejected, contact Qiwi support for more information |
65 | ACQUIRING_LIMIT_EXCEEDED | The Client may be recommended to retry the transaction on another day — after the Issuer resets the limit on the total number of transactions of this type |
75 | ACQUIRING_INCORRECT_CVV | The transaction was rejected due to incorrect PIN code entered earlier |
76 | REATTEMPT_NOT_PERMITTED_BY_PS | Rejecting the cancellation of a request due to the absence of the original request |
78 | REATTEMPT_NOT_PERMITTED_BY_PS | Denying a request due to an attempt to use an inactive card |
86 | ACQUIRING_INCORRECT_CVV | The transaction was rejected due to incorrect PIN code entered earlier |
88 | ACQUIRING_AUTH_TECHNICAL_ERROR | The transaction was rejected due to cryptography error, can occur due to incorrect CVV2/CVC2 |
91 | ACQUIRING_ISSUER_NOT_AVAILABLE | The Client may be advised to retry the transaction at another time – after the Issuer recovers the functioning |
92 | REATTEMPT_NOT_PERMITTED_BY_PS | Rejection by the Payment System due to the impossibility of carrying out the transaction |
93 | REATTEMPT_NOT_PERMITTED_BY_PS | Denial of a request due to violation of legal requirements |
94 | REATTEMPT_NOT_PERMITTED_BY_PS | Rejecting a duplicate request |
96 | ACQUIRING_NOT_PERMITTED | The Client may be advised to retry the transaction at another time – after the Issuer ot the Platform recovers the functioning |
TS | REATTEMPT_NOT_PERMITTED_BY_PS | Rejection of the request due to cancellation of the Cardholder's long-term order |
CB | ACQUIRING_ACQUIRER_ERROR | The transaction was rejected due to incorrect date of birth of the Cardholder |
CD | REATTEMPT_NOT_PERMITTED_BY_PS | The transaction was rejected due to death of the Cardholder |
Rules for working with detailed information
There are two groups of error codes:
- Group 1:
03
,04
,12
,15
,33
,41
,43
,57
,58
,62
,76
,78
,92
,93
,94
,CD
,TS
,05
. - Group 2:
13
,14
,30
,54
,51
,61
,63
,65
,75
,86
,88
,91
,96
,CB
.
According to the NSPC rules, the following conditions for repeating transactions with non-3DS authorization on MIR cards are applied
- After a response from group 1, no more transactions can be performed during the day.
- After the response from group 2, another attempt to perform transactions is allowed during the day.
Restrictions apply to the final recipient, if we have received the corresponding response codes.
API Method Reference
Invoice
{
"amount": {
"currency": "RUB",
"value": 100.00
},
"billPaymentMethodsType": [
"QIWI_WALLET",
"SBP"
],
"comment": "Text comment",
"expirationDateTime": "2018-04-13T14:30:00+03:00",
"customer": {},
"customFields": {
"cf1": "Some data"
}
}
{
"billId": "893794793973",
"invoiceUid": "d875277b-6f0f-445d-8a83-f62c7c07be77",
"amount": {
"value": "100.00",
"currency": "RUB"
},
"status": {
"value": "CREATED",
"changedDateTime": "2018-03-05T11:27:41"
},
"comment": "Text comment",
"customFields": {
"cf1": "Some data"
},
"creationDateTime": "2018-03-05T11:27:41",
"expirationDateTime": "2018-04-13T14:30:00",
"payUrl": "https://oplata.qiwi.com/form/?invoice_uid=d875277b-6f0f-445d-8a83-f62c7c07be77"
}
Response when the invoice exists and has been already expired
{
"billId": "12345",
"invoiceUid": "3b39ad6d-f111-401d-8108-ed11af920a65",
"amount": {
"currency": "RUB",
"value": "1.00"
},
"expirationDateTime": "2023-03-21T13:02:00+03:00",
"status": {
"value": "EXPIRED",
"changedDateTime": "2023-03-21T13:02:00+03:00"
},
"comment": "Text comment",
"flags": [
"TEST"
],
"payUrl": "https://oplata.qiwi.com/form?invoiceUid=3b39ad6d-f211-401d-8008-ed11af920a65"
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName" : "payin-core",
"errorCode" : "payin.resource.not.found",
"userMessage" : "Resource not found",
"description" : "Resource not found",
"traceId" : "c3564ba25e221fe3",
"dateTime" : "2018-11-13T16:30:52.464+03:00"
}
Invoice status
GET /partner/payin/v1/sites/site-01/bills/3a3d0286cefe645d2b11/details HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"billId": "3a3d0286cefe645d2b11",
"invoiceUid": "235d8d5a-38ed-11fc-9ab6-8b5a65d7e2f8",
"amount": {
"currency": "RUB",
"value": "3000.00"
},
"expirationDateTime": "2023-05-07T19:25:36+03:00",
"status": {
"value": "PAID",
"changedDateTime": "2023-04-07T19:28:12+03:00"
},
"comment": "Детская футбольная школа «Тигры»",
"flags": [
"SALE"
],
"payUrl": "https://oplata.qiwi.com/form?invoiceUid=235d8d5a-11ed-46fc-9ab6-8b5a65d7e2f8",
"payments": [
{
"paymentId": "cd4a4ade-011e6-484d-87c8-40a7f48326fa",
"billId": "3a3d0286cefe645d2b11",
"createdDateTime": "2023-04-07T19:27:52+03:00",
"amount": {
"currency": "RUB",
"value": "3000.00"
},
"capturedAmount": {
"currency": "RUB",
"value": "3000.00"
},
"refundedAmount": {
"currency": "RUB",
"value": "0.00"
},
"paymentMethod": {
"type": "CARD",
"maskedPan": "422264******1232",
"rrn": "309711196151",
"authCode": "231181"
},
"status": {
"value": "COMPLETED",
"changedDateTime": "2023-04-07T19:28:12+03:00"
},
"comment": "Детская футбольная школа «Тигры»",
"customFields": {
"auto_capture": "true",
"invoice_creation_type": "PUBLIC_KEY"
},
"paymentCardInfo": {
"issuingCountry": "643",
"issuingBank": "Сбербанк России",
"paymentSystem": "VISA",
"fundingSource": "DEBIT",
"paymentSystemProduct": "N1|Visa Rewards"
}
},
{
"paymentId": "A30971626215731E01110841111138B2",
"billId": "3a3d0286cefe645d2b11",
"createdDateTime": "2023-04-07T19:26:21+03:00",
"amount": {
"currency": "RUB",
"value": "3000.00"
},
"capturedAmount": {
"currency": "RUB",
"value": "3000.00"
},
"refundedAmount": {
"currency": "RUB",
"value": "0.00"
},
"paymentMethod": {
"type": "SBP",
"phone": "0079031232001"
},
"status": {
"value": "DECLINED",
"changedDateTime": "2023-04-07T19:26:23+03:00",
"reason": "GATEWAY_INTEGRATION_ERROR",
"reasonMessage": "I07999 OPKC_TECH_ERROR"
},
"comment": "Детская футбольная школа «Тигры»",
"customFields": {
"auto_capture": "true",
"invoice_creation_type": "PUBLIC_KEY"
}
}
]
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2022-03-05T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
List of payments on the invoice
GET /partner/payin/v1/sites/site-01/bills/3a3d0286cefe645d2b11 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
[
{
"paymentId": "cd4a4ade-12e6-484d-87c8-40a7f48326fa",
"billId": "3a3d0286cefe645d2b11",
"createdDateTime": "2023-04-07T19:27:52+03:00",
"amount": {
"currency": "RUB",
"value": "3000.00"
},
"capturedAmount": {
"currency": "RUB",
"value": "3000.00"
},
"refundedAmount": {
"currency": "RUB",
"value": "0.00"
},
"paymentMethod": {
"type": "CARD",
"maskedPan": "422264******1232",
"rrn": "309711234151",
"authCode": "232481"
},
"status": {
"value": "COMPLETED",
"changedDateTime": "2023-04-07T19:28:12+03:00"
},
"comment": "Детская футбольная школа «Тигры»",
"customFields": {
"auto_capture": "true",
"invoice_creation_type": "PUBLIC_KEY"
},
"paymentCardInfo": {
"issuingCountry": "643",
"issuingBank": "Сбербанк России",
"paymentSystem": "VISA",
"fundingSource": "DEBIT",
"paymentSystemProduct": "N1|Visa Rewards"
}
},
{
"paymentId": "A30971626215731E000008415C2D38B2",
"billId": "3a3d0286cefe645d2b00",
"createdDateTime": "2023-04-07T19:26:21+03:00",
"amount": {
"currency": "RUB",
"value": "3000.00"
},
"capturedAmount": {
"currency": "RUB",
"value": "3000.00"
},
"refundedAmount": {
"currency": "RUB",
"value": "0.00"
},
"paymentMethod": {
"type": "SBP",
"phone": "0079099922001"
},
"status": {
"value": "DECLINED",
"changedDateTime": "2023-04-07T19:26:23+03:00",
"reason": "GATEWAY_INTEGRATION_ERROR",
"reasonMessage": "I07999 OPKC_TECH_ERROR"
},
"comment": "Детская футбольная школа «Тигры»",
"customFields": {
"auto_capture": "true",
"invoice_creation_type": "PUBLIC_KEY"
}
}
]
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
Payment
PUT /partner/payin/v1/sites/test-01/payments/1811 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"billId": "testBillId28",
"amount": {
"currency": "RUB",
"value": 200.00
},
"paymentMethod" : {
"type" : "CARD",
"pan" : "4444443616621049",
"expiryDate" : "12/19",
"cvv2" : "123",
"holderName" : "CARDHOLDER NAME",
"cardTokenPaymentType" : "INSTALLMENT",
"firstTransaction" : {
"paymentId" : "testPaymentId28"
}
},
"customer": {
"account": "string",
"address": {
"city": "Moscow",
"country": "Russian Federation",
"details": "Severnoe chertanovo microdistrict 1a 1",
"region": "Moscow city"
},
"email": "customer@example.com",
"phone": "+79991234567"
},
"deviceData": {
"datetime": "2017-09-03T14:30:00+03:00",
"fingerprint": "TW96aWxsYS81LjAgKHBsYXRmb3JtOyBydjpnZWNrb3ZlcnNpb24p",
"ip": "127.0.0.1",
"screenResolution": "1280x1024",
"timeOnPage": 1440,
"userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion"
},
"callbackUrl": "https://example.com/callbacks",
"comment": "Example payment",
"customFields": {
"cf1": "Some data"
},
"flags": [
"SALE"
]
}
{
"paymentId" : "223E",
"createdDateTime" : "2018-11-01T17:10:31.284+03:00",
"amount" : {
"currency" : "RUB",
"value" : "200.00"
},
"capturedAmount" : {
"currency" : "RUB",
"value" : "0.00"
},
"refundedAmount" : {
"currency" : "RUB",
"value" : "0.00"
},
"paymentMethod" : {
"type" : "CARD",
"maskedPan" : "444444******1049"
},
"customer" : { },
"deviceData" : { },
"requirements" : {
"threeDS" : {
"pareq" : "eJyrrgUAAXUA+Q==",
"acsUrl" : "https://test.paymentgate.ru/acs/auth/start.do"
}
},
"status" : {
"value" : "WAITING",
"changedDateTime" : "2018-11-01T17:10:32.607+03:00"
},
"paymentCardInfo": {
"issuingCountry": "810",
"issuingBank": "QiwiBank",
"paymentSystem": "VISA",
"fundingSource": "CREDIT",
"paymentSystemProduct": "P|Visa Gold"
},
"callbackUrl": "https://example.com/callbacks",
"customFields" : {
"cf1": "Some data"
},
"flags" : [ ]
}
{
"serviceName":"payin-core",
"errorCode":"validation.error",
"description":"Validation error",
"userMessage":"Validation error",
"dateTime":"2022-11-13T16:49:59.166+03:00",
"traceId":"fd0e2a08c63ace83",
"cause":{
"paymentToken": [
"Exchange token error. Token disabled, please create new one"
]
}
}
{
"serviceName" : "payin-core",
"errorCode" : "payin.resource.not.found",
"userMessage" : "Resource not found",
"description" : "Resource not found",
"traceId" : "c3564ba25e221fe3",
"dateTime" : "2018-11-13T16:30:52.464+03:00"
}
Payment status
GET /partner/payin/v1/sites/test-01/payments/1811 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"amount" : {
"currency" : "RUB",
"value" : "200.00"
},
"capturedAmount" : {
"currency" : "RUB",
"value" : "0.00"
},
"refundedAmount" : {
"currency" : "RUB",
"value" : "0.00"
},
"paymentMethod" : {
"type" : "CARD",
"maskedPan" : "444444******1049",
"rrn": "124",
"authCode": "182817",
},
"createdDateTime" : "2018-11-01T17:10:31.284+03:00",
"customer" : { },
"deviceData" : { },
"requirements" : {
"threeDS" : {
"pareq" : "eJyrrgUAAXUA+Q==",
"acsUrl" : "https://test.paymentgate.ru/acs/auth/start.do"
}
},
"status" : {
"value" : "WAITING",
"changedDateTime" : "2018-11-01T17:10:32.607+03:00"
},
"customFields" : { },
"flags" : [ ]
}
{
"serviceName":"payin-core",
"errorCode":"validation.error",
"description":"Validation error",
"userMessage":"Validation error",
"dateTime":"2022-11-13T16:49:59.166+03:00",
"traceId":"fd0e2a08c63ace83",
"cause":{
"paymentToken": [
"Exchange token error. Token disabled, please create new one"
]
}
}
{
"serviceName" : "payin-core",
"errorCode" : "payin.resource.not.found",
"userMessage" : "Resource not found",
"description" : "Resource not found",
"traceId" : "c3564ba25e221fe3",
"dateTime" : "2018-11-13T16:30:52.464+03:00"
}
Completing customer authentication
POST /partner/payin/v1/sites/test-01/payments/1811/complete HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"threeDS": {
"pares": "eJzVWFevo9iyfu9fMZrzaM0QjWHk3tIiGptgooE3cgabYMKvv3jvTurTc3XOfbkaJMuL...."
}
}
{
"paymentId" : "223E",
"createdDateTime" : "2018-11-01T17:10:31.284+03:00",
"amount" : {
"currency" : "RUB",
"value" : "200.00"
},
"capturedAmount" : {
"currency" : "RUB",
"value" : "0.00"
},
"refundedAmount" : {
"currency" : "RUB",
"value" : "0.00"
},
"paymentMethod" : {
"type" : "CARD",
"maskedPan" : "444444******1049"
},
"customer" : { },
"deviceData" : { },
"requirements" : {
"threeDS" : {
"pareq" : "eJyrrgUAAXUA+Q==",
"acsUrl" : "https://test.paymentgate.ru/acs/auth/start.do"
}
},
"status" : {
"value" : "COMPLETED",
"changedDateTime" : "2018-11-01T17:10:32.607+03:00"
},
"customFields" : { },
"flags" : [ ]
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName" : "payin-core",
"errorCode" : "payin.resource.not.found",
"userMessage" : "Resource not found",
"description" : "Resource not found",
"traceId" : "c3564ba25e221fe3",
"dateTime" : "2018-11-13T16:30:52.464+03:00"
}
Payment confirmation
PUT /partner/payin/v1/sites/test-01/payments/1811/captures/bxwd8096 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"callbackUrl": "https://example.com/callbacks",
"comment": "Example capture"
}
{
"captureId": "bxwd8096",
"createdDateTime": "2018-11-20T16:29:58.96+03:00",
"amount": {
"currency": "RUB",
"value": "6.77"
},
"status": {
"value": "COMPLETED",
"changedDateTime": "2018-11-20T16:29:58.963+03:00"
}
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName" : "payin-core",
"errorCode" : "payin.resource.not.found",
"userMessage" : "Resource not found",
"description" : "Resource not found",
"traceId" : "c3564ba25e221fe3",
"dateTime" : "2018-11-13T16:30:52.464+03:00"
}
Payment confirmation status
GET /partner/payin/v1/sites/test-01/payments/1811/captures/bxwd8096 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"captureId": "bxwd8096",
"createdDateTime": "2018-11-20T16:29:58.96+03:00",
"amount": {
"currency": "RUB",
"value": "6.77"
},
"status": {
"value": "COMPLETED",
"changedDateTime": "2018-11-20T16:29:58.963+03:00"
}
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName" : "payin-core",
"errorCode" : "payin.resource.not.found",
"userMessage" : "Resource not found",
"description" : "Resource not found",
"traceId" : "c3564ba25e221fe3",
"dateTime" : "2018-11-13T16:30:52.464+03:00"
}
Faster Payments System QR Code
POST Methods
POST /partner/payin/v1/sites/test-01/sbp/qrCodes HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"qrCodeUid": "Test12",
"amount": {
"value": "1.00",
"currency": "RUB"
},
"qrCode": {
"type": "DYNAMIC",
"ttl": 60,
"image": {
"mediaType": "image/png",
"width": 300,
"height": 300
}
},
"paymentPurpose": "Flower for my girlfriend",
"redirectUrl": "http://example.com"
}
{
"qrCodeUid": "Test12",
"amount": {
"currency": "RUB",
"value": "1.00"
},
"qrCode": {
"type": "DYNAMIC",
"ttl": 60,
"image": {
"mediaType": "image/png",
"width": 300,
"height": 300,
"content": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAA"
},
"payload": "https://qr.nspk.ru/AD10006M8KH234K782OQM0L13JI31LQD?type=02&bank=100000000009&sum=200&cur=RUB&crc=C63A",
"status": "CREATED"
},
"createdOn": "2022-08-11T20:10:32+03:00"
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName":"payin-core",
"errorCode":"internal.error",
"userMessage":"Internal error",
"description":"Internal error",
"traceId":"3fb3420ee1795dcf",
"dateTime":"2020-02-12T21:28:01.813+03:00"
}
PUT Method
PUT /partner/payin/v1/sites/test-01/sbp/qrCodes/Test12 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"amount": {
"value": "1.00",
"currency": "RUB"
},
"qrCode": {
"type": "DYNAMIC",
"ttl": 60,
"image": {
"mediaType": "image/png",
"width": 300,
"height": 300
}
},
"paymentPurpose": "Flower for my girlfriend",
"redirectUrl": "http://example.com"
}
{
"qrCodeUid": "Test12",
"amount": {
"currency": "RUB",
"value": "1.00"
},
"qrCode": {
"type": "DYNAMIC",
"ttl": 60,
"image": {
"mediaType": "image/png",
"width": 300,
"height": 300,
"content": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAA"
},
"payload": "https://qr.nspk.ru/AD10006M8KH234K782OQM0L13JI31LQDtype=02bank=100000000009&sum=200&cur=RUB&crc=C63A",
"status": "CREATED"
},
"createdOn": "2022-08-11T20:10:32+03:00"
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName":"payin-core",
"errorCode":"internal.error",
"userMessage":"Internal error",
"description":"Internal error",
"traceId":"3fb3420ee1795dcf",
"dateTime":"2020-02-12T21:28:01.813+03:00"
}
Faster Payments System QR Code Status
GET /partner/payin/v1/sites/test-01/sbp/qrCodes/Test HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"qrCodeUid": "Test",
"amount": {
"currency": "RUB",
"value": "1.00"
},
"qrCode": {
"type": "DYNAMIC",
"ttl": 60,
"payload": "https://qr.nspk.ru/AD10006M8KH234K782OQM0L13JI31LQDtype=02bank=100000000009&sum=200&cur=RUB&crc=C63A",
"status": "PAYED"
},
"payment": {
"paymentUid": "A22231710446971300200933E625FCB3",
"paymentStatus": "COMPLETED"
},
"createdOn": "2022-08-11T20:10:32+03:00"
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName":"payin-core",
"errorCode":"internal.error",
"userMessage":"Internal error",
"description":"Internal error",
"traceId":"3fb3420ee1795dcf",
"dateTime":"2020-02-12T21:28:01.813+03:00"
}
Faster Payments System token payment
FPS token payment
POST /partner/payin/v1/sites/test-01/sbp/qrCodes/adghj17d1g8/payments HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"tokenizationAccount": "customer123",
"token": "c5ba4a05-21c9-4a36-af7a-b709b4caa4d6"
}
Successful response for the FPS token payment request
{
"qrCodeUid": "adghj17d1g8",
"amount": {
"value": "100.00",
"currency": "RUB"
},
"paymentPurpose": "Flower for my girlfriend",
"redirectUrl": "http://someurl.com",
"qrCode": {
"type": "DYNAMIC",
"ttl": 999,
"status": "INIT_PAYMENT_BY_TOKEN",
"payload": ""
}
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName":"payin-core",
"errorCode":"internal.error",
"userMessage":"Internal error",
"description":"Internal error",
"traceId":"3fb3420ee1795dcf",
"dateTime":"2020-02-12T21:28:01.813+03:00"
}
Refund
PUT /partner/payin/v1/sites/test-01/payments/1811/refunds/tcwv3132 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"amount": {
"value": 2.34,
"currency": "RUB"
}
}
{
"refundId": "tcwv3132",
"createdDateTime": "2018-11-20T16:32:55.547+03:00",
"amount": {
"currency": "RUB",
"value": "2.34"
},
"status": {
"value": "COMPLETED",
"changedDateTime": "2018-11-20T16:32:55.55+03:00"
},
"flags": [
"REVERSAL"
]
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName" : "payin-core",
"errorCode" : "payin.resource.not.found",
"userMessage" : "Resource not found",
"description" : "Resource not found",
"traceId" : "c3564ba25e221fe3",
"dateTime" : "2018-11-13T16:30:52.464+03:00"
}
Refund status
GET /partner/payin/v1/sites/test-01/payments/1811/refunds/tcwv3132 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"refundId": "tcwv3132",
"createdDateTime": "2018-11-20T16:32:55.547+03:00",
"amount": {
"currency": "RUB",
"value": "2.34"
},
"status": {
"value": "COMPLETED",
"changedDateTime": "2018-11-20T16:32:55.55+03:00"
},
"flags": [
"REVERSAL"
]
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName" : "payin-core",
"errorCode" : "payin.resource.not.found",
"userMessage" : "Resource not found",
"description" : "Resource not found",
"traceId" : "c3564ba25e221fe3",
"dateTime" : "2018-11-13T16:30:52.464+03:00"
}
All refunds status
GET /partner/payin/v1/sites/test-01/payments/1811/refunds HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
[
{
"refundId": "tcwv3132",
"createdDateTime": "2018-11-20T16:32:55.547+03:00",
"amount": {
"currency": "RUB",
"value": "2.34"
},
"status": {
"value": "COMPLETED",
"changedDateTime": "2018-11-20T16:32:55.55+03:00"
},
"flags": [
"REVERSAL"
]
}
]
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName" : "payin-core",
"errorCode" : "payin.resource.not.found",
"userMessage" : "Resource not found",
"description" : "Resource not found",
"traceId" : "c3564ba25e221fe3",
"dateTime" : "2018-11-13T16:30:52.464+03:00"
}
Refund decline
POST /partner/payin/v1/sites/test-01/payments/1811/refunds/tcwv3132/decline HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"refundId": "tcwv3132",
"createdDateTime": "2018-11-20T16:32:55.547+03:00",
"amount": {
"currency": "RUB",
"value": "2.34"
},
"status": {
"value": "COMPLETED",
"changedDateTime": "2018-11-20T16:32:55.55+03:00"
},
"flags": [
"REVERSAL"
]
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName" : "payin-core",
"errorCode" : "payin.resource.not.found",
"userMessage" : "Resource not found",
"description" : "Resource not found",
"traceId" : "c3564ba25e221fe3",
"dateTime" : "2018-11-13T16:30:52.464+03:00"
}
Card verification
GET /partner/payin/v1/sites/test-01/validation/card/requests/acd7bf20-22e2-4cbf-a218-38d90e9f29b9 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"cardData": {
"pan": "1111222233334444",
"expiryDate": "12/34",
"cvv2": "123",
"holderName": "Super Man"
},
"tokenizationData": {
"account": "cat_girl"
}
}
{
"requestUid": "acd7bf20-22e2-4cbf-a218-38d90e9f29b9",
"status": "SUCCESS",
"isValidCard": true,
"threeDsStatus": "WITHOUT",
"checkOperationDate": "2021-07-29T16:30:00+03:00",
"cardInfo": {
"issuingCountry": "RUS",
"issuingBank": "Qiwi bank",
"paymentSystem": "VISA",
"fundingSource": "DEBIT",
"paymentSystemProduct": "Platinum..."
},
"createdToken": {
"token": "1a77343a-dd8a-11eb-ba80-0242ac130004",
"name": "111122******4444",
"expiredDate": "2034-12-01T00:00:00+03:00",
"account": "cat_girl"
}
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName":"payin-core",
"errorCode":"internal.error",
"userMessage":"Internal error",
"description":"Internal error",
"traceId":"3fb3420ee1795dcf",
"dateTime":"2020-02-12T21:28:01.813+03:00"
}
Card verification status
GET /partner/payin/v1/sites/test-01/validation/card/requests/acd7bf20-22e2-4cbf-a218-38d90e9f29b9 HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"requestUid": "acd7bf20-22e2-4cbf-a218-38d90e9f29b9",
"status": "SUCCESS",
"isValidCard": true,
"threeDsStatus": "WITHOUT",
"checkOperationDate": "2021-07-29T16:30:00+03:00",
"cardInfo": {
"issuingCountry": "RUS",
"issuingBank": "Qiwi bank",
"paymentSystem": "VISA",
"fundingSource": "DEBIT",
"paymentSystemProduct": "Platinum..."
},
"createdToken": {
"token": "1a77343a-dd8a-11eb-ba80-0242ac130004",
"name": "111122******4444",
"expiredDate": "2034-12-01T00:00:00+03:00",
"account": "cat_girl"
}
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName":"payin-core",
"errorCode":"internal.error",
"userMessage":"Internal error",
"description":"Internal error",
"traceId":"3fb3420ee1795dcf",
"dateTime":"2020-02-12T21:28:01.813+03:00"
}
Complete 3DS on card verification
POST /partner/payin/v1/sites/test-01/validation/card/requests/acd7bf20-22e2-4cbf-a218-38d90e9f29b9/complete HTTP/1.1
Accept: application/json
Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
Content-type: application/json
Host: api.qiwi.com
{
"pares": "eJzVWFevo9iyfu9fMZrzaM0QjWHk3tIiGptgooE3cgabYMKvv3jvTurTc3XOfbkaJMuL...."
}
{
"requestUid": "acd7bf20-22e2-4cbf-a218-38d90e9f29b9",
"status": "SUCCESS",
"isValidCard": true,
"threeDsStatus": "PASSED",
"checkOperationDate": "2021-07-29T16:30:00+03:00",
"cardInfo": {
"issuingCountry": "RUS",
"issuingBank": "Qiwi bank",
"paymentSystem": "VISA",
"fundingSource": "DEBIT",
"paymentSystemProduct": "Platinum..."
},
"createdToken": {
"token": "1a77343a-dd8a-11eb-ba80-0242ac130004",
"name": "111122******4444",
"expiredDate": "2034-12-01T00:00:00+03:00",
"account": "cat_girl"
}
}
{
"serviceName" : "payin-core",
"errorCode" : "validation.error",
"description" : "Validation error",
"userMessage" : "Validation error",
"dateTime" : "2018-11-13T16:49:59.166+03:00",
"traceId" : "fd0e2a08c63ace83"
}
{
"serviceName":"payin-core",
"errorCode":"internal.error",
"userMessage":"Internal error",
"description":"Internal error",
"traceId":"3fb3420ee1795dcf",
"dateTime":"2020-02-12T21:28:01.813+03:00"
}
Electronic Receipt Transfer (by Fed.Rule 54)
To work on 54-FZ Rule, the Payment Protocol provides a tool to interact with your online cash register. Information to form a fiscal receipt is passed on to the JSON-object cheque
of invoice, payment, and refund API methods.
To activate the fiscal receipt service, contact your manager in QIWI Support with the TIN number with which your organization is registered in the online cash rental service.
For the ATOL service, provide the following data also:
- RSP's email for receipt printing
- Full title of the organization
- Fiscal data operator details (name, TIN, URL)
- Login / password for security token generation
- Commodity group code
Fiscal receipt for the successful operation is provided in chequeData
object in the synchronous response to the operation, and in the operation notification.
JSON-object description
{
...
"cheque" : {
"sellerId" : 3123011520,
"customerContact" : "Test customer contact",
"chequeType" : "COLLECT",
"taxSystem" : "OSN",
"positions" : [
{
"quantity" : 1,
"price" : {
"value" : 7.82,
"currency" : "RUB"
},
"tax" : "NDS_0",
"paymentSubject" : "PAYMENT",
"paymentMethod" : "FULL_PAYMENT",
"description" : "Test description"
}
]
}
}
Parameter | Req. | Type | Description |
---|---|---|---|
sellerId | Y | Number | Organization's TIN |
chequeType | Y | String | Cash operation (1054 fiscal tag):COLLECT – Incoming cash COLLECT_RETURN - Cash return CONSUME - Outgoing cash CONSUME_RETURN - Outgoing cash return |
customerContact | Y | String(64) | Customer's phone or e-mail (fiscal tag 1008) |
taxSystem | Y | String | Tax system (fiscal tag 1055):OSN - GeneralUSN – Simplified incomeUSN_MINUS_CONSUM – Simplified income minus expenseENVD – United tax to conditional incomeESN - United agriculture taxPATENT – Patent tax system |
positions | Y | Array | Commodities list |
quantity | Y | Number | Quantity (fiscal tag 1023) |
price | Y | Number | One item price, with discounts and extra charges (fiscal tag 1079) |
tax | Y | String | VAT rate (fiscal tag 1199):NDS_CALC_18_118 - VAT rate 18% (18/118) NDS_CALC_10_110 – VAT rate 10% (10/110) NDS_0 – VAT rate 0% NO_NDS – VAT not applicableNDS_CALC_20_120 – VAT rate 20% (20/120) |
description | Y | String(128) | Name |
paymentMethod | Y | String | Cash type (fiscal tag 1214):ADVANCED_FULL_PAYMENT – payment in advance 100%. Full payment in advance before commodity provisionPARTIAL_ADVANCE_PAYMENT – payment in advance. Partial payment before commodity provisionADVANCE – prepaymentFULL_PAYMENT – full payment, taking into account prepayment, with commodity provisionPARTIAL_PAYMENT – partial payment and credit payment. Partial payment for the commodity at the moment of delivery, with future credit payment.CREDIT – credit payment. Commodity is delivered with no payment at the moment and future credit payment is expected.CREDIT_PAYMENT – payment for the credit. Commodity payment after its delivery with future credit payment. |
paymentSubject | Y | String | Payment subject (fiscal tag 1212):COMMODITY – commodity except excise commodities (name and other properties describing the commodity).EXCISE_COMMODITY – excise commodity (name and other properties describing the commodity).WORK – work (name and other properties describing the work). .SERVICE – service (name and other properties describing the service).GAMBLING_RATE – gambling rate (in any gambling activities).GAMBLING_PRIZE – gambling prize payment (in any gambling activities).LOTTERY_TICKET – lottery ticket payment (in accepting payments for lottery tickets, including electronic ones, lottery stakes in any lottery activities).LOTTERY_PRIZE – lottery prize payment (n any lottery activities). GRANTING_RESULTS_OF_INTELLECTUAL_ACTIVITY – provision of rights to use intellectual activity results.PAYMENT – payment (advance, pre-payment, deposit, partial payment, credit, fine, bonus, reward, or any similar payment subject).AGENCY_FEE – agent's commission (in any fee to payment agent, bank payment agent, commissioner or other agent service).COMPAUND_PAYMENT_SUBJECT – multiple payment subject (in any payment constituent subject to any of the above).OTHER_PAYMENT_SUBJECT – other payment subject not related to any of the above. |