Skip to content

Latest commit

 

History

History
99 lines (76 loc) · 5.4 KB

File metadata and controls

99 lines (76 loc) · 5.4 KB

Transaction Status Check {#status}

When registered in QIWI Wallet system, a payment passes through a set of states with different statuses. Each status is specified by its unique numeric identifier. Payment processing is treated as complete when it reaches a final status. All possible status codes are listed in Payment statuses.

To check if a payment is completed successfully, the Agent’s system should use this API method to query payment status in QIWI Wallet, until a final status code, successful or unsuccessful, is received.

The request provides current payment status. Repeating request for the same payment should be used no more than once in 10 minutes.

Request format

Request parameters

<?xml version="1.0" encoding="utf-8"?>
  <request>
    <request-type>pay</request-type>
    <extra name="password">XXXXXX</extra>
    <terminal-id>123</terminal-id>
    <status>
      <payment>
        <transaction-number>12345678</transaction-number>
        <to>
          <account-number>79181234567</account-number>
        </to>
      </payment>
    </status>
  </request>
Tag Description
request A grouping tag. The child tags contain payment data
request-type Request type (payment status check is the same as top-up request: pay)
terminal-id Agent ID in QIWI Wallet system
extra name="password" Agent’s password in QIWI Wallet system
status A grouping tag. The tag contains child tags with payments data to check their status (one or more payment tag)
payment A grouping tag containing single payment data to check its status
transaction-number Transaction number generated by the Agent’s system and specified in top-up request. Together with Agent ID, transaction number uniquely identifies the payment in QIWI Wallet system. Transaction number always stays immutable within payment lifetime.
to A grouping tag with payment information
to/account-number QIWI Wallet user ID, i.e. the mobile phone number in international format

Response format

In case of non-fatal error or non-final payment status received in response to the request, the Agent’s system should repeat the request.

Fatal errors mean that sending a secondary request with the same parameters will result in the same error. Fatal errors are often caused by invalid configuration and require manual intervention. In case of fatal error, the Agent’s system may either keep repeating requests, or pause repeating the request until the configuration is corrected. Agent’s system needs not to deny payment as transaction status is unknown on request processing error. Transaction status information is inaccessible in case of these errors, so the Agent should not denies the payment on its side.

In case of network error (connection or response timeout) or HTTP error (HTTP status code other than 200, or empty HTTP response), incorrect XML-documents (no required tag/attribute) the Agent’s system should repeat the request. Transaction status information is inaccessible in case of these errors, so the Agent should not reject the payment on its side.

If you are not sure how to interpret API response, address to our Support: bss@qiwi.com.

Successful request processing

<?xml version="1.0" encoding="utf-8"?>
<response>
  <result-code fatal="false">0</result-code>
  <payment status='60' transaction-number='12345678' txn_id='759640439' result-сode='0' final-status='true' fatal-error='false' txn-date='12.03.2012 14:24:38'  />
  <balances>
    <balance code="643">90.79</balance>
    <balance code="840">0.00</balance>
  </balances>
</response>

Response data:

Tag Description Attributes
response A grouping tag No
payment Details of the checked payment. When several payments status check is requested, response contains corresponding payment tags. When payment in the request is not found in QIWI Wallet system, corresponding payment tag will be absent in the response. You have to repeat payment status check request for that payment. statuspayment status in QIWI Wallet system;
txn_id – transaction ID in QIWI Wallet system;
transaction-number – transaction number in the Agent’s system;
result-code – payment processing error code;
final-status – logical flag indicating if payment status is final;
fatal-error - logical flag indicating if payment processing error is fatal;
txn-date – date and time when the payment was accepted by QIWI Wallet system;
balances A grouping tag. The child tags are current balances of the Agent's active accounts in QIWI Wallet system No
balances/balance Balance of the Agent's account code - currency of the Agent's account (numeric code of currency according to ISO 4217)

Error response

If QIWI Wallet server is unable to process the request, the response is as follows.

<?xml version="1.0" encoding="utf-8"?>
<response>
  <result-code fatal="false">300</result-code>
</response>

Response data:

Tag Description Attributes
result-code Request processing error code fatal – logical flag indicating if request processing error is fatal