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

# Add Product Attribute

> Create a new attribute. The attribute name, attribute type, input type, and data type are required. This current version of the Attributes API includes localizedContent to support <a href="/pages/catalog-structure#multi-locale-catalogs">multi-locale catalogs</a>, which was not present in the previous API model. If you were a client prior to May 2024 and have upgraded your implementation to support this feature, you can still access attribute data that has not yet been rewritten to the new model by providing an x-api-version header set to "1".



## OpenAPI

````yaml /openapi/openapi_catalog_admin.json post /commerce/catalog/admin/attributedefinition/attributes
openapi: 3.0.1
info:
  description: |-
    <div id="overview_CATALOG_ADMIN">
                <h2>CATALOG ADMINISTRATION</h2>
                <p>The Catalog Administration APIs are a collection of resources for configuring the catalogs and products offered to your shoppers, including
                    discounts and coupon sets, faceting, price lists, and different types or variations of products. See the
                    <a href="/concept-guides/catalog">Catalog user guides</a>
                    for information about the related features in the Unified Commerce Admin.</p>
                <p>Use the <strong>Attributes</strong> resource to manage localization and attribute configurations for your catalogs. This current version of the Attributes API includes localizedContent to
                    support <a href="/pages/catalog-structure#multi-locale-catalogs">multi-locale catalogs</a>, which was not present in the legacy API model. If
                    you were a client prior to May 2024 and have upgraded your implementation to support this feature,
                    you can still access attribute data that has not yet been rewritten to the new model by providing
                    an x-api-version header set to "1". </p>
                <p>Use the <strong>Categories</strong> resource to organize products and control where they appear on the storefront. Create
                    and maintain a hierarchy of categories and subcategories where the site will store properties. This current version of the Categories API includes localizedContent to
                    support <a href="/pages/catalog-structure#multi-locale-catalogs">multi-locale catalogs</a>, which was not present in the legacy API model. If
                    you were a client prior to May 2024 and have upgraded your implementation to support this feature,
                    you can still access category data that has not yet been rewritten to the new model by providing
                    an x-api-version header set to "1". </p>
                <p>Use the <strong>Coupon Sets</strong> resource to view and create coupon sets. You can use coupon sets to group multiple
                    coupon codes together and associate them with one or more discounts.</p>
                <p>Use the <strong>Currency</strong> resource to manage the currency localization rules and exchange rates for any of the
                    currencies that are supported for placing orders in.</p>
                <p>Use the <strong>Discounts</strong> and <strong>Discount Settings</strong> resources to define and manage discounts to apply to products, product categories, or
                    orders. This current version of the Discounts API includes localizedContent to
                    support <a href="/pages/catalog-structure#multi-locale-catalogs">multi-locale catalogs</a>, which was not present in the legacy Products API model. If
                    you were a client prior to May 2024 and have upgraded your implementation to support this feature,
                    you can still access discount data that has not yet been rewritten to the new model by providing
                    an x-api-version header set to "1". </p>
                <p>Use the <strong>Facets</strong> resource to manage the facets shoppers use to filter product display results on a
                    storefront. Facets can include categories, product attributes, or prices, and use either a range of
                    values or discrete values.</p>
                <p>Use the <strong>Master Catalog</strong> resource to view details of the master catalogs associated with a tenant and to
                    manage the product publishing mode for each master catalog.</p>
                <p>Use the <strong>Price Lists</strong> resources to view and create price lists. You can use price lists to override the
                    catalog pricing of products for specific customer segments and/or sites.</p>
                <p>Use the <strong>Products</strong>, <strong>Product Types/Extras/Options/Properties</strong>, and <strong>Product Sort Definitions</strong> resources to create new product definitions in the master catalog and determine which
                    catalogs will feature products. This current version of the Products API includes localizedContent to
                    support <a href="/pages/catalog-structure#multi-locale-catalogs">multi-locale catalogs</a>, which was not present in the legacy Products API model. If
                    you were a client prior to May 2024 and have upgraded your implementation to support this feature,
                    you can still access product data that has not yet been rewritten to the new model by providing
                    an x-api-version header set to "1".</p>
                <p>Use the <strong>Publishing</strong> resource to publish pending product updates together as part of a set.</p>
                <p>Use the <strong>Search</strong> resource to manage all settings and options for providing product search on your site, as
                    well as search tuning rules.</p>
            </div>
  title: Catalog Admin
  version: 0.0.1
