# Payment Result Query API

## Request

### Endpoint

```markup
https://queryapi.lianlianpay.com/orderquery.htm
```

### Request Parameters

| Name           | Required | Type       | Description                                                                                                                 |
| -------------- | -------- | ---------- | --------------------------------------------------------------------------------------------------------------------------- |
| oid\_partner   | Required | String(18) | The unique identification assigned to the merchant. E.g. 201304121000001004                                                 |
| sign\_type     | Required | String(3)  | RSA                                                                                                                         |
| sign           | Required | String     | Signature value                                                                                                             |
| no\_order      | Required | String(32) | Merchant order No. Optional if `oid_paybill` is present                                                                     |
| dt\_order      | Required | String(14) | Merchant order date. Format: yyyyMMddHHmmss, E.g. 20170801225714                                                            |
| oid\_paybill   | Required | String(18) | Unique transaction No. in LianLian system. E.g. 2011030900001098. Optional if `no_order` is present                         |
| query\_version | Optional | String(6)  | <p>1.0, regular response(default value) <br> 1.1, return additional parameter <code>memo</code>, <code>bank_name</code></p> |

### Sample Request

```
curl https://queryapi.lianlianpay.com/orderquery.htm \
-H "Content-type:application/json;charset=utf-8" \
-d '{
        "oid_partner":"201103171000000000",
        "dt_order":"20130515094013",
        "no_order":"2013051500001",
        "sign_type":"RSA",
        "sign":"ZPZULntRpJwFmGNIVKwjLEF2Tze7bqs60rxQ22CqT5J1UlvGo575QK9z/+p+7E9cOoRoWzqR6xHZ6WVv3dloyGKDR0btvrdqPgUAoeaX/YOWzTh00vwcQ+HBtXE+vPTfAqjCTxiiSJEOY7ATCF1q7iP3sfQxhS0nDUug1LP3OLk="
    }'
```

## Response

### Parameters

| Name         | Required | Type           | Description                                                                                                                                                                                                                                                                                    |
| ------------ | -------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ret\_code    | Required | String(4)      | Return code, whether the request is handled successfully or not. Refer to [return codes](https://github.com/LianLianPay/GitBook-Docs-en/tree/a4af028fe84e1d3f6e1554da7e53e8ef91373623/docs/return_code.md)                                                                                     |
| ret\_msg     | Required | String(100)    | Return message, description of `ret_code`, in Chinese                                                                                                                                                                                                                                          |
| oid\_partner | Required | String(18)     | The unique identification assigned to the merchant. E.g. 201304121000001004                                                                                                                                                                                                                    |
| sign\_type   | Required | String(3)      | RSA                                                                                                                                                                                                                                                                                            |
| sign         | Required | String         | Signature value                                                                                                                                                                                                                                                                                |
| no\_order    | Required | String(32)     | Merchant order No.                                                                                                                                                                                                                                                                             |
| dt\_order    | Optional | String(14)     | Merchant order date. Format: yyyyMMddHHmmss, E.g. 20170801225714                                                                                                                                                                                                                               |
| oid\_paybill | Optional | String(18)     | Unique transaction No. in LianLian system. E.g. 2011030900001098                                                                                                                                                                                                                               |
| money\_order | Optional | String(12)     | Merchant order amount, 2 decimal places are expected, in CNY                                                                                                                                                                                                                                   |
| result\_pay  | Optional | String         | <p>SUCCESS, payment is successful <br> WAITING, waiting for payment result <br> PROCESSING, payment is processing by banks <br> REFUND, the payment is reversed <br> FAILURE, the payment is failed <br> This is the final transaction status. You may do delivery according to this field</p> |
| settle\_date | Optional | String(8)      | Format YYYYMMDD. Returns when payment is successful                                                                                                                                                                                                                                            |
| info\_order  | Optional | String(255)    | Returns when `info_order` is sent in API requests                                                                                                                                                                                                                                              |
| pay\_type    | Optional | String(1)      | <p>The payment method used in this transaction. <br> M, regular payment, debit card <br> N, regular payment, credit card <br>  F, authorization payment, credit card</p>                                                                                                                       |
| bank\_code   | Optional | String(8)      | Short code of banks                                                                                                                                                                                                                                                                            |
| bank\_name   | Optional | String(32)     | Name of banks, returns only when `query_version` is 1.1, this filed is not involved in [signature](../development/signature)                                                                                                                                                                   |
| memo         | Optional | String(255)    | Payment failed information from bank side,  returns only when `query_version` is 1.1, this filed is not involved in [signature](../development/signature)                                                                                                                                      |
| card\_no     | Optional | String(15\~19) | The masked number of used card. E.g. 62220&#x38;**\***&#x30;000                                                                                                                                                                                                                                |

### Sample Response

```javascript
{
    "oid_partner":"201103171000000000",
    "dt_order":"20130515094013",
    "no_order":"2013051500001",
    "result_pay":"SUCCESS",
    "oid_paybill":"2013051500001",
    "money_order":"49.65",
    "settle_date":"20130515",
    "info_order":"测试商品信息",
    "pay_type":"M",
    "bank_code":"01020000",
    "sign_type":"RSA",
    "sign":"ZPZULntRpJwFmGNIVKwjLEF2Tze7bqs60rxQ22CqT5J1UlvGo575QK9z/+p+7E9cOoRoWzqR6xHZ6WVv3dloyGKDR0btvrdqPgUAoeaX/YOWzTh00vwcQ+HBtXE+vPTfAqjCTxiiSJEOY7ATCF1q7iP3sfQxhS0nDUug1LP3OLk="
}
```
