> ## 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.

# checkoutDiscountRulesReorder

> Set the evaluation order of the active rules. At checkout the first active rule whose conditions match wins. Returns the active rules in their new order. When discount rules are on, the store's live checkout discount is updated right away. `ids` must list every active rule exactly once; otherwise the request fails with INVALID_CHECKOUT_DISCOUNT_RULE_ORDER (400).

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

## Arguments

**input** `[CheckoutDiscountRulesReorderInput!](/docs/api-reference/v3/reference/checkout/checkout-discount-rules-reorder-input)` *required*

The new order.

**fields**

**ids** `[ID!]!` *required*

Every active rule's id exactly once, the one to try first at the start.

## Returns

**checkoutDiscountRulesReorder** `[\[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 {
  checkoutDiscountRulesReorder(input: { ... }) {
    active
    createdAt
    id
    message
    updatedAt
  }
}
```


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