Parameters
Single item (simple)
| Param | Type | Required | Description |
|---|---|---|---|
variantId | string | Yes | Product variant GID |
quantity | number | No | Quantity to add (default: 1) |
Single item (with options)
| Param | Type | Required | Description |
|---|---|---|---|
variantId | string | Yes | Product variant GID |
options.quantity | number | No | Quantity to add (default: 1) |
options.sellingPlanId | string | No | Selling plan GID for pre-orders/subscriptions |
Multiple items
| Param | Type | Required | Description |
|---|---|---|---|
lines | CartLineInput[] | Yes | Array of line items |
Returns
Promise<ShopifyCart>