---
title: "Create Cart"
method: POST
path: "/billing/cart"
tags: ["provider", "billing"]
---

# Create Cart

`POST /billing/cart`

Create a new cart with items and packages.

This endpoint creates a cart similar to how charges are created,
handling items, packages, discounts, and pricing calculations.

## Headers

- `TENANT` string, required
- `API-KEY` string, required

## Request body

- CartCreate — Schema for creating a new cart.
  - `id` string, nullable — Cart ID (auto-generated if not provided)
  - `patientId` string, required — ID of the patient
  - `creatorId` string, nullable — ID of the user creating the cart
  - `status` 'DRAFT' | 'ABANDONED' | 'ACCEPTED' | 'REJECTED' | 'CONVERTED' | 'EXPIRED' — Status of a patient cart.
  - `notes` string, nullable — Notes about the cart
  - `expiresDate` string, date-time, nullable — When the cart expires
  - `discountAmount` integer — Overall cart discount in cents
  - `discountPercentage` number — Overall cart discount percentage
  - `items` CartItemCreate[] — Items and packages to add to the cart
    - `itemId` string, nullable — ID of the item to add to cart
    - `packageId` string, nullable — ID of the package to add to cart
    - `quantity` number — Quantity of the item/package
    - `unitPrice` integer, nullable — Custom unit price in cents (if different from item/package price)
    - `discountAmount` integer — Discount amount in cents
    - `discountPercentage` number — Discount percentage (0-100)
    - `notes` string, nullable — Notes about this item/package

## Response `200`

Successful Response

