Skip to content

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"];
            /**
             * 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>;
        };
        /** ProductVariant */
}

Component References

ReferenceResolves To
components["schemas"]["NotificationPreferences"]NotificationPreferences
components["schemas"]["CustomerGroup"]CustomerGroup
components["schemas"]["Business"]Business

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",
    "customer_group",
    "customer_id",
    "business"
  ],
  "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"
        }
      ]
    },
    "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

Last updated: