> For the complete documentation index, see [llms.txt](https://intella2.gitbook.io/scan2pay/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://intella2.gitbook.io/scan2pay/api-specification/customer-scan.md).

# Merchant-Presented QR Code

OLPay obtains a transaction URL and transforms it to a QR code that allows consumer to scan by their mobile device.

## Request

### Header

| Item        | **Mandatory** | **Data Type** | Sample         | Description                                                                    |
| ----------- | ------------- | ------------- | -------------- | ------------------------------------------------------------------------------ |
| Method      | YES           | String(5)     | 00000          | Fill in 00000 (indefinite payment method)                                      |
| ServiceType | YES           | String(32)    | **OLPay**      | Selected Scan2Pay Service type                                                 |
| MchId       | YES           | String(32)    | Account0001    | Selected Scan2Pay Service type                                                 |
| TradeKey    | YES           | String(128)   | sha256...hash  | Marchant password provided by intella, this password must be encoded by SHA256 |
| CreateTime  | YES           | String(14)    | 20180101120000 | Request time, the format is "yyyyMMddHHmmss"                                   |

### Data

| Item         | **Mandatory** | Data Type  | Sample            | Description                                                                              |
| ------------ | ------------- | ---------- | ----------------- | ---------------------------------------------------------------------------------------- |
| TimeExpire   | NO            | String     | 20180101120100    | Order (QR Code) expiry time, the format is "yyyyMMddHHmmss"                              |
| DeviceInfo   | YES           | String     | skb0001           | Terminal number is fixed at “skb0001”                                                    |
| StoreOrderNo | YES           | String(20) | 2018010100001     | Order number, composition shall be an alphanumeric string and no more than 20 characters |
| Body         | YES           | String     | chickenchop       | Product name                                                                             |
| FeeType      | NO            | String     | TWD               | Transaction currency, defaults to TWD                                                    |
| TotalFee     | YES           | Integer    | 70                | Positive integer. Cannot be a negative value                                             |
| Detail       | NO            | String     | crispychickenchop | Order detail                                                                             |
| StoreInfo    | NO            | String     | A0001             | Store ID                                                                                 |
| Cashier      | NO            | String     | ShaomingW         | Cashier                                                                                  |
| StoreName    | NO            | String     | ZhongxiaoStore    | Store name                                                                               |
| StoreType    | NO            | String     | RegularChain      | Store type                                                                               |
| DeviceOS     | NO            | String     | 2                 | Device type (1:iOS / 2:Android / 3:Windows / 4:Others)                                   |

{% hint style="danger" %}
To avoid transaction failure, order number (StoreOrderNo) cannot be more than 20 characters, and must be alphabets and/or numbers, any special symbols or characters might fail the transaction.
{% endhint %}

## Response

### Header

| Item         | Data Type | Sample         | Description                                                                                                                      |
| ------------ | --------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| StatusCode   | String(4) | 0000           | [Transaction Status Code](https://intella2.gitbook.io/scan2pay/~/edit/drafts/-L_QN8wakNfvU4Ezi77d/appendix/scan2pay-error-codes) |
| StatusDesc   | String    | Success        | Description of transaction status                                                                                                |
| Method       | String(5) | 10100          | Payment method code                                                                                                              |
| ServiceType  | String    | **OLPay**      | Selected Scan2Pay Service type                                                                                                   |
| MchId        | String    | Account0001    | Merchant ID                                                                                                                      |
| ResponseTime | String    | 20180101120100 | Response time, the format is "yyyyMMddHHmmss"                                                                                    |

### Data

| Item     | Data Type | Sample                        | Description                                                                      |
| -------- | --------- | ----------------------------- | -------------------------------------------------------------------------------- |
| urlToken | String    | <https://s.intella.co/hdjkhd> | Transaction URL address, can be transformed to QR Code to allow consumer to scan |

{% hint style="warning" %}
If not providing an URL for receiving the payment notification (see [Payment Notification API](https://intella2.gitbook.io/scan2pay/~/edit/drafts/-L_QN8wakNfvU4Ezi77d/api-callback)), the payee has to call the “[Single order query API](https://intella2.gitbook.io/scan2pay/~/edit/drafts/-L_QN8wakNfvU4Ezi77d/api-specification/single-order-query)” periodically for a few minutes until the payment result is obtained or timeout.
{% endhint %}

## API Example

### Request

```
{
  "Header": {
    "Method": "00000",
    "ServiceType": "OLPay",
    "MchId": "myMchId",
    "TradeKey": "9af15b336e6a9619928537df30b2e6a2376569fcf9d7e773eccede65606529a0",
    "CreateTime": "20180715101009"
  },
  "Data": "{\"DeviceInfo\":\"skb0001\",\"StoreOrderNo\":\"PO-20180715-001\",\"Body\":\"Chicken Rice\",\"TotalFee\":\"1\"}"
}
```

### Response

```
{
  "Header": {
    "StatusCode": "0000",
    "StatusDesc": "執行成功",
    "ServiceType": "OLPay",
    "MchId": "myMchId",
    "ResponseTime": "20180715101012"
  },
  "Data": {
    "urlToken": "https://s.intella.co/tf6oc66cgfp"
  }
}
```

To offer Google Pay through Scan2Pay OLPay, please refer to the Google Pay™ Developer Guide ([Scan2Pay OLPay Integration](/scan2pay/appendix/google-pay-tm-developer-guide-integrating-with-scan2pay-olpay.md)).
