# Quick Pay - Merchant Scan

## Overview

This endpoint processes a payment using a customer-provided authorization code (often from a QR code or barcode on their device). This is typically used in a "merchant-scan" scenario where the merchant's point-of-sale system scans the customer's payment code.

## Environments

<table><thead><tr><th width="123">Environment</th><th width="93.5999755859375">Protocol</th><th width="84.20001220703125">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/microPay</code></td></tr><tr><td>Production</td><td>HTTPS</td><td><code>POST</code></td><td><code>https://portal.paywizard.biz/ovstrade/openPay/microPay</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](https://smartpossdk.gitbook.io/paywizard-open-api/cloud-api/paywizard-open-platform-api-signature-guide-v3). |

## **Request Body Parameters**

| Parameter        | Type   | Required               | Description                                                                                                                                         |
| ---------------- | ------ | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clientId`       | String | Yes                    | Your unique developer ID.                                                                                                                           |
| `transIndexCode` | String | Yes                    | The unique order ID generated by your system.                                                                                                       |
| `scanChannel`    | String | Yes                    | The payment channel associated with the auth code. See [Scan Channels](https://oversea.hs1c.cn/showdoc/web/#/671575440/155776416) for valid values. |
| `amount`         | String | Yes                    | The total transaction amount. Example: `"10.50"`.                                                                                                   |
| `authCode`       | String | Yes                    | The authorization code scanned from the customer's device.                                                                                          |
| `tranCurrency`   | String | Yes                    | The 3-letter ISO currency code for the transaction. Example: `"USD"`.                                                                               |
| `productDesc`    | String | No                     | A brief description of the product(s) or service(s).                                                                                                |
| `payerType`      | String | Conditionally Required | The type of payer identifier. Valid values: `MSISDN`, `EMAIL`, `PARTY_CODE`. Required when `scanChannel` is `MOMO`.                                 |
| `notifyUrl`      | String | No                     | The callback URL where you will receive the final transaction result notification.                                                                  |

## **Request Example**

```json
{
    "clientId": "825429536610058240",
    "transIndexCode": "20250401123534801",
    "scanChannel": "M_PAY",
    "amount": "10.50",
    "authCode": "awrawfsfegojpenmfkapowngpawngpgrigawfnrtujgpsn",
    "tranCurrency": "USD"
}
```

***

## **Response Body**

The response object contains the status of the request and the transaction details.

| Parameter             | Type    | Description                                                                                     |
| --------------------- | ------- | ----------------------------------------------------------------------------------------------- |
| `code`                | Integer | The HTTP status code. `200` indicates a successful request. Any other value indicates an error. |
| `msg`                 | String  | A human-readable message describing the result. "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 unique transaction ID generated by the payment platform.                                    |
| `data.transIndexCode` | String  | The original third-party order ID from the request.                                             |
| `data.result`         | Integer | The status of the transaction. \<br> `0`: Success \<br> `1`: Failure \<br> `2`: Pending         |
| `data.amount`         | String  | The transaction amount.                                                                         |

## **Success Response Example**

*Note: The parameter `state` in the example below corresponds to `result` in the documentation.*

```json
{
    "code": 200,
    "msg": "success",
    "timestamp": "2024-08-12 14:45:54",
    "data": {
        "mid": "10800000003",
        "paywizardId": "1000000011",
        "checkoutId": "768878984749514752",
        "transIndexCode": "202504011341223232135",
        "state": 0,
        "amount": "100.21"
    }
}
```
