Skip to content

UpdateUserRequest ​

Type: schema

Description ​

Updates only the supplied fields. Only a primary user can change business or customer_group_id.

TypeScript Definition ​

typescript
UpdateUserRequest: {{
            first_name?: string | null;
            last_name?: string | null;
            /** @description Phone number, or null to remove it while keeping an email address. Formatting and an Indian +91 prefix are removed, along with leading zeros; the resulting number must have exactly 10 digits. */
            phone?: string | null;
            /** Format: email */
            email?: string | null;
            country_code?: string | null;
            customer_group_id?: string | null;
            business?: {
                type?: string | null;
                name?: string | null;
                /** @description Replaces the entire customer metadata object; omitted keys are removed. null clears the metadata and {} replaces it with an empty object. Only the primary user may use this field. Send either this field or top-level metadata, which merges keys instead. */
                metadata?: {
                    [key: string]: unknown;
                } | null;
                registered_address?: components["schemas"]["UpdateBusinessAddress"] | null;
            } | null;
            /** @description Customer metadata shared by all users of the customer. Each supplied key is set, a key whose value is null is removed, and omitted keys are kept. null or {} changes nothing. The resulting metadata may contain at most 50 keys and 16 KB as JSON. Send either this field or business.metadata. */
            metadata?: {
                [key: string]: unknown;
            } | null;
            attributes?: components["schemas"]["UserAttribute"][];
            notification_preferences?: {
                transactional?: {
                    email?: boolean;
                    sms?: boolean;
                    whatsapp?: boolean;
                };
                promotional?: {
                    email?: boolean;
                    sms?: boolean;
                    whatsapp?: boolean;
                };
                newsletter?: {
                    email?: boolean;
                    sms?: boolean;
                    whatsapp?: boolean;
                };
            };
        };
        /**
         * UpiPayment
         * @description UPI Payment
         */
}

Component References ​

ReferenceResolves To
components["schemas"]["UpdateBusinessAddress"]UpdateBusinessAddress
components["schemas"]["UserAttribute"]UserAttribute

OpenAPI Schema ​

json
{
  "description": "Updates only the supplied fields. Only a primary user can change `business` or `customer_group_id`.",
  "type": "object",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/UpdateUserRequest",
    "description": "API reference for the UpdateUserRequest schema"
  },
  "properties": {
    "first_name": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 255,
      "minLength": 1,
      "pattern": "\\S"
    },
    "last_name": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 255,
      "minLength": 1,
      "pattern": "\\S"
    },
    "phone": {
      "description": "Phone number, or null to remove it while keeping an email address. Formatting and an Indian +91 prefix are removed, along with leading zeros; the resulting number must have exactly 10 digits.",
      "type": [
        "string",
        "null"
      ],
      "minLength": 1
    },
    "email": {
      "type": [
        "string",
        "null"
      ],
      "format": "email"
    },
    "country_code": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^\\+?\\d{1,4}$"
    },
    "customer_group_id": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "pattern": "\\S"
    },
    "business": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "type": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 128,
          "minLength": 1,
          "pattern": "\\S"
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 128,
          "minLength": 1,
          "pattern": "\\S"
        },
        "metadata": {
          "description": "Replaces the entire customer metadata object; omitted keys are removed. null clears the metadata and {} replaces it with an empty object. Only the primary user may use this field. Send either this field or top-level metadata, which merges keys instead.",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "registered_address": {
          "anyOf": [
            {
              "$ref": "#/components/schemas/UpdateBusinessAddress"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "metadata": {
      "description": "Customer metadata shared by all users of the customer. Each supplied key is set, a key whose value is null is removed, and omitted keys are kept. null or {} changes nothing. The resulting metadata may contain at most 50 keys and 16 KB as JSON. Send either this field or business.metadata.",
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true
    },
    "attributes": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/UserAttribute"
      },
      "maxItems": 50
    },
    "notification_preferences": {
      "type": "object",
      "properties": {
        "transactional": {
          "type": "object",
          "properties": {
            "email": {
              "type": "boolean"
            },
            "sms": {
              "type": "boolean"
            },
            "whatsapp": {
              "type": "boolean"
            }
          }
        },
        "promotional": {
          "type": "object",
          "properties": {
            "email": {
              "type": "boolean"
            },
            "sms": {
              "type": "boolean"
            },
            "whatsapp": {
              "type": "boolean"
            }
          }
        },
        "newsletter": {
          "type": "object",
          "properties": {
            "email": {
              "type": "boolean"
            },
            "sms": {
              "type": "boolean"
            },
            "whatsapp": {
              "type": "boolean"
            }
          }
        }
      }
    }
  }
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: