# Refund & Refund Query API (Common)

## :white\_check\_mark: **Refund Transaction API**

:ballot\_box\_with\_check: **Request Message Parameters**

| **Params Name** | **Description**            | **Required** | **Notes**             |
| --------------- | -------------------------- | ------------ | --------------------- |
| action          | Action name                | Y            | REFUND                |
| version         | Version number             | Y            | 1.0                   |
| merchant\_id    | Merchant ID                | Y            |                       |
| data            | Encrypted Transaction Data | Y            | refer to "Data" below |
| md5             | Message digest             | Y            |                       |

#### :white\_check\_mark: Dat&#x61;**(JSON Data, to be encrypted):**

|   Params Name  |    Description    | Required |                                              Notes                                             |
| :------------: | :---------------: | :------: | :--------------------------------------------------------------------------------------------: |
|    order\_id   |      Order ID     |     N    | Optional. A new order id (Refund Order ID) will be generated for refund instead of old orderID |
| ori\_order\_id | Original order ID |     Y    |                                                                                                |
|   refund\_amt  |   Refund amount   |     Y    |                                 String, "100" for 1.00 dollar.                                 |

:ballot\_box\_with\_check: **Response Message Parameters**

| **Params Name** | **Description**            | **Required** | **Notes**                  |
| --------------- | -------------------------- | ------------ | -------------------------- |
| rsp\_code       | Response code              | Y            | Please refer to Appendix B |
| rsp\_msg        | Response message           | Y            |                            |
| data            | Encrypted Transaction Data | Y            | refer to "Data" below      |
| md5             | Message digest             | Y            |                            |

#### :white\_check\_mark: Dat&#x61;**(JSON Data, to be encrypted):**

| Params Name |  Description  | Required |              Notes             |
| :---------: | :-----------: | :------: | :----------------------------: |
|  order\_id  |    Order ID   |     N    |         Refund Order ID        |
| trade\_time | Transact time |     N    |                                |
| refund\_amt | Refund amount |     Y    | String, "100" for 1.00 dollar. |

## :white\_check\_mark: **Query Refund API**

### :ballot\_box\_with\_check: **Request Message Parameters**

| **Params Name** | **Description**            | **Required** | **Notes**             |
| --------------- | -------------------------- | ------------ | --------------------- |
| action          | Action name                | Y            | REFUND\_STATUS\_QUERY |
| version         | Version number             | Y            | 1.0                   |
| merchant\_id    | Merchant ID                | Y            |                       |
| data            | Encrypted Transaction Data | Y            | refer to "Data" below |
| md5             | Message digest             | Y            |                       |

#### :white\_check\_mark: Dat&#x61;**(JSON Data, to be encrypted):**

| Params Name | Description | Required |      Notes      |
| :---------: | :---------: | :------: | :-------------: |
|  order\_id  |   Order ID  |     N    | Refund Order ID |

### :ballot\_box\_with\_check: **Response Message Parameters**

| **Params Name** | **Description**            | **Required** | **Notes**                  |
| --------------- | -------------------------- | ------------ | -------------------------- |
| rsp\_code       | Response code              | Y            | Please refer to Appendix B |
| rsp\_msg        | Response message           | Y            |                            |
| data            | Encrypted Transaction Data | Y            | refer to "Data" below      |
| md5             | Message digest             | Y            |                            |

#### :white\_check\_mark: Dat&#x61;**(JSON Data, to be encrypted):**

|  Params Name  |  Description  | Required |              Notes             |
| :-----------: | :-----------: | :------: | :----------------------------: |
|   order\_id   |    Order ID   |     Y    |         Refund Order ID        |
| order\_status |  Order status |     Y    |           ""success"           |
|  refund\_amt  | Refund amount |     Y    | String, "100" for 1.00 dollar. |


---

# 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/refund-transaction-and-query-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.
