# Create Attribute

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/attributes/:
    post:
      summary: Create Attribute
      deprecated: false
      description: |-
        Add new product attributes for a certain Role.

        <Accordion title="🔑Scopes" defaultOpen>
            
          `products.read_write` - Products Read & Write
         
        </Accordion>
      operationId: post-new-attribute
      tags:
        - Default module/Apps/Merchant APIs/Products/Product Attributes
        - Product Attributes
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: false
          example: '{{Autherization}}'
          schema:
            type: string
        - name: Access-Token
          in: header
          description: ''
          required: false
          example: '{{Access-Token}}'
          schema:
            type: string
        - name: Store-Id
          in: header
          description: ''
          required: true
          example: '{{StoreId}}'
          schema:
            type: number
            examples:
              - 37213
        - name: Accept-Language
          in: header
          description: >-
            Preferred language for the response. Defaults to `en` if not
            specified.
          required: false
          example: en
          schema:
            type: string
            enum:
              - en
              - ar
            examples:
              - en
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: object
                  properties:
                    en:
                      type: string
                    ar:
                      type: string
                  x-apidog-orders:
                    - en
                    - ar
                  x-apidog-ignore-properties: []
              x-apidog-orders:
                - name
              x-apidog-ignore-properties: []
            example:
              name: Weight
              slug: weight
              is_extra: false
              is_enabled: true
              display_order: null
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                title: Product Attribute
                $ref: '#/components/schemas/AttributeObject'
              example:
                id: 6f637324-a016-4389-a397-44233a13692c
                name: Weight
                slug: weight
                presets: []
                is_extra: false
                is_enabled: true
                display_order: null
                preset_count: null
          headers: {}
          x-apidog-name: Created
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Response returned when the request cannot be authenticated
                  because the required credentials are missing, invalid, or
                  expired.
                properties:
                  status:
                    type: string
                    description: Indicates the overall status of the API response.
                    examples:
                      - error
                  message:
                    type: object
                    description: >-
                      Contains structured details explaining why the request
                      could not be authenticated.
                    properties:
                      type:
                        type: string
                        description: Indicates the category of the response message.
                        examples:
                          - error
                      code:
                        type: string
                        description: >-
                          A machine-readable code identifying the authentication
                          error. Returns null when no specific code is
                          available.
                        examples:
                          - UNAUTHORIZED
                        nullable: true
                      name:
                        type: string
                        description: >-
                          A short, human-readable title describing the
                          authentication error. Returns null when no title is
                          available.
                        examples:
                          - Unauthorized
                        nullable: true
                      description:
                        type: string
                        description: >-
                          A human-readable explanation of why the request could
                          not be authenticated. Returns null when no detailed
                          explanation is available.
                        examples:
                          - >-
                            Authentication credentials are missing, invalid, or
                            expired.
                        nullable: true
                    required:
                      - type
                      - code
                      - name
                      - description
                    x-apidog-orders:
                      - type
                      - code
                      - name
                      - description
                    x-apidog-ignore-properties: []
                required:
                  - status
                  - message
                x-apidog-orders:
                  - status
                  - message
                examples:
                  - status: error
                    message:
                      type: error
                      code: UNAUTHORIZED
                      name: Unauthorized
                      description: >-
                        Authentication credentials are missing, invalid, or
                        expired.
                x-apidog-ignore-properties: []
              examples:
                '2':
                  summary: Example 1
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_MISSING
                      name: Sorry
                      description: Please login first.
                '3':
                  summary: Example 2
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_INVALID
                      name: Sorry
                      description: Login session expired. Please login again.
                '4':
                  summary: Example 3
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_INVALID
                      name: Sorry
                      description: Invalid authentication
          headers: {}
          x-apidog-name: Unauthorized
        '500':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status of the error.
                  message:
                    $ref: '#/components/schemas/ResponseEnvelopMessage'
                required:
                  - status
                  - message
                x-apidog-orders:
                  - status
                  - message
                x-apidog-ignore-properties: []
              example:
                status: error
                message:
                  type: error
                  code: MSG_HIDDEN
                  name: Error
                  description: Internal Server Error
          headers: {}
          x-apidog-name: Internal Server error
      security: []
      x-apidog-folder: Default module/Apps/Merchant APIs/Products/Product Attributes
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/613905/apis/api-9148554-run
components:
  schemas:
    AttributeObject:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the product attribute.
          examples:
            - cfb5bd3f-bbc5-4439-a171-b2d70e1c0293
        name:
          type: string
          description: >-
            Display name of the product attribute shown to merchants and
            customers.
          examples:
            - Color
        slug:
          type: string
          description: URL-friendly unique key used to identify the attribute internally.
          examples:
            - color-6
        presets:
          type: array
          items:
            description: Attribute preset object.
            $ref: '#/components/schemas/AttributePresetObject'
          description: >-
            List of predefined selectable values for the attribute. Empty when
            no presets are defined.
          examples:
            - []
        is_extra:
          type: boolean
          description: >-
            Indicates whether the attribute is marked as an extra attribute and
            not a core product attribute.
          examples:
            - false
        is_enabled:
          type: boolean
          description: >-
            Determines whether the attribute is active and can be used in
            products.
          examples:
            - true
        display_order:
          type: integer
          description: >-
            Defines the order in which the attribute is displayed. Null means
            default ordering is applied.
          examples:
            - null
          nullable: true
        preset_count:
          type: integer
          description: Total number of presets associated with the attribute.
          examples:
            - 0
      required:
        - id
        - name
        - slug
        - presets
        - is_extra
        - is_enabled
        - display_order
        - preset_count
      x-apidog-orders:
        - id
        - name
        - slug
        - presets
        - is_extra
        - is_enabled
        - display_order
        - preset_count
      title: AttributeObject
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    AttributePresetObject:
      type: object
      properties:
        id:
          type: string
        slug:
          type: string
        name:
          type: string
        value:
          type: string
        type:
          type: string
        type_value:
          type: string
          nullable: true
        display_order:
          type: integer
          nullable: true
        attribute_image_id:
          type: string
          nullable: true
        attribute_id:
          type: string
      required:
        - id
        - slug
        - name
        - value
        - type
        - type_value
        - display_order
        - attribute_image_id
        - attribute_id
      x-apidog-orders:
        - id
        - slug
        - name
        - value
        - type
        - type_value
        - display_order
        - attribute_image_id
        - attribute_id
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ResponseEnvelopMessage:
      type: object
      properties:
        type:
          type: string
          description: Type of response message returned by the API.
          examples:
            - success
        code:
          type: string
          description: Response code returned by the API, if available.
          examples:
            - MSG_POPUP_OK
          nullable: true
        name:
          type: string
          description: Name or title of the response message, if available.
          examples:
            - Coupons
          nullable: true
        description:
          type: string
          description: Detailed description of the response message, if available.
          examples:
            - Coupons created successfully
          nullable: true
      required:
        - type
        - code
        - name
        - description
      description: Additional response metadata.
      x-apidog-orders:
        - type
        - code
        - name
        - description
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.zid.sa/
    description: Prod Env
security: []

```
