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

# Update Attribute

> Update Attribute



## OpenAPI

````yaml patch /v1/attributes/{attribute_id}
openapi: 3.0.0
info:
  description: Open API's for WizCommerce API's
  title: WizCommerce Open API's
  termsOfService: https://wizcommerce.com/terms/
  contact:
    name: Tech Support
    url: https://help.wizcommerce.com/
    email: tech@wizcommerce.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: '1.0'
servers:
  - url: https://api.wizcommerce.com
    description: Production BaseURL
  - url: https://api-staging.sourcerer.tech
    description: Staging BaseURL
security: []
paths:
  /v1/attributes/{attribute_id}:
    patch:
      tags:
        - Attributes
      summary: Update Attribute
      description: Update Attribute
      parameters:
        - description: Attribute ID
          name: attribute_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/attribute.AttributeUpdateRequest'
        description: request
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/dtos.SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/attribute.AttributeResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    attribute.AttributeUpdateRequest:
      type: object
      required:
        - entity
      properties:
        configuration:
          $ref: '#/components/schemas/attribute.UnifiedAttributeConfig'
        entity:
          type: string
          enum:
            - customer
            - product
            - address
            - contact
            - order
        is_mandatory:
          type: boolean
          example: true
        name:
          type: string
          example: Customer Type
        priority:
          type: integer
          example: 1
    dtos.SuccessResponse:
      type: object
      properties:
        data:
          x-order: '1'
    attribute.AttributeResponse:
      type: object
      properties:
        id:
          description: UUID
          type: string
          x-order: '1'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        name:
          type: string
          x-order: '2'
          example: Color
        entity:
          type: string
          x-order: '3'
          example: customer
        data_type:
          type: string
          x-order: '4'
          example: select
        options:
          description: Only for select and multiple select attributes
          type: array
          items:
            type: string
          x-order: '5'
          example:
            - Red
            - Blue
            - Green
        created_at:
          type: string
          x-order: '6'
          example: '2021-01-01T00:00:00Z'
        updated_at:
          type: string
          x-order: '7'
          example: '2021-01-01T00:00:00Z'
    errors.HttpError:
      type: object
      properties:
        code:
          type: string
          x-order: '1'
        message:
          type: string
          x-order: '2'
        details:
          type: array
          items:
            $ref: '#/components/schemas/errors.HttpErrorDetails'
          x-order: '3'
    attribute.UnifiedAttributeConfig:
      type: object
      properties:
        default_value: {}
        options:
          type: array
          items:
            $ref: '#/components/schemas/attribute.Option'
        show_label:
          type: boolean
          example: true
    errors.HttpErrorDetails:
      type: object
      properties:
        field:
          type: string
          x-order: '1'
        reason:
          type: string
          x-order: '2'
    attribute.Option:
      type: object
      required:
        - label
        - value
      properties:
        label:
          type: string
          example: Cotton
        value:
          type: string
          example: cotton
  securitySchemes:
    ApiKeyAuth:
      description: API Key for authentication
      type: apiKey
      name: X-API-Key
      in: header

````