PayCore PayCore開發者中心

API 目錄

依金流分類查看可串接的 API。

本頁列出 PayCore 對外串接可使用的 API。每個金流可展開查看 Endpoint、可填參數、gateway_credentials、回應格式、錯誤與測試範例。

API CATALOG

PayCore 公開 API 方法目錄

本頁只公開目前可提供給串接方使用的 API;內部工程名稱、檔案路徑與資料庫細節不會顯示在公開文件。

公開文件只顯示串接所需資訊,不顯示內部工程名稱、檔案路徑或資料庫欄位。 最後更新:2026-06-23
公開串接文件

快速開始

PayCore 串接先取得 PayCore API Key,決定 Direct Gateway 或 All-in-One 收款專案,再呼叫建立付款 API。可用上方搜尋框依金流、付款方式、欄位或 endpoint 搜尋。

1. API 認證X-API-KEY
2. gateway_credentials每家金流各自填憑證
3. 建立付款POST /api/paycore/pay/{gateway}/{method}
X-API-KEY

API 認證

PayCore API 使用 X-API-KEY Header 驗證呼叫方;各金流商店憑證放在 request body 的 gateway_credentials。

Direct / All-in-One

串接模式

Direct Gateway 適合商戶直接帶金流憑證建立付款;All-in-One 收款專案則由 PayCore 專案 API Key 統一管理付款頁與付款方式。

Webhook

Webhook 概念

金流回調會先更新 PayCore 付款狀態;若商戶有提供 payok_url,PayCore 會在付款成功後通知商戶系統。付款頁也會背景查詢狀態,降低使用者手動刷新需求。

COMMON

共用 API

所有金流共用的查詢、同步、首頁概況。

商戶可呼叫 API

正式可用
查詢付款

依 payment_no 查詢付款狀態與付款資訊。

GET /api/paycore/payments/{paymentNo}
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
X-API-KEY header 必填 string PayCore API Key。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
paymentNo path 必填 string PayCore payment_no。 PAY202606220001ABCDEFGH
Request / Response 範例
cURL
curl -X GET "https://api-core.cc/api/paycore/payments/{paymentNo}" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY"
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->get('https://api-core.cc/api/paycore/payments/{paymentNo}');

return $response->json();
成功回應重點
  • payment transaction data
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。smilepay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款狀態。pending|paid|failed|expired
data.payment_urlstring|nullPayCore 付款頁網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobject金流取號資訊或前端付款資訊。{...}
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "smilepay",
        "method": "atm",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "bank_code": "809",
            "bank_name": "凱基銀行",
            "virtual_account": "8011773423689453",
            "expire_at": "2026-06-28 23:59:59"
        }
    },
    "message": "Payment found"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • PAYMENT_NOT_FOUND
正式可用
同步付款狀態

針對支援同步的金流查詢第三方狀態並更新 PayCore。

POST /api/paycore/payments/{paymentNo}/sync
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
paymentNo path 必填 string PayCore payment_no。 PAY202606220001ABCDEFGH
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/payments/{paymentNo}/sync" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{}'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/payments/{paymentNo}/sync', []);

return $response->json();
成功回應重點
  • PaymentSyncResult + transaction data
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。smilepay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款狀態。pending|paid|failed|expired
data.payment_urlstring|nullPayCore 付款頁網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobject金流取號資訊或前端付款資訊。{...}
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "smilepay",
        "method": "atm",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "bank_code": "809",
            "bank_name": "凱基銀行",
            "virtual_account": "8011773423689453",
            "expire_at": "2026-06-28 23:59:59"
        }
    },
    "message": "Payment synced"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • gateway_sync_not_supported
  • PAYMENT_NOT_FOUND
正式可用
首頁收款概況

PayCore 首頁展示用安全統計,可用瀏覽器時區計算今日。

GET /api/paycore/home/overview
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
X-PayCore-Timezone header 選填 IANA timezone 瀏覽器時區,例如 Asia/Taipei。 Asia/Taipei
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
timezone query 選填 IANA timezone 時區 query 參數。 Asia/Taipei
Request / Response 範例
cURL
curl -X GET "https://api-core.cc/api/paycore/home/overview" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY"
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->get('https://api-core.cc/api/paycore/home/overview');

return $response->json();
成功回應重點
  • today_amount
  • month_amount
  • recent_transactions
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "home",
        "method": "overview",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項

此 API 沒有額外列出的專屬錯誤碼;仍可能回傳通用驗證錯誤。

ECPAY

綠界 ECPay

支援綠界 AIO 導轉付款與 ATM / CVS / BARCODE 背景取號。

商戶可呼叫 API

正式可用
建立綠界 AIO 付款

建立綠界 AIO 導轉付款,預設 ChoosePayment=ALL,付款人會在綠界頁面選擇可用付款方式。

POST /api/paycore/pay/ecpay/aio
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
merchant_id gateway_credentials 必填 string 綠界特店編號。亦相容 MerchantID。 2000132
hash_key gateway_credentials 必填 string 綠界 HashKey。亦相容 HashKey。 5294y06JbISpM5x9
hash_iv gateway_credentials 必填 string 綠界 HashIV。亦相容 HashIV。 v77hoKGq4kWxNNIS
environment gateway_credentials 選填 stage|production 環境。支援 stage/staging/test/testing 或 production/prod。 stage
platform_id gateway_credentials 選填 string 綠界 PlatformID,只有特定平台商情境需要。
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/aio" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/ecpay/aio', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • merchant_order_no
  • gateway=ecpay
  • method=all
  • status=pending
  • payment_url
  • redirect_form
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "aio",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • ECPAY_CREDENTIAL_INVALID
  • ORDER_CONFLICT
  • INVALID_ARGUMENT
  • Payment gateway error

AIO 取號成功仍為 pending,不等於付款成功。

正式可用
建立綠界 AIO 信用卡付款

