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

## Queries

### Query Product Discounts

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

### Get Product Discount

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

## Mutations

### Create Product Discount

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

### Update Product Discount

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

### Delete Product Discount

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

## Output types

### ProductDiscount

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

### Product Discount Query Result

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

## Input types

### ProductDiscountDraft

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

### ProductDiscountUpdateAction

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

### Update actions

#### Change Is Active

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

#### Change Name

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

#### Change Predicate

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

#### Change Sort Order

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

#### Change Value

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

#### Set Description

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

#### Set Key

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

#### Set Valid From

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

#### Set Valid From And Until

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

#### Set Valid Until

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

## Related pages

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