> For the complete documentation index, see [llms.txt](https://intella.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://intella.gitbook.io/scan2pay/api-general-rules/api-response-format.md). Agents can also search and read this documentation through its [MCP server](https://intella.gitbook.io/scan2pay/~gitbook/mcp).

# API Response資料格式

Scan2Pay API Response資料格式說明

## 基本格式

資料以JSON格式填寫, 基本JSON內容為

```
{
    "Header":
    {
        "StatusCode":"0000",
        "StatusDesc":"交易成功",
        "Method":"10100",
        "ServiceType":"OLPay",
        "MchId":"Account0001",
        "ResponseTime":"20180101120100"
    },
    "Data":
    {
        "xxx":"xxx"
    }
}
```

### Header

"Header"內為固定的必要欄位, 說明如下

| 欄位名稱         | 型別        | 範例             | 說明                                                                                         |
| ------------ | --------- | -------------- | ------------------------------------------------------------------------------------------ |
| StatusCode   | String(4) | 0000           | [交易結果代碼](https://intella.gitbook.io/scan2pay/appendix/scan2pay-error-codes.md)             |
| StatusDesc   | String    | 交易成功           | 交易結果代碼說明                                                                                   |
| Method       | String(5) | 10100          | [支付方式代碼](https://intella.gitbook.io/scan2pay/appendix/payment-type.md)                     |
| ServiceType  | String    | OLPay          | 所選用的Scan2Pay[服務代碼](https://intella.gitbook.io/scan2pay/api-specification.md#api-gong-neng) |
| MchId        | String    | Account0001    | 特店帳號                                                                                       |
| ResponseTime | String    | 20180101120200 | 交易回應時間, 格式為yyyyMMddHHmmss                                                                  |

### Data

"Data"欄位內容為根據各API所定義而不同, 內容為JSON格式的資料.
