Skip to main content
POST
/
billing
/
cart
Create Cart
curl --request POST \
  --url https://api.decodahealth.com/billing/cart \
  --header 'API-KEY: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'TENANT: <tenant>' \
  --data '
{
  "patientId": "<string>",
  "id": "<string>",
  "creatorId": "<string>",
  "status": "DRAFT",
  "notes": "<string>",
  "expiresDate": "2023-11-07T05:31:56Z",
  "discountAmount": 0,
  "discountPercentage": 0,
  "items": []
}
'
{
  "id": "<string>",
  "patient": {
    "id": "<string>",
    "type": "PROVIDER",
    "createdDate": "2023-11-07T05:31:56Z",
    "firstName": "<string>",
    "lastName": "<string>",
    "phoneNumber": "<string>",
    "email": "<string>",
    "locationId": "<string>",
    "externalId": "<string>",
    "address": "<string>",
    "addressLineTwo": "<string>",
    "city": "<string>",
    "state": "<string>",
    "zipCode": "<string>",
    "country": "<string>",
    "addressValid": true,
    "meta": {},
    "isArchived": true,
    "primaryLocationId": "<string>",
    "gender": "<string>",
    "dateOfBirth": "2023-12-25",
    "patientMedications": [
      "<string>"
    ],
    "onSchedulingBlacklist": true,
    "surchargeDisabled": true,
    "tags": [
      {
        "id": "<string>",
        "name": "<string>",
        "isActive": true,
        "createdDate": "2023-11-07T05:31:56Z",
        "emoji": "<string>",
        "color": "<string>",
        "updatedDate": "2023-11-07T05:31:56Z"
      }
    ],
    "creditBalance": 123,
    "preferredProviderId": "<string>"
  },
  "status": "DRAFT",
  "discountAmount": 123,
  "discountPercentage": 123,
  "taxAmount": 123,
  "total": 123,
  "subtotal": 123,
  "creator": {
    "id": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "email": "<string>",
    "createdDate": "2023-11-07T05:31:56Z"
  },
  "items": [],
  "quotes": [
    {
      "id": "<string>",
      "patientId": "<string>",
      "status": "DRAFT",
      "discountAmount": 123,
      "discountPercentage": 123,
      "taxAmount": 123,
      "total": 123,
      "creatorId": "<string>",
      "cartId": "<string>",
      "title": "<string>",
      "itemCount": 0,
      "packageCount": 0,
      "createdDate": "2023-11-07T05:31:56Z",
      "updatedDate": "2023-11-07T05:31:56Z",
      "validUntilDate": "2023-11-07T05:31:56Z",
      "sentDate": "2023-11-07T05:31:56Z",
      "viewedDate": "2023-11-07T05:31:56Z",
      "respondedDate": "2023-11-07T05:31:56Z",
      "internalNotes": "<string>",
      "creator": {
        "id": "<string>",
        "firstName": "<string>",
        "lastName": "<string>",
        "email": "<string>",
        "createdDate": "2023-11-07T05:31:56Z"
      },
      "patient": {
        "id": "<string>",
        "type": "PROVIDER",
        "createdDate": "2023-11-07T05:31:56Z",
        "firstName": "<string>",
        "lastName": "<string>",
        "phoneNumber": "<string>",
        "email": "<string>",
        "locationId": "<string>",
        "externalId": "<string>",
        "address": "<string>",
        "addressLineTwo": "<string>",
        "city": "<string>",
        "state": "<string>",
        "zipCode": "<string>",
        "country": "<string>",
        "addressValid": true,
        "meta": {},
        "isArchived": true,
        "primaryLocationId": "<string>",
        "gender": "<string>",
        "dateOfBirth": "2023-12-25",
        "patientMedications": [
          "<string>"
        ],
        "onSchedulingBlacklist": true,
        "surchargeDisabled": true,
        "tags": [
          {
            "id": "<string>",
            "name": "<string>",
            "isActive": true,
            "createdDate": "2023-11-07T05:31:56Z",
            "emoji": "<string>",
            "color": "<string>",
            "updatedDate": "2023-11-07T05:31:56Z"
          }
        ],
        "creditBalance": 123,
        "preferredProviderId": "<string>"
      }
    }
  ],
  "createdDate": "2023-11-07T05:31:56Z",
  "updatedDate": "2023-11-07T05:31:56Z",
  "expiresDate": "2023-11-07T05:31:56Z",
  "notes": "<string>",
  "convertedChargeId": "<string>"
}

Headers

TENANT
string
required

The tenant you are making this request on behalf of

API-KEY
string
required

Your api key

Body

application/json

Schema for creating a new cart.

patientId
string
required

ID of the patient

id
string | null

Cart ID (auto-generated if not provided)

creatorId
string | null

ID of the user creating the cart

status
enum<string> | null

Cart status

Available options:
DRAFT,
ABANDONED,
ACCEPTED,
REJECTED,
CONVERTED,
EXPIRED
notes
string | null

Notes about the cart

expiresDate
string<date-time> | null

When the cart expires

discountAmount
integer
default:0

Overall cart discount in cents

discountPercentage
number
default:0

Overall cart discount percentage

items
CartItemCreate · object[]

Items and packages to add to the cart

Response

Successful Response

Summary schema for cart with basic details.

id
string
required

Cart ID

patient
PatientSummary · object
required

Patient details

status
enum<string>
required

Cart status

Available options:
DRAFT,
ABANDONED,
ACCEPTED,
REJECTED,
CONVERTED,
EXPIRED
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

subtotal
integer
required

Calculate subtotal from items after item-level discounts.

creator
ProviderTiny · object

Creator details

items
CartItem · object[]

Items and packages in the cart

quotes
QuoteSummary · object[]

Quotes created from this cart

createdDate
string<date-time> | null

Date the cart was created

updatedDate
string<date-time> | null

Date the cart was last updated

expiresDate
string<date-time> | null

When the cart expires

notes
string | null

Notes about the cart

convertedChargeId
string | null

ID of charge if cart was converted