# IPN

### Instant Payment Notification

Merchant receive refund result. Similar to [IPN](/docs/global/payment-gateway/transaction-management/ipn.md)

Merchant has to respond to NeoX  following the structure [merchant response](#merchant-response) when receiving IPN.

#### IPN verification

Merchant needs to build a hashed string follow above guide and compare to received *neo\_SecureHash* parameter

Method: POST

### NeoX's IPN data

<table><thead><tr><th width="200">Parameter</th><th width="117">Data type</th><th>Description</th></tr></thead><tbody><tr><td>neo_MerchantCode</td><td>String</td><td>The merchant code is  provided by NeoX.</td></tr><tr><td>neo_Command</td><td>String</td><td>"REFUND"</td></tr><tr><td>neo_OrderID</td><td>String</td><td>Order ID</td></tr><tr><td>neo_PaymentID</td><td>String</td><td>ID of payment record</td></tr><tr><td>neo_RequestID</td><td>String</td><td>Request ID sent to NeoX in refund request</td></tr><tr><td>neo_TransactionID</td><td>String</td><td>Unique - Transaction ID is generated by NeoX.</td></tr><tr><td>neo_Amount</td><td>Number</td><td>Refund amount.</td></tr><tr><td>neo_Fee</td><td>Number</td><td>Refund fee</td></tr><tr><td>neo_Version</td><td>String</td><td>Payment gateway version, “1” as default</td></tr><tr><td>neo_ResponseCode</td><td>Number</td><td>Result of transaction: <br> 0: transaction success <br> != 0: transaction failed, refer to <a href="/pages/kU24dUIxUPVgYJPLKotj#table-of-error-code">table of error code</a></td></tr><tr><td>neo_ResponseMsg</td><td>String</td><td>Error description.</td></tr><tr><td>neo_SecureHash</td><td>String</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>

```
{
  "neo_MerchantCode": "UFLIYL",
  "neo_Command": "REFUND",
  "neo_OrderID": "DH7255715767",
  "neo_PaymentID": "1439211",
  "neo_RequestID": "a68de39f-ea76-43fb-848f-b605b4aaf44e",
  "neo_TransactionID": "XBSKM1OELUDU",
  "neo_Amount": 10000,
  "neo_Fee": 3300,
  "neo_Version": "1",
  "neo_ResponseCode": 0,
  "neo_ResponseMsg": "Success",
  "neo_SecureHash": "3C97E508CBED7561759D049C5FA58BE2DE455EA4E7EE07B1DFDF2AFC4783E144"
}
```

### Merchant response

<table><thead><tr><th width="158.33333333333331">Parameter</th><th width="162">Data type</th><th>Description</th></tr></thead><tbody><tr><td>respcode</td><td>Number</td><td><ul><li>0: Successful, merchant received IPN.</li><li>1: Failed, NeoX will retry the IPN. </li></ul></td></tr><tr><td>respmsg</td><td>String</td><td>Error message. Default is “<em>received</em>”</td></tr></tbody></table>


---

# 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/ipn.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.
