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

# Data models

These models are shared by services and app-extension hooks.

## Product models

```ts theme={null}
interface Product {
  id: string;
  name: string;
  vendor: string;
  collectionIDs: string[];
  tags: string[];
  discountPercentage: number;
  thumbnail: string | null;
  metaFields(keys: string[]): object;
  getMetaFields(keys: string[]): Promise<unknown>;
}

interface ProductVariant {
  id: string;
  stock: number;
  price: number;
  policy: "continue" | "deny";
  getMetaFields(keys: string[]): Promise<unknown>;
}

interface ProductTag {
  type: string;
  labelText: string;
  labelTextColor: string;
  labelBackgroundColor: string;
}
```

## Cart models

```ts theme={null}
interface CartLineItem {
  id: string;
  quantity: number;
  productID: string;
  product: Product | null;
  variantID: string;
  variant: ProductVariant | null;
  attributes: Record<string, string>;
  totalAmount: number;
  subtotalAmount: number;
  properties: Record<string, string>;
  requiresShipping: boolean;
  weight: number;
  weightUnit: string;
}

interface Cart {
  lineItems: CartLineItem[];
  attributes: Record<string, string>;
  currency: string;
  note: string;
  subtotalAmount: number;
  totalAmount: number;
  totalDiscount: number;
  checkoutChargeAmount: number;
  itemsSubTotalAmount: number;
  itemCount: number;
  getTotalWeight(unit?: string | null): object;
}

type CartOperation = object;
```

`CartOperation` is the native mutation object returned by `CartOperations`. Create it with the factory methods documented in [Cart operations](/cart-operations); do not construct it manually.

## Collection model

```ts theme={null}
interface Collection {
  id: string;
  title: string;
  description: string;
  url: string;
  metafields: Record<string, unknown>;
}
```