建立綠界 AIO 信用卡導轉付款,ChoosePayment=Credit。

POST /api/paycore/pay/ecpay/aio/credit
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
merchant_id gateway_credentials 必填 string 綠界特店編號。亦相容 MerchantID。 2000132
hash_key gateway_credentials 必填 string 綠界 HashKey。亦相容 HashKey。 5294y06JbISpM5x9
hash_iv gateway_credentials 必填 string 綠界 HashIV。亦相容 HashIV。 v77hoKGq4kWxNNIS
environment gateway_credentials 選填 stage|production 環境。支援 stage/staging/test/testing 或 production/prod。 stage
platform_id gateway_credentials 選填 string 綠界 PlatformID,只有特定平台商情境需要。
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/aio/credit" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/ecpay/aio/credit', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • merchant_order_no
  • gateway=ecpay
  • method=credit
  • status=pending
  • payment_url
  • redirect_form
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "aio",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • ECPAY_CREDENTIAL_INVALID
  • ORDER_CONFLICT
  • INVALID_ARGUMENT
  • Payment gateway error

綠界 AIO 付款目前只接受 TWD。

正式可用
建立綠界 AIO ATM 導轉付款

建立綠界 AIO ATM 導轉付款,綠界取號後 PayCore 會保存銀行代碼、虛擬帳號與繳費期限。

POST /api/paycore/pay/ecpay/aio/atm
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
merchant_id gateway_credentials 必填 string 綠界特店編號。亦相容 MerchantID。 2000132
hash_key gateway_credentials 必填 string 綠界 HashKey。亦相容 HashKey。 5294y06JbISpM5x9
hash_iv gateway_credentials 必填 string 綠界 HashIV。亦相容 HashIV。 v77hoKGq4kWxNNIS
environment gateway_credentials 選填 stage|production 環境。支援 stage/staging/test/testing 或 production/prod。 stage
platform_id gateway_credentials 選填 string 綠界 PlatformID,只有特定平台商情境需要。
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/aio/atm" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/ecpay/aio/atm', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • merchant_order_no
  • gateway=ecpay
  • method=atm
  • status=pending
  • payment_url
  • redirect_form
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "aio",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • ECPAY_CREDENTIAL_INVALID
  • ORDER_CONFLICT
  • ECPAY amount mismatch

AIO ATM 需要先導到綠界頁面,回站後由 token 付款頁顯示取號資訊。

正式可用
建立綠界 AIO 超商代碼付款

建立綠界 AIO 超商代碼導轉付款,綠界取號後 PayCore 付款頁顯示超商代碼與繳費期限。

POST /api/paycore/pay/ecpay/aio/cvs
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
merchant_id gateway_credentials 必填 string 綠界特店編號。亦相容 MerchantID。 2000132
hash_key gateway_credentials 必填 string 綠界 HashKey。亦相容 HashKey。 5294y06JbISpM5x9
hash_iv gateway_credentials 必填 string 綠界 HashIV。亦相容 HashIV。 v77hoKGq4kWxNNIS
environment gateway_credentials 選填 stage|production 環境。支援 stage/staging/test/testing 或 production/prod。 stage
platform_id gateway_credentials 選填 string 綠界 PlatformID,只有特定平台商情境需要。
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/aio/cvs" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/ecpay/aio/cvs', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • merchant_order_no
  • gateway=ecpay
  • method=cvs
  • status=pending
  • payment_url
  • redirect_form
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "aio",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • ECPAY_CREDENTIAL_INVALID
  • ECPAY amount mismatch

付款頁會提供綠界超商代碼繳費教學連結。

正式可用
建立綠界 AIO 超商條碼付款

建立綠界 AIO 超商條碼導轉付款,綠界取號後 PayCore 付款頁顯示三段條碼與繳費期限。

POST /api/paycore/pay/ecpay/aio/barcode
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
merchant_id gateway_credentials 必填 string 綠界特店編號。亦相容 MerchantID。 2000132
hash_key gateway_credentials 必填 string 綠界 HashKey。亦相容 HashKey。 5294y06JbISpM5x9
hash_iv gateway_credentials 必填 string 綠界 HashIV。亦相容 HashIV。 v77hoKGq4kWxNNIS
environment gateway_credentials 選填 stage|production 環境。支援 stage/staging/test/testing 或 production/prod。 stage
platform_id gateway_credentials 選填 string 綠界 PlatformID,只有特定平台商情境需要。
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/aio/barcode" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/ecpay/aio/barcode', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • merchant_order_no
  • gateway=ecpay
  • method=barcode
  • status=pending
  • payment_url
  • redirect_form
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。barcode
data.payment_urlstring|nullPayCore 條碼繳費頁網址。付款人到超商時開啟此網址掃描三段條碼。https://pay-core.app/zh-tw/pay/PAY...
data.payment_info.*.barcode_user_copy_urlstring建議複製給付款人的繳費頁網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_info.*.barcode_segments_copyableboolean固定為 false;Barcode1/2/3 僅供畫面轉條碼掃描,不作為主要複製項目。false
data.payment_info.*.barcode_intro_urlstring|null對應金流的官方條碼繳費介紹連結。綠界顯示綠界,速買配顯示速買配。https://...
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "barcode",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "ecpay": {
                "selected_payment_method": "barcode",
                "barcode1": "150630A1F",
                "barcode2": "6763618191673429",
                "barcode3": "00000980000000000000",
                "barcode_user_copy_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
                "barcode_segments_copyable": false,
                "barcode_user_action": "copy_payment_page_url_and_scan_rendered_barcodes",
                "barcode_intro_url": "https://www.ecpay.com.tw/introcvs",
                "expire_at": "2026-06-28 23:59:59"
            }
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • ECPAY_CREDENTIAL_INVALID
  • ECPAY amount mismatch

