> For the complete documentation index, see [llms.txt](https://docs.ottpay.com/payment-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ottpay.com/payment-api/pc-api/upayspay/untitled-1.md).

# Query Transaction with UnionPay-SecurePay

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

|  Params Name |          Description         | Required |          Notes         |
| :----------: | :--------------------------: | :------: | :--------------------: |
|    action    | Action name (Constant Value) |     Y    |     "CC\_QUERYPAY"     |
|    version   |        Version number        |     Y    |          "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):**

```php
{
    "action":"STATUS_QUERY",
    "version":"1.0",
    "merchant_id":"QC00005496",
    "data": "zTadPG0YM4gD1WOFqxg7wn3vmU20NjCnCUOOnE9mTTkxYraQDflljA8W3azYG9MuOvOyl3cZhafH+io6PiWdZCwRmi3HGa19BvT215IIxRy2HvYe0Sqs2lxshm9E4y5F1gJ7HHMTqpY0wIA4DsuWA97UC55adB2G86VbanI7B5a3kErApr5mbAoE7wcNbDJfGh4CBbSoRxQyiGZ48SvYuIW/sclT4yu6okjo6CY3xL4=",
    "md5":"6AFB2E94A70D9A208F101723700EB287"
}
```

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

| Params Name | Description | Required |                                      Notes                                     |
| :---------: | :---------: | :------: | :----------------------------------------------------------------------------: |
|  order\_id  |   Order ID  |     Y    | OrderID could be generated by client's code, or generated by OTTPay as default |

:ballot\_box\_with\_check: **Data Example(JSON Data,to be encrypted):**

```
{
  "order_id":"2020041468976O124O000857",
}
```

## :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              |
| :--------------: | :---------------------: | :------: | :-----------------------------: |
|   order\_status  |       Order status      |     Y    |                                 |
|    trade\_time   |     Transaction time    |     N    |                                 |
|     order\_id    |         Order ID        |     Y    |                                 |
| buyer\_login\_id |         Buyer ID        |     N    |                                 |
|   total\_amount  |    Order total amount   |     N    |  String, "100" for 1.00 dollar. |
|  receive\_amount | Merchant receive amount |     N    |  String, "100" for 1.00 dollar. |
|    pay\_amount   |     User pay amount     |     N    |  String, "100" for 1.00 dollar. |
|        tip       |        tip amount       |     N    |  String, "100" for 1.00 dollar. |
|    refund\_fee   |        Refund fee       |     N    | Only exist for a refunded order |

:ballot\_box\_with\_check: **Data Example(JSON Data, after decrypted):**

```
{
    "order_id":"2020041468976O124O000857",
    "total_amount":1,
    "refund_fee": 0,
    "order_status":"init",
    "trade_time":"Apr 14, 2020 12:08:58 AM",
    "tip": 0
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.ottpay.com/payment-api/pc-api/upayspay/untitled-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
