# Void

## Overview

This endpoint is used to void a prior prepaid card transaction, such as a payment or a reload. A void typically cancels a transaction before it has been settled, effectively reversing the original operation.

## Environments

| Environment | Protocol | HTTP Method | URL                                                             |
| ----------- | -------- | ----------- | --------------------------------------------------------------- |
| Sandbox     | HTTPS    | `POST`      | `https://uat.paywizard.biz/ovstrade/openLoyaltyPay/giftVoid`    |
| Production  | HTTPS    | `POST`      | `https://portal.paywizard.biz/ovstrade/openLoyaltyPay/giftVoid` |

## **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.                                                        |
| `tranOrderNo` | String | Yes      | A new, unique order ID for this specific void request, generated by your system. |
| `oriOrderNo`  | String | Yes      | The `checkoutId` of the original prepaid transaction you want to void.           |

## **Request Example**

```json
{
    "clientId": "825429536610058240",
    "tranOrderNo": "20250401123534801",
    "oriOrderNo": "933358163137265664"
}
```

***

**Response Body**

The response object contains the status of the void transaction request.

| Parameter                | Type    | Description                                                                                                                                                    |
| ------------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `code`                   | Integer | The HTTP status code. `200` indicates a successful request.                                                                                                    |
| `msg`                    | String  | A human-readable message. `success` on successful requests.                                                                                                    |
| `timestamp`              | String  | The UTC timestamp of the response. Format: `YYYY-MM-DD HH:mm:ss`.                                                                                              |
| `data`                   | Object  | A container for the successful response data. Null on error.                                                                                                   |
| `data.mid`               | String  | The merchant ID.                                                                                                                                               |
| `data.paywizardId`       | String  | The unique platform ID for the transaction.                                                                                                                    |
| `data.checkoutId`        | String  | The new, unique transaction ID for this void, generated by the payment platform.                                                                               |
| `data.transIndexCode`    | String  | The unique void order ID that you provided in the request.                                                                                                     |
| `data.oriCheckoutId`     | String  | The `checkoutId` of the original transaction that was voided.                                                                                                  |
| `data.oriTransIndexCode` | String  | The `transIndexCode` of the original transaction that was voided.                                                                                              |
| `data.result`            | Integer | An integer code representing the status of the transaction. See [Transaction Status Codes](https://www.google.com/search?q=%23transaction-status-codes) below. |

**Transaction Status Codes**

The `result` field indicates the immediate outcome of the void request.

| Result Code | Description           |
| ----------- | --------------------- |
| `0`         | Success               |
| `1`         | Failure               |
| `2`         | Pending / In Progress |

**Success Response Example**

JSON

```
{
    "code": 200,
    "msg": "success",
    "timestamp": "2025-07-24 13:07:08",
    "data": {
        "mid": "202507081058",
        "paywizardId": "10020000080",
        "checkoutId": "933393048983961600",
        "transIndexCode": "100200000802784286495",
        "result": 0,
        "oriCheckoutId": "933392815902294016",
        "oriTransIndexCode": "100200000807293844967"
    }
}
```