台灣條碼繳費只建議複製繳費頁網址,讓付款人到超商掃描頁面上的三段條碼;付款頁只顯示綠界條碼繳費介紹連結。

正式可用
建立綠界 ATM 背景取號

PayCore 後端直接呼叫綠界 GenPaymentCode 取得 ATM 虛擬帳號,不導轉到綠界付款頁。

POST /api/paycore/pay/ecpay/atm
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
merchant_id gateway_credentials 必填 string 綠界特店編號。亦相容 MerchantID。 2000132
hash_key gateway_credentials 必填 string 綠界 HashKey。亦相容 HashKey。 5294y06JbISpM5x9
hash_iv gateway_credentials 必填 string 綠界 HashIV。亦相容 HashIV。 v77hoKGq4kWxNNIS
environment gateway_credentials 選填 stage|production 環境。支援 stage/staging/test/testing 或 production/prod。 stage
platform_id gateway_credentials 選填 string 綠界 PlatformID,只有特定平台商情境需要。
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/atm" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/ecpay/atm', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • bank_code
  • virtual_account
  • expire_at
  • payment_url
  • status=pending
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "bg",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • ECPAY_CREDENTIAL_INVALID
  • ORDER_CONFLICT
  • ECPAY_BACKGROUND_CODE_FAILED

背景取號成功只代表取得繳費資訊,不代表已付款。

正式可用
建立綠界超商代碼背景取號

PayCore 後端直接呼叫綠界 GenPaymentCode 取得超商代碼,不導轉到綠界付款頁。

POST /api/paycore/pay/ecpay/cvs
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
merchant_id gateway_credentials 必填 string 綠界特店編號。亦相容 MerchantID。 2000132
hash_key gateway_credentials 必填 string 綠界 HashKey。亦相容 HashKey。 5294y06JbISpM5x9
hash_iv gateway_credentials 必填 string 綠界 HashIV。亦相容 HashIV。 v77hoKGq4kWxNNIS
environment gateway_credentials 選填 stage|production 環境。支援 stage/staging/test/testing 或 production/prod。 stage
platform_id gateway_credentials 選填 string 綠界 PlatformID,只有特定平台商情境需要。
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/cvs" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/ecpay/cvs', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • payment_code
  • payment_code_url
  • expire_at
  • payment_url
  • status=pending
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "bg",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • ECPAY_CREDENTIAL_INVALID
  • ORDER_CONFLICT
  • ECPAY_BACKGROUND_CODE_FAILED

付款頁會提供綠界超商代碼繳費教學連結。

正式可用
建立綠界超商條碼背景取號

PayCore 後端直接呼叫綠界 GenPaymentCode 取得三段超商條碼,不導轉到綠界付款頁。

POST /api/paycore/pay/ecpay/barcode
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
merchant_id gateway_credentials 必填 string 綠界特店編號。亦相容 MerchantID。 2000132
hash_key gateway_credentials 必填 string 綠界 HashKey。亦相容 HashKey。 5294y06JbISpM5x9
hash_iv gateway_credentials 必填 string 綠界 HashIV。亦相容 HashIV。 v77hoKGq4kWxNNIS
environment gateway_credentials 選填 stage|production 環境。支援 stage/staging/test/testing 或 production/prod。 stage
platform_id gateway_credentials 選填 string 綠界 PlatformID,只有特定平台商情境需要。
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/barcode" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/ecpay/barcode', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • barcode1
  • barcode2
  • barcode3
  • expire_at
  • payment_url
  • status=pending
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。barcode
data.payment_urlstring|nullPayCore 條碼繳費頁網址。付款人到超商時開啟此網址掃描三段條碼。https://pay-core.app/zh-tw/pay/PAY...
data.payment_info.*.barcode_user_copy_urlstring建議複製給付款人的繳費頁網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_info.*.barcode_segments_copyableboolean固定為 false;Barcode1/2/3 僅供畫面轉條碼掃描,不作為主要複製項目。false
data.payment_info.*.barcode_intro_urlstring|null對應金流的官方條碼繳費介紹連結。綠界顯示綠界,速買配顯示速買配。https://...
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "barcode",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "ecpay": {
                "selected_payment_method": "barcode",
                "barcode1": "150630A1F",
                "barcode2": "6763618191673429",
                "barcode3": "00000980000000000000",
                "barcode_user_copy_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
                "barcode_segments_copyable": false,
                "barcode_user_action": "copy_payment_page_url_and_scan_rendered_barcodes",
                "barcode_intro_url": "https://www.ecpay.com.tw/introcvs",
                "expire_at": "2026-06-28 23:59:59"
            }
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • ECPAY_CREDENTIAL_INVALID
  • ORDER_CONFLICT
  • ECPAY_BACKGROUND_CODE_FAILED

台灣條碼繳費只建議複製繳費頁網址,不提供 Barcode1/2/3 字串複製;付款頁只顯示綠界條碼繳費介紹連結。

Webhook / Return 說明

正式可用
綠界 ReturnURL / PaymentInfoURL / 背景取號通知接收

給綠界回打 PayCore 使用,商戶不應主動呼叫。支援 AIO PaymentInfoURL 與背景取號付款結果通知;背景取號 JSON callback 會自動解析加密 Data。

POST /api/paycore/webhooks/ecpay
參數表
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
MerchantID body 選填 string 綠界特店編號。AIO 或背景取號 JSON callback 都可能出現。 2000132
RqHeader body 選填 object 綠界背景取號 JSON callback 的傳輸標頭。 {"Timestamp":1782144000}
Data body 選填 string 綠界背景取號 JSON callback 的 AES 加密資料;PayCore 會容錯處理 base64 + 被轉成空白的情況。 encrypted-data
TransCode body 選填 integer 綠界背景取號 JSON callback 的傳輸結果。 1
MerchantTradeNo body 選填 string 綠界交易編號,對應 gateway_order_no。 PC202606220001
CustomField1 body 選填 string PayCore payment_no。 PAY202606220001ABCDEFGH
TradeAmt body 選填 integer 綠界回傳金額,PayCore 會比對交易金額。 980
RtnCode body 選填 string 綠界狀態碼。取號成功不等於付款成功。 2
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/webhooks/ecpay" \
  -H "Content-Type: application/json" \
  -d '{
    "event_type": "example.event",
    "resource": {
      "payment_no": "PAY202606220001ABCDEFGH"
    }
  }'
