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

# Add Item To Cart

> Add an item to cart with quantity, pricing, and discounts.
Automatically recalculates cart totals.



## OpenAPI

````yaml post /billing/cart/{cart_id}/items
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /billing/cart/{cart_id}/items:
    post:
      tags:
        - provider
        - billing
      summary: Add Item To Cart
      description: |-
        Add an item to cart with quantity, pricing, and discounts.
        Automatically recalculates cart totals.
      operationId: add_item_to_cart_billing_cart__cart_id__items_post
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: cart_id
          in: path
          required: true
          schema:
            type: string
            title: Cart Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CartItemCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CartItemCreate:
      properties:
        itemId:
          anyOf:
            - type: string
            - type: 'null'
          title: Itemid
          description: ID of the item to add to cart
        packageId:
          anyOf:
            - type: string
            - type: 'null'
          title: Packageid
          description: ID of the package to add to cart
        quantity:
          type: number
          title: Quantity
          description: Quantity of the item/package
          default: 1
        unitPrice:
          anyOf:
            - type: integer
            - type: 'null'
          title: Unitprice
          description: Custom unit price in cents (if different from item/package price)
        discountAmount:
          type: integer
          title: Discountamount
          description: Discount amount in cents
          default: 0
        discountPercentage:
          type: number
          title: Discountpercentage
          description: Discount percentage (0-100)
          default: 0
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: Notes about this item/package
      type: object
      title: CartItemCreate
      description: Schema for creating cart items (can be either items or packages).
    CartSummary:
      properties:
        id:
          type: string
          title: Id
          description: Cart ID
        patient:
          $ref: '#/components/schemas/PatientSummary'
          description: Patient details
        creator:
          anyOf:
            - $ref: '#/components/schemas/ProviderTiny'
            - type: 'null'
          description: Creator details
        status:
          $ref: '#/components/schemas/CartStatus'
          description: Cart status
        discountAmount:
          type: integer
          title: Discountamount
          description: Total discount in cents
        discountPercentage:
          type: number
          title: Discountpercentage
          description: Overall discount percentage
        taxAmount:
          type: integer
          title: Taxamount
          description: Total tax in cents
        total:
          type: integer
          title: Total
          description: Final total in cents
        items:
          items:
            $ref: '#/components/schemas/CartItem'
          type: array
          title: Items
          description: Items and packages in the cart
          default: []
        quotes:
          items:
            $ref: '#/components/schemas/QuoteSummary'
          type: array
          title: Quotes
          description: Quotes created from this cart
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
          description: Date the cart was created
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
          description: Date the cart was last updated
        expiresDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expiresdate
          description: When the cart expires
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: Notes about the cart
        convertedChargeId:
          anyOf:
            - type: string
            - type: 'null'
          title: Convertedchargeid
          description: ID of charge if cart was converted
        subtotal:
          type: integer
          title: Subtotal
          description: Calculate subtotal from items after item-level discounts.
          readOnly: true
      type: object
      required:
        - id
        - patient
        - status
        - discountAmount
        - discountPercentage
        - taxAmount
        - total
        - subtotal
      title: CartSummary
      description: Summary schema for cart with basic details.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PatientSummary:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier for the user.
        firstName:
          anyOf:
            - type: string
            - type: 'null'
          title: Firstname
          description: The user's first name.
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
          description: The user's last name.
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Phonenumber
          description: The user's phone number.
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: The user's email address.
        type:
          $ref: '#/components/schemas/UserType'
          description: The type of user.
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
          description: The location of the user.
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
          description: The user's external identifier if available.
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
          description: The user's primary address.
        addressLineTwo:
          anyOf:
            - type: string
            - type: 'null'
          title: Addresslinetwo
          description: Additional address information.
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
          description: The city of the user's address.
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
          description: The state of the user's address.
        zipCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Zipcode
          description: The postal code of the user's address.
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: The country of the user's address.
        createdDate:
          type: string
          format: date-time
          title: Createddate
          description: The date and time when the user was created.
        addressValid:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Addressvalid
          description: Whether the user's address is valid.
        meta:
          anyOf:
            - type: object
            - type: 'null'
          title: Meta
          description: Any additional metadata about the user relevant to your system.
        isArchived:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Isarchived
          description: Whether the user is archived.
        primaryLocationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Primarylocationid
          description: The primary location of the user.
        gender:
          anyOf:
            - type: string
            - type: 'null'
          title: Gender
          description: The gender of the patient.
        dateOfBirth:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Dateofbirth
          description: The date of birth of the patient.
        patientMedications:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Patientmedications
          description: List of patient's self-reported medications.
        onSchedulingBlacklist:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Onschedulingblacklist
          description: Whether the patient is on the scheduling blacklist.
        surchargeDisabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Surchargedisabled
          description: Whether surcharges are disabled for this patient.
        tags:
          anyOf:
            - items:
                $ref: '#/components/schemas/PatientTagSummary'
              type: array
            - type: 'null'
          title: Tags
          description: List of patient tags
        creditBalance:
          anyOf:
            - type: integer
            - type: 'null'
          title: Creditbalance
          description: Patient's credit balance in cents.
        preferredProviderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Preferredproviderid
          description: The preferred provider ID for this patient.
      type: object
      required:
        - id
        - type
        - createdDate
      title: PatientSummary
    ProviderTiny:
      properties:
        id:
          type: string
          title: Id
        firstName:
          type: string
          title: Firstname
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
      type: object
      required:
        - id
        - firstName
      title: ProviderTiny
    CartStatus:
      type: string
      enum:
        - DRAFT
        - ABANDONED
        - ACCEPTED
        - REJECTED
        - CONVERTED
        - EXPIRED
      title: CartStatus
      description: Status of a patient cart.
    CartItem:
      properties:
        id:
          type: string
          title: Id
          description: Cart item ID
        cartId:
          type: string
          title: Cartid
          description: ID of the cart
        itemId:
          anyOf:
            - type: string
            - type: 'null'
          title: Itemid
          description: ID of the item
        packageId:
          anyOf:
            - type: string
            - type: 'null'
          title: Packageid
          description: ID of the package
        quantity:
          type: number
          title: Quantity
          description: Quantity of the item/package
        unitPrice:
          type: integer
          title: Unitprice
          description: Unit price in cents
        discountAmount:
          type: integer
          title: Discountamount
          description: Discount amount in cents
        discountPercentage:
          type: number
          title: Discountpercentage
          description: Discount percentage
        taxAmount:
          type: integer
          title: Taxamount
          description: Tax amount in cents
        totalPrice:
          type: integer
          title: Totalprice
          description: Total price for this quantity in cents
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: Notes about this item/package
        item:
          anyOf:
            - $ref: '#/components/schemas/ItemTiny'
            - type: 'null'
          description: Item details
        package:
          anyOf:
            - $ref: '#/components/schemas/PackageTiny'
            - type: 'null'
          description: Package details
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
          description: Date the item was added
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
          description: Date the item was last updated
      type: object
      required:
        - id
        - cartId
        - quantity
        - unitPrice
        - discountAmount
        - discountPercentage
        - taxAmount
        - totalPrice
      title: CartItem
      description: >-
        Schema for cart items with full details (can be either items or
        packages).
    QuoteSummary:
      properties:
        id:
          type: string
          title: Id
          description: Quote ID
        patientId:
          type: string
          title: Patientid
          description: Patient ID
        creatorId:
          anyOf:
            - type: string
            - type: 'null'
          title: Creatorid
          description: Creator ID
        cartId:
          anyOf:
            - type: string
            - type: 'null'
          title: Cartid
          description: Source cart ID
        status:
          $ref: '#/components/schemas/QuoteStatus'
          description: Quote status
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
          description: Title/subject of the quote
        discountAmount:
          type: integer
          title: Discountamount
          description: Total discount in cents
        discountPercentage:
          type: number
          title: Discountpercentage
          description: Overall discount percentage
        taxAmount:
          type: integer
          title: Taxamount
          description: Total tax in cents
        total:
          type: integer
          title: Total
          description: Final total in cents
        itemCount:
          type: integer
          title: Itemcount
          description: Number of items in quote
          default: 0
        packageCount:
          type: integer
          title: Packagecount
          description: Number of packages in quote
          default: 0
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
          description: Date the quote was created
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
          description: Date the quote was last updated
        validUntilDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Validuntildate
          description: When the quote expires
        sentDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sentdate
          description: When the quote was sent
        viewedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Vieweddate
          description: When the patient first viewed the quote
        respondedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Respondeddate
          description: When the patient responded to the quote
        internalNotes:
          anyOf:
            - type: string
            - type: 'null'
          title: Internalnotes
          description: Internal notes
        creator:
          anyOf:
            - $ref: '#/components/schemas/ProviderTiny'
            - type: 'null'
          description: Creator details
        patient:
          anyOf:
            - $ref: '#/components/schemas/PatientSummary'
            - type: 'null'
          description: Patient details
      type: object
      required:
        - id
        - patientId
        - status
        - discountAmount
        - discountPercentage
        - taxAmount
        - total
      title: QuoteSummary
      description: Summary schema for quote with basic details.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UserType:
      type: string
      enum:
        - PROVIDER
        - PATIENT
        - ASSISTANT
      title: UserType
    PatientTagSummary:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the patient tag
        name:
          type: string
          title: Name
          description: Name of the patient tag
        emoji:
          anyOf:
            - type: string
            - type: 'null'
          title: Emoji
          description: Emoji associated with the tag
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
          description: Color code for the tag (hex format)
        isActive:
          type: boolean
          title: Isactive
          description: Whether the tag is active
        createdDate:
          type: string
          format: date-time
          title: Createddate
          description: Date and time when the tag was created
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
          description: Date and time when the tag was last updated
      type: object
      required:
        - id
        - name
        - isActive
        - createdDate
      title: PatientTagSummary
    ItemTiny:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the item
        name:
          type: string
          title: Name
          description: Name of the item
        brandName:
          anyOf:
            - type: string
            - type: 'null'
          title: Brandname
          description: Optional brand name of the item
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description of the item
        price:
          type: integer
          title: Price
          description: Price of the item in cents
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
          description: Category name (references category.name)
        unit:
          anyOf:
            - $ref: '#/components/schemas/Unit'
            - type: 'null'
          description: Unit of measurement for the item
        isPhysical:
          type: boolean
          title: Isphysical
          description: Whether the item is physical
          default: true
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the item is archived
          default: false
        internalNotes:
          anyOf:
            - type: string
            - type: 'null'
          title: Internalnotes
          description: Optional internal notes for the item
        taxable:
          type: boolean
          title: Taxable
          description: Whether the item is subject to taxes
          default: false
        sortOrder:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sortorder
          description: Optional sort order for the item
        allowCustomPricing:
          type: boolean
          title: Allowcustompricing
          description: Whether custom pricing is allowed for this item
          default: false
        type:
          $ref: '#/components/schemas/ItemType'
          description: Type of item (PRODUCT, MEDICATION, etc.)
          default: PRODUCT
      type: object
      required:
        - name
        - price
      title: ItemTiny
    PackageTiny:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the package
        name:
          type: string
          title: Name
          description: Name of the package
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description of the package
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the package is archived
          default: false
        price:
          type: integer
          title: Price
          description: Price of the package in cents
      type: object
      required:
        - name
        - price
      title: PackageTiny
    QuoteStatus:
      type: string
      enum:
        - DRAFT
        - SENT
        - VIEWED
        - ACCEPTED
        - DECLINED
        - EXPIRED
        - CONVERTED
      title: QuoteStatus
      description: Status of a quote.
    Unit:
      type: string
      enum:
        - AMPOULES
        - APPLICATORS
        - BOTTLES
        - BOXES
        - CAPSULES
        - CUPS
        - DOSES
        - G_PER_ML
        - GRAMS
        - IU
        - IU_PER_ML
        - OUNCES
        - FLUID_OUNCES
        - KG
        - KITS
        - LITERS
        - MCG
        - MG
        - MG_PER_ML
        - ML
        - MMOL
        - MICROGRAM_PER_ML
        - PACKS
        - PAIRS
        - PATCHES
        - PERCENTAGE
        - PIECES
        - POUCHES
        - ROLLS
        - SACHETS
        - SHEETS
        - SPRAYS
        - STRIPS
        - SYRINGES
        - TABLETS
        - TABLETS_PER_DAY
        - TESTS
        - TUBES
        - UNITS
        - VIALS
        - TREATMENTS
        - SESSIONS
        - PULSES
        - JOULES
        - CENTIMETERS
        - THREAD_COUNT
        - INJECTIONS
        - WRINKLE_UNITS
        - POUNDS
        - FEET
        - INCHES
      title: Unit
    ItemType:
      type: string
      enum:
        - ITEM
        - PRODUCT
        - MEDICATION
        - SERVICE
        - PACKAGE
        - MEMBERSHIP
      title: ItemType

````