# APIs

## 1. Get payment list API

**Path:** /api/v1/paygate/neopay

**Method**: POST

### Request

<table><thead><tr><th>Parameter</th><th width="117">Data type</th><th width="101">Required</th><th>Description</th></tr></thead><tbody><tr><td>neo_Command</td><td>String</td><td>Y</td><td>"QUERY_PT"</td></tr><tr><td>neo_MerchantCode</td><td>String</td><td>Y</td><td>The merchant code is provided by NeoX</td></tr><tr><td>neo_TransactionID</td><td>String</td><td>Y</td><td>neo_TransactionID returned in IPN payload. Ref to <a href="/pages/BzWVnz8jBsH8spBH9nlw">IPN</a></td></tr><tr><td>neo_Version</td><td>String</td><td>Y</td><td>Version of API, "1" as default</td></tr><tr><td>neo_SecureHash</td><td>String</td><td>Y</td><td>Use <strong>SHA256</strong> to hash the above parameters (sort the key by Alphabet order) + Secret Key (is provided by NeoX after actual integrating)</td></tr></tbody></table>

With the secret key: **311235E7043244EC8306F96720748C56**

```javascript
{
  neo_Command: "QUERY_PT"
  neo_MerchantCode: "UFLIYL"
  neo_TransactionID: "240830080146NDTISR"
  neo_Version: "1"
  neo_SecureHash: "df594d1e467bd327a30fa45ce259987718a68bd54cc67afe74d1e15e255182a4"
}
```

### Response

<table><thead><tr><th width="209">Key</th><th width="98.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>neo_ResponseCode</td><td>Number</td><td><p>0: Successful.</p><p>&#x3C;>0: Failed, refer <a href="/pages/kU24dUIxUPVgYJPLKotj">Table of errors</a></p></td></tr><tr><td>neo_ResponseData</td><td>Object</td><td><p>Array of payments: [{</p><p>    id: NeoX's PaymentID</p><p>    status: SUCCESS | FAILED | PROCESSING</p><p>    amount: Refund amount,<br>    paymentMethod: QR | ATM | CC</p><p>    refundedAmount: Total refunded amount</p><p>}]</p></td></tr><tr><td>neo_ResponseMsg</td><td>String</td><td>Error message</td></tr></tbody></table>

```json
{
  "neo_ResponseCode": 0,
  "neo_ResponseData": [
      {
          "id": "1439209",
          "status": "PROCESSING",
          "amount": 20000000,
          "refundedAmount": 0,
          "paymentMethod": "CC"
      },
      {
          "id": "1439211",
          "status": "SUCCESS",
          "amount": 20000000,
          "refundedAmount": 100000,
          "paymentMethod": "QR"
      }
  ],
  "neo_ResponseMsg": "Successful"
}
```

## 2. Refund request API

**Path:** /api/v1/paygate/neopay

**Method**: POST

### Request

<table><thead><tr><th>Parameter</th><th width="117">Data type</th><th width="101">Required</th><th>Description</th></tr></thead><tbody><tr><td>neo_Command</td><td>String</td><td>Y</td><td>“REFUND”</td></tr><tr><td>neo_MerchantCode</td><td>String</td><td>Y</td><td>The merchant code is provided by NeoX</td></tr><tr><td>neo_RequestID</td><td>String</td><td>Y</td><td>Unique - The merchant transaction ID is provided by merchant</td></tr><tr><td>neo_PaymentID</td><td>String</td><td>Y</td><td>Payment ID, Ref </td></tr><tr><td>neo_Amount</td><td>Number</td><td>Y</td><td>Refund amount</td></tr><tr><td>neo_Receiver</td><td>String</td><td>N</td><td><p>Require beneficiary information if the user pays using the QR method.</p><p>Encode base64 follow Jsonformat: <code>{"accountName":"value", "accountNumber": "1234567", "swiftCode": "ASCBVNVX"}</code><br>=> neo_Receiver: <code>eyJhY2NvdW50TmFtZSI6InZhbHVlIiwiYWNjb3VudE51bWJlciI6ICIxMjM0NTY3Iiwic3dpZnRDb2RlIjoiQVNDQlZOVlgifQ==</code></p></td></tr><tr><td>neo_Version</td><td>String</td><td>Y</td><td>Version of API, "1" as default</td></tr><tr><td>neo_SecureHash</td><td>String</td><td>Y</td><td>Use <strong>SHA256</strong> to hash the above parameters (sort the key by Alphabet order) + Secret Key (is provided by NeoX after actual integrating)</td></tr></tbody></table>

```javascript
{
  neo_MerchantCode: "UFLIYL"
  neo_Command: "REFUND"
  neo_RequestID: "a68de39f-ea76-43fb-848f-b605b4aaf44e"
  neo_PaymentID: "1439211"
  neo_Amount: 10000
  neo_Version: "1"
  neo_Receiver: "eyJhY2NvdW50TmFtZSI6Ik5HVVlFTiBWQU4gQSIsImFjY291bnROdW1iZXIiOiIxMjM0NTY3ODkiLCJzd2lmdENvZGUiOiJBU0NCVk5WWCJ9"
  neo_SecureHash: "88cafbc3bc1312a4dbae11dedf17819ea6462b85a218298417a917f1797597fa"
}
```

### Response

<table><thead><tr><th width="209">Key</th><th width="98.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>neo_ResponseCode</td><td>Number</td><td><p>0: Successful.</p><p>&#x3C;>0: Failed, refer <a href="/pages/kU24dUIxUPVgYJPLKotj">Table of errors</a></p></td></tr><tr><td>neo_ResponseData</td><td>Object</td><td><p>{</p><p>    transId: &#x3C;Refund ID></p><p>}</p></td></tr><tr><td>neo_ResponseMsg</td><td>String</td><td>Error message</td></tr></tbody></table>

```json
{
    "neo_ResponseCode": 0,
    "neo_ResponseData": {
        "transId": "5SYNM1OELUND"
    },
    "neo_ResponseMsg": "Successful"
}
```


---

# 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.neox.vn/docs/global/payment-gateway/integrations/refund/apis.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.
