curl --request POST \
--url https://api.zangsho.com/v1/subscriptions/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subscriptions": [
{
"customer_id": 123,
"mrr": "990.00",
"billing_cycle": "monthly",
"started_at": "2023-11-07T05:31:56Z",
"current_period_start": "2023-11-07T05:31:56Z",
"plan_name": "Pro Plan"
}
],
"on_conflict": "skip"
}
'{
"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>"
}
]
}
}
}批次建立多筆訂閱。
api > inferredcurl --request POST \
--url https://api.zangsho.com/v1/subscriptions/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subscriptions": [
{
"customer_id": 123,
"mrr": "990.00",
"billing_cycle": "monthly",
"started_at": "2023-11-07T05:31:56Z",
"current_period_start": "2023-11-07T05:31:56Z",
"plan_name": "Pro Plan"
}
],
"on_conflict": "skip"
}
'{
"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