curl --request POST \
--url https://api.zangsho.com/v1/orders/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"orders": [
{
"order_no": "ORD-001",
"amount": "990.00",
"status": "paid",
"customer_email": "user1@example.com",
"currency": "TWD",
"payment_method": "credit_card",
"billing_cycle": "monthly",
"paid_at": "2026-01-01T00:00:00Z"
},
{
"order_no": "ORD-002",
"amount": "1990.00",
"status": "paid",
"customer_email": "user2@example.com",
"currency": "TWD",
"payment_method": "atm",
"billing_cycle": "yearly",
"paid_at": "2026-01-05T10:30:00Z"
},
{
"order_no": "ORD-003",
"amount": "599.00",
"status": "paid",
"customer_email": "user3@example.com",
"currency": "TWD",
"payment_method": "line_pay",
"billing_cycle": "monthly",
"paid_at": "2026-01-10T08:00:00Z"
},
{
"order_no": "ORD-004",
"amount": "3500.00",
"status": "paid",
"customer_email": "user4@example.com",
"currency": "TWD",
"payment_method": "cvs",
"billing_cycle": "one-time",
"paid_at": "2026-01-12T16:45:00Z"
}
]
}
'{
"data": {
"total": 123,
"created": 123,
"updated": 123,
"skipped": 123,
"failed": 123,
"results": {
"created": [
{
"index": 123,
"id": 123,
"identifier": "<string>"
}
],
"updated": [
{
"index": 123,
"id": 123,
"identifier": "<string>"
}
],
"skipped": [
{
"index": 123,
"reason": "duplicate_email",
"identifier": "<string>"
}
],
"failed": [
{
"index": 123,
"reason": "validation_error",
"message": "<string>",
"identifier": "<string>"
}
]
}
}
}批次建立多筆訂單,適合匯入歷史資料。
order_no 已存在時,只更新非空欄位curl --request POST \
--url https://api.zangsho.com/v1/orders/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"orders": [
{
"order_no": "ORD-001",
"amount": "990.00",
"status": "paid",
"customer_email": "user1@example.com",
"currency": "TWD",
"payment_method": "credit_card",
"billing_cycle": "monthly",
"paid_at": "2026-01-01T00:00:00Z"
},
{
"order_no": "ORD-002",
"amount": "1990.00",
"status": "paid",
"customer_email": "user2@example.com",
"currency": "TWD",
"payment_method": "atm",
"billing_cycle": "yearly",
"paid_at": "2026-01-05T10:30:00Z"
},
{
"order_no": "ORD-003",
"amount": "599.00",
"status": "paid",
"customer_email": "user3@example.com",
"currency": "TWD",
"payment_method": "line_pay",
"billing_cycle": "monthly",
"paid_at": "2026-01-10T08:00:00Z"
},
{
"order_no": "ORD-004",
"amount": "3500.00",
"status": "paid",
"customer_email": "user4@example.com",
"currency": "TWD",
"payment_method": "cvs",
"billing_cycle": "one-time",
"paid_at": "2026-01-12T16:45:00Z"
}
]
}
'{
"data": {
"total": 123,
"created": 123,
"updated": 123,
"skipped": 123,
"failed": 123,
"results": {
"created": [
{
"index": 123,
"id": 123,
"identifier": "<string>"
}
],
"updated": [
{
"index": 123,
"id": 123,
"identifier": "<string>"
}
],
"skipped": [
{
"index": 123,
"reason": "duplicate_email",
"identifier": "<string>"
}
],
"failed": [
{
"index": 123,
"reason": "validation_error",
"message": "<string>",
"identifier": "<string>"
}
]
}
}
}使用 Laravel Sanctum Token 進行認證。
Token 可在商家後台的「API 設定」頁面取得。
批次匯入結果
Show child attributes