- CartSummary — Summary schema for cart with basic details.
  - `id` string, required — Cart ID
  - `patient` PatientSummary, required
    - `id` string, required — The unique identifier for the user.
    - `firstName` string, nullable — The user's first name.
    - `lastName` string, nullable — The user's last name.
    - `phoneNumber` string, nullable — The user's phone number.
    - `email` string, nullable — The user's email address.
    - `type` 'PROVIDER' | 'PATIENT' | 'ASSISTANT', required
    - `locationId` string, nullable — The location of the user.
    - `externalId` string, nullable — The user's external identifier if available.
    - `address` string, nullable — The user's primary address.
    - `addressLineTwo` string, nullable — Additional address information.
    - `city` string, nullable — The city of the user's address.
    - `state` string, nullable — The state of the user's address.
    - `zipCode` string, nullable — The postal code of the user's address.
    - `country` string, nullable — The country of the user's address.
    - `createdDate` string, date-time, required — The date and time when the user was created.
    - `addressValid` boolean, nullable — Whether the user's address is valid.
    - `meta` object, nullable — Any additional metadata about the user relevant to your system.
    - `isArchived` boolean, nullable — Whether the user is archived.
    - `primaryLocationId` string, nullable — The primary location of the user.
    - `gender` string, nullable — The gender of the patient.
    - `dateOfBirth` string, date, nullable — The date of birth of the patient.
    - `patientMedications` string[], nullable — List of patient's self-reported medications.
    - `onSchedulingBlacklist` boolean, nullable — Whether the patient is on the scheduling blacklist.
    - `surchargeDisabled` boolean, nullable — Whether surcharges are disabled for this patient.
    - `tags` PatientTagSummary[], nullable — List of patient tags
      - `id` string, required — Unique identifier for the patient tag
      - `name` string, required — Name of the patient tag
      - `emoji` string, nullable — Emoji associated with the tag
      - `color` string, nullable — Color code for the tag (hex format)
      - `isActive` boolean, required — Whether the tag is active
      - `createdDate` string, date-time, required — Date and time when the tag was created
      - `updatedDate` string, date-time, nullable — Date and time when the tag was last updated
    - `creditBalance` integer, nullable — Patient's credit balance in cents.
    - `preferredProviderId` string, nullable — The preferred provider ID for this patient.
  - `creator` ProviderTiny
    - `id` string, required
    - `firstName` string, required
    - `lastName` string, nullable
    - `email` string, nullable
    - `createdDate` string, date-time, nullable
  - `status` 'DRAFT' | 'ABANDONED' | 'ACCEPTED' | 'REJECTED' | 'CONVERTED' | 'EXPIRED', required — Status of a patient cart.
  - `discountAmount` integer, required — Total discount in cents
  - `discountPercentage` number, required — Overall discount percentage
  - `taxAmount` integer, required — Total tax in cents
  - `total` integer, required — Final total in cents
  - `items` CartItem[] — Items and packages in the cart
    - `id` string, required — Cart item ID
    - `cartId` string, required — ID of the cart
    - `itemId` string, nullable — ID of the item
    - `packageId` string, nullable — ID of the package
    - `quantity` number, required — Quantity of the item/package
    - `unitPrice` integer, required — Unit price in cents
    - `discountAmount` integer, required — Discount amount in cents
    - `discountPercentage` number, required — Discount percentage
    - `taxAmount` integer, required — Tax amount in cents
    - `totalPrice` integer, required — Total price for this quantity in cents
    - `notes` string, nullable — Notes about this item/package
    - `item` ItemTiny
      - `id` string — Unique identifier for the item
      - `name` string, required — Name of the item
      - `brandName` string, nullable — Optional brand name of the item
      - `description` string, nullable — Optional description of the item
      - `price` integer, required — Price of the item in cents
      - `category` string, nullable — Category name (references category.name)
      - `unit` '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'
      - `isPhysical` boolean — Whether the item is physical
      - `isArchived` boolean — Whether the item is archived
      - `internalNotes` string, nullable — Optional internal notes for the item
      - `taxable` boolean — Whether the item is subject to taxes
      - `sortOrder` integer, nullable — Optional sort order for the item
      - `allowCustomPricing` boolean — Whether custom pricing is allowed for this item
      - `type` 'ITEM' | 'PRODUCT' | 'MEDICATION' | 'SERVICE' | 'PACKAGE' | 'MEMBERSHIP'
    - `package` PackageTiny
      - `id` string — Unique identifier for the package
      - `name` string, required — Name of the package
      - `description` string, nullable — Optional description of the package
      - `isArchived` boolean — Whether the package is archived
      - `price` integer, required — Price of the package in cents
    - `createdDate` string, date-time, nullable — Date the item was added
    - `updatedDate` string, date-time, nullable — Date the item was last updated
  - `quotes` QuoteSummary[] — Quotes created from this cart
    - `id` string, required — Quote ID
    - `patientId` string, required — Patient ID
    - `creatorId` string, nullable — Creator ID
    - `cartId` string, nullable — Source cart ID
    - `status` 'DRAFT' | 'SENT' | 'VIEWED' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CONVERTED', required — Status of a quote.
    - `title` string, nullable — Title/subject of the quote
    - `discountAmount` integer, required — Total discount in cents
    - `discountPercentage` number, required — Overall discount percentage
    - `taxAmount` integer, required — Total tax in cents
    - `total` integer, required — Final total in cents
    - `itemCount` integer — Number of items in quote
    - `packageCount` integer — Number of packages in quote
    - `createdDate` string, date-time, nullable — Date the quote was created
    - `updatedDate` string, date-time, nullable — Date the quote was last updated
    - `validUntilDate` string, date-time, nullable — When the quote expires
    - `sentDate` string, date-time, nullable — When the quote was sent
    - `viewedDate` string, date-time, nullable — When the patient first viewed the quote
    - `respondedDate` string, date-time, nullable — When the patient responded to the quote
    - `internalNotes` string, nullable — Internal notes
    - `creator` ProviderTiny
      - `id` string, required
      - `firstName` string, required
      - `lastName` string, nullable
      - `email` string, nullable
      - `createdDate` string, date-time, nullable
    - `patient` PatientSummary
      - `id` string, required — The unique identifier for the user.
      - `firstName` string, nullable — The user's first name.
      - `lastName` string, nullable — The user's last name.
      - `phoneNumber` string, nullable — The user's phone number.
      - `email` string, nullable — The user's email address.
      - `type` 'PROVIDER' | 'PATIENT' | 'ASSISTANT', required
      - `locationId` string, nullable — The location of the user.
      - `externalId` string, nullable — The user's external identifier if available.
      - `address` string, nullable — The user's primary address.
      - `addressLineTwo` string, nullable — Additional address information.
      - `city` string, nullable — The city of the user's address.
      - `state` string, nullable — The state of the user's address.
      - `zipCode` string, nullable — The postal code of the user's address.
      - `country` string, nullable — The country of the user's address.
      - `createdDate` string, date-time, required — The date and time when the user was created.
      - `addressValid` boolean, nullable — Whether the user's address is valid.
      - `meta` object, nullable — Any additional metadata about the user relevant to your system.
      - `isArchived` boolean, nullable — Whether the user is archived.
      - `primaryLocationId` string, nullable — The primary location of the user.
      - `gender` string, nullable — The gender of the patient.
      - `dateOfBirth` string, date, nullable — The date of birth of the patient.
      - `patientMedications` string[], nullable — List of patient's self-reported medications.
      - `onSchedulingBlacklist` boolean, nullable — Whether the patient is on the scheduling blacklist.
      - `surchargeDisabled` boolean, nullable — Whether surcharges are disabled for this patient.
      - `tags` PatientTagSummary[], nullable — List of patient tags
        - `id` string, required — Unique identifier for the patient tag
        - `name` string, required — Name of the patient tag
        - `emoji` string, nullable — Emoji associated with the tag
        - `color` string, nullable — Color code for the tag (hex format)
        - `isActive` boolean, required — Whether the tag is active
        - `createdDate` string, date-time, required — Date and time when the tag was created
        - `updatedDate` string, date-time, nullable — Date and time when the tag was last updated
      - `creditBalance` integer, nullable — Patient's credit balance in cents.
      - `preferredProviderId` string, nullable — The preferred provider ID for this patient.
  - `createdDate` string, date-time, nullable — Date the cart was created
  - `updatedDate` string, date-time, nullable — Date the cart was last updated
  - `expiresDate` string, date-time, nullable — When the cart expires
  - `notes` string, nullable — Notes about the cart
  - `convertedChargeId` string, nullable — ID of charge if cart was converted
  - `subtotal` integer, required — Calculate subtotal from items after item-level discounts.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/decodahealth/apis/decoda-api.md) · [All operations](https://skmtc.dev/decodahealth/apis/decoda-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/decodahealth/decoda-api/revisions/4939a65a89d2/schema)
