NewCartLine

cart · /core·type

Minimal input needed to add a variant to a cart. Passed to createCart or the add-line mutation; the adapter expands it into a full using catalog data from the provider.

Properties

quantity
number
variantId
string
attributes?
{ key: string; value: string }[]

Example

const line: NewCartLine = { variantId: 'gid://shopify/ProductVariant/1', quantity: 2 };
await kernel.mutate(ctx, { kind: 'add-line', ...line });

RunCartAdapterContractOpts runCartAdapterContract CartCapabilityUnsupportedError CartError CartNotFoundError CartProviderError CartUserError CartAdapter

Sourcetypes.ts:136Edit the JSDoc directly

On this page