> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# checkoutDiscountRuleCreate

> Create a checkout discount rule. It is created inactive; turn it on with checkoutDiscountRuleSetActive. Amounts must be in the shop's currency. Numeric Shopify product and collection ids are saved as GIDs, and empty condition blocks are dropped. An invalid rule fails with INVALID_CHECKOUT_DISCOUNT_RULE (400).

**Required scopes:** [`checkout_write`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-checkout_write)

## Arguments

**input** `[CheckoutDiscountRuleCreateInput!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-create-input)` *required*

The rule to create.

**fields**

**conditions** `[CheckoutDiscountRuleConditionsInput!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-conditions-input)` *required*

When the rule applies.

**fields**

**blocks** `[\[CheckoutDiscountRuleConditionBlockInput!\]!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-condition-block-input)` *required*

Groups of conditions, at most 6 that are not empty.

**conjunction** `[CheckoutDiscountRuleConjunction!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-conjunction)` *required*

How the blocks combine.

**discount** `[CheckoutDiscountRuleDiscountInput!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-discount-input)` *required*

What the rule takes off.

**fields**

**fixedAmount** `[CheckoutDiscountRuleFixedAmountDiscountInput](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-fixed-amount-discount-input)`

A fixed amount off.

**percentage** `[CheckoutDiscountRulePercentageDiscountInput](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-percentage-discount-input)`

A percentage off.

**message** `String!` *required*

Shopper-facing text, 1 to 250 characters.

**target** `[CheckoutDiscountRuleTargetInput!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-target-input)` *required*

What the rule discounts.

**fields**

**shipping** `[CheckoutDiscountRuleShippingTargetInput](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-shipping-target-input)`

Discount shipping.

## Returns

**checkoutDiscountRuleCreate** `[CheckoutDiscountRule!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule)` *required*

A store-level checkout discount rule: when its conditions match the cart, its discount applies to the targeted delivery options. The first matching active rule wins.

**fields**

**active** `Boolean!` *required*

Whether the rule is evaluated at checkout while discount rules are on.

**conditions** `[CheckoutDiscountRuleConditions!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-conditions)` *required*

When the rule applies.

**fields**

**blocks** `[\[CheckoutDiscountRuleConditionBlock!\]!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-condition-block)` *required*

Groups of conditions, at most 6.

**fields**

**conditions** `[\[CheckoutDiscountRuleCondition!\]!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-condition)` *required*

The conditions in this block.

**conjunction** `[CheckoutDiscountRuleConjunction!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-conjunction)` *required*

How the conditions in this block combine.

**conjunction** `[CheckoutDiscountRuleConjunction!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-conjunction)` *required*

How the blocks combine.

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the rule was created.

**discount** `[CheckoutDiscountRuleDiscount!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-discount)` *required*

What the rule takes off.

**id** `ID!` *required*

The rule's id.

**message** `String!` *required*

Shopper-facing text shown with the discounted price.

**target** `[CheckoutDiscountRuleTarget!](/docs/api-reference/v3/reference/checkout/checkout-discount-rule-target)` *required*

What the rule discounts.

**updatedAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the rule was last changed.

## Example

```graphql theme={null}
mutation {
  checkoutDiscountRuleCreate(input: { ... }) {
    active
    createdAt
    id
    message
    updatedAt
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.