# My Carts

## GraphQL partial SDLs

This is a graphql reference page. In the llms.txt variant, those components link to the shared partial SDL key list instead of trying to resolve inline GraphQL reference content.

Fetch all available partial SDL keys first:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:returnTypesList
```

Then fetch the one or more relevant partial SDL with a key from that list by calling the same endpoint with a schema ID:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:schema:<key>
```

The response body is a JSON object keyed by the requested content ID. For example, the key-list request returns a `ctp:gql-sphere:returnTypesList` field and a schema request returns a `ctp:gql-sphere:schema:<key>` field.

**Queries and mutations for managing the Carts of the authenticated Customer.**

The My Carts mutations operate on the same [Cart](/api/graphql/carts.md#cart) output type as the [Carts](/api/graphql/carts.md) mutations, but accept a restricted set of input types and update actions. Types that are shared with Carts are documented only on the [Carts](/api/graphql/carts.md) page and linked from here.

## Queries

The queries for My Carts are the `cart`, `carts`, and `activeCart` fields on the `me` field. They are the same as the queries documented on the [Carts](/api/graphql/carts.md#queries) page ([Query Carts](/api/graphql/carts.md#query-carts), [Get Cart](/api/graphql/carts.md#get-cart), and [Get active Cart](/api/graphql/carts.md#get-active-cart)), but return only Carts of the authenticated Customer.

## Mutations

### Create My Cart

[fetch SDL for mutation createMyCart](#graphql-partial-sdls).

### Update My Cart

[fetch SDL for mutation updateMyCart](#graphql-partial-sdls).

### Delete My Cart

[fetch SDL for mutation deleteMyCart](#graphql-partial-sdls).

### Replicate My Cart

[fetch SDL for mutation replicateMyCart](#graphql-partial-sdls).

## Output types

The My Carts mutations return the [Cart](/api/graphql/carts.md#cart) type. To query Carts of the authenticated Customer, use the `cart`, `carts`, and `activeCart` fields on the `me` field. These return [Cart](/api/graphql/carts.md#cart) and [CartQueryResult](/api/graphql/carts.md#cart-query-result).

## Input types

### MyCartDraft

[fetch SDL for type MyCartDraft](#graphql-partial-sdls).

### MyCartUpdateAction

[fetch SDL for type MyCartUpdateAction](#graphql-partial-sdls).

### Update actions

`MyCartUpdateAction` supports a subset of the [CartUpdateAction](/api/graphql/carts.md#cartupdateaction) update actions. Update actions that are not listed on this page are not available for My Carts. Update actions that use the same input type as on Carts link to their definition on the [Carts](/api/graphql/carts.md) page.

#### Add DiscountCode

See [Add DiscountCode](/api/graphql/carts.md#add-discountcode) on Carts.

#### Add ItemShippingAddress

See [Add ItemShippingAddress](/api/graphql/carts.md#add-itemshippingaddress) on Carts.

#### Add Payment

See [Add Payment](/api/graphql/carts.md#add-payment) on Carts.

#### Add Shopping List

See [Add Shopping List](/api/graphql/carts.md#add-shopping-list) on Carts.

#### Change LineItems Order

See [Change LineItems Order](/api/graphql/carts.md#change-lineitems-order) on Carts.

#### Change TaxMode

[fetch SDL for type ChangeMyCartTaxMode](#graphql-partial-sdls).

This update action uses a dedicated input type instead of `ChangeCartTaxMode`. See [Change TaxMode](/api/graphql/carts.md#change-taxmode) on Carts for the Cart version.

#### Recalculate

See [Recalculate](/api/graphql/carts.md#recalculate) on Carts.

#### Remove DiscountCode

See [Remove DiscountCode](/api/graphql/carts.md#remove-discountcode) on Carts.

#### Remove ItemShippingAddress

See [Remove ItemShippingAddress](/api/graphql/carts.md#remove-itemshippingaddress) on Carts.

#### Remove LineItem

See [Remove LineItem](/api/graphql/carts.md#remove-lineitem) on Carts.

#### Remove Payment

See [Remove Payment](/api/graphql/carts.md#remove-payment) on Carts.

#### Set Billing Address

See [Set Billing Address](/api/graphql/carts.md#set-billing-address) on Carts.

#### Set Billing Address CustomField

See [Set Billing Address CustomField](/api/graphql/carts.md#set-billing-address-customfield) on Carts.

#### Set Billing Address Custom Type

See [Set Billing Address Custom Type](/api/graphql/carts.md#set-billing-address-custom-type) on Carts.

#### Set Business Unit &#x20;

See [Set Business Unit](/api/graphql/carts.md#set-business-unit) on Carts.

#### Set Country

See [Set Country](/api/graphql/carts.md#set-country) on Carts.

#### Set CustomField

See [Set CustomField](/api/graphql/carts.md#set-customfield) on Carts.

#### Set Custom Type

See [Set Custom Type](/api/graphql/carts.md#set-custom-type) on Carts.

#### Set Customer Email

See [Set Customer Email](/api/graphql/carts.md#set-customer-email) on Carts.

#### Set DeleteDaysAfterLastModification

See [Set DeleteDaysAfterLastModification](/api/graphql/carts.md#set-deletedaysafterlastmodification) on Carts.

#### Set ItemShipping Address CustomField

See [Set ItemShipping Address CustomField](/api/graphql/carts.md#set-itemshipping-address-customfield) on Carts.

#### Set ItemShipping Address Custom Type

See [Set ItemShipping Address Custom Type](/api/graphql/carts.md#set-itemshipping-address-custom-type) on Carts.

#### Set LineItem CustomField

See [Set LineItem CustomField](/api/graphql/carts.md#set-lineitem-customfield) on Carts.

#### Set LineItem Custom Type

See [Set LineItem Custom Type](/api/graphql/carts.md#set-lineitem-custom-type) on Carts.

#### Set LineItem DistributionChannel

See [Set LineItem DistributionChannel](/api/graphql/carts.md#set-lineitem-distributionchannel) on Carts.

#### Set LineItem ShippingDetails

See [Set LineItem ShippingDetails](/api/graphql/carts.md#set-lineitem-shippingdetails) on Carts.

#### Set LineItem SupplyChannel

See [Set LineItem SupplyChannel](/api/graphql/carts.md#set-lineitem-supplychannel) on Carts.

#### Set Locale

See [Set Locale](/api/graphql/carts.md#set-locale) on Carts.

#### Set ShippingMethod

[fetch SDL for type SetMyCartShippingMethod](#graphql-partial-sdls).

This update action uses a dedicated input type instead of `SetCartShippingMethod`. See [Set ShippingMethod](/api/graphql/carts.md#set-shippingmethod) on Carts for the Cart version.

#### Set Shipping Address

See [Set Shipping Address](/api/graphql/carts.md#set-shipping-address) on Carts.

#### Set Shipping Address CustomField

See [Set Shipping Address CustomField](/api/graphql/carts.md#set-shipping-address-customfield) on Carts.

#### Set Shipping Address Custom Type

See [Set Shipping Address Custom Type](/api/graphql/carts.md#set-shipping-address-custom-type) on Carts.

#### Set Shipping CustomField

See [Set Shipping CustomField](/api/graphql/carts.md#set-shipping-customfield) on Carts.

#### Set Shipping Custom Type

See [Set Shipping Custom Type](/api/graphql/carts.md#set-shipping-custom-type) on Carts.

#### Update ItemShippingAddress

See [Update ItemShippingAddress](/api/graphql/carts.md#update-itemshippingaddress) on Carts.

#### Apply DeltaToLineItemShippingDetailsTargets

See [Apply DeltaToLineItemShippingDetailsTargets](/api/graphql/carts.md#apply-deltatolineitemshippingdetailstargets) on Carts.

#### Apply DeltaToCustomLineItemShippingDetailsTargets

See [Apply DeltaToCustomLineItemShippingDetailsTargets](/api/graphql/carts.md#apply-deltatocustomlineitemshippingdetailstargets) on Carts.

#### Add LineItem

[fetch SDL for type AddMyCartLineItem](#graphql-partial-sdls).

This update action uses a dedicated input type instead of `AddCartLineItem`. See [Add LineItem](/api/graphql/carts.md#add-lineitem) on Carts for the Cart version.

#### Set LineItemRecurrenceInfo

See [Set LineItemRecurrenceInfo](/api/graphql/carts.md#set-lineitemrecurrenceinfo) on Carts.

#### Set CustomLineItemRecurrenceInfo

See [Set CustomLineItemRecurrenceInfo](/api/graphql/carts.md#set-customlineitemrecurrenceinfo) on Carts.

#### Change LineItem Quantity

See [Change LineItem Quantity](/api/graphql/carts.md#change-lineitem-quantity) on Carts.

## Related pages

- [Area overview page with navigation](/api.md)
- [Previous page: REST](/api/projects/me-carts.md)
- [Search documentation and API specs](/search.md)