# Query Transaction API

## :white\_check\_mark: API Request Parameter&#x73;**(HTTP-Request-Body )**

|  Params Name |         Description        | Required |          Notes          |
| :----------: | :------------------------: | :------: | :---------------------: |
|    action    |         Action name        |     Y    | String, “PREPAY\_QUERY” |
|    version   |       Version number       |     Y    |      String, “2.0”      |
| merchant\_id |         Merchant ID        |     Y    |   Provided by OTT Pay   |
|     data     | Encrypted Transaction Data |     Y    |  See "Data" table below |
|      md5     |       Message Digest       |     Y    |                         |

:ballot\_box\_with\_check: **Request Example(JSON Data):**

<pre class="language-php"><code class="lang-php">{
    "action":"PREPAY_QUERY",
    "version":"2.0",
    "merchant_<a data-footnote-ref href="#user-content-fn-1">id</a>":"QC00005496",
    "data": "zTadPG0YM4gD1WOFqxg7wn3vmU20NjCnCUOOnE9mTTkxYraQDflljA8W3azYG9MuOvOyl3cZhafH+io6PiWdZCwRmi3HGa19BvT215IIxRy2HvYe0Sqs2lxshm9E4y5F1gJ7HHMTqpY0wIA4DsuWA97UC55adB2G86VbanI7B5a3kErApr5mbAoE7wcNbDJfGh4CBbSoRxQyiGZ48SvYuIW/sclT4yu6okjo6CY3xL4=",
    "md5":"6AFB2E94A70D9A208F101723700EB287"
}
</code></pre>

#### :ballot\_box\_with\_check: Dat&#x61;**(JSON Data, to be encrypted):**

|    Params Name    |  Description | Required | Notes |
| :---------------: | :----------: | :------: | :---: |
| prepay\_order\_id | Prepay order |     Y    |       |
|     order\_id     |   Order id   |     N    |       |
|    merchant\_id   |  Merchant id |     Y    |       |

## :white\_check\_mark: API Response Parameter&#x73;**(HTTP-Response-Body)**

| Params Name |    Description   | Required |          Notes         |
| :---------: | :--------------: | :------: | :--------------------: |
|  rsp\_code  |   Response code  |     Y    |   refer to Appendix B  |
|   rsp\_msg  | Response message |     Y    |                        |
|     data    |  Encrypted Data  |     Y    | See "Data" table below |
|     md5     |  Message Digest  |     Y    |                        |

:ballot\_box\_with\_check: **Response Example(JSON Data):**

```
{
"rsp_code":"SUCCESS",
"rsp_msg":"success",
"data":"41kiLvjVBO8AW4wTOthI92OQu+8fwac5cIDx0DoZpitLvSJU8WKQbk5Bii5ZYrgLz4hepQ865QZFWqj2PRZ1FjxxipxEy2KoOKchWK09e42Se3CMAxt/+8UGrnAHDJLbU/BBlZLJoLpruSNKBeVfwhI7TtGdP4ciwzKPmv5aS2DWoU4Jl26IAPa8PeGhPNLuT99HwBGXa7aUz5adYk3uAR5Ww9HkBlPrqzJlUQ4zdMgjxaM2bROldcKTK8NxPM7X",
"md5":"32310A0DD3D021A7D0CDF6A5909A1A61"
}
```

#### :ballot\_box\_with\_check: Transaction Data(JSON format, After decrypted)

|    Params Name    |        Description       | Required |                                                    Notes                                                    |
| :---------------: | :----------------------: | :------: | :---------------------------------------------------------------------------------------------------------: |
|      rspCode      |   Inquiry Response code  |     Y    |                                                                                                             |
|       rspMsg      | Inquiry Response message |     Y    |                                                                                                             |
|    merchant\_id   |        Merchant ID       |     Y    |                                                                                                             |
|   merchant\_name  |                          |     Y    |                                                                                                             |
|       amount      |      Payment amount      |     Y    |                                                                                                             |
|        tip        |        Tip Amount        |     N    |                                                                                                             |
|      shop\_id     |         Store ID         |     Y    |                                                                                                             |
|    operator\_id   |         Operator         |     Y    |                                                                                                             |
|       status      |          status          |          |       “SUCCESS”: payment successfully, ”ORDERCLOSE”: payment fail, ”PROCESSING”: payment on processing      |
|  call\_back\_url  |       Call back URL      |          |                                                                                                             |
|   redirect\_url   |       Redirect URL       |          |                                                                                                             |
|     biz\_type     |                          |     Y    |                                                   “PREPAY”                                                  |
| prepay\_order\_id |      Prepay Order ID     |     Y    |                                                                                                             |
|     order\_id     |         Order ID         |     N    | Order\_id in OTT Pay system, if the prepay order is implemented with a payments method, it will not be null |
|     sale\_num     |        Sale number       |     Y    |                               The sale number or invoice number from merchant                               |
|       email       |        Buyer email       |     N    |                                                                                                             |
|      remarks      |          Remarks         |     N    |                                                                                                             |
|   currency\_type  |         currency         |     Y    |                                                 CAD/USD/CNY                                                 |
|      duration     |     Payment duration     |     Y    |                                                                                                             |
|    create\_time   |        create time       |     Y    |                                       Only exist for a refunded order                                       |
|    expire\_time   |        expire time       |     Y    |                                                                                                             |
| payments\_methods |       Payment list       |     Y    |                             The list of available payment to the prey pay order                             |

[^1]:


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ottpay.com/payment-api/12-1-api-for-checkout-payment/query-transaction-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
