Skip to content

API Methods

The API serves for payment acceptance within the Payment acceptance for providers via credit organizations product.

Get the status of the subscriber and extra parameters of payment without registering the payment

On receiving the request, the provider checks the presence of a subscriber with the specified ID in its database and, optionally, returns extra parameters for showing them to the customer. These extra parameters can then be transferred as additional payment details in check and pay requests.

Request parameters

Parameter Description
command Required. Identification of the request type: get additional payment data for the customer. Always getInfo
account Required. Subscriber’s identifier (account number, phone number, login etc) in the provider’s database. String of letters, digits, and special symbols, up to 200 symbols. Before sending the request, QIWI system verify the identifier to match to the regular expression given by the provider
ccy Required. Currency code according to ISO 4217
prv_id Service identifier in the provider’s information system. Integer
sum Transaction amount. A number with two decimal places in the fractional part, the separator of the integer and fractional parts is a dot
data1,data2,…,dataN Additional parameters for the subscriber identification. Format specified by the provider

Response parameters

In response, the provider’s interface must return a valid XML document containing the <response> block with the following XML tags:

Tag Description
result Required. Operation result code (result=0 if payment is possible)
comment Text comment from the provider
fields Section with subscriber’s information or operation data
fields.field1, …, fields.fieldN Tags with information
fields.field1.name, …, fields.fieldN.name The name of the information parameter. If not specified, the name disp1,.., dispN according to the order number of the fieldN tag is assigned

Examples

POST /payment_app.cgi HTTP/1.1
Accept: application/xml
Content-type: application/x-www-form-urlencoded; charset=utf-8
Host: example.com:8443
command=getInfo&account=4950001111&sum=10.45&ccy=643
<?xml version="1.0" encoding="UTF-8"?>
<response>
<result>0</result>
<comment>OK</comment>
</response>


POST /payment_app.cgi HTTP/1.1
Accept: application/xml
Content-type: application/x-www-form-urlencoded; charset=utf-8
Host: example.com:8443
command=getInfo&account=4950001111&sum=10.45&ccy=643&data1=ivanov&data2=ivan
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <result>0</result>
  <comment>OK</comment>
  <fields>
  <field1 name="name1" type="disp">value1</field1>
  <field2 name="name2" type="disp">value2</field2>
  </fields>
</response>

Check the status of the subscriber, get extra parameters of payment and register the payment

On receiving the request, the provider does the following:

  • Checks the presence of a subscriber with the specified ID in its database.
  • Performs internal checks of the payment data in accordance with the accepted logic of replenishment through payment systems.
  • (Optionally) Returns extra parameters for showing them to the customer.

Attention

The provider’s information system must not contain two successful QIWI payments with the same txn_id payment ID in QIWI system. If provider receives a request with a txn_id already existing in the provider’s system, the provider must return the result of processing of the previous request.

Request parameters

Parameter Description
command Required. Identification of the request type: check the subscriber’s account and payment data. Always check
txn_id Required. Payment identifier in QIWI system
account Required. Subscriber’s identifier in the provider’s database
sum Required. Operation amount
ccy Required. Currency code according to ISO 4217.
prv_id Internal identifier of the provider in QIWI. Integer
data1, data2,…, dataN Additional parameters for the subscriber identification. Format specified by the provider

Response parameters

In response, the provider’s interface must return a valid XML document containing the <response> block with the following XML tags:

Tag Description
osmp_txn_id Required. QIWI system’s transaction identifier, that is txn_id from the original request
result Required. Operation result code (result=0 if payment is possible)
comment Text comment from the provider
fields Section with subscriber’s information or operation data
fields.field1, …, fields.fieldN Tags with information
fields.field1.name, …, fields.fieldN.name The name of the information parameter. If not specified, the name disp1,.., dispN (according to the order number of the fieldN tag) is assigned

Examples

