Skip to main content
POST
/
customers
curl --request POST \
  --url https://api.zangsho.com/v1/customers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "customer@example.com",
  "name": "王小明"
}
'
{
  "data": {
    "id": 123,
    "email": "customer@example.com",
    "name": "王小明",
    "phone": "0912345678",
    "metadata": {
      "source": "website"
    },
    "ltv": "0.00",
    "order_count": 0,
    "first_payment_at": null,
    "last_payment_at": null,
    "created_at": "2026-01-09T08:00:00Z",
    "updated_at": "2026-01-09T08:00:00Z"
  }
}

Authorizations

Authorization
string
header
required

使用 Laravel Sanctum Token 進行認證。

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

Body

application/json
email
string<email>
required

客戶 Email(商家內唯一)

Example:

"customer@example.com"

name
string

客戶姓名

Example:

"王小明"

phone
string

電話號碼

Example:

"0912345678"

external_id
string

外部系統 ID(方便整合)

Example:

"cus_abc123"

metadata
object

自訂欄位(JSON 格式)

Example:
{
"source": "website",
"campaign": "2026-q1"
}

Response

客戶建立成功

data
object