# Query Transaction Status

## Overview

This endpoint allows you to query the status and details of a specific transaction using either the platform's `checkoutId` or your original `transIndexCode`.

## Environments

<table><thead><tr><th width="119">Environment</th><th width="85.79998779296875">Protocol</th><th width="63.79998779296875">HTTP Method</th><th>URL</th></tr></thead><tbody><tr><td>Sandbox</td><td>HTTPS</td><td><code>POST</code></td><td><code>https://uat.paywizard.biz/ovstrade/openPay/queryOrder</code></td></tr><tr><td>Production</td><td>HTTPS</td><td><code>POST</code></td><td><code>https://portal.paywizard.biz/ovstrade/openPay/queryOrder</code></td></tr></tbody></table>



## **Headers**

| Key            | Type   | Required | Description                                                                                                           |
| -------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------- |
| `Content-Type` | String | Yes      | Must be `application/json`.                                                                                           |
| `jwt-token`    | String | Yes      | The transaction token obtained using your developer credentials.                                                      |
| `sign`         | String | Yes      | The request signature. See [Signature Generation Guide](../cloud-api/paywizard-open-platform-api-signature-guide-v3). |

## **Request Body Parameters**

| Parameter        | Type   | Required | Description                                                  |
| ---------------- | ------ | -------- | ------------------------------------------------------------ |
| `clientId`       | String | Yes      | Your unique developer ID.                                    |
| `checkoutId`     | String | No       | The unique transaction ID generated by the payment platform. |
| `transIndexCode` | String | No       | The unique order ID that was generated by your system.       |

{% hint style="warning" %}
_Note: At least one of `checkoutId` or `transIndexCode` must be provided. If both are sent, `checkoutId` will take precedence._
{% endhint %}

## **Request Example**

```json
{
    "clientId": "825429536610058240",
    "checkoutId": "202504011341223232135",
    "transIndexCode": "20250401123534801"
}
```

***

## **Response Body**

The response object contains the current details of the queried transaction.

<table><thead><tr><th width="195">Parameter</th><th width="116.99993896484375">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>code</code></td><td>Integer</td><td>The HTTP status code. <code>200</code> indicates a successful request. Any other value indicates an error.</td></tr><tr><td><code>msg</code></td><td>String</td><td>A human-readable message describing the result. "success" on successful requests.</td></tr><tr><td><code>timestamp</code></td><td>String</td><td>The UTC timestamp of the response. Format: <code>YYYY-MM-DD HH:mm:ss</code>.</td></tr><tr><td><code>data</code></td><td>Object</td><td>A container for the successful response data. Null on error or if the order is not found.</td></tr><tr><td><code>data.mid</code></td><td>String</td><td>The merchant ID.</td></tr><tr><td><code>data.paywizardId</code></td><td>String</td><td>The unique platform ID for the transaction.</td></tr><tr><td><code>data.checkoutId</code></td><td>String</td><td>The unique transaction ID generated by the payment platform.</td></tr><tr><td><code>data.transIndexCode</code></td><td>String</td><td>The original third-party order ID from the request.</td></tr><tr><td><code>data.state</code></td><td>Integer</td><td>An integer code representing the current status of the transaction. See <a href="https://www.google.com/search?q=%23transaction-states">Transaction States</a> below.</td></tr><tr><td><code>data.amount</code></td><td>String</td><td>The transaction amount.</td></tr><tr><td><code>data.tranTime</code></td><td>String</td><td>The UTC timestamp of when the transaction was successfully completed. Format: <code>YYYY-MM-DD HH:mm:ss</code>. Returned only on successful transactions.</td></tr></tbody></table>

**Transaction States**

The `state` field in the response data indicates the current status of the order.

<table><thead><tr><th width="90.800048828125">State Code</th><th>Description</th></tr></thead><tbody><tr><td><code>1</code></td><td>Not Paid</td></tr><tr><td><code>2</code></td><td>Payment/Operation Complete</td></tr><tr><td><code>3</code></td><td>Canceled</td></tr><tr><td><code>4</code></td><td>Refunded</td></tr><tr><td><code>5</code></td><td>Order Closed</td></tr><tr><td><code>6</code></td><td>Partially Refunded</td></tr><tr><td><code>7</code></td><td>Pre-authorization Complete</td></tr><tr><td><code>8</code></td><td>Pre-authorization Canceled</td></tr><tr><td><code>9</code></td><td>Partially Canceled</td></tr></tbody></table>

## **Success Response Example**

```json
{
    "code": 200,
    "msg": "success",
    "timestamp": "2024-08-12 14:45:54",
    "data": {
        "mid": "10800000003",
        "paywizardId": "1000000011",
        "checkoutId": "768878984749514752",
        "transIndexCode": "202504011341223232135",
        "state": 2,
        "amount": "100.21",
        "tranTime": "2025-06-04 17:03:21"
    }
}
```