成功回應重點
  • 1|OK
Response 欄位表
欄位型別說明範例
HTTP statusintegerHTTP 狀態碼。SmilePay 成功時為 200。200
Content-Typestring回覆內容格式。SmilePay 為 text/plain。application/json
bodystring|object金流要求的 ACK 或 PayCore 結果頁。{"success":true}
成功 Response 範例
JSON
{
    "success": true,
    "message": "Webhook received"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • ECPay MerchantID mismatch.
  • ECPay amount mismatch.
  • ECPay CheckMacValue verification failed.
  • ECPay encrypted background callback transaction not found.
SMILEPAY

速買配 SmilePay

支援 ATM 虛擬帳號、CVS 超商代碼與獨立超商條碼付款。

商戶可呼叫 API

正式可用
建立速買配 ATM 虛擬帳號

建立速買配 ATM 付款。PayCore 會自動使用 ATM 對應付款參數。

POST /api/paycore/pay/smilepay/atm
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
dcvc gateway_credentials 必填 string 速買配商家代號。亦相容 Dcvc。 2109
rvg2c gateway_credentials 必填 string 速買配 Rvg2c。通常為 1。亦相容 Rvg2c。 1
verify_key gateway_credentials 必填 string 速買配檢查碼 Verify_key。 YOUR_VERIFY_KEY
validation_token gateway_credentials 選填 string PayCore 額外自訂的回調驗證 token,可用於模擬與防誤打。 optional-token
default_cvs_type gateway_credentials 選填 ibon|fami|famiport|barcode 未傳 cvs_type 時的預設超商類型。 ibon
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/smilepay/atm" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "dcvc": "YOUR_SMILEPAY_DCVC",
      "rvg2c": "1",
      "verify_key": "YOUR_VERIFY_KEY"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/smilepay/atm', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • SmilePayNO
  • AtmBankNo
  • AtmNo
  • PayEndDate
  • status
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "smilepay",
        "method": "atm",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • SMILEPAY_CREDENTIAL_INVALID
  • SmilePay amount mismatch.
  • SmilePay Dcvc mismatch.

Amount 必須與建立付款 amount 一致。

正式可用
建立速買配超商代碼付款

建立速買配超商代碼付款。使用 cvs_type 選擇 ibon、fami、famiport 或 family;台灣代碼繳費會提供代碼複製。

POST /api/paycore/pay/smilepay/cvs
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
cvs_type body 選填 ibon|fami|famiport|family 超商代碼類型。family 會正規化為 fami。條碼請改用 /api/paycore/pay/smilepay/barcode。 ibon
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
dcvc gateway_credentials 必填 string 速買配商家代號。亦相容 Dcvc。 2109
rvg2c gateway_credentials 必填 string 速買配 Rvg2c。通常為 1。亦相容 Rvg2c。 1
verify_key gateway_credentials 必填 string 速買配檢查碼 Verify_key。 YOUR_VERIFY_KEY
validation_token gateway_credentials 選填 string PayCore 額外自訂的回調驗證 token,可用於模擬與防誤打。 optional-token
default_cvs_type gateway_credentials 選填 ibon|fami|famiport|barcode 未傳 cvs_type 時的預設超商類型。 ibon
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/smilepay/cvs" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "cvs_type": "ibon",
    "gateway_credentials": {
      "dcvc": "YOUR_SMILEPAY_DCVC",
      "rvg2c": "1",
      "verify_key": "YOUR_VERIFY_KEY"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/smilepay/cvs', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • SmilePayNO
  • payment_code
  • PayEndDate
  • status
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "smilepay",
        "method": "cvs",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • SMILEPAY_CREDENTIAL_INVALID
  • SmilePay amount mismatch.
  • SmilePay validation token mismatch.

速買配超商代碼繳費教學只顯示速買配相關入口。

正式可用
建立速買配超商條碼付款

建立速買配超商條碼付款,PayCore 會用 SmilePay 條碼參數取號並在付款頁顯示三段可掃描條碼。台灣條碼繳費只建議複製繳費頁網址,不提供 Barcode1/2/3 字串複製。

POST /api/paycore/pay/smilepay/barcode
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
dcvc gateway_credentials 必填 string 速買配商家代號。亦相容 Dcvc。 2109
rvg2c gateway_credentials 必填 string 速買配 Rvg2c。通常為 1。亦相容 Rvg2c。 1
verify_key gateway_credentials 必填 string 速買配檢查碼 Verify_key。 YOUR_VERIFY_KEY
validation_token gateway_credentials 選填 string PayCore 額外自訂的回調驗證 token,可用於模擬與防誤打。 optional-token
default_cvs_type gateway_credentials 選填 ibon|fami|famiport|barcode 未傳 cvs_type 時的預設超商類型。 ibon
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/smilepay/barcode" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "dcvc": "YOUR_SMILEPAY_DCVC",
      "rvg2c": "1",
      "verify_key": "YOUR_VERIFY_KEY"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/smilepay/barcode', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • SmilePayNO
  • barcode1
  • barcode2
  • barcode3
  • barcode_user_copy_url
  • barcode_intro_url
  • PayEndDate
  • status
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.gatewaystring金流代號。smilepay
data.methodstring付款方式。barcode
data.payment_urlstring|nullPayCore 條碼繳費頁網址。付款人到超商時開啟此網址掃描三段條碼。https://pay-core.app/zh-tw/pay/PAY...
data.payment_info.*.barcode_user_copy_urlstring建議複製給付款人的繳費頁網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_info.*.barcode_segments_copyableboolean固定為 false;Barcode1/2/3 僅供畫面轉條碼掃描,不作為主要複製項目。false
data.payment_info.*.barcode_intro_urlstring|null對應金流的官方條碼繳費介紹連結。綠界顯示綠界,速買配顯示速買配。https://...
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "smilepay",
        "method": "barcode",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "smilepay": {
                "selected_payment_method": "barcode",
                "barcode1": "150630A1F",
                "barcode2": "6763618191673429",
                "barcode3": "00000980000000000000",
                "barcode_user_copy_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
                "barcode_segments_copyable": false,
                "barcode_user_action": "copy_payment_page_url_and_scan_rendered_barcodes",
                "barcode_intro_url": "https://www.smilepay.net/es/index_gz_index.asp",
                "expire_at": "2026-06-28 23:59:59"
            }
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • SMILEPAY_CREDENTIAL_INVALID
  • SMILEPAY_BARCODE_SERVICE_NOT_ENABLED
  • SmilePay amount mismatch.
  • SmilePay validation token mismatch.

付款頁只顯示速買配條碼繳費介紹連結,不混用綠界說明。

若速買配回覆 Can not use this Pay_zg service(Store),PayCore 會回 422 與 SMILEPAY_BARCODE_SERVICE_NOT_ENABLED,不建立付款單、不回 502。

Webhook / Return 說明

正式可用
速買配 Roturl 背景通知

給速買配付款完成通知使用。Data_id 對應 merchant_order_no,SmilePayNO 對應 gateway_trade_no。

POST /api/paycore/webhooks/smilepay
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 選填 form/json 速買配可能以表單或 PayCore 模擬 JSON 傳入。 application/x-www-form-urlencoded
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
Dcvc body 必填 string 商家代號,PayCore 會與交易憑證比對。 2109
Data_id body 必填 string 商戶訂單號,對應 merchant_order_no。 ORDER202606220202111
SmilePayNO body 選填 string 速買配交易號,PayCore 優先用它匹配 gateway_trade_no。 062223689453
Amount body 必填 integer|string 付款金額。必須與原建立付款的 amount 一致。 980
Status body 必填 string|integer 狀態。Status=1 代表成功。 1
AtmBankNo body 選填 string ATM 銀行代碼。 809
AtmNo body 選填 string ATM 虛擬帳號。 8011773423689453
PayEndDate body 選填 datetime|string 繳費期限。 2026/06/28 23:59:59
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/webhooks/smilepay" \
  -H "Content-Type: application/json" \
  -d '{
    "event_type": "example.event",
    "resource": {
      "payment_no": "PAY202606220001ABCDEFGH"
    }
  }'
成功回應重點
  • plain text acknowledgement
Response 欄位表
欄位型別說明範例
HTTP statusintegerHTTP 狀態碼。SmilePay 成功時為 200。200
Content-Typestring回覆內容格式。SmilePay 為 text/plain。text/plain
bodystring|object金流要求的 ACK 或 PayCore 結果頁。OK
成功 Response 範例
text/plain
HTTP/1.1 200 OK
Content-Type: text/plain; charset=UTF-8

OK
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • SmilePay Dcvc mismatch.
  • SmilePay amount mismatch.
  • SmilePay validation token mismatch.
若回 SmilePay amount mismatch,請查 paycore.log 的 SmilePay amount mismatch detail:expected_amount、received_amount、matched_by、payload_data_id、payload_smilepay_no。
PAYPAL

PayPal

支援 PayPal Checkout 建立訂單、Return Capture 與 Webhook。

商戶可呼叫 API

正式可用
建立 PayPal Checkout

建立 PayPal Order 並取得 approval_url。付款者完成授權後會回到 PayCore capture。

POST /api/paycore/pay/paypal/checkout
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
client_id gateway_credentials 必填 string PayPal REST API client_id。 PAYPAL_CLIENT_ID
client_secret gateway_credentials 必填 string PayPal REST API client_secret。 PAYPAL_CLIENT_SECRET
environment gateway_credentials 選填 sandbox|live|production PayPal 環境。production 會正規化為 live。 sandbox
webhook_id gateway_credentials 選填 string PayPal webhook 驗證用 webhook_id。正式環境建議設定。 WH-xxxxxxxx
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/paypal/checkout" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "client_id": "PAYPAL_CLIENT_ID",
      "client_secret": "PAYPAL_CLIENT_SECRET",
      "webhook_id": "PAYPAL_WEBHOOK_ID",
      "environment": "sandbox"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/paypal/checkout', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • payment_url / approval_url
  • status
  • created
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "paypal",
        "method": "checkout",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • PAYPAL_CLIENT_ID_REQUIRED
  • PAYPAL_CLIENT_SECRET_REQUIRED
  • PAYPAL_ENVIRONMENT_INVALID
  • PAYPAL_REQUEST_REJECTED

PayPal 正式上線通常需要 PayPal Business account。

Webhook / Return 說明

正式可用
PayPal Return Capture

付款者從 PayPal 返回 PayCore 後,PayCore 執行 capture 並顯示結果頁。

GET /{locale}/payment/paypal/return/{paymentNo}
參數表
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
paymentNo path 必填 string PayCore payment_no。 PAY202606220001ABCDEFGH
token query 選填 string PayPal return token / order id。 PAYPAL_ORDER_ID
Request / Response 範例
cURL
curl -X GET "https://api-core.cc/{locale}/payment/paypal/return/{paymentNo}" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY"
成功回應重點
  • PayCore result page
Response 欄位表
欄位型別說明範例
HTTP statusintegerHTTP 狀態碼。SmilePay 成功時為 200。200
Content-Typestring回覆內容格式。SmilePay 為 text/plain。application/json
bodystring|object金流要求的 ACK 或 PayCore 結果頁。{"success":true}
成功 Response 範例
JSON
{
    "type": "html",
    "description": "PayCore result page"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • PayPal capture failed
正式可用
PayPal Webhook

接收 PayPal webhook 事件並同步付款狀態。

POST /api/paycore/webhooks/paypal
參數表
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
event_type body 必填 string PayPal webhook 事件類型。 CHECKOUT.ORDER.APPROVED
resource body 必填 object PayPal 事件資源。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
webhook_id gateway_credentials 選填 string 正式環境建議設定用於 webhook 驗證。 WH-xxxx
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/webhooks/paypal" \
  -H "Content-Type: application/json" \
  -d '{
    "event_type": "example.event",
    "resource": {
      "payment_no": "PAY202606220001ABCDEFGH"
    }
  }'
成功回應重點
  • JSON ack
Response 欄位表
欄位型別說明範例
HTTP statusintegerHTTP 狀態碼。SmilePay 成功時為 200。200
Content-Typestring回覆內容格式。SmilePay 為 text/plain。application/json
bodystring|object金流要求的 ACK 或 PayCore 結果頁。{"success":true}
成功 Response 範例
JSON
{
    "success": true,
    "message": "Webhook received"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • PAYPAL_WEBHOOK_VERIFY_FAILED
STRIPE

Stripe

支援信用卡、支付寶、微信支付與東南亞本地付款方式,採 Stripe PaymentIntent / Payment Element 流程。

商戶可呼叫 API

正式可用
建立 Stripe 信用卡付款

建立 Stripe 信用卡付款。PayCore 會回傳付款頁網址,由付款者在 PayCore 安全付款頁完成付款。

POST /api/paycore/pay/stripe/credit
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
secret_key gateway_credentials 必填 string Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。 sk_test_xxxxx
publishable_key gateway_credentials 必填 string Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。 pk_test_xxxxx
webhook_secret gateway_credentials 選填 string Stripe webhook secret,若提供必須以 whsec_ 開頭。 whsec_xxxxx
callback_secret gateway_credentials 選填 string PayCore 自訂 callback secret。 optional-secret
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/credit" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/stripe/credit', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=card
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "credit",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • STRIPE_SECRET_KEY_INVALID
  • STRIPE_PUBLISHABLE_KEY_INVALID
  • STRIPE_AUTH_FAILED
  • STRIPE_PAYMENT_INTENT_CREATE_FAILED
正式可用
建立 Stripe 支付寶付款(中國)

建立 Stripe Alipay 支付寶付款。PayCore 會建立 payment_method_types[]=alipay 的 PaymentIntent。

POST /api/paycore/pay/stripe/alipay
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
secret_key gateway_credentials 必填 string Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。 sk_test_xxxxx
publishable_key gateway_credentials 必填 string Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。 pk_test_xxxxx
webhook_secret gateway_credentials 選填 string Stripe webhook secret,若提供必須以 whsec_ 開頭。 whsec_xxxxx
callback_secret gateway_credentials 選填 string PayCore 自訂 callback secret。 optional-secret
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/alipay" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/stripe/alipay', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=alipay
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "alipay",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • STRIPE_PAYMENT_METHOD_CURRENCY_UNSUPPORTED
  • STRIPE_PAYMENT_INTENT_CREATE_FAILED
  • STRIPE_AUTH_FAILED

目前限制幣別:CNY、AUD、CAD、EUR、GBP、HKD、JPY、MYR、NZD、SGD、USD。若商戶 Stripe 帳號所在地尚未啟用 Alipay,Stripe 仍可能拒絕建立。

正式可用
建立 Stripe 微信支付付款(中國)

建立 Stripe WeChat Pay 微信支付付款。公開 API 使用 wechat-pay,內部對應 Stripe enum wechat_pay。

POST /api/paycore/pay/stripe/wechat-pay
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
secret_key gateway_credentials 必填 string Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。 sk_test_xxxxx
publishable_key gateway_credentials 必填 string Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。 pk_test_xxxxx
webhook_secret gateway_credentials 選填 string Stripe webhook secret,若提供必須以 whsec_ 開頭。 whsec_xxxxx
callback_secret gateway_credentials 選填 string PayCore 自訂 callback secret。 optional-secret
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/wechat-pay" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/stripe/wechat-pay', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=wechat_pay
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "wechat",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • STRIPE_PAYMENT_METHOD_CURRENCY_UNSUPPORTED
  • STRIPE_PAYMENT_INTENT_CREATE_FAILED
  • STRIPE_AUTH_FAILED

目前限制幣別:CNY、AUD、CAD、EUR、GBP、HKD、JPY、SGD、USD、DKK、NOK、SEK、CHF;仍需商戶 Stripe 帳號可使用 WeChat Pay。

正式可用
建立 Stripe GrabPay 付款(新加坡/馬來西亞)

建立 Stripe GrabPay 付款。PayCore 會建立 payment_method_types[]=grabpay 的 PaymentIntent。

POST /api/paycore/pay/stripe/grabpay
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
secret_key gateway_credentials 必填 string Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。 sk_test_xxxxx
publishable_key gateway_credentials 必填 string Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。 pk_test_xxxxx
webhook_secret gateway_credentials 選填 string Stripe webhook secret,若提供必須以 whsec_ 開頭。 whsec_xxxxx
callback_secret gateway_credentials 選填 string PayCore 自訂 callback secret。 optional-secret
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/grabpay" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/stripe/grabpay', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=grabpay
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "grabpay",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • STRIPE_PAYMENT_METHOD_CURRENCY_UNSUPPORTED
  • STRIPE_PAYMENT_INTENT_CREATE_FAILED
  • STRIPE_AUTH_FAILED

目前限制幣別:SGD、MYR。

正式可用
建立 Stripe PayNow 付款(新加坡)

建立 Stripe PayNow 付款。付款者會在付款頁看到 PayNow QR code 並用支援的 App 掃碼付款。

POST /api/paycore/pay/stripe/paynow
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
secret_key gateway_credentials 必填 string Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。 sk_test_xxxxx
publishable_key gateway_credentials 必填 string Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。 pk_test_xxxxx
webhook_secret gateway_credentials 選填 string Stripe webhook secret,若提供必須以 whsec_ 開頭。 whsec_xxxxx
callback_secret gateway_credentials 選填 string PayCore 自訂 callback secret。 optional-secret
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/paynow" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/stripe/paynow', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=paynow
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "paynow",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • STRIPE_PAYMENT_METHOD_CURRENCY_UNSUPPORTED
  • STRIPE_PAYMENT_INTENT_CREATE_FAILED
  • STRIPE_AUTH_FAILED

PayNow 目前限制幣別:SGD。

正式可用
建立 Stripe PromptPay 付款(泰國)

建立 Stripe PromptPay 付款。付款者會在付款頁看到 PromptPay QR code 並用泰國銀行 App 掃碼付款。

POST /api/paycore/pay/stripe/promptpay
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
secret_key gateway_credentials 必填 string Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。 sk_test_xxxxx
publishable_key gateway_credentials 必填 string Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。 pk_test_xxxxx
webhook_secret gateway_credentials 選填 string Stripe webhook secret,若提供必須以 whsec_ 開頭。 whsec_xxxxx
callback_secret gateway_credentials 選填 string PayCore 自訂 callback secret。 optional-secret
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/promptpay" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/stripe/promptpay', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=promptpay
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "promptpay",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • STRIPE_PAYMENT_METHOD_CURRENCY_UNSUPPORTED
  • STRIPE_PAYMENT_INTENT_CREATE_FAILED
  • STRIPE_AUTH_FAILED

PromptPay 目前限制幣別:THB。

正式可用
建立 Stripe FPX 付款(馬來西亞)

建立 Stripe FPX 付款。付款者會從 PayCore 付款頁導向 FPX 網銀授權後返回。

POST /api/paycore/pay/stripe/fpx
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
secret_key gateway_credentials 必填 string Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。 sk_test_xxxxx
publishable_key gateway_credentials 必填 string Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。 pk_test_xxxxx
webhook_secret gateway_credentials 選填 string Stripe webhook secret,若提供必須以 whsec_ 開頭。 whsec_xxxxx
callback_secret gateway_credentials 選填 string PayCore 自訂 callback secret。 optional-secret
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/fpx" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/stripe/fpx', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=fpx
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "fpx",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • STRIPE_PAYMENT_METHOD_CURRENCY_UNSUPPORTED
  • STRIPE_PAYMENT_INTENT_CREATE_FAILED
  • STRIPE_AUTH_FAILED

FPX 目前限制幣別:MYR;Stripe 也可能要求商戶提供 Business Registration Number。

Webhook / Return 說明

正式可用
Stripe Webhook

接收 Stripe webhook 事件並同步 PaymentIntent 付款狀態。

POST /api/paycore/webhooks/stripe
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Stripe-Signature header 選填 string Stripe webhook 簽章標頭。 t=...,v1=...
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
type body 必填 string Stripe event type。 payment_intent.succeeded
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
webhook_secret gateway_credentials 選填 string 如果提供會用於驗證 Stripe webhook。 whsec_xxxxx
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/webhooks/stripe" \
  -H "Content-Type: application/json" \
  -d '{
    "event_type": "example.event",
    "resource": {
      "payment_no": "PAY202606220001ABCDEFGH"
    }
  }'
成功回應重點
  • JSON ack
Response 欄位表
欄位型別說明範例
HTTP statusintegerHTTP 狀態碼。SmilePay 成功時為 200。200
Content-Typestring回覆內容格式。SmilePay 為 text/plain。application/json
bodystring|object金流要求的 ACK 或 PayCore 結果頁。{"success":true}
成功 Response 範例
JSON
{
    "success": true,
    "message": "Webhook received"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • STRIPE_WEBHOOK_SIGNATURE_INVALID
PLUS

PLUS

目前程式只支援 PLUS ATM 付款、PLUS balance action、Return / Webhook。

商戶可呼叫 API

正式可用
建立 PLUS ATM 付款

建立 PLUS ATM 付款。PLUS 的小額 / 大額通道分流只屬於 PLUS 付款方式。

POST /api/paycore/pay/plus/atm
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
merchant_order_no body 必填 string|max:100 商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。 ORDER202606220001
amount body 必填 integer|min:1 付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。 980
currency body 選填 string|max:10 幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。 TWD
payer_account body 選填 string|max:100 付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。 uid811118A
success_url body 選填 url 付款成功後可導回商戶的網址。 https://merchant.example/success
return_url body 選填 url 相容欄位;部分付款方式會當作 success_url 使用。 https://merchant.example/return
cancel_url body 選填 url 付款取消或未完成時導回商戶的網址。 https://merchant.example/cancel
payok_url body 選填 url PayCore 付款成功後通知商戶系統的 URL。 https://merchant.example/paycore/payok
item_name body 選填 string|max:200 商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。 PayCore 測試商品
description body 選填 string|max:200 付款描述。可作為商品名稱或交易描述 fallback。 Order payment
buyer_name body 選填 string|max:100 買家姓名,主要供 SmilePay 等離線付款使用。 王小明
buyer_mobile body 選填 string|max:30 買家手機。 0912345678
buyer_phone body 選填 string|max:30 買家電話;可作為 buyer_mobile / buyer_tel fallback。 0912345678
buyer_tel body 選填 string|max:30 買家市話。 02-12345678
buyer_email body 選填 email|max:150 買家 Email。 [email protected]
expire_days body 選填 integer|min:1|max:60 離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。 7
gateway_credentials body 必填 object 金流商店憑證。依 gateway 不同,欄位不同。 {...}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
appid gateway_credentials 必填 string PLUS App ID。 PLUS_APPID
secret_key gateway_credentials 必填 string PLUS secret_key。 PLUS_SECRET_KEY
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/pay/plus/atm" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "appid": "PLUS_APPID",
      "secret_key": "PLUS_SECRET_KEY"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/pay/plus/atm', [
    'merchant_order_no' => 'ORDER202606220001',
    'amount' => 980,
    'currency' => 'TWD',
    'gateway_credentials' => [
        // Fill the credentials shown in this section.
    ],
]);

