> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/api-reference/member/partially-update-member-details.md).

# Partially update member details

Management\
\
Allows partial update of member's custom attributes (labels) and custom fields data.

**Two formats are supported:**

1. **New format (recommended):**
   * Labels as associative array (object with key-value pairs)
   * **Adding:** To add a new label, provide a new key with its value.
   * **Editing:** To update an existing label, provide its key with a new value.
   * **Removing:** To remove a label, provide its key and set the value to `null`.
   * Only provided labels will be updated, other labels remain unchanged.
2. **Legacy format (deprecated, will be removed soon):**
   * Labels as array of objects with `key` and `value` properties
   * **Replaces all existing labels** - use with caution!

**Member identifiers (`email`, `phone`, `loyaltyCardNumber`)** can also be partially updated. Only the identifiers present in the request are changed; all other member data is preserved. Editing identifiers is **admin-only** and is applied directly (no confirmation flow). A non-admin member sending any of these fields receives a `400` response. Members change their own `email`/`phone` (with the confirmation flow) via the PUT member endpoint instead.

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Member","description":"These endpoints allow you to easily manage members."}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\\\n`POST /api/{storeCode}/member/login_check` [Go to definition](#operation/memberLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nThere are two endpoints\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\\\nTo refresh member token `POST /api/{storeCode}/token/refresh` [Go to definition](#operation/tokenRefreshMember)\n","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}}},"responses":{"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"required":["code","message","errors"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"errors":{"type":"array","items":{"required":["message","parameters","plural","code","path"],"properties":{"message":{"type":"string"},"parameters":{},"plural":{"type":"integer","nullable":true},"code":{"type":"string"},"path":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}},"NotFound":{"description":"Not found.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}},"schemas":{"ExpiredToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"InvalidToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"Unauthorized":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}},"paths":{"/api/{storeCode}/member/{member}":{"patch":{"tags":["Member"],"summary":"Partially update member details","description":"<label style=\"background-color: #D4EDBC;padding:5px;\">Management</label><br><br>\nAllows partial update of member's custom attributes (labels) and custom fields data.\n\n**Two formats are supported:**\n\n1. **New format (recommended):**\n   * Labels as associative array (object with key-value pairs)\n   * **Adding:** To add a new label, provide a new key with its value.\n   * **Editing:** To update an existing label, provide its key with a new value.\n   * **Removing:** To remove a label, provide its key and set the value to `null`.\n   * Only provided labels will be updated, other labels remain unchanged.\n\n2. **Legacy format (deprecated, will be removed soon):**\n   * Labels as array of objects with `key` and `value` properties\n   * **Replaces all existing labels** - use with caution!\n\n\n**Member identifiers (`email`, `phone`, `loyaltyCardNumber`)** can also be partially updated. Only the identifiers present in the request are changed; all other member data is preserved. Editing identifiers is **admin-only** and is applied directly (no confirmation flow). A non-admin member sending any of these fields receives a `400` response. Members change their own `email`/`phone` (with the confirmation flow) via the [PUT member](#operation/_memberPut) endpoint instead.\n","operationId":"_memberPatch","parameters":[{"$ref":"#/components/parameters/storeCode"},{"name":"member","in":"path","required":true,"schema":{"type":"string","pattern":"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|email=[a-zA-Z0-9!#$%&'\\.*+\\-@=?^_`{|}~;]+|phone=[0-9+]+|loyaltyCardNumber=[0-9a-zA-Z\\._-]+"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"customer":{"properties":{"labels":{"oneOf":[{"description":"**New format (recommended)**\nAssociative array where keys are label names and values are label values.\nSet value to `null` to remove a label. Only provided labels will be updated.\n","type":"object","nullable":true,"additionalProperties":{"type":"string","nullable":true}},{"description":"**Legacy format (deprecated)** - Will be removed soon.\nArray of label objects. **WARNING: Replaces all existing labels!**\n","type":"array","nullable":true,"items":{"required":["key","value"],"properties":{"key":{"description":"Label key/name","type":"string"},"value":{"description":"Label value","type":"string"}},"type":"object"},"deprecated":true}]},"customFieldsData":{"description":"Custom fields data for member. Replaces all existing custom fields.","type":"array","items":{"required":["customFieldSchemaId","value"],"properties":{"customFieldSchemaId":{"description":"ID of the custom field schema","type":"string","format":"uuid"},"value":{"description":"Value for the custom field (validated against schema requirements)","type":"string"}},"type":"object"},"nullable":true},"customFields":{"description":"Custom field values (CustomField module), keyed by group then field. A field's value type depends on the field's configured `fieldType`: `text` (string), `integer`, `float`, `boolean`, `date` (`YYYY-MM-DD`), `datetime` (`YYYY-MM-DD HH:mm:ss.SSSSSS`), `single_select` (string, one value from a predefined list), `multi_select` (array of strings, one or more values from a predefined list), or `object_array` (array of objects, each containing the scalar sub-fields defined for that field). Partial merge: only submitted fields are updated, fields and groups omitted from the payload are left untouched, and a field set to `null` is cleared. Requires the `CUSTOM_FIELD_MEMBER` feature flag; ignored when disabled.","type":"object","nullable":true,"properties":{"group_1":{"description":"Example custom field group illustrating each supported field type. Actual group and field names are tenant-defined.","type":"object","nullable":true,"properties":{"field_1":{"description":"fieldType: text","type":"string"},"field_2":{"description":"fieldType: integer","type":"integer"},"field_3":{"description":"fieldType: float","type":"number"},"field_4":{"description":"fieldType: boolean","type":"boolean"},"field_5":{"description":"fieldType: date","type":"string"},"field_6":{"description":"fieldType: datetime","type":"string"},"field_7":{"description":"fieldType: text, cleared by setting to null","type":"string","nullable":true},"field_8":{"description":"fieldType: single_select","type":"string"},"field_9":{"description":"fieldType: multi_select","type":"array","items":{"type":"string"}},"subgroup_1":{"description":"fieldType: object_array","type":"array","nullable":true,"items":{"type":"object","properties":{"field_name1":{"type":"integer"},"field_name2":{"type":"number"},"field_name3":{"type":"boolean"}}}}}}},"additionalProperties":{"type":"object","additionalProperties":{}}},"email":{"description":"Member email. Admin-only. Applied directly (no confirmation flow). Sent by a non-admin member it yields a `400`.","type":"string","format":"email"},"phone":{"description":"Member phone. Admin-only. Applied directly (no confirmation flow). Sent by a non-admin member it yields a `400`.","type":"string"},"loyaltyCardNumber":{"description":"Member loyalty card number. Admin-only. Applied directly (no confirmation flow). Sent by a non-admin member it yields a `400`.","type":"string"}},"type":"object","additionalProperties":false}},"type":"object","additionalProperties":false}}}},"responses":{"200":{"description":"Member successfully updated","content":{"application/json":{"schema":{"properties":{"customerId":{"description":"Updated member identity","type":"string","format":"uuid"}},"type":"object"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ExpiredToken"},{"$ref":"#/components/schemas/InvalidToken"},{"$ref":"#/components/schemas/Unauthorized"}]}}}},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
````


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.openloyalty.io/api-reference/member/partially-update-member-details.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
