跳至內容
StagePayDocs v2

端點參考

StagePay REST API v1 端點清單 — 建立付款、交易、商品、App、結算查詢的路徑、範圍、參數與回應欄位。

所有路徑的基本網址皆為 https://api.stagepay.io,且需要 API 金鑰驗證。機器可讀的規格可從 GET /api/v1/openapi.json(OpenAPI 3.1)取得。

方法路徑範圍說明
POST/api/v1/paymentswrite:transactions建立付款
GET/api/v1/transactionsread:transactions交易清單
GET/api/v1/transactions/{id}read:transactions交易詳情
GET/api/v1/productsread:products商品清單(僅限啟用中)
GET/api/v1/products/{id}read:products商品詳情
GET/api/v1/appsread:appsApp 清單
GET/api/v1/apps/{id}read:appsApp 詳情
GET/api/v1/settlementssettlement:read結算批次清單
GET/api/v1/settlements/{batchNo}settlement:read結算批次詳情
GET/api/v1/settlements/{batchNo}/linessettlement:read結算明細行(JSON 或 CSV)

read:all 範圍允許所有交易・商品・App 查詢(不含結算)。

交易

GET /api/v1/transactions

查詢參數說明
page, limit分頁(預設 1、20)
appIdApp 篩選
statuspending, success, failed, cancelled, expired, partial_refunded, refunded
startDate, endDate建立時間範圍(ISO 8601)

交易物件主要欄位

欄位說明
tidStagePay 交易編號
appId, userId, serverId, playerId請求時傳入的值
productId, productName商品
status交易狀態
amount / amountMinor / currency顯示金額 / 結算基準金額(minor)/ 幣別
refundedAmountMinor, refunds[]累計退款金額、退款明細 {refundId, amountMinor, reason, at}
pgCode, method, pgTidPG、付款方式、PG 交易編號(退款 API 的 tno 等)
paidAt, createdAt付款確定時間、建立時間
callback{status, attempts, lastAttemptAt, lastStatusCode, nextAttemptAt} 回呼狀態
cryptoUSDT 付款資訊(USDT)
userdata, etc, uniqueId商戶自由資料

商品

GET /api/v1/products

查詢參數說明
page, limit分頁(預設 1、20)
appIdApp 篩選

回應中只包含 status=active 的商品。收銀台的 productId 請使用商品 ID(控制台上顯示的值)。

App

GET /api/v1/apps

金鑰可存取的 App 清單。回應中不包含 App 機密資訊(webhookSecret、apiKey)。

結算

路徑、參數、回應欄位與 CSV 格式整理於結算查詢 API。

curl "https://api.stagepay.io/api/v1/settlements?status=APPROVED&from=2026-01-01T00:00:00%2B09:00" \
  -H "Authorization: Bearer $STAGEPAY_KEY_ID:$STAGEPAY_KEY_SECRET"

規格與文件不一致時

OpenAPI 規格(/api/v1/openapi.json)是由 API 伺服器產生的基準文件。若與本頁內容不同,請以規格為準,並告知我們文件錯誤。

本頁目錄