return $response->json();
成功回應重點
  • payment_no
  • payment_url
  • account_code
  • plat_no
  • status
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.payment_nostringPayCore 付款編號。PAY202606220001ABCDEFGH
data.merchant_order_nostring商戶訂單號。ORDER202606220001
data.gatewaystring金流代號。ecpay
data.methodstring付款方式。atm
data.amountinteger交易金額。980
data.currencystring幣別。TWD
data.statusstring付款建立後狀態。離線付款多為 pending。pending
data.payment_urlstring|nullPayCore 付款頁或金流導轉網址。https://pay-core.app/zh-tw/pay/PAY...
data.payment_infoobjectATM / 超商代碼 / 前端付款必要資訊。{...}
data.createdboolean是否本次新建立。若回傳既有付款則為 false。true
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "plus",
        "method": "atm",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • PLUS appid is required.
  • PLUS secret_key is required.
  • PLUS money mismatch.
正式可用
查詢 PLUS 餘額

PLUS 專用 Gateway Action,目前公開可用 action 為 plus/balance。

POST /api/paycore/gateways/plus/balance
參數表
Header 參數
欄位 位置 必填 型別 說明 範例
Content-Type header 必填 string 建立付款時使用 application/json。 application/json
X-API-KEY header 必填 string PayCore API 身分驗證 Key。這不是金流商店金鑰。 pc_live_xxxxx
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
gateway_credentials body 必填 object PLUS appid / secret_key。 {"appid":"...","secret_key":"..."}
gateway_credentials 可填欄位
欄位 位置 必填 型別 說明 範例
appid gateway_credentials 必填 string PLUS App ID。 PLUS_APPID
secret_key gateway_credentials 必填 string PLUS secret_key。 PLUS_SECRET_KEY
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/gateways/plus/balance" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "gateway_credentials": {
      "appid": "PLUS_APPID",
      "secret_key": "PLUS_SECRET_KEY"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => env('PAYCORE_API_KEY'),
])->post('https://api-core.cc/api/paycore/gateways/plus/balance', [
    'gateway_credentials' => [
        'appid' => 'PLUS_APPID',
        'secret_key' => 'PLUS_SECRET_KEY',
    ],
]);