POST /payment_app.cgi HTTP/1.1
Accept: application/xml
Content-type: application/x-www-form-urlencoded; charset=utf-8
Host: example.com:8443
command=check&txn_id=1234567&account=4950001111&sum=10.45&ccy=643
<?xml version="1.0" encoding="UTF-8"?>
<response>
    <osmp_txn_id>1234567</osmp_txn_id>
    <result>0</result>
    <comment>OK</comment>
</response>


POST /payment_app.cgi HTTP/1.1
Accept: application/xml
Content-type: application/x-www-form-urlencoded; charset=utf-8
Host: example.com:8443
command=check&txn_id=1234567&account=4950001111&sum=10.45&ccy=643&data1=ivanov
<?xml version=”1.0” encoding="UTF-8"?>
<response>
         <osmp_txn_id>1234567</osmp_txn_id>
         <result>0</result>
         <comment>OK</comment>
         <fields>
               <field1 name="name1" type="disp">value1</field1>
               <field2 name="name2" type="disp">value2</field2>
         </fields>
</response>

Confirm the payment

On getting the request, provider replenishes the subscriber’s balance in its system.

Attention

The provider’s information system must not contain two successful QIWI payments with the same txn_id payment ID in QIWI system. If provider receives a request with a txn_id already existing in the provider’s system, the provider must return the result of processing of the previous request.

Request parameters

Parameter Description
command Required. Identification of the request type: replenish the subscriber’s balance. Always pay
txn_id Required. Payment identifier in the QIWI system
txn_date Required. Date of the transaction with YYYYMMDDHHMMSS format
account Required. Subscriber identifier in the provider’s system
sum Required. Transaction amount. A number with two decimal places in the fractional part, the separator of the integer and fractional parts is a dot
ccy Required. Currency code according to ISO 4217
prv_id Internal identifier of the provider in QIWI. Integer
data1, data2,…, dataN Additional parameters for the subscriber identification. Format specified by the provider

Response parameters

In response, the provider’s interface must return a valid XML document containing the <response> block with the following XML tags:

Tag Description
osmp_txn_id Required. QIWI system’s transaction identifier, that is txn_id from the original request
prv_txn Required. Unique ID of the replenishment operation in the provider’s system
sum Required. Payment amount transferred to the provider. A number with two decimal places in the fractional part, the separator of the integer and fractional parts is a dot
result Required. Operation result code (result=0 if payment is successfully registered)
comment Text comment from the provider
fields Section with customer information or operation data
fields.field1, …, fields.fieldN Tags with information
fields.field1.type, …, fields.fieldN.type Information data type. The following types are possible:
  • disp – information to show to the customer when making a payment (default value);
  • info – information to save in the QIWI system
  • fields.field1.name, …, fields.fieldN.name The name of the information parameter. If not specified, the name disp1,.., dispN (according to the order number of the fieldN tag) is assigned

    Examples

    POST /payment_app.cgi HTTP/1.1
    Accept: application/xml
    Content-type: application/x-www-form-urlencoded; charset=utf-8
    Host: example.com:8443
    command=pay&txn_id=1234567&txn_date=20220815120133&account=4950001111&sum=10.45&ccy=643
    
    <?xml version="1.0" encoding="UTF-8"?>
    <response>
        <osmp_txn_id>1234567</osmp_txn_id>
        <prv_txn>123</prv_txn>
        <sum>10.45</sum>
        <result>0</result>
        <comment>OK</comment>
    </response>
    


    POST /payment_app.cgi HTTP/1.1
    Accept: application/xml
    Content-type: application/x-www-form-urlencoded; charset=utf-8
    Host: example.com:8443
    command=pay&txn_id=1234567&txn_date=20220815120133&account=4950001111&sum=10.45&ccy=643&data1=ivanov
    
    <?xml version=”1.0” encoding="UTF-8"?>
    <response>
             <osmp_txn_id>1234567</osmp_txn_id>
             <prv_txn>2016</prv_txn>
             <sum>10.45</sum>
             <result>0</result>
             <comment>OK</comment>
             <fields>
                   <field1 name="name1" type="disp">value1</field1>
                   <field2 name="name2" type="disp">value2</field2>
             </fields>
    </response>