Current section
Quickstart
Public integration docs
Quickstart
Start by getting a PayCore API key, choose Direct Gateway or All-in-One payment project, then call the create payment API. Use the search box above to find gateways, methods, fields or endpoints.
1. API authentication X-API-KEY
2. gateway_credentials Gateway-specific merchant credentials
3. Create payment POST /api/paycore/pay/{gateway}/{method}
X-API-KEY
API authentication
PayCore APIs authenticate callers with the X-API-KEY header. Gateway merchant credentials are sent in gateway_credentials in the request body.
Direct / All-in-One
Integration modes
Direct Gateway lets merchants pass gateway credentials directly. All-in-One projects use a PayCore project API key to manage payment pages and methods centrally.
Webhook
Webhook concept
Gateway callbacks update PayCore payment status first. If payok_url is provided, PayCore notifies the merchant system after payment succeeds. Payment pages also poll status in the background to reduce manual refreshes.
COMMON
共用 API
所有金流共用的查詢、同步、首頁概況。
Merchant APIs
GET
/api/paycore/payments/{paymentNo}
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
X-API-KEY
header
Required
string
PayCore API Key。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
paymentNo
path
Required
string
PayCore payment_no。
PAY202606220001ABCDEFGH
Request / Response examples
curl -X GET "https://api-core.cc/api/paycore/payments/{paymentNo}" \
-H "X-API-KEY: YOUR_PAYCORE_API_KEY"
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();
Success response highlights
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. smilepaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringPayment status. pending|paid|failed|expireddata.payment_urlstring|nullPayCore payment page URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectGateway payment instructions or frontend payment data. {...}
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
POST
/api/paycore/payments/{paymentNo}/sync
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
paymentNo
path
Required
string
PayCore payment_no。
PAY202606220001ABCDEFGH
Request / Response examples
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 '{}'
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();
Success response highlights
PaymentSyncResult + transaction data
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. smilepaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringPayment status. pending|paid|failed|expireddata.payment_urlstring|nullPayCore payment page URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectGateway payment instructions or frontend payment data. {...}
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
gateway_sync_not_supported
PAYMENT_NOT_FOUND
GET
/api/paycore/home/overview
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
X-PayCore-Timezone
header
Optional
IANA timezone
瀏覽器時區,例如 Asia/Taipei。
Asia/Taipei
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
timezone
query
Optional
IANA timezone
時區 query 參數。
Asia/Taipei
Request / Response examples
curl -X GET "https://api-core.cc/api/paycore/home/overview" \
-H "X-API-KEY: YOUR_PAYCORE_API_KEY"
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();
Success response highlights
today_amount
month_amount
recent_transactions
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
No gateway-specific error is listed for this API. Generic validation errors may still be returned.
ECPAY
綠界 ECPay
支援綠界 AIO 導轉付款與 ATM / CVS / BARCODE 背景取號。
Merchant APIs
POST
/api/paycore/pay/ecpay/aio
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
merchant_id
gateway_credentials
Required
string
綠界特店編號。亦相容 MerchantID。
2000132
hash_key
gateway_credentials
Required
string
綠界 HashKey。亦相容 HashKey。
5294y06JbISpM5x9
hash_iv
gateway_credentials
Required
string
綠界 HashIV。亦相容 HashIV。
v77hoKGq4kWxNNIS
environment
gateway_credentials
Optional
stage|production
環境。支援 stage/staging/test/testing 或 production/prod。
stage
platform_id
gateway_credentials
Optional
string
綠界 PlatformID,只有特定平台商情境需要。
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
merchant_order_no
gateway=ecpay
method=all
status=pending
payment_url
redirect_form
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
ECPAY_CREDENTIAL_INVALID
ORDER_CONFLICT
INVALID_ARGUMENT
Payment gateway error
AIO 取號成功仍為 pending,不等於付款成功。
POST
/api/paycore/pay/ecpay/aio/credit
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
merchant_id
gateway_credentials
Required
string
綠界特店編號。亦相容 MerchantID。
2000132
hash_key
gateway_credentials
Required
string
綠界 HashKey。亦相容 HashKey。
5294y06JbISpM5x9
hash_iv
gateway_credentials
Required
string
綠界 HashIV。亦相容 HashIV。
v77hoKGq4kWxNNIS
environment
gateway_credentials
Optional
stage|production
環境。支援 stage/staging/test/testing 或 production/prod。
stage
platform_id
gateway_credentials
Optional
string
綠界 PlatformID,只有特定平台商情境需要。
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
merchant_order_no
gateway=ecpay
method=credit
status=pending
payment_url
redirect_form
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
ECPAY_CREDENTIAL_INVALID
ORDER_CONFLICT
INVALID_ARGUMENT
Payment gateway error
POST
/api/paycore/pay/ecpay/aio/atm
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
merchant_id
gateway_credentials
Required
string
綠界特店編號。亦相容 MerchantID。
2000132
hash_key
gateway_credentials
Required
string
綠界 HashKey。亦相容 HashKey。
5294y06JbISpM5x9
hash_iv
gateway_credentials
Required
string
綠界 HashIV。亦相容 HashIV。
v77hoKGq4kWxNNIS
environment
gateway_credentials
Optional
stage|production
環境。支援 stage/staging/test/testing 或 production/prod。
stage
platform_id
gateway_credentials
Optional
string
綠界 PlatformID,只有特定平台商情境需要。
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
merchant_order_no
gateway=ecpay
method=atm
status=pending
payment_url
redirect_form
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
ECPAY_CREDENTIAL_INVALID
ORDER_CONFLICT
ECPAY amount mismatch
AIO ATM 需要先導到綠界頁面,回站後由 token 付款頁顯示取號資訊。
POST
/api/paycore/pay/ecpay/aio/cvs
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
merchant_id
gateway_credentials
Required
string
綠界特店編號。亦相容 MerchantID。
2000132
hash_key
gateway_credentials
Required
string
綠界 HashKey。亦相容 HashKey。
5294y06JbISpM5x9
hash_iv
gateway_credentials
Required
string
綠界 HashIV。亦相容 HashIV。
v77hoKGq4kWxNNIS
environment
gateway_credentials
Optional
stage|production
環境。支援 stage/staging/test/testing 或 production/prod。
stage
platform_id
gateway_credentials
Optional
string
綠界 PlatformID,只有特定平台商情境需要。
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
merchant_order_no
gateway=ecpay
method=cvs
status=pending
payment_url
redirect_form
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
ECPAY_CREDENTIAL_INVALID
ECPAY amount mismatch
POST
/api/paycore/pay/ecpay/aio/barcode
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
merchant_id
gateway_credentials
Required
string
綠界特店編號。亦相容 MerchantID。
2000132
hash_key
gateway_credentials
Required
string
綠界 HashKey。亦相容 HashKey。
5294y06JbISpM5x9
hash_iv
gateway_credentials
Required
string
綠界 HashIV。亦相容 HashIV。
v77hoKGq4kWxNNIS
environment
gateway_credentials
Optional
stage|production
環境。支援 stage/staging/test/testing 或 production/prod。
stage
platform_id
gateway_credentials
Optional
string
綠界 PlatformID,只有特定平台商情境需要。
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
merchant_order_no
gateway=ecpay
method=barcode
status=pending
payment_url
redirect_form
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.gatewaystringGateway code. ecpaydata.methodstringPayment method. barcodedata.payment_urlstring|nullPayCore barcode payment page URL. The payer opens it at the store to scan the three barcode lines. https://pay-core.app/zh-tw/pay/PAY...data.payment_info.*.barcode_user_copy_urlstringRecommended payment page URL to copy for the payer. https://pay-core.app/zh-tw/pay/PAY...data.payment_info.*.barcode_segments_copyablebooleanAlways false; Barcode1/2/3 are used to render scannable barcodes, not as primary copy targets. falsedata.payment_info.*.barcode_intro_urlstring|nullGateway-specific official barcode payment intro URL. ECPay shows ECPay; SmilePay shows SmilePay. https://...
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
ECPAY_CREDENTIAL_INVALID
ECPAY amount mismatch
台灣條碼繳費只建議複製繳費頁網址,讓付款人到超商掃描頁面上的三段條碼;付款頁只顯示綠界條碼繳費介紹連結。
POST
/api/paycore/pay/ecpay/atm
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
merchant_id
gateway_credentials
Required
string
綠界特店編號。亦相容 MerchantID。
2000132
hash_key
gateway_credentials
Required
string
綠界 HashKey。亦相容 HashKey。
5294y06JbISpM5x9
hash_iv
gateway_credentials
Required
string
綠界 HashIV。亦相容 HashIV。
v77hoKGq4kWxNNIS
environment
gateway_credentials
Optional
stage|production
環境。支援 stage/staging/test/testing 或 production/prod。
stage
platform_id
gateway_credentials
Optional
string
綠界 PlatformID,只有特定平台商情境需要。
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
bank_code
virtual_account
expire_at
payment_url
status=pending
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
ECPAY_CREDENTIAL_INVALID
ORDER_CONFLICT
ECPAY_BACKGROUND_CODE_FAILED
POST
/api/paycore/pay/ecpay/cvs
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
merchant_id
gateway_credentials
Required
string
綠界特店編號。亦相容 MerchantID。
2000132
hash_key
gateway_credentials
Required
string
綠界 HashKey。亦相容 HashKey。
5294y06JbISpM5x9
hash_iv
gateway_credentials
Required
string
綠界 HashIV。亦相容 HashIV。
v77hoKGq4kWxNNIS
environment
gateway_credentials
Optional
stage|production
環境。支援 stage/staging/test/testing 或 production/prod。
stage
platform_id
gateway_credentials
Optional
string
綠界 PlatformID,只有特定平台商情境需要。
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
payment_code
payment_code_url
expire_at
payment_url
status=pending
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
ECPAY_CREDENTIAL_INVALID
ORDER_CONFLICT
ECPAY_BACKGROUND_CODE_FAILED
POST
/api/paycore/pay/ecpay/barcode
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
merchant_id
gateway_credentials
Required
string
綠界特店編號。亦相容 MerchantID。
2000132
hash_key
gateway_credentials
Required
string
綠界 HashKey。亦相容 HashKey。
5294y06JbISpM5x9
hash_iv
gateway_credentials
Required
string
綠界 HashIV。亦相容 HashIV。
v77hoKGq4kWxNNIS
environment
gateway_credentials
Optional
stage|production
環境。支援 stage/staging/test/testing 或 production/prod。
stage
platform_id
gateway_credentials
Optional
string
綠界 PlatformID,只有特定平台商情境需要。
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
barcode1
barcode2
barcode3
expire_at
payment_url
status=pending
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.gatewaystringGateway code. ecpaydata.methodstringPayment method. barcodedata.payment_urlstring|nullPayCore barcode payment page URL. The payer opens it at the store to scan the three barcode lines. https://pay-core.app/zh-tw/pay/PAY...data.payment_info.*.barcode_user_copy_urlstringRecommended payment page URL to copy for the payer. https://pay-core.app/zh-tw/pay/PAY...data.payment_info.*.barcode_segments_copyablebooleanAlways false; Barcode1/2/3 are used to render scannable barcodes, not as primary copy targets. falsedata.payment_info.*.barcode_intro_urlstring|nullGateway-specific official barcode payment intro URL. ECPay shows ECPay; SmilePay shows SmilePay. https://...
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
ECPAY_CREDENTIAL_INVALID
ORDER_CONFLICT
ECPAY_BACKGROUND_CODE_FAILED
台灣條碼繳費只建議複製繳費頁網址,不提供 Barcode1/2/3 字串複製;付款頁只顯示綠界條碼繳費介紹連結。
Webhooks / Returns
POST
/api/paycore/webhooks/ecpay
Copy full API URL
Parameters
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
MerchantID
body
Optional
string
綠界特店編號。AIO 或背景取號 JSON callback 都可能出現。
2000132
RqHeader
body
Optional
object
綠界背景取號 JSON callback 的傳輸標頭。
{"Timestamp":1782144000}
Data
body
Optional
string
綠界背景取號 JSON callback 的 AES 加密資料;PayCore 會容錯處理 base64 + 被轉成空白的情況。
encrypted-data
TransCode
body
Optional
integer
綠界背景取號 JSON callback 的傳輸結果。
1
MerchantTradeNo
body
Optional
string
綠界交易編號,對應 gateway_order_no。
PC202606220001
CustomField1
body
Optional
string
PayCore payment_no。
PAY202606220001ABCDEFGH
TradeAmt
body
Optional
integer
綠界回傳金額,PayCore 會比對交易金額。
980
RtnCode
body
Optional
string
綠界狀態碼。取號成功不等於付款成功。
2
Request / Response examples
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"
}
}'
Success response highlights
Response fields
Field Type Description Example HTTP statusintegerHTTP status code. SmilePay success uses 200. 200Content-TypestringResponse content type. SmilePay uses text/plain. application/jsonbodystring|objectGateway-required ACK or PayCore result page. {"success":true}
Success response example
{
"success": true,
"message": "Webhook received"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
ECPay MerchantID mismatch.
ECPay amount mismatch.
ECPay CheckMacValue verification failed.
ECPay encrypted background callback transaction not found.
SMILEPAY
速買配 SmilePay
支援 ATM 虛擬帳號、CVS 超商代碼與獨立超商條碼付款。
Merchant APIs
POST
/api/paycore/pay/smilepay/atm
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
dcvc
gateway_credentials
Required
string
速買配商家代號。亦相容 Dcvc。
2109
rvg2c
gateway_credentials
Required
string
速買配 Rvg2c。通常為 1。亦相容 Rvg2c。
1
verify_key
gateway_credentials
Required
string
速買配檢查碼 Verify_key。
YOUR_VERIFY_KEY
validation_token
gateway_credentials
Optional
string
PayCore 額外自訂的回調驗證 token,可用於模擬與防誤打。
optional-token
default_cvs_type
gateway_credentials
Optional
ibon|fami|famiport|barcode
未傳 cvs_type 時的預設超商類型。
ibon
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
SmilePayNO
AtmBankNo
AtmNo
PayEndDate
status
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
SMILEPAY_CREDENTIAL_INVALID
SmilePay amount mismatch.
SmilePay Dcvc mismatch.
Amount 必須與建立付款 amount 一致。
POST
/api/paycore/pay/smilepay/cvs
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
cvs_type
body
Optional
ibon|fami|famiport|family
超商代碼類型。family 會正規化為 fami。條碼請改用 /api/paycore/pay/smilepay/barcode。
ibon
gateway_credentials fields
Field
Location
Required
Type
Description
Example
dcvc
gateway_credentials
Required
string
速買配商家代號。亦相容 Dcvc。
2109
rvg2c
gateway_credentials
Required
string
速買配 Rvg2c。通常為 1。亦相容 Rvg2c。
1
verify_key
gateway_credentials
Required
string
速買配檢查碼 Verify_key。
YOUR_VERIFY_KEY
validation_token
gateway_credentials
Optional
string
PayCore 額外自訂的回調驗證 token,可用於模擬與防誤打。
optional-token
default_cvs_type
gateway_credentials
Optional
ibon|fami|famiport|barcode
未傳 cvs_type 時的預設超商類型。
ibon
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
SmilePayNO
payment_code
PayEndDate
status
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
SMILEPAY_CREDENTIAL_INVALID
SmilePay amount mismatch.
SmilePay validation token mismatch.
POST
/api/paycore/pay/smilepay/barcode
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
dcvc
gateway_credentials
Required
string
速買配商家代號。亦相容 Dcvc。
2109
rvg2c
gateway_credentials
Required
string
速買配 Rvg2c。通常為 1。亦相容 Rvg2c。
1
verify_key
gateway_credentials
Required
string
速買配檢查碼 Verify_key。
YOUR_VERIFY_KEY
validation_token
gateway_credentials
Optional
string
PayCore 額外自訂的回調驗證 token,可用於模擬與防誤打。
optional-token
default_cvs_type
gateway_credentials
Optional
ibon|fami|famiport|barcode
未傳 cvs_type 時的預設超商類型。
ibon
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
SmilePayNO
barcode1
barcode2
barcode3
barcode_user_copy_url
barcode_intro_url
PayEndDate
status
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.gatewaystringGateway code. smilepaydata.methodstringPayment method. barcodedata.payment_urlstring|nullPayCore barcode payment page URL. The payer opens it at the store to scan the three barcode lines. https://pay-core.app/zh-tw/pay/PAY...data.payment_info.*.barcode_user_copy_urlstringRecommended payment page URL to copy for the payer. https://pay-core.app/zh-tw/pay/PAY...data.payment_info.*.barcode_segments_copyablebooleanAlways false; Barcode1/2/3 are used to render scannable barcodes, not as primary copy targets. falsedata.payment_info.*.barcode_intro_urlstring|nullGateway-specific official barcode payment intro URL. ECPay shows ECPay; SmilePay shows SmilePay. https://...
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
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。
Webhooks / Returns
POST
/api/paycore/webhooks/smilepay
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Optional
form/json
速買配可能以表單或 PayCore 模擬 JSON 傳入。
application/x-www-form-urlencoded
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
Dcvc
body
Required
string
商家代號,PayCore 會與交易憑證比對。
2109
Data_id
body
Required
string
商戶訂單號,對應 merchant_order_no。
ORDER202606220202111
SmilePayNO
body
Optional
string
速買配交易號,PayCore 優先用它匹配 gateway_trade_no。
062223689453
Amount
body
Required
integer|string
付款金額。必須與原建立付款的 amount 一致。
980
Status
body
Required
string|integer
狀態。Status=1 代表成功。
1
AtmBankNo
body
Optional
string
ATM 銀行代碼。
809
AtmNo
body
Optional
string
ATM 虛擬帳號。
8011773423689453
PayEndDate
body
Optional
datetime|string
繳費期限。
2026/06/28 23:59:59
Request / Response examples
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"
}
}'
Success response highlights
plain text acknowledgement
Response fields
Field Type Description Example HTTP statusintegerHTTP status code. SmilePay success uses 200. 200Content-TypestringResponse content type. SmilePay uses text/plain. text/plainbodystring|objectGateway-required ACK or PayCore result page. OK
Success response example
HTTP/1.1 200 OK
Content-Type: text/plain; charset=UTF-8
OK
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
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。
Merchant APIs
POST
/api/paycore/pay/paypal/checkout
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
client_id
gateway_credentials
Required
string
PayPal REST API client_id。
PAYPAL_CLIENT_ID
client_secret
gateway_credentials
Required
string
PayPal REST API client_secret。
PAYPAL_CLIENT_SECRET
environment
gateway_credentials
Optional
sandbox|live|production
PayPal 環境。production 會正規化為 live。
sandbox
webhook_id
gateway_credentials
Optional
string
PayPal webhook 驗證用 webhook_id。正式環境建議設定。
WH-xxxxxxxx
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
payment_url / approval_url
status
created
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
PAYPAL_CLIENT_ID_REQUIRED
PAYPAL_CLIENT_SECRET_REQUIRED
PAYPAL_ENVIRONMENT_INVALID
PAYPAL_REQUEST_REJECTED
PayPal 正式上線通常需要 PayPal Business account。
Webhooks / Returns
GET
/{locale}/payment/paypal/return/{paymentNo}
Copy full API URL
Parameters
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
paymentNo
path
Required
string
PayCore payment_no。
PAY202606220001ABCDEFGH
token
query
Optional
string
PayPal return token / order id。
PAYPAL_ORDER_ID
Request / Response examples
curl -X GET "https://api-core.cc/{locale}/payment/paypal/return/{paymentNo}" \
-H "X-API-KEY: YOUR_PAYCORE_API_KEY"
Success response highlights
Response fields
Field Type Description Example HTTP statusintegerHTTP status code. SmilePay success uses 200. 200Content-TypestringResponse content type. SmilePay uses text/plain. application/jsonbodystring|objectGateway-required ACK or PayCore result page. {"success":true}
Success response example
{
"type": "html",
"description": "PayCore result page"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
POST
/api/paycore/webhooks/paypal
Copy full API URL
Parameters
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
event_type
body
Required
string
PayPal webhook 事件類型。
CHECKOUT.ORDER.APPROVED
resource
body
Required
object
PayPal 事件資源。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
webhook_id
gateway_credentials
Optional
string
正式環境建議設定用於 webhook 驗證。
WH-xxxx
Request / Response examples
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"
}
}'
Success response highlights
Response fields
Field Type Description Example HTTP statusintegerHTTP status code. SmilePay success uses 200. 200Content-TypestringResponse content type. SmilePay uses text/plain. application/jsonbodystring|objectGateway-required ACK or PayCore result page. {"success":true}
Success response example
{
"success": true,
"message": "Webhook received"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
PAYPAL_WEBHOOK_VERIFY_FAILED
STRIPE
Stripe
支援信用卡、支付寶、微信支付與東南亞本地付款方式,採 Stripe PaymentIntent / Payment Element 流程。
Merchant APIs
POST
/api/paycore/pay/stripe/credit
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
secret_key
gateway_credentials
Required
string
Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。
sk_test_xxxxx
publishable_key
gateway_credentials
Required
string
Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。
pk_test_xxxxx
webhook_secret
gateway_credentials
Optional
string
Stripe webhook secret,若提供必須以 whsec_ 開頭。
whsec_xxxxx
callback_secret
gateway_credentials
Optional
string
PayCore 自訂 callback secret。
optional-secret
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
payment_url
status
payment_info.stripe_payment_method=card
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
STRIPE_SECRET_KEY_INVALID
STRIPE_PUBLISHABLE_KEY_INVALID
STRIPE_AUTH_FAILED
STRIPE_PAYMENT_INTENT_CREATE_FAILED
POST
/api/paycore/pay/stripe/alipay
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
secret_key
gateway_credentials
Required
string
Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。
sk_test_xxxxx
publishable_key
gateway_credentials
Required
string
Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。
pk_test_xxxxx
webhook_secret
gateway_credentials
Optional
string
Stripe webhook secret,若提供必須以 whsec_ 開頭。
whsec_xxxxx
callback_secret
gateway_credentials
Optional
string
PayCore 自訂 callback secret。
optional-secret
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
payment_url
status
payment_info.stripe_payment_method=alipay
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
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 仍可能拒絕建立。
POST
/api/paycore/pay/stripe/wechat-pay
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
secret_key
gateway_credentials
Required
string
Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。
sk_test_xxxxx
publishable_key
gateway_credentials
Required
string
Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。
pk_test_xxxxx
webhook_secret
gateway_credentials
Optional
string
Stripe webhook secret,若提供必須以 whsec_ 開頭。
whsec_xxxxx
callback_secret
gateway_credentials
Optional
string
PayCore 自訂 callback secret。
optional-secret
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
payment_url
status
payment_info.stripe_payment_method=wechat_pay
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
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。
POST
/api/paycore/pay/stripe/grabpay
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
secret_key
gateway_credentials
Required
string
Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。
sk_test_xxxxx
publishable_key
gateway_credentials
Required
string
Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。
pk_test_xxxxx
webhook_secret
gateway_credentials
Optional
string
Stripe webhook secret,若提供必須以 whsec_ 開頭。
whsec_xxxxx
callback_secret
gateway_credentials
Optional
string
PayCore 自訂 callback secret。
optional-secret
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
payment_url
status
payment_info.stripe_payment_method=grabpay
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
STRIPE_PAYMENT_METHOD_CURRENCY_UNSUPPORTED
STRIPE_PAYMENT_INTENT_CREATE_FAILED
STRIPE_AUTH_FAILED
POST
/api/paycore/pay/stripe/paynow
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
secret_key
gateway_credentials
Required
string
Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。
sk_test_xxxxx
publishable_key
gateway_credentials
Required
string
Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。
pk_test_xxxxx
webhook_secret
gateway_credentials
Optional
string
Stripe webhook secret,若提供必須以 whsec_ 開頭。
whsec_xxxxx
callback_secret
gateway_credentials
Optional
string
PayCore 自訂 callback secret。
optional-secret
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
payment_url
status
payment_info.stripe_payment_method=paynow
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
STRIPE_PAYMENT_METHOD_CURRENCY_UNSUPPORTED
STRIPE_PAYMENT_INTENT_CREATE_FAILED
STRIPE_AUTH_FAILED
POST
/api/paycore/pay/stripe/promptpay
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
secret_key
gateway_credentials
Required
string
Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。
sk_test_xxxxx
publishable_key
gateway_credentials
Required
string
Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。
pk_test_xxxxx
webhook_secret
gateway_credentials
Optional
string
Stripe webhook secret,若提供必須以 whsec_ 開頭。
whsec_xxxxx
callback_secret
gateway_credentials
Optional
string
PayCore 自訂 callback secret。
optional-secret
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
payment_url
status
payment_info.stripe_payment_method=promptpay
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
STRIPE_PAYMENT_METHOD_CURRENCY_UNSUPPORTED
STRIPE_PAYMENT_INTENT_CREATE_FAILED
STRIPE_AUTH_FAILED
POST
/api/paycore/pay/stripe/fpx
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
secret_key
gateway_credentials
Required
string
Stripe Secret Key,必須以 sk_test_ 或 sk_live_ 開頭。
sk_test_xxxxx
publishable_key
gateway_credentials
Required
string
Stripe Publishable Key,必須以 pk_test_ 或 pk_live_ 開頭。
pk_test_xxxxx
webhook_secret
gateway_credentials
Optional
string
Stripe webhook secret,若提供必須以 whsec_ 開頭。
whsec_xxxxx
callback_secret
gateway_credentials
Optional
string
PayCore 自訂 callback secret。
optional-secret
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
payment_url
status
payment_info.stripe_payment_method=fpx
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
STRIPE_PAYMENT_METHOD_CURRENCY_UNSUPPORTED
STRIPE_PAYMENT_INTENT_CREATE_FAILED
STRIPE_AUTH_FAILED
FPX 目前限制幣別:MYR;Stripe 也可能要求商戶提供 Business Registration Number。
Webhooks / Returns
POST
/api/paycore/webhooks/stripe
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Stripe-Signature
header
Optional
string
Stripe webhook 簽章標頭。
t=...,v1=...
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
type
body
Required
string
Stripe event type。
payment_intent.succeeded
gateway_credentials fields
Field
Location
Required
Type
Description
Example
webhook_secret
gateway_credentials
Optional
string
如果提供會用於驗證 Stripe webhook。
whsec_xxxxx
Request / Response examples
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"
}
}'
Success response highlights
Response fields
Field Type Description Example HTTP statusintegerHTTP status code. SmilePay success uses 200. 200Content-TypestringResponse content type. SmilePay uses text/plain. application/jsonbodystring|objectGateway-required ACK or PayCore result page. {"success":true}
Success response example
{
"success": true,
"message": "Webhook received"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
STRIPE_WEBHOOK_SIGNATURE_INVALID
PLUS
PLUS
目前程式只支援 PLUS ATM 付款、PLUS balance action、Return / Webhook。
Merchant APIs
POST
/api/paycore/pay/plus/atm
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
merchant_order_no
body
Required
string|max:100
商戶訂單號。建議唯一;若同一訂單已有未完成或已付款交易,PayCore 會回傳既有付款或訂單衝突。
ORDER202606220001
amount
body
Required
integer|min:1
付款金額。ECPay / SmilePay / PLUS 以 TWD 整數元處理;Stripe 使用最小貨幣單位;PayPal 使用主要金額字串,TWD / JPY / HUF 不帶小數。
980
currency
body
Optional
string|max:10
幣別。ECPay / SmilePay 限 TWD;PLUS 預設 TWD;PayPal 不由 PayCore 限制,由 PayPal 回應。
TWD
payer_account
body
Optional
string|max:100
付款者或會員識別,可協助 PLUS pay_name 或商戶端追蹤。
uid811118A
success_url
body
Optional
url
付款成功後可導回商戶的網址。
https://merchant.example/success
return_url
body
Optional
url
相容欄位;部分付款方式會當作 success_url 使用。
https://merchant.example/return
cancel_url
body
Optional
url
付款取消或未完成時導回商戶的網址。
https://merchant.example/cancel
payok_url
body
Optional
url
PayCore 付款成功後通知商戶系統的 URL。
https://merchant.example/paycore/payok
item_name
body
Optional
string|max:200
商品名稱。ECPay 使用上限 200;SmilePay 會依金流限制裁切到安全長度。
PayCore 測試商品
description
body
Optional
string|max:200
付款描述。可作為商品名稱或交易描述 fallback。
Order payment
buyer_name
body
Optional
string|max:100
買家姓名,主要供 SmilePay 等離線付款使用。
王小明
buyer_mobile
body
Optional
string|max:30
買家手機。
0912345678
buyer_phone
body
Optional
string|max:30
買家電話;可作為 buyer_mobile / buyer_tel fallback。
0912345678
buyer_tel
body
Optional
string|max:30
買家市話。
02-12345678
buyer_email
body
Optional
email|max:150
買家 Email。
[email protected]
expire_days
body
Optional
integer|min:1|max:60
離線付款繳費有效天數。SmilePay / ECPay ATM / CVS 可使用。
7
gateway_credentials
body
Required
object
金流商店憑證。依 gateway 不同,欄位不同。
{...}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
appid
gateway_credentials
Required
string
PLUS App ID。
PLUS_APPID
secret_key
gateway_credentials
Required
string
PLUS secret_key。
PLUS_SECRET_KEY
Request / Response examples
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"
}
}'
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();
Success response highlights
payment_no
payment_url
account_code
plat_no
status
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.payment_nostringPayCore payment number. PAY202606220001ABCDEFGHdata.merchant_order_nostringMerchant order number. ORDER202606220001data.gatewaystringGateway code. ecpaydata.methodstringPayment method. atmdata.amountintegerTransaction amount. 980data.currencystringCurrency. TWDdata.statusstringStatus after creation. Offline payments are usually pending. pendingdata.payment_urlstring|nullPayCore payment page or gateway redirect URL. https://pay-core.app/zh-tw/pay/PAY...data.payment_infoobjectATM / CVS / frontend payment info. {...}data.createdbooleanWhether the payment was newly created. False when an existing active payment is returned. true
Success response example
{
"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"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
PLUS appid is required.
PLUS secret_key is required.
PLUS money mismatch.
POST
/api/paycore/gateways/plus/balance
Copy full API URL
Parameters
Header parameters
Field
Location
Required
Type
Description
Example
Content-Type
header
Required
string
建立付款時使用 application/json。
application/json
X-API-KEY
header
Required
string
PayCore API 身分驗證 Key。這不是金流商店金鑰。
pc_live_xxxxx
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
gateway_credentials
body
Required
object
PLUS appid / secret_key。
{"appid":"...","secret_key":"..."}
gateway_credentials fields
Field
Location
Required
Type
Description
Example
appid
gateway_credentials
Required
string
PLUS App ID。
PLUS_APPID
secret_key
gateway_credentials
Required
string
PLUS secret_key。
PLUS_SECRET_KEY
Request / Response examples
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"
}
}'
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();
Success response highlights
gateway=plus
balance
raw_response
Response fields
Field Type Description Example successbooleanWhether the request succeeded. truedata.gatewaystringGateway code. plusdata.balanceinteger|string|nullPLUS balance returned by the gateway. 10000messagestringPayCore response message. Gateway action completed
Success response example
{
"success": true,
"data": {
"gateway": "plus",
"balance": 10000,
"raw_response": {
"status": "ok"
}
},
"message": "Gateway action completed"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
Unsupported gateway action
Gateway action failed
Webhooks / Returns
GET
/{locale}/payment/plus/return/{paymentNo}
Copy full API URL
Parameters
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
paymentNo
path
Required
string
PayCore payment_no。
PAY202606220001ABCDEFGH
Request / Response examples
curl -X GET "https://api-core.cc/{locale}/payment/plus/return/{paymentNo}" \
-H "X-API-KEY: YOUR_PAYCORE_API_KEY"
Success response highlights
Response fields
Field Type Description Example HTTP statusintegerHTTP status code. SmilePay success uses 200. 200Content-TypestringResponse content type. SmilePay uses text/plain. application/jsonbodystring|objectGateway-required ACK or PayCore result page. {"success":true}
Success response example
{
"type": "html",
"description": "PayCore result page"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
Production ready
PLUS Webhook
接收 PLUS callback_url 回調。
POST
/api/paycore/webhooks/plus
Copy full API URL
Parameters
Path / Query / Body parameters
Field
Location
Required
Type
Description
Example
appid
body
Required
string
PLUS appid。
PLUS_APPID
money
body
Required
integer|string
回調金額,PayCore 會比對交易金額。
980
Request / Response examples
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"
}
}'
Success response highlights
Response fields
Field Type Description Example HTTP statusintegerHTTP status code. SmilePay success uses 200. 200Content-TypestringResponse content type. SmilePay uses text/plain. application/jsonbodystring|objectGateway-required ACK or PayCore result page. {"success":true}
Success response example
{
"success": true,
"message": "Webhook received"
}
Error response example
{
"success": false,
"message": "Validation failed",
"error": {
"error_code": "VALIDATION_FAILED",
"fields": {
"amount": [
"The amount field is required."
]
}
}
}
Errors and notes
PLUS appid mismatch.
PLUS money mismatch.
You have reached the end
Pico is here with you at the end.
Need to find another API, return to the catalog, or review the integration flow? Jump back to search or continue from the API catalog.