# API規格說明

## API功能

Scan2Pay API 包括

| 功能                                                              | ServiceType      | 備註                       |
| --------------------------------------------------------------- | ---------------- | ------------------------ |
| [消費者主掃](/scan2pay/api-specification/customer-scan.md)           | OLPay            | 用來取得URL產生QR Code供消費者掃描交易 |
| [消費者被掃](/scan2pay/api-specification/merchant-scan.md)           | Micropay         | 掃描消費者QR Code進行交易         |
| [信用卡授權](/scan2pay/api-specification/credit-card.md)             | Payment          | 使用信用卡授權交易                |
| [退款](/scan2pay/api-specification/refund.md)                     | Refund           | 退款                       |
| [單筆交易查詢](/scan2pay/api-specification/single-order-query.md)     | SingleOrderQuery | 依據訂單編號查詢單筆交易             |
| [多筆交易查詢](/scan2pay/api-specification/multi-order-query.md)      | OrderQuery       | 依據日期區間查詢交易               |
| [新版多筆交易查詢](/scan2pay/api-specification/multi-order-query1.1.md) | OrderQuery1.1    | 依據日期區間查詢交易               |

## 消費者主掃

消費者主掃, 是指收款端透過呼叫消費者主掃API, 取得一個URL, 並將期顯示為一個QR Code, 讓消費者使用手機掃描.

消費者掃描QR Code後, 開啟支付頁面, 選擇所要使用的支付方式後, 在對應的App中完成支付.

收款端透過輪詢單筆交易查詢API, 或是[提供接收交易結果通知的API](/scan2pay/api-callback.md), 來獲取消費者支付結果, 完成交易.

{% hint style="warning" %}
並非每種支付方式都支援消費者主掃的交易方式
{% endhint %}

{% content-ref url="/pages/-LEhOIcOX4bCh313-z1k" %}
[消費者主掃](/scan2pay/api-specification/customer-scan.md)
{% endcontent-ref %}

## 消費者被掃

消費者被掃,  是指收款端使用掃描槍或是相機, 掃描消費手出示的付款QR Code,   然後呼叫消費者被掃API, 完成交易.

{% hint style="warning" %}
並非每種支付方式都支援消費者被掃的交易方式
{% endhint %}

{% content-ref url="/pages/-LEhnQt3JEWLzJs6PRFO" %}
[消費者被掃](/scan2pay/api-specification/merchant-scan.md)
{% endcontent-ref %}

## 信用卡授權

收款端取得消費者的信用卡資料, 然後呼叫信用卡授權API, 進行信用卡授權交易.

{% hint style="info" %}
測試信用卡交易, 請洽intella取得測試信用卡卡號
{% endhint %}

{% content-ref url="/pages/-LEhnXebXjUwp8LVx64P" %}
[信用卡授權](/scan2pay/api-specification/credit-card.md)
{% endcontent-ref %}

## 悠遊卡操作

透過悠遊卡操作API, 收款端可以直接對讀卡機進行扣款, 退款等操作, 進行交易.

{% hint style="info" %}
悠遊卡操作API需搭配intella所提供的讀卡機, 該讀卡機使用WiFi連線到網際網路, 以及intella server
{% endhint %}

{% content-ref url="/pages/-LEhnau-6PP\_59-V56kH" %}
[悠遊卡操作](/scan2pay/api-specification/easycard-api.md)
{% endcontent-ref %}

## 退款

對於已經成功的交易, 可以透過退款API, 將指定的交易訂單進行退款.

{% hint style="info" %}
退款的實際時間, 需視各支付機構的規定.
{% endhint %}

{% content-ref url="/pages/-LEhnkNFUsEZsr2RrpLy" %}
[退款](/scan2pay/api-specification/refund.md)
{% endcontent-ref %}

## 單筆交易查詢

單筆交易查詢API提供查詢單筆交易的交易結果, 以及訂單狀態

{% content-ref url="/pages/-LEhnmN\_DJ\_VaCOVg3JE" %}
[單筆交易查詢](/scan2pay/api-specification/single-order-query.md)
{% endcontent-ref %}

## 多筆交易查詢

查詢指定的時間內的交易,  可以透過呼叫多筆交易查詢API取得.

{% hint style="info" %}
查詢的交易時間以日為單位
{% endhint %}

{% content-ref url="/pages/-LEhns3z3OavznxQVghg" %}
[多筆交易查詢](/scan2pay/api-specification/multi-order-query.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-specification.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.
