# API通用規則說明

## 單一API接入口

Scan2Pay API採用單一API接入口, Request和Response的內容是依據所POST的內容(Body)來決定.

## 傳輸資料加密

Request的Body為JSON格式的資料, 其欄位內容為AES加密過後的內容, 以及以RSA加密過後的AES Key, Server收到此Request後, 會依據所提供的AES Key將Request內容解密成原始資料. 加解密說明請參看

{% content-ref url="/pages/-LEhSZExgXFr8QdvICQI" %}
[API資料傳輸加解密](/scan2pay/api-general-rules/api-jia-jie-mi-ming.md)
{% endcontent-ref %}

## 原始傳輸JSON資料格式

API所接收和回應的原始JSON資料, 請參看

{% content-ref url="/pages/-LEhUWgxAKW9SH9UOVD8" %}
[API Request資料格式](/scan2pay/api-general-rules/api-request-format.md)
{% endcontent-ref %}

{% content-ref url="/pages/-LEhgKsRVh7GoX35fYP3" %}
[API Response資料格式](/scan2pay/api-general-rules/api-response-format.md)
{% endcontent-ref %}


---

# Agent Instructions: 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://intella.gitbook.io/scan2pay/api-general-rules.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.