servers:
  - description: Kibo Base URL
    url: '{baseUrl}/api'
    variables:
      baseUrl:
        default: https://t1000000.sb.usc1.gcp.kibocommerce.com
        description: Base URL
security:
  - bearerAuth: []
paths:
  /commerce/catalog/admin/attributedefinition/attributes:
    post:
      tags:
        - ProductAttributes
      summary: Add Product Attribute
      description: >-
        Create a new attribute. The attribute name, attribute type, input type,
        and data type are required. This current version of the Attributes API
        includes localizedContent to support <a
        href="/pages/catalog-structure#multi-locale-catalogs">multi-locale
        catalogs</a>, which was not present in the previous API model. If you
        were a client prior to May 2024 and have upgraded your implementation to
        support this feature, you can still access attribute data that has not
        yet been rewritten to the new model by providing an x-api-version header
        set to "1".
      parameters:
        - description: limits which fields are returned in the response body
          in: query
          name: responseFields
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CatalogAdminsAttribute'
        description: ''
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CatalogAdminsAttribute'
            text/json:
              schema:
                $ref: '#/components/schemas/CatalogAdminsAttribute'
            text/plain:
              schema:
                $ref: '#/components/schemas/CatalogAdminsAttribute'
          description: OK
components:
  schemas:
    CatalogAdminsAttribute:
      description: Attribute
      properties:
        adminName:
          description: >-
            Name of the product displayed in the admin, This field does not need
            to be unqiue, but is required. It can include spaces...and is
            limited to a length of 50.
          nullable: true
          type: string
        attributeCode:
          description: "Unique identifier of the Attribute. Must be unique within a namespace and cannot be changed once the attribute is created. This value will be generated and match the attribute\r\nsequence if not provided on create."
          nullable: true
          type: string
        attributeDataTypeSequence:
          description: >-
            Read only System generated monotonically increasing unique sequence
            for each attribute,DataType created (this is used to optimize
            indexed field names in search).
          format: int32
          nullable: true
          type: integer
        attributeFQN:
          description: >-
            Attribute fully qualified name, Read only value that combines
            namespace and attribute code as NameSpace~AttributeCode
          nullable: true
          type: string
        attributeMetadata:
          description: >-
            Attribute Metadata. This list can contain opaque data (key value
            pairs) that can be used as a property bag for UI concerns.
          items:
            $ref: '#/components/schemas/CatalogAdminsAttributeMetadataItem'
          nullable: true
          type: array
        attributeSequence:
          description: >-
            Read only System generated monotonically increasing unique sequence
            for each attribute created.
          format: int32
          nullable: true
          type: integer
        auditInfo:
          $ref: '#/components/schemas/AdminUserAuditInfo'
        availableForOrderRouting:
          description: Specifies if this attribute is available for order routing
          type: boolean
        content:
          $ref: '#/components/schemas/CatalogAdminsAttributeLocalizedContent'
        dataType:
          description: "The DataType of the attribute.  Must be a valid value for DataType defined in DataTypeTypeConst and the combination of types set must match an entry in the AttributeTypeRules resource. \r\nThis value cannot be changed after create"
          maxLength: 20
          nullable: true
          type: string
        inputType:
          description: "The InputType type of the attribute. Must be a valid value for InputType defined in InputTypeConst and the combination of types set must match an entry in the AttributeTypeRules resource. \r\nThis value cannot be changed after create"
          maxLength: 20
          nullable: true
          type: string
        isExtra:
          description: >-
            Specifies if this attribute can have a usage type of Extra in a
            ProductType. This value can only be true when when it matches an
            AttributeTypeRule in the AttributeTypeRules resource.
          nullable: true
          type: boolean
        isOption:
          description: >-
            Specifies if this attribute can have a usage type of Option in a
            ProductType. This value can only be true when when it matches an
            AttributeTypeRule in the AttributeTypeRules resource.
          nullable: true
          type: boolean
        isProperty:
          description: >-
            Specifies if this attribute can have a usage type of Property in a
            ProductType. This value can only be true when when it matches an
            AttributeTypeRule in the AttributeTypeRules resource.
          nullable: true
          type: boolean
        isValueMappingAttribute:
          description: >-
            Specifies if this attribute can can be used to generalize values of
            another attribute
          nullable: true
          type: boolean
        localizedContent:
          description: >-
            The Content of an attribute. This content is always in the default
            language of the MasterCatalog.
          items:
            $ref: '#/components/schemas/CatalogAdminsAttributeLocalizedContent'
          nullable: true
          type: array
        masterCatalogId:
          description: >-
            Indentifier of the master that this attribute is a member of.
            System-supplied and read-only. Attributes will be created in the
            MasterCatalog of the supplied context.
          format: int32
          nullable: true
          type: integer
        namespace:
          description: "NameSpace, each application creating attributes will have a uniqe namespace to avoid name (Code) collisions. The namespace provided must be a valid registered\r\nnamespace. If no namespace is specified it is assumed to be the namespace of the Tenant."
          nullable: true
          type: string
        searchSettings:
          $ref: '#/components/schemas/AttributeSearchSettings'
        validation:
          $ref: '#/components/schemas/CatalogAdminsAttributeValidation'
        valueMappingAttributeFQN:
          description: >-
            Attribute fully qualified name of a corresponding value mapping
            atribuite
          nullable: true
          type: string
        valueType:
          description: "The ValueType of the attribute.  Must be a valid value for ValueType defined in ValueTypeTypeConst and the combination of types set must match an entry in the AttributeTypeRules resource. \r\nThis value cannot be changed after create"
          maxLength: 20
          nullable: true
          type: string
        vocabularyValues:
          description: >-
            The list of Values for this attribute. Only available for
            ValueType:PredefinedVocabulary
          items:
            $ref: '#/components/schemas/CatalogAdminsAttributeVocabularyValue'
          nullable: true
          type: array
      type: object
    CatalogAdminsAttributeMetadataItem:
      description: >-
        Attribute Metadata Item.  It can be utilized for storing abitrary
        key/value pairs of data related to an attribute.
      properties:
        key:
          description: The key
          nullable: true
          type: string
        value:
          description: The value
          nullable: true
          type: string
      type: object
    AdminUserAuditInfo:
      properties:
        createBy:
          nullable: true
          type: string
        createDate:
          format: date-time
          nullable: true
          type: string
        updateBy:
          nullable: true
          type: string
        updateDate:
          format: date-time
          nullable: true
          type: string
      type: object
    CatalogAdminsAttributeLocalizedContent:
      description: >-
        Container for language-specific content to display on the storefront.
        You'll have a container for each supported language (LocaleCode). This
        enables you to display an attribute in multiple languages yet manage it
        as a single attribute internally.
      properties:
        description:
          description: >-
            Description of the attribute in the language specified by
            LocaleCode.
          nullable: true
          type: string
        localeCode:
          description: >-
            Language used for the attribute name and description. Currently,
            only en_US is supported.
          nullable: true
          type: string
        name:
          description: Name of the attribute in the language specified by LocaleCode.
          nullable: true
          type: string
      type: object
    AttributeSearchSettings:
      description: >-
        Attribute Search Settings. A container for all of the search and
        indexing settings of an Attribute
      properties:
        allowFilteringAndSortingInStorefront:
          description: >-
            Indicates whether the attribute should be able to be used in
            filters, facets, and sorting on the public storefront.
          nullable: true
          type: boolean
        customWeightInStorefrontSearch:
          description: >-
            Indicates whether the attribute is indevidually stored as a
            tokenized field in search for custom term search weight
          nullable: true
          type: boolean
        indexValueWithCase:
          description: "Indicates whether the attribute value is case sensative for filtering and faceting. This applies to Text Admin entered attributes. \r\nA null value means it is not case sensative"
          nullable: true
          type: boolean
        searchDisplayValue:
          description: "If true, the system will index the display value of string attributes instead of the canonical value for searching. \r\nThe canonical value will always be used for filtering. Does not apply for for non-string attributes."
          type: boolean
        searchableInAdmin:
          description: >-
            Indicates whether the attribute value should be searchable in the
            merchant catalog admin.
          type: boolean
        searchableInStorefront:
          description: >-
            Indicates whether the attribute value should be searchable on the
            public storefront.
          type: boolean
      type: object
    CatalogAdminsAttributeValidation:
      description: Used to validate attributes.
      properties:
        maxDateValue:
          description: For validating a DateTime attribute value, maximum datetime allowed.
          format: date-time
          nullable: true
          type: string
        maxNumericValue:
          description: For validating Number attribute value, maximum number allowed.
          format: double
          nullable: true
          type: number
        maxStringLength:
          description: For validating strings, maximum length allowed for a string.
          format: int32
          nullable: true
          type: integer
        minDateValue:
          description: For validating a DateTime attribute value, minimum datetime allowed.
          format: date-time
          nullable: true
          type: string
        minNumericValue:
          description: For validating Number attribute value, minimum number allowed.
          format: double
          nullable: true
          type: number
        minStringLength:
          description: For validating strings, minimum length allowed for a string.
          format: int32
          nullable: true
          type: integer
        regularExpression:
          description: >-
            Regular expression to run against the attribute value. This should
            follow JavaScript/EMCA's Regular Expression syntax.
          nullable: true
          type: string
      type: object
    CatalogAdminsAttributeVocabularyValue:
      description: Value of an attribute
      properties:
        content:
          $ref: '#/components/schemas/AttributeVocabularyValueLocalizedContent'
        displayOrder:
          description: >-
            The order in which the attribute value displays. If you omit a value
            for this property, Mozu infers the display order from the attribute
            value's position the list.
          format: int32
          nullable: true
          type: integer
        localizedContent:
          description: >-
            The Content of an attribute value. This content is in multiple
            locals supported by the master catalog and is only valid for String
            DataType.
          items:
            $ref: '#/components/schemas/AttributeVocabularyValueLocalizedContent'
          nullable: true
          type: array
        mappedGenericValues:
          description: "The actual values of the related generic attribute. This value must match the datatype of the attribute and already exist \r\nwithin the Vocabulary values of the related ValueMappingAttribute. Only supporting string at this time."
          items: {}
          nullable: true
          type: array
        productName:
          description: The ProductName when the Attribute DataType is ProductCode.
          nullable: true
          type: string
        value:
          description: "The actual value of the attribute vocabulary. This value must be unique within the vocabulary for a single attribute and match the datatype of the attribute. \r\nString data type requires a canonical value here or one will be system generated if null. The actual string content displayed to users should be stored as Content. \r\nString values require content to be present.\r\nOnce this value is set it cannot be changed."
          nullable: true
        valueSequence:
          description: Read only System generated monotonically increasing unique sequence.
          format: int32
          nullable: true
          type: integer
      type: object
    AttributeVocabularyValueLocalizedContent:
      description: Attribute Value Localized Resource
      properties:
        localeCode:
          description: >-
            Language used for the string attribute value. Currently, only en_US
            is supported.
          nullable: true
          type: string
        stringValue:
          description: Localized Value in the language of the locale code
          nullable: true
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: JWT Authorization header using the Bearer scheme.
      scheme: bearer
      type: http

````