● 客户 · /v1

客户

把商户侧用户映射成 Baton 客户,用于绑卡复用、风控画像与争议举证。

创建客户

POST /v1/customers

请求头

Idempotency-Key必填 string 商户生成的唯一串(建议 UUID/ULID)。24 小时内重放同一 key 返回首次结果,不会产生第二笔。

请求体

reference_id必填 string
email string
phone string
name string
country string

响应 201

uid string
reference_id string 你系统里的用户 ID
email string
phone string
name string
country string
created_at string<date-time>
请求
curl -X POST https://api.baton.example/v1/customers \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Idempotency-Key: 01J8ZQ4T7M2K9F3B" \
  -H "X-Timestamp: 1763280000" -H "X-Nonce: 7f3a" -H "X-Signature: v1=..." \
  -H "Content-Type: application/json" \
  -d '{
  "reference_id": "user_90213",
  "email": "[email protected]",
  "country": "US"
}'

查询客户

GET /v1/customers/{uid}

路径参数

uid必填 string

响应 200

uid string
reference_id string 你系统里的用户 ID
email string
phone string
name string
country string
created_at string<date-time>
请求
curl -X GET https://api.baton.example/v1/customers/{uid} \
  -H "Authorization: Bearer sk_live_xxx"

更新客户

POST /v1/customers/{uid}/update

路径参数

uid必填 string

请求体

email string
phone string
name string
country string

响应 200

uid string
reference_id string 你系统里的用户 ID
email string
phone string
name string
country string
created_at string<date-time>
请求
curl -X POST https://api.baton.example/v1/customers/{uid}/update \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "X-Timestamp: 1763280000" -H "X-Nonce: 7f3a" -H "X-Signature: v1=..." \
  -H "Content-Type: application/json" \
  -d '{
  "email": "[email protected]"
}'