# Cart Discounts

## 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 Cart Discounts in the platform.**

## Queries

### Query Cart Discounts

[fetch SDL for query cartDiscounts](#graphql-partial-sdls).

### Get Cart Discount

[fetch SDL for query cartDiscount](#graphql-partial-sdls).

## Mutations

### Create Cart Discount

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

### Update Cart Discount

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

### Delete Cart Discount

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

## Output types

### CartDiscount

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

### Cart Discount Query Result

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

## Input types

### CartDiscountDraft

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

### CartDiscountUpdateAction

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

### Update actions

#### Set Stores

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

#### Add Store

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

#### Remove Store

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

#### Set Recurring Order Scope

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

#### Change Cart Predicate

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

#### Change Is Active

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

#### Change Name

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

#### Change Requires Discount Code

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

#### Change Sort Order

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

#### Change Stacking Mode

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

#### Change Target

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

#### Change Value

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

#### Set Custom Field

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

#### Set Custom Type

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

#### Set Description

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

#### Set Key

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

#### Set Valid From

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

#### Set Valid From And Until

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

#### Set Valid Until

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

#### Set Discount Group

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

## Related pages

- [Search documentation and API specs](/search.md)