PayCore PayCoreDeveloper Center

API catalog

Browse every verified API method by payment gateway.

This page lists only externally callable APIs that can be mapped to route, controller and driver code. Expand each gateway to view endpoints, parameters, gateway_credentials, responses, errors and test examples.

API CATALOG

PayCore public API catalog

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

Public docs show integration details only. Internal engineering names, file paths and database fields are not shown. Last updated:2026-06-23
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 authenticationX-API-KEY
2. gateway_credentialsGateway-specific merchant credentials
3. Create paymentPOST /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

Production ready
查詢付款

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

GET /api/paycore/payments/{paymentNo}
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
curl -X GET "https://api-core.cc/api/paycore/payments/{paymentNo}" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY"
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment transaction data
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.smilepay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringPayment status.pending|paid|failed|expired
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "smilepay",
        "method": "atm",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "bank_code": "809",
            "bank_name": "凱基銀行",
            "virtual_account": "8011773423689453",
            "expire_at": "2026-06-28 23:59:59"
        }
    },
    "message": "Payment found"
}
Error response example
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
Errors and notes
  • PAYMENT_NOT_FOUND
Production ready
同步付款狀態

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

POST /api/paycore/payments/{paymentNo}/sync
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
curl -X POST "https://api-core.cc/api/paycore/payments/{paymentNo}/sync" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{}'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • PaymentSyncResult + transaction data
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.smilepay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringPayment status.pending|paid|failed|expired
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "smilepay",
        "method": "atm",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "bank_code": "809",
            "bank_name": "凱基銀行",
            "virtual_account": "8011773423689453",
            "expire_at": "2026-06-28 23:59:59"
        }
    },
    "message": "Payment synced"
}
Error response example
JSON
{
    "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
Production ready
首頁收款概況

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

GET /api/paycore/home/overview
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
curl -X GET "https://api-core.cc/api/paycore/home/overview" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY"
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • today_amount
  • month_amount
  • recent_transactions
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "home",
        "method": "overview",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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

Production ready
建立綠界 AIO 付款

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

POST /api/paycore/pay/ecpay/aio
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
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/aio" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • merchant_order_no
  • gateway=ecpay
  • method=all
  • status=pending
  • payment_url
  • redirect_form
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "aio",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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,不等於付款成功。

Production ready
建立綠界 AIO 信用卡付款

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

POST /api/paycore/pay/ecpay/aio/credit
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
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/aio/credit" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • merchant_order_no
  • gateway=ecpay
  • method=credit
  • status=pending
  • payment_url
  • redirect_form
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "aio",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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 付款目前只接受 TWD。

Production ready
建立綠界 AIO ATM 導轉付款

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

POST /api/paycore/pay/ecpay/aio/atm
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
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/aio/atm" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • merchant_order_no
  • gateway=ecpay
  • method=atm
  • status=pending
  • payment_url
  • redirect_form
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "aio",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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 付款頁顯示取號資訊。

Production ready
建立綠界 AIO 超商代碼付款

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

POST /api/paycore/pay/ecpay/aio/cvs
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
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/aio/cvs" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • merchant_order_no
  • gateway=ecpay
  • method=cvs
  • status=pending
  • payment_url
  • redirect_form
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "aio",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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

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

Production ready
建立綠界 AIO 超商條碼付款

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

POST /api/paycore/pay/ecpay/aio/barcode
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
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/aio/barcode" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • merchant_order_no
  • gateway=ecpay
  • method=barcode
  • status=pending
  • payment_url
  • redirect_form
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.barcode
data.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.false
data.payment_info.*.barcode_intro_urlstring|nullGateway-specific official barcode payment intro URL. ECPay shows ECPay; SmilePay shows SmilePay.https://...
Success response example
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "barcode",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "ecpay": {
                "selected_payment_method": "barcode",
                "barcode1": "150630A1F",
                "barcode2": "6763618191673429",
                "barcode3": "00000980000000000000",
                "barcode_user_copy_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
                "barcode_segments_copyable": false,
                "barcode_user_action": "copy_payment_page_url_and_scan_rendered_barcodes",
                "barcode_intro_url": "https://www.ecpay.com.tw/introcvs",
                "expire_at": "2026-06-28 23:59:59"
            }
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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

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

Production ready
建立綠界 ATM 背景取號

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

POST /api/paycore/pay/ecpay/atm
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
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/atm" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • bank_code
  • virtual_account
  • expire_at
  • payment_url
  • status=pending
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "bg",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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

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

Production ready
建立綠界超商代碼背景取號

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

POST /api/paycore/pay/ecpay/cvs
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
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/cvs" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • payment_code
  • payment_code_url
  • expire_at
  • payment_url
  • status=pending
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "bg",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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

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

Production ready
建立綠界超商條碼背景取號

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

POST /api/paycore/pay/ecpay/barcode
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
curl -X POST "https://api-core.cc/api/paycore/pay/ecpay/barcode" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "merchant_id": "YOUR_ECPAY_MERCHANT_ID",
      "hash_key": "YOUR_HASH_KEY",
      "hash_iv": "YOUR_HASH_IV",
      "environment": "stage"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • barcode1
  • barcode2
  • barcode3
  • expire_at
  • payment_url
  • status=pending
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.barcode
data.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.false
data.payment_info.*.barcode_intro_urlstring|nullGateway-specific official barcode payment intro URL. ECPay shows ECPay; SmilePay shows SmilePay.https://...
Success response example
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "ecpay",
        "method": "barcode",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "ecpay": {
                "selected_payment_method": "barcode",
                "barcode1": "150630A1F",
                "barcode2": "6763618191673429",
                "barcode3": "00000980000000000000",
                "barcode_user_copy_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
                "barcode_segments_copyable": false,
                "barcode_user_action": "copy_payment_page_url_and_scan_rendered_barcodes",
                "barcode_intro_url": "https://www.ecpay.com.tw/introcvs",
                "expire_at": "2026-06-28 23:59:59"
            }
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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

Production ready
綠界 ReturnURL / PaymentInfoURL / 背景取號通知接收

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

POST /api/paycore/webhooks/ecpay
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
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
  • 1|OK
Response fields
FieldTypeDescriptionExample
HTTP statusintegerHTTP status code. SmilePay success uses 200.200
Content-TypestringResponse content type. SmilePay uses text/plain.application/json
bodystring|objectGateway-required ACK or PayCore result page.{"success":true}
Success response example
JSON
{
    "success": true,
    "message": "Webhook received"
}
Error response example
JSON
{
    "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

Production ready
建立速買配 ATM 虛擬帳號

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

POST /api/paycore/pay/smilepay/atm
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
curl -X POST "https://api-core.cc/api/paycore/pay/smilepay/atm" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "dcvc": "YOUR_SMILEPAY_DCVC",
      "rvg2c": "1",
      "verify_key": "YOUR_VERIFY_KEY"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • SmilePayNO
  • AtmBankNo
  • AtmNo
  • PayEndDate
  • status
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "smilepay",
        "method": "atm",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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 一致。

Production ready
建立速買配超商代碼付款

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

POST /api/paycore/pay/smilepay/cvs
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
curl -X POST "https://api-core.cc/api/paycore/pay/smilepay/cvs" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "cvs_type": "ibon",
    "gateway_credentials": {
      "dcvc": "YOUR_SMILEPAY_DCVC",
      "rvg2c": "1",
      "verify_key": "YOUR_VERIFY_KEY"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • SmilePayNO
  • payment_code
  • PayEndDate
  • status
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "smilepay",
        "method": "cvs",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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.

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

Production ready
建立速買配超商條碼付款

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

POST /api/paycore/pay/smilepay/barcode
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
curl -X POST "https://api-core.cc/api/paycore/pay/smilepay/barcode" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "dcvc": "YOUR_SMILEPAY_DCVC",
      "rvg2c": "1",
      "verify_key": "YOUR_VERIFY_KEY"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • SmilePayNO
  • barcode1
  • barcode2
  • barcode3
  • barcode_user_copy_url
  • barcode_intro_url
  • PayEndDate
  • status
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.gatewaystringGateway code.smilepay
data.methodstringPayment method.barcode
data.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.false
data.payment_info.*.barcode_intro_urlstring|nullGateway-specific official barcode payment intro URL. ECPay shows ECPay; SmilePay shows SmilePay.https://...
Success response example
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "smilepay",
        "method": "barcode",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "smilepay": {
                "selected_payment_method": "barcode",
                "barcode1": "150630A1F",
                "barcode2": "6763618191673429",
                "barcode3": "00000980000000000000",
                "barcode_user_copy_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
                "barcode_segments_copyable": false,
                "barcode_user_action": "copy_payment_page_url_and_scan_rendered_barcodes",
                "barcode_intro_url": "https://www.smilepay.net/es/index_gz_index.asp",
                "expire_at": "2026-06-28 23:59:59"
            }
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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

Production ready
速買配 Roturl 背景通知

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

POST /api/paycore/webhooks/smilepay
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
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
FieldTypeDescriptionExample
HTTP statusintegerHTTP status code. SmilePay success uses 200.200
Content-TypestringResponse content type. SmilePay uses text/plain.text/plain
bodystring|objectGateway-required ACK or PayCore result page.OK
Success response example
text/plain
HTTP/1.1 200 OK
Content-Type: text/plain; charset=UTF-8

OK
Error response example
JSON
{
    "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

Production ready
建立 PayPal Checkout

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

POST /api/paycore/pay/paypal/checkout
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
curl -X POST "https://api-core.cc/api/paycore/pay/paypal/checkout" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "client_id": "PAYPAL_CLIENT_ID",
      "client_secret": "PAYPAL_CLIENT_SECRET",
      "webhook_id": "PAYPAL_WEBHOOK_ID",
      "environment": "sandbox"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • payment_url / approval_url
  • status
  • created
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "paypal",
        "method": "checkout",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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

Production ready
PayPal Return Capture

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

GET /{locale}/payment/paypal/return/{paymentNo}
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
curl -X GET "https://api-core.cc/{locale}/payment/paypal/return/{paymentNo}" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY"
Success response highlights
  • PayCore result page
Response fields
FieldTypeDescriptionExample
HTTP statusintegerHTTP status code. SmilePay success uses 200.200
Content-TypestringResponse content type. SmilePay uses text/plain.application/json
bodystring|objectGateway-required ACK or PayCore result page.{"success":true}
Success response example
JSON
{
    "type": "html",
    "description": "PayCore result page"
}
Error response example
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
Errors and notes
  • PayPal capture failed
Production ready
PayPal Webhook

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

POST /api/paycore/webhooks/paypal
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
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
  • JSON ack
Response fields
FieldTypeDescriptionExample
HTTP statusintegerHTTP status code. SmilePay success uses 200.200
Content-TypestringResponse content type. SmilePay uses text/plain.application/json
bodystring|objectGateway-required ACK or PayCore result page.{"success":true}
Success response example
JSON
{
    "success": true,
    "message": "Webhook received"
}
Error response example
JSON
{
    "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

Production ready
建立 Stripe 信用卡付款

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

POST /api/paycore/pay/stripe/credit
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
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/credit" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=card
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "credit",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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
Production ready
建立 Stripe 支付寶付款(中國)

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

POST /api/paycore/pay/stripe/alipay
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
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/alipay" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=alipay
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "alipay",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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 仍可能拒絕建立。

Production ready
建立 Stripe 微信支付付款(中國)

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

POST /api/paycore/pay/stripe/wechat-pay
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
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/wechat-pay" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=wechat_pay
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "wechat",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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。

Production ready
建立 Stripe GrabPay 付款(新加坡/馬來西亞)

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

POST /api/paycore/pay/stripe/grabpay
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
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/grabpay" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=grabpay
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "grabpay",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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

目前限制幣別:SGD、MYR。

Production ready
建立 Stripe PayNow 付款(新加坡)

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

POST /api/paycore/pay/stripe/paynow
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
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/paynow" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=paynow
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "paynow",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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

PayNow 目前限制幣別:SGD。

Production ready
建立 Stripe PromptPay 付款(泰國)

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

POST /api/paycore/pay/stripe/promptpay
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
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/promptpay" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=promptpay
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "promptpay",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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

PromptPay 目前限制幣別:THB。

Production ready
建立 Stripe FPX 付款(馬來西亞)

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

POST /api/paycore/pay/stripe/fpx
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
curl -X POST "https://api-core.cc/api/paycore/pay/stripe/fpx" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "secret_key": "sk_test_xxxxx",
      "publishable_key": "pk_test_xxxxx",
      "webhook_secret": "whsec_xxxxx"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • payment_url
  • status
  • payment_info.stripe_payment_method=fpx
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "stripe",
        "method": "fpx",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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

Production ready
Stripe Webhook

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

POST /api/paycore/webhooks/stripe
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
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
  • JSON ack
Response fields
FieldTypeDescriptionExample
HTTP statusintegerHTTP status code. SmilePay success uses 200.200
Content-TypestringResponse content type. SmilePay uses text/plain.application/json
bodystring|objectGateway-required ACK or PayCore result page.{"success":true}
Success response example
JSON
{
    "success": true,
    "message": "Webhook received"
}
Error response example
JSON
{
    "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

Production ready
建立 PLUS ATM 付款

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

POST /api/paycore/pay/plus/atm
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
curl -X POST "https://api-core.cc/api/paycore/pay/plus/atm" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "merchant_order_no": "ORDER202606220001",
    "amount": 980,
    "currency": "TWD",
    "description": "PayCore test order",
    "success_url": "https://merchant.example/success",
    "cancel_url": "https://merchant.example/cancel",
    "payok_url": "https://merchant.example/payok",
    "gateway_credentials": {
      "appid": "PLUS_APPID",
      "secret_key": "PLUS_SECRET_KEY"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • payment_no
  • payment_url
  • account_code
  • plat_no
  • status
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.payment_nostringPayCore payment number.PAY202606220001ABCDEFGH
data.merchant_order_nostringMerchant order number.ORDER202606220001
data.gatewaystringGateway code.ecpay
data.methodstringPayment method.atm
data.amountintegerTransaction amount.980
data.currencystringCurrency.TWD
data.statusstringStatus after creation. Offline payments are usually pending.pending
data.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
JSON
{
    "success": true,
    "data": {
        "payment_no": "PAY202606220001ABCDEFGH",
        "merchant_order_no": "ORDER202606220001",
        "gateway": "plus",
        "method": "atm",
        "amount": 980,
        "currency": "TWD",
        "status": "pending",
        "payment_url": "https://pay-core.app/zh-tw/pay/PAY202606220001ABCDEFGH?token=...",
        "payment_info": {
            "payment_code": "A12345678901234",
            "expire_at": "2026-06-28 23:59:59"
        },
        "created": true
    },
    "message": "Payment created successfully"
}
Error response example
JSON
{
    "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.
Production ready
查詢 PLUS 餘額

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

POST /api/paycore/gateways/plus/balance
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
curl -X POST "https://api-core.cc/api/paycore/gateways/plus/balance" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY" \
  -d '{
    "gateway_credentials": {
      "appid": "PLUS_APPID",
      "secret_key": "PLUS_SECRET_KEY"
    }
  }'
Laravel
use Illuminate\Support\Facades\Http;

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

return $response->json();
Success response highlights
  • gateway=plus
  • balance
  • raw_response
Response fields
FieldTypeDescriptionExample
successbooleanWhether the request succeeded.true
data.gatewaystringGateway code.plus
data.balanceinteger|string|nullPLUS balance returned by the gateway.10000
messagestringPayCore response message.Gateway action completed
Success response example
JSON
{
    "success": true,
    "data": {
        "gateway": "plus",
        "balance": 10000,
        "raw_response": {
            "status": "ok"
        }
    },
    "message": "Gateway action completed"
}
Error response example
JSON
{
    "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

Production ready
PLUS Return 頁

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

GET /{locale}/payment/plus/return/{paymentNo}
Parameters
Path / Query / Body parameters
Field Location Required Type Description Example
paymentNo path Required string PayCore payment_no。 PAY202606220001ABCDEFGH
Request / Response examples
cURL
curl -X GET "https://api-core.cc/{locale}/payment/plus/return/{paymentNo}" \
  -H "X-API-KEY: YOUR_PAYCORE_API_KEY"
Success response highlights
  • PayCore PLUS return page
Response fields
FieldTypeDescriptionExample
HTTP statusintegerHTTP status code. SmilePay success uses 200.200
Content-TypestringResponse content type. SmilePay uses text/plain.application/json
bodystring|objectGateway-required ACK or PayCore result page.{"success":true}
Success response example
JSON
{
    "type": "html",
    "description": "PayCore result page"
}
Error response example
JSON
{
    "success": false,
    "message": "Validation failed",
    "error": {
        "error_code": "VALIDATION_FAILED",
        "fields": {
            "amount": [
                "The amount field is required."
            ]
        }
    }
}
Errors and notes
  • Payment not found
Production ready
PLUS Webhook

接收 PLUS callback_url 回調。

POST /api/paycore/webhooks/plus
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
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
  • JSON ack
Response fields
FieldTypeDescriptionExample
HTTP statusintegerHTTP status code. SmilePay success uses 200.200
Content-TypestringResponse content type. SmilePay uses text/plain.application/json
bodystring|objectGateway-required ACK or PayCore result page.{"success":true}
Success response example
JSON
{
    "success": true,
    "message": "Webhook received"
}
Error response example
JSON
{
    "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.

PayCore開発者センターは公開されています。Direct Gateway API、All-in-One決済プロジェクト、Webhook、エラーコード例を順次追加します。