> ## 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.

# Add attribute to cart item

> Add attribute to cart item



## OpenAPI

````yaml oms_v1 patch /api-cart/cart/{cartId}/item/attribute
openapi: 3.0.0
info:
  description: Order Management System
  version: 1.0.0
  title: Orders v1 (OMS v1)
  contact:
    email: oms-team@fabric.inc
  license:
    name: fabric API license
    url: https://fabric.inc/api-license
servers:
  - url: https://prod01-apigw.{customer_name}.fabric.zone
    description: Production
    variables:
      customer_name:
        default: yourcompany
        description: Customer name, provided by support team
security: []
tags:
  - name: Cart
    description: >-
      Cart APIs<br /><br />**Note:** These are the legacy Cart APIs. To view
      fabric's new Cart APIs, navigate to *Cart API > Cart* from the left side
      navigation pane.
  - name: Bill To
    description: Bill To APIs [Deprecated]
  - name: Ship To
    description: >-
      Ship To APIs<br /><br />**Note:** These are the legacy Ship To APIs. To
      view fabric's new Shipping APIs, navigate to *Cart API > Shipping* from
      the left side navigation pane.
  - name: Wishlist
    description: Wishlist APIs
  - name: Cart Decoupled
    description: Cart Decoupled APIs
  - name: Warehouse
    description: Warehouse APIs
  - name: Inventory
    description: Inventory APIs
  - name: Attributes
    description: >-
      Attributes APIs<br /><br />**Note:** These are the legacy Attribute APIs.
      To view fabric's new Attribute APIs, navigate to *Cart API > Attribute*
      from the left side navigation pane.
  - name: List
    description: List APIs
  - name: Tax/Address Validate
    description: Tax/Address Validate APIs
  - name: Shipping
    description: Shipping APIs
  - name: Payments
    description: Payments APIs
  - name: Order
    description: Order APIs
paths:
  /api-cart/cart/{cartId}/item/attribute:
    patch:
      tags:
        - Attributes
      summary: Add attribute to cart item
      description: Add attribute to cart item
      operationId: addAttributeToItem
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - in: path
          name: cartId
          required: true
          schema:
            type: string
            minLength: 24
            maxLength: 24
            example: 5e5818a84d030c206b2ffb02
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                required:
                  - lineItemId
                  - attributeId
                  - attributeValue
                properties:
                  lineItemId:
                    type: integer
                    example: 1
                  attributeId:
                    type: string
                    example: 60a77de306f682000975c24c
                  attributeValue:
                    type: string
                    example: test
      responses:
        '200':
          description: Cart with updated item attribute
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cartData'
        '400':
          $ref: '#/components/responses/GenericClientError'
        '404':
          description: Attribute - cart not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    description: The error code
                    example: ATTRIBUTE_ERROR
                    type: string
                  message:
                    description: The error message
                    type: string
        '500':
          $ref: '#/components/responses/GenericServerError'
components:
  parameters:
    xSiteContent:
      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"}
  schemas:
    cartData:
      allOf:
        - type: object
          properties:
            deleted:
              type: boolean
              example: false
            allPromosApplied:
              type: array
              items:
                type: object
                properties:
                  unit:
                    type: string
                  value:
                    type: integer
                    format: int32
                  'ON':
                    title: 'ON'
                    required:
                      - kind
                      - value
                    type: object
                    properties:
                      kind:
                        type: string
                      value:
                        type: string
                        nullable: true
                    example:
                      kind: SKU
                      value: ''
                  id:
                    type: string
                  promoId:
                    type: string
                  promoCode:
                    type: string
            items:
              type: array
              items:
                allOf:
                  - type: object
                    required:
                      - itemId
                      - group
                      - quantity
                      - price
                    properties:
                      itemId:
                        type: number
                        example: 1000000012
                      priceListId:
                        type: number
                        example: 100002
                      isUnique:
                        type: string
                        example: 123
                      quantity:
                        type: number
                        minimum: 1
                        default: 1
                        example: 2
                      price:
                        type: object
                        required:
                          - currency
                          - base
                          - discount
                        properties:
                          currency:
                            type: string
                            maxLength: 3
                            minLength: 3
                            example: USD
                          base:
                            type: number
                            example: 15.99
                          sale:
                            type: number
                            example: 10.99
                          discount:
                            type: object
                            required:
                              - price
                            properties:
                              price:
                                type: number
                                default: 0
                                example: 10.99
                              discountAmount:
                                type: number
                                default: 0
                                example: 10.99
                              promosApplied:
                                type: array
                                minItems: 0
                                items:
                                  $ref: '#/components/schemas/allPromosApplied'
                      group:
                        type: array
                        minItems: 1
                        items:
                          type: string
                          minLength: 24
                          maxLength: 24
                          example: 5ddd1a156c5a5fed1e0d91fb
                  - type: object
                    properties:
                      discountedQuantity:
                        type: number
                        example: 0
                      lineItemId:
                        type: number
                        example: 1
                      totalPrice:
                        type: object
                        properties:
                          currency:
                            type: string
                            example: USD
                          amount:
                            type: number
                            example: 200
                      id:
                        type: string
                        example: 5fee9d59f2f08a1b3cbdea08
                      sample:
                        type: boolean
                        example: false
                      weightUnit:
                        type: string
                        example: kg
                      isPickup:
                        type: boolean
                        example: false
                      sku:
                        type: string
                        example: blue
                      taxCode:
                        type: string
                        example: PH0607
                      title:
                        type: string
                        example: item title
                      weight:
                        type: number
                        example: 7
                      attributeTotalPrice:
                        type: number
                        example: 0
                      attributes:
                        type: array
                        items:
                          type: object
                          properties:
                            price:
                              type: number
                              example: 10
                            _id:
                              type: string
                              example: 6146e98408e3700008b64611
                            attributeId:
                              type: string
                              example: 60a77de306f682000975c24c
                            value:
                              type: string
                              example: true/false
                            name:
                              type: string
                              example: Gift Message
                            type:
                              type: string
                            id:
                              type: string
                              example: 6146e98408e3700008b64611
                            shipTo:
                              allOf:
                                - $ref: '#/components/schemas/pickupPerson'
                                - type: object
                                  required:
                                    - street1
                                    - city
                                    - state
                                    - country
                                    - zipCode
                                    - email
                                    - name
                                  properties:
                                    attention:
                                      type: string
                                      maxLength: 140
                                      example: Leave at the back door.
                                    street1:
                                      type: string
                                      maxLength: 140
                                      example: 123 Main Street
                                    street2:
                                      type: string
                                      maxLength: 240
                                      example: ABC Boulevard
                                    city:
                                      type: string
                                      maxLength: 140
                                      example: Seattle
                                    state:
                                      type: string
                                      maxLength: 25
                                      example: WA
                                    country:
                                      type: string
                                      maxLength: 140
                                      example: United States of America
                                    zipCode:
                                      type: string
                                      minLength: 3
                                      maxLength: 25
                                      example: 10008-1234
                                    kind:
                                      type: string
                                      maxLength: 24
                                      example: TBD
                                    name:
                                      type: object
                                      properties:
                                        first:
                                          type: string
                                          minLength: 2
                                          maxLength: 50
                                          example: John
                                        last:
                                          type: string
                                          minLength: 2
                                          maxLength: 50
                                          example: Smith
                                    phone:
                                      type: object
                                      required:
                                        - number
                                        - kind
                                      properties:
                                        number:
                                          type: string
                                          minLength: 5
                                          maxLength: 25
                                          example: 123-456-7890
                                        kind:
                                          type: string
                                          minLength: 3
                                          maxLength: 25
                                          example: Mobile
                                    email:
                                      type: string
                                      format: email
                                      minLength: 5
                                      maxLength: 100
                                      example: johnsmith@fabric.inc
                                - type: object
                                  properties:
                                    shipTo:
                                      type: object
                                      properties:
                                        shipMethod:
                                          type: object
                                          properties:
                                            shipMethodId:
                                              type: string
                                              minLength: 3
                                              example: 1a2b3c4d5e6f7g8h9i0j
                                            shipmentCarrier:
                                              type: string
                                              example: Fedex
                                            shipmentMethod:
                                              type: string
                                              example: Next Day
                                            cost:
                                              type: object
                                              required:
                                                - currency
                                                - amount
                                              properties:
                                                currency:
                                                  type: string
                                                  minLength: 3
                                                  example: USD
                                                amount:
                                                  type: number
                                                  minimum: 0
                                                  example: 5.99
                                - type: object
                                  properties:
                                    shipToId:
                                      type: string
                                      example: 5269
                                    cartId:
                                      type: object
                                      example: 61e03ff6a865fe00094f8620
                                    taxCode:
                                      type: string
                                      example: FR1000
                                    shipToType:
                                      type: string
                                      example: SHIP_TO_ADDRESS
                  - type: object
                    properties:
                      _id:
                        type: string
                        example: 5fee9d59f2f08a1b3cbdea08
                      createdAt:
                        type: string
                        example: '2020-12-31T02:09:53.914Z'
                      updatedAt:
                        type: string
                        example: '2020-12-31T02:09:53.914Z'
        - type: object
          properties:
            registeredUser:
              type: boolean
              example: false
            cartId:
              type: number
              example: 4
            totalAmmount":
              type: object
              properties:
                currency:
                  type: string
                  example: USD
                amount:
                  type: number
                  example: 200
            quantity:
              type: number
              example: 2
            __v:
              type: number
              example: 0
            attributes:
              type: array
              items:
                type: object
                properties:
                  price:
                    type: number
                    example: 10
                  _id:
                    type: string
                    example: 6146e98408e3700008b64611
                  attributeId:
                    type: string
                    example: 60a77de306f682000975c24c
                  value:
                    type: string
                    example: true/false
                  name:
                    type: string
                    example: Gift Message
                  type:
                    type: string
                  id:
                    type: string
                    example: 6146e98408e3700008b64611
            account:
              type: string
            approver:
              type: string
            po:
              type: string
            company:
              type: string
            status:
              type: string
              example: pending
            extra:
              type: object
            errors:
              type: object
              properties:
                inventory:
                  type: array
                price:
                  type: array
                promo:
                  type: array
        - $ref: '#/components/schemas/pickupPerson'
    allPromosApplied:
      type: object
      properties:
        unit:
          type: string
        value:
          type: integer
          format: int32
        'ON':
          title: 'ON'
          required:
            - kind
            - value
          type: object
          properties:
            kind:
              type: string
            value:
              type: string
              nullable: true
          example:
            kind: SKU
            value: ''
        id:
          type: string
        promoId:
          type: string
        promoCode:
          type: string
    pickupPerson:
      type: object
      properties:
        name:
          type: object
          properties:
            first:
              type: string
              minLength: 2
              maxLength: 50
              example: John
            last:
              type: string
              minLength: 2
              maxLength: 50
              example: Smith
        phone:
          type: object
          required:
            - number
            - kind
          properties:
            number:
              type: string
              minLength: 5
              maxLength: 25
              example: 123-456-7890
            kind:
              type: string
              minLength: 3
              maxLength: 25
              example: Mobile
        email:
          type: string
          format: email
          minLength: 5
          maxLength: 100
          example: johnsmith@fabric.inc
  responses:
    GenericClientError:
      description: A generic client error
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                description: The error code
                type: string
              message:
                description: The error message
                type: string
    GenericServerError:
      description: A generic server error
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                description: The error code
                type: string
              message:
                description: The error message
                type: string

````