> 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).

# 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           | [交易結果代碼](/scan2pay/appendix/scan2pay-error-codes.md)             |
| StatusDesc   | String    | 交易成功           | 交易結果代碼說明                                                         |
| Method       | String(5) | 10100          | [支付方式代碼](/scan2pay/appendix/payment-type.md)                     |
| ServiceType  | String    | OLPay          | 所選用的Scan2Pay[服務代碼](/scan2pay/api-specification.md#api-gong-neng) |
| MchId        | String    | Account0001    | 特店帳號                                                             |
| ResponseTime | String    | 20180101120200 | 交易回應時間, 格式為yyyyMMddHHmmss                                        |

### Data

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


---

# 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, and the optional `goal` query parameter:

```
GET https://intella.gitbook.io/scan2pay/api-general-rules/api-response-format.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
