Z Zise Developers 简体中文

Update merchant-side attributes (nickname and language)

PATCH /v1/members/{id} scope: members:write
Merchant account Requires x-idempotency-key

Only two fields can be changed: nickname and notify_lang. Other keys are ignored. If neither editable field is supplied, returns invalid_request; this is deliberate, because a successful no-change 200 would falsely suggest an update was applied.

Both fields are silently truncated rather than rejected: nickname to 60 characters, language code to 12. Read the returned values rather than assuming everything was stored exactly as submitted.

Email and external_member_id cannot be changed.

Path Parameters

FieldTypeRequiredDescription
id string Required external_member_id or mem_<uuid>.
FieldTypeRequiredDescription
x-idempotency-key string Required UUID v4

Request Body

FieldTypeRequiredDescription
nickname string Optional Display nickname. Silently truncated beyond 60 characters.
notify_lang string Optional Notification language code, such as zh-Hans / en. Silently truncated beyond 12 characters. We do not validate whether the language is supported; unrecognized values use the default notification language.

Response

200Updated; returns the complete row.
{
  "id": "mem_9f1c0c8e-6f2a-4c1d-9d0b-2a7e5b3f8c41",
  "external_member_id": "u-10086",
  "uid": "80031427",
  "email": "alice@example.com",
  "nickname": "Alice",
  "status": "normal",
  "kyc_level": 1,
  "created_at": "2026-08-12T09:30:00.000Z"
}
400invalid_request: body is not JSON or no editable field was supplied.
404member_not_found, including members belonging to another merchant.
409idempotency_key_reused · idempotency_in_progress
Request
curl -X PATCH 'https://api.zinfra.vip/v1/members/{id}' \
  -H 'x-auth-token: Bearer $TOKEN' \
  -H 'x-idempotency-key: $IDEMPOTENCY_KEY' \
  -H 'content-type: application/json' \
  -d '{
    "nickname": "Alice",
    "notify_lang": "zh-Hans"
  }'
const res = await fetch("https://api.zinfra.vip/v1/members/{id}", {
  method: "PATCH",
  headers: {
    "x-auth-token": "Bearer $TOKEN",
    "x-idempotency-key": "$IDEMPOTENCY_KEY",
    "content-type": "application/json",
  },
  body: JSON.stringify({
    "nickname": "Alice",
    "notify_lang": "zh-Hans"
  }),
});
// Keep monetary amounts as strings, never numbers.
const data = await res.json();
import requests

res = requests.patch(
    "https://api.zinfra.vip/v1/members/{id}",
    headers={
        "x-auth-token": "Bearer $TOKEN",
        "x-idempotency-key": "$IDEMPOTENCY_KEY",
        "content-type": "application/json",
    },
    json={
      "nickname": "Alice",
      "notify_lang": "zh-Hans"
    },
)
# Use Decimal(str(...)) for amounts, not float.
data = res.json()
req, _ := http.NewRequest("PATCH", "https://api.zinfra.vip/v1/members/{id}",
    strings.NewReader(`{
  "nickname": "Alice",
  "notify_lang": "zh-Hans"
}`))
req.Header.Set("x-auth-token", "Bearer $TOKEN")
req.Header.Set("x-idempotency-key", "$IDEMPOTENCY_KEY")
req.Header.Set("content-type", "application/json")
res, err := http.DefaultClient.Do(req)
// Decode amount fields as string, not float64.
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://api.zinfra.vip/v1/members/{id}"))
    .header("x-auth-token", "Bearer $TOKEN")
    .header("x-idempotency-key", "$IDEMPOTENCY_KEY")
    .header("content-type", "application/json")
    .method("PATCH", HttpRequest.BodyPublishers.ofString("""
{
  "nickname": "Alice",
  "notify_lang": "zh-Hans"
}
"""))
    .build();
// Use String / BigDecimal for amounts, not double.
$ch = curl_init('https://api.zinfra.vip/v1/members/{id}');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'x-auth-token: Bearer $TOKEN',
    'x-idempotency-key: $IDEMPOTENCY_KEY',
    'content-type: application/json',
  ],
  CURLOPT_POSTFIELDS => <<<'JSON'
{
  "nickname": "Alice",
  "notify_lang": "zh-Hans"
}
JSON,
]);
$res = curl_exec($ch);
// Use bcmath / strings for amounts, not floatval.
200
{
  "id": "mem_9f1c0c8e-6f2a-4c1d-9d0b-2a7e5b3f8c41",
  "external_member_id": "u-10086",
  "uid": "80031427",
  "email": "alice@example.com",
  "nickname": "Alice",
  "status": "normal",
  "kyc_level": 1,
  "created_at": "2026-08-12T09:30:00.000Z"
}