> ## Documentation Index
> Fetch the complete documentation index at: https://developer.fabric.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Create local user

> Create local user



## OpenAPI

````yaml identity_v1 post /api-commerceIdentity/user/local
openapi: 3.0.1
info:
  title: Authentication v1
  description: >-
    The fabric Identity API lets you manage users. You can create and update
    user names and addresses.  Users can log in to an application and can change
    or reset their passwords.
  version: 1.0.0
  contact:
    email: support@fabric.inc
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
servers:
  - url: https://{customerDomain}.fabric.zone
    variables:
      customerDomain:
        default: demo
security: []
tags:
  - name: User
    description: >-
      The User endpoints let you create local or guest users, update a user's
      user name, and get information about a specific user.
  - name: Address
    description: >-
      The Address endpoints let you create, delete, and update addresses, as
      well as get a list of addresses or address information.
  - name: Auth
    description: >-
      The Auth endpoints let the user log in and change or reset a password. You
      can also refresh a local user.
paths:
  /api-commerceIdentity/user/local:
    parameters:
      - name: x-site-context
        in: header
        description: >-
          The `x-site-context` header is a JSON object that contains information
          about the source you wish to pull from. The mandatory `account` is the
          24 character identifier found in Copilot. The `channel` (Sales channel
          ID), `stage` (environment name), and `date` attributes can be used to
          further narrow the scope of your data source.
        required: true
        schema:
          type: string
          example: >-
            {"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account":
            "1234abcd5678efgh9ijklmno","stage":"production"}
    post:
      tags:
        - User
      summary: Create local user
      description: Create local user
      operationId: createLocalUser
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLocalUser'
      responses:
        '200':
          $ref: '#/components/responses/sign-in'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateLocalUser:
      description: Request body for creating a local user
      type: object
      allOf:
        - type: object
          properties:
            user:
              $ref: '#/components/schemas/BaseUser'
        - type: object
          properties:
            provider:
              type: object
              properties:
                username:
                  description: Local user's name
                  type: string
                  example: user101
                password:
                  description: Local user's login password
                  type: string
                  example: ABC123
    BaseUser:
      description: User details
      type: object
      properties:
        name:
          description: User's full name
          type: object
          properties:
            first:
              description: User's first name
              type: string
              example: Pat
            middle:
              description: User's middle name
              type: string
              example: E
            last:
              description: User's last name
              type: string
              example: Kake
        phone:
          description: User's telephone numbers and details
          type: array
          items:
            type: object
            properties:
              number:
                description: Telephone number
                type: string
                example: 555-123-4567
              countryCode:
                description: Telephone country code
                type: string
                example: '+91'
              extenstion:
                description: Telephone number extension
                type: string
                example: x-6789
              kind:
                description: Phone type
                type: string
                example: Mobile
        email:
          description: User's email address
          type: string
          example: test@mail.com
        extra:
          description: Extra user details
          type: object
          additionalProperties: true
    SignInResponse:
      description: Sign-in response body
      type: object
      properties:
        _id:
          description: Response ID
          type: string
          example: 596f7557696e2d4d617a616c546f7621
        userId:
          description: User ID
          type: string
          example: 6169b2d892a5f30009d76480
        roles:
          description: User roles
          type: array
          example: customer
          items:
            type: string
        name:
          description: User's full name
          type: object
          example: Pat E Kake
          properties:
            first:
              description: User's first name
              type: string
              example: Pat
            middle:
              description: User's middle name
              type: string
              example: E
            last:
              description: User's last name
              type: string
              example: Kake
        account:
          description: Merchant account ID
          type: string
          example: xxxxxcxxxxxxxxxxxxxx
        userType:
          description: Type of user
          type: string
          example: customer
        accessToken:
          description: Access token
          type: string
          example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
        refreshToken:
          description: Refresh token
          type: string
          example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
    APIError:
      description: API error response
      type: object
      properties:
        error:
          description: Error condition
          type: string
          example: USER_NOT_FOUND
        code:
          description: Error code
          type: string
          example: '404'
        message:
          description: Error message
          type: string
          example: User not found
  responses:
    sign-in:
      description: Sign-in response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SignInResponse'
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIError'
          example:
            error: BAD_REQUEST
            code: '400'
            message: BAD_REQUEST
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIError'
          example:
            error: INTERNAL_SERVER_ERROR
            code: '500'
            message: Internal server error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````