User
Type: schema
TypeScript Definition
typescript
User: {{
/** @description The unique ID of the user. */
id: $Read<string>;
/** @description User’s first name. */
first_name: string | null;
/** @description User’s last name. */
last_name: string | null;
/**
* Format: email
* @description User’s email I’d.
*/
email: string | null;
/** @description Boolean indicating whether the email is verified. */
is_email_verified: $Read<boolean>;
/** @description 10 digit phone number without country code. */
phone: string | null;
/**
* @description Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
* Use this key along with phone. Not necessary for email.
*/
country_code: string | null;
/** @description Boolean indicating whether the phone is verified. */
is_phone_verified: $Read<boolean>;
/** @description URL to the user's profile image. */
profile_image_url: $Read<string | null>;
/** @description Indicates whether the user is anonymous. */
is_anonymous: $Read<boolean>;
/** @description Indicates whether the user is currently logged in. */
is_logged_in: $Read<boolean>;
login_methods: ("email" | "phone" | "whatsapp" | "password")[];
/** @description User's notification preferences are categorized by transactional, promotional, and newsletter types. */
notification_preferences: components["schemas"]["NotificationPreferences"];
/** @description User's customer group ID. */
customer_group_id?: $Write<string | null>;
/** @description The unique ID of the customer. Can be used to identify the customer in the system. It can be different from the user ID if there are multiple users created for the same customer. */
customer_id?: $Read<string>;
/** @description User's customer group. */
customer_group?: $Read<null | components["schemas"]["CustomerGroup"]>;
/** @description User's business information. */
business?: null | components["schemas"]["Business"];
/** @description The customer's own data as key-value pairs, shared by all its users. In an update, each key sent is set, a key sent as `null` is removed, and keys not sent are kept; `null` or `{}` changes nothing. At most 50 keys and 16 KB as JSON. */
metadata?: {
[key: string]: unknown;
} | null;
/** @description Customer attribute values to set, as `PUT /auth/user/{id}/attributes` sets them, in the same change. Read them with `GET /auth/user/{id}/attributes`. */
attributes?: $Write<components["schemas"]["UserAttributeInput"][]>;
/** @description Whether this user is the primary user for its customer. */
is_primary?: $Read<boolean>;
/** @description KYC status of the customer. Only present on the user-detail/update response; `null` when not applicable. */
kyc_status?: $Read<string | null>;
/**
* Format: datetime
* @description Timestamps indicate when the user's account was created.
*/
created_at?: $Read<string>;
/**
* Format: datetime
* @description Timestamps indicating when the user account was last modified.
*/
modified_at?: $Read<string>;
};
/**
* UserAttributeInput
* @description A value to set for one attribute, named by its `attribute_id` or its `slug` (one of the two). Shoppers can set visible, active `custom` attributes that aren't `is_readonly`.
*/
}Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["NotificationPreferences"] | NotificationPreferences |
components["schemas"]["CustomerGroup"] | CustomerGroup |
components["schemas"]["Business"] | Business |
components["schemas"]["UserAttributeInput"] | UserAttributeInput |
OpenAPI Schema
json
{
"title": "User",
"type": "object",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/schemas/User",
"description": "API reference for the User schema"
},
"required": [
"id",
"first_name",
"last_name",
"email",
"is_email_verified",
"phone",
"country_code",
"is_phone_verified",
"profile_image_url",
"is_anonymous",
"is_logged_in",
"login_methods",
"notification_preferences"
],
"properties": {
"id": {
"description": "The unique ID of the user.",
"type": "string",
"readOnly": true
},
"first_name": {
"description": "User’s first name.",
"type": [
"string",
"null"
]
},
"last_name": {
"description": "User’s last name.",
"type": [
"string",
"null"
]
},
"email": {
"description": "User’s email I’d.",
"type": [
"string",
"null"
],
"format": "email"
},
"is_email_verified": {
"description": "Boolean indicating whether the email is verified.",
"type": "boolean",
"readOnly": true
},
"phone": {
"description": "10 digit phone number without country code.",
"type": [
"string",
"null"
]
},
"country_code": {
"description": "Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.\nUse this key along with phone. Not necessary for email.",
"type": [
"string",
"null"
]
},
"is_phone_verified": {
"description": "Boolean indicating whether the phone is verified.",
"type": "boolean",
"readOnly": true
},
"profile_image_url": {
"description": "URL to the user's profile image.",
"type": [
"string",
"null"
],
"readOnly": true
},
"is_anonymous": {
"description": "Indicates whether the user is anonymous.",
"type": "boolean",
"readOnly": true
},
"is_logged_in": {
"description": "Indicates whether the user is currently logged in.",
"type": "boolean",
"readOnly": true
},
"login_methods": {
"type": "array",
"items": {
"type": "string",
"enum": [
"email",
"phone",
"whatsapp",
"password"
]
}
},
"notification_preferences": {
"description": "User's notification preferences are categorized by transactional, promotional, and newsletter types.",
"$ref": "#/components/schemas/NotificationPreferences"
},
"customer_group_id": {
"description": "User's customer group ID.",
"type": [
"string",
"null"
],
"writeOnly": true
},
"customer_id": {
"description": "The unique ID of the customer. Can be used to identify the customer in the system. It can be different from the user ID if there are multiple users created for the same customer.",
"type": "string",
"readOnly": true
},
"customer_group": {
"description": "User's customer group.",
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/components/schemas/CustomerGroup"
}
],
"readOnly": true
},
"business": {
"description": "User's business information.",
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/components/schemas/Business"
}
]
},
"metadata": {
"description": "The customer's own data as key-value pairs, shared by all its users. In an update, each key sent is set, a key sent as `null` is removed, and keys not sent are kept; `null` or `{}` changes nothing. At most 50 keys and 16 KB as JSON.",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"attributes": {
"description": "Customer attribute values to set, as `PUT /auth/user/{id}/attributes` sets them, in the same change. Read them with `GET /auth/user/{id}/attributes`.",
"type": "array",
"items": {
"$ref": "#/components/schemas/UserAttributeInput"
},
"maxItems": 50,
"writeOnly": true
},
"is_primary": {
"description": "Whether this user is the primary user for its customer.",
"type": "boolean",
"readOnly": true
},
"kyc_status": {
"description": "KYC status of the customer. Only present on the user-detail/update response; `null` when not applicable.",
"type": [
"string",
"null"
],
"readOnly": true
},
"created_at": {
"description": "Timestamps indicate when the user's account was created.",
"type": "string",
"format": "datetime",
"readOnly": true
},
"modified_at": {
"description": "Timestamps indicating when the user account was last modified.",
"type": "string",
"format": "datetime",
"readOnly": true
}
}
}Auto-generated from OpenAPI spec and TypeScript definitions