Skip to main content
POST

Authorizations

Authorization
string
header
required

使用 Laravel Sanctum Token 進行認證。

Token 可在商家後台的「API 設定」頁面取得。

Headers

X-Idempotency-Key
string

冪等鍵(24 小時內有效)

Body

application/json
order_no
string
required

訂單編號(商家內唯一)

Example:

"ORD-20260109-001"

amount
string
required

訂單金額

Example:

"990.00"

customer_email
string<email>
required

客戶 Email(不存在會自動建立客戶)

status
enum<string>
default:pending

訂單狀態

Available options:
pending,
paid,
failed,
refunded,
cancelled
customer_name
string

客戶姓名(建立新客戶時使用)

currency
string
default:TWD

幣別,使用 ISO 4217 貨幣代碼。預設為 TWD(新台幣)。

常見幣別:

Example:

"TWD"

payment_method
enum<string>

付款方式。支援以下選項:

Available options:
credit_card,
atm,
cvs,
line_pay,
jkopay,
apple_pay
Example:

"credit_card"

billing_cycle
enum<string>

訂閱週期(影響 MRR 計算)

Available options:
monthly,
quarterly,
semi-annual,
yearly,
one-time
paid_at
string<date-time>

付款時間(若未提供且 status 為 paid,系統自動填入當前時間)

refunded_at
string<date-time>

退款時間(若未提供且 status 為 refunded,系統自動填入當前時間)

failed_at
string<date-time>

付款失敗時間(若未提供且 status 為 failed,系統自動填入當前時間)

metadata
object

自訂欄位

Response

訂單建立成功

data
object