> 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/merchant-scan.md).

# Customer-Presented QR Code

## Request

### Header

| Item        | Mandatory | Data Type  | Sample         | Description                                                                    |
| ----------- | --------- | ---------- | -------------- | ------------------------------------------------------------------------------ |
| Method      | YES       | String(5)  | 00000          | Fill in 00000 (indefinite payment method)                                      |
| ServiceType | YES       | String     | **Micropay**   | Selected Scan2Pay Service type                                                 |
| MchId       | YES       | String     | Account0001    | Merchant ID provided by intella                                                |
| TradeKey    | YES       | String     | 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                                                                              |
| ------------ | --------- | ----------- | ----------------- | ---------------------------------------------------------------------------------------- |
| StoreOrderNo | YES       | String(20)  | PO180101001       | Order number, composition shall be an alphanumeric string and no more than 20 characters |
| DeviceInfo   | YES       | String      | skb0001           | Terminal number is fixed at “skb0001”                                                    |
| Body         | YES       | String(128) | chickenchop       | Product name                                                                             |
| TotalFee     | YES       | Integer     | 75                | Positive integer. Can not be a negative value                                            |
| Detail       | NO        | String      | crispychickenchop | Order detail                                                                             |
| StoreInfo    | NO        | String      | 0001              | Store ID                                                                                 |
| Cashier      | NO        | String      | ShaomingW         | Cashier                                                                                  |
| AuthCode     | YES       | String      | 13000011423       | Authorization code obtained from the QR Code the consumer presented                      |
| 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 are unacceptable.
{% endhint %}

## Response

### Header

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

### Data

| Item         | Data Type | Sample              | Description                                                                |
| ------------ | --------- | ------------------- | -------------------------------------------------------------------------- |
| SysOrderNo   | String    | 2018010110074205610 | System order number                                                        |
| StoreOrderNo | String    | PO180101001         | Store order number                                                         |
| TotalFee     | Integer   | 75                  | Positive integer. Can not be a negative value                              |
| AuthCode     | String    | 13000011423         | Payment authorization code, obtains from the QR Code the consumer provided |

## API Example

### Request

```
{
  "Header": {
    "Method": "00000",
    "ServiceType": "Micropay",
    "MchId": "myMchId",
    "TradeKey": "9af15b336e6a9619928537df30b2e6a2376569fcf9d7e773eccede65606529a0",
    "CreateTime": "20180715101650"
  },
  "Data": "{\"DeviceInfo\":\"skb0001\",\"StoreOrderNo\":\"PO-20180715-002\",\"Body\":\"Chicken Rice\",\"TotalFee\":\"1\",\"AuthCode\":\"3K21111111301\"}"
}
```

### Response

```
{
  "Header": {
    "StatusCode": "0000",
    "StatusDesc": "執行成功",
    "Method": "10900",
    "ServiceType": "Micropay",
    "MchId": "myMchId",
    "ResponseTime": "20180715101723"
  },
  "Data": {
    "SysOrderNo": "J006536011807150001",
    "StoreOrderNo": "PO-20180715-002",
    "TotalFee": "1",
    "AuthCode": ""
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://intella2.gitbook.io/scan2pay/api-specification/merchant-scan.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.