return $response->json();
成功回應重點
  • gateway=plus
  • balance
  • raw_response
Response 欄位表
欄位型別說明範例
successboolean是否成功。true
data.gatewaystring金流代號。plus
data.balanceinteger|string|nullPLUS 回傳餘額。依 PLUS 原始回應而定。10000
messagestringPayCore 回應訊息。Gateway action completed
成功 Response 範例
JSON
{
    "success": true,
    "data": {
        "gateway": "plus",
        "balance": 10000,
        "raw_response": {
            "status": "ok"
        }
    },
    "message": "Gateway action completed"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • Unsupported gateway action
  • Gateway action failed

Webhook / Return 說明

正式可用
PLUS Return 頁

付款者從 PLUS 回 PayCore 的前台頁面。

GET /{locale}/payment/plus/return/{paymentNo}
參數表
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
paymentNo path 必填 string PayCore payment_no。 PAY202606220001ABCDEFGH
Request / Response 範例
cURL
curl -X GET "https://api-core.cc/{locale}/payment/plus/return/{paymentNo}" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY"
成功回應重點
  • PayCore PLUS return page
Response 欄位表
欄位型別說明範例
HTTP statusintegerHTTP 狀態碼。SmilePay 成功時為 200。200
Content-Typestring回覆內容格式。SmilePay 為 text/plain。application/json
bodystring|object金流要求的 ACK 或 PayCore 結果頁。{"success":true}
成功 Response 範例
JSON
{
    "type": "html",
    "description": "PayCore result page"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • Payment not found
正式可用
PLUS Webhook

接收 PLUS callback_url 回調。

POST /api/paycore/webhooks/plus
參數表
Path / Query / Body 參數
欄位 位置 必填 型別 說明 範例
appid body 必填 string PLUS appid。 PLUS_APPID
money body 必填 integer|string 回調金額,PayCore 會比對交易金額。 980
Request / Response 範例
cURL
curl -X POST "https://api-core.cc/api/paycore/webhooks/plus" \
  -H "Content-Type: application/json" \
  -d '{
    "event_type": "example.event",
    "resource": {
      "payment_no": "PAY202606220001ABCDEFGH"
    }
  }'
成功回應重點
  • JSON ack
Response 欄位表
欄位型別說明範例
HTTP statusintegerHTTP 狀態碼。SmilePay 成功時為 200。200
Content-Typestring回覆內容格式。SmilePay 為 text/plain。application/json
bodystring|object金流要求的 ACK 或 PayCore 結果頁。{"success":true}
成功 Response 範例
JSON
{
    "success": true,
    "message": "Webhook received"
}
錯誤 Response 範例
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
錯誤碼與注意事項
  • PLUS appid mismatch.
  • PLUS money mismatch.
已經到底囉

Pico 陪你看到這裡了。

需要重新找 API、回到目錄,或再確認串接流程嗎?可以一鍵回到上方搜尋,也可以回到 API 目錄繼續瀏覽。

PayCore 開發者中心已正式公開,文件會持續補齊 Direct Gateway API、All-in-One 收款專案、Webhook 與錯誤碼範例。