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

# DiscountCodeSettingsInput

> How the discount reduces the order. Pass exactly one of `amountOff`, `freeShipping`, or `buyXGetY`.

<ResponseField name="amountOff" type={<a href="/docs/api-reference/v3/reference/marketing/amount-off-discount-settings-input">AmountOffDiscountSettingsInput</a>}>
  A percent-off or amount-off discount.

  <Expandable title="fields" lazyRender>
    <ResponseField name="amount" type="Float!" required>
      Percent off (0–100) when `valueType` is PERCENTAGE; otherwise a currency amount.
    </ResponseField>

    <ResponseField name="appliesOncePerCustomer" type="Boolean">
      Whether each customer may use the code only once.
    </ResponseField>

    <ResponseField name="collectionIds" type="[String!]">
      Platform collection ids this code applies to.
    </ResponseField>

    <ResponseField name="combinesWith" type={<a href="/docs/api-reference/v3/reference/marketing/discount-combines-with-input">DiscountCombinesWithInput</a>}>
      Which other discounts this code may stack with.

      <Expandable title="fields" lazyRender>
        <ResponseField name="orderDiscounts" type="Boolean">
          Stack with order discounts. Defaults to false.
        </ResponseField>

        <ResponseField name="productDiscounts" type="Boolean">
          Stack with product discounts. Defaults to false.
        </ResponseField>

        <ResponseField name="shippingDiscounts" type="Boolean">
          Stack with shipping discounts. Defaults to false.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="customerEligibility" type={<a href="/docs/api-reference/v3/reference/marketing/discount-customer-eligibility">DiscountCustomerEligibility</a>}>
      Which customers may use the code.
    </ResponseField>

    <ResponseField name="customerIds" type="[String!]">
      Platform customer ids when eligibility is SPECIFIC.
    </ResponseField>

    <ResponseField name="excludeItemsOnSale" type="Boolean">
      Whether items already on sale are excluded.
    </ResponseField>

    <ResponseField name="minimumRequirement" type={<a href="/docs/api-reference/v3/reference/marketing/discount-min-requirement-input">DiscountMinRequirementInput</a>}>
      A minimum purchase required to use the code.

      <Expandable title="fields" lazyRender>
        <ResponseField name="minimum" type="Float!" required>
          The required quantity or subtotal.
        </ResponseField>

        <ResponseField name="type" type={<a href="/docs/api-reference/v3/reference/marketing/discount-min-requirement-type">DiscountMinRequirementType!</a>} required>
          Whether `minimum` is a quantity or a subtotal.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="productIds" type="[String!]">
      Platform product ids this code applies to.
    </ResponseField>

    <ResponseField name="purchaseType" type={<a href="/docs/api-reference/v3/reference/marketing/discount-purchase-type">DiscountPurchaseType</a>}>
      Whether the code applies to one-time, subscription, or both.
    </ResponseField>

    <ResponseField name="recurringCycleLimit" type="Float">
      How many subscription cycles the code applies to.
    </ResponseField>

    <ResponseField name="segmentIds" type="[String!]">
      Platform segment ids when eligibility is SEGMENTS.
    </ResponseField>

    <ResponseField name="totalUsageLimit" type="Float">
      Maximum times this code may be used in total.
    </ResponseField>

    <ResponseField name="valueType" type={<a href="/docs/api-reference/v3/reference/marketing/discount-value-type">DiscountValueType!</a>} required>
      Whether `amount` is a percent or a currency amount.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="buyXGetY" type={<a href="/docs/api-reference/v3/reference/marketing/buy-x-get-y-discount-settings-input">BuyXGetYDiscountSettingsInput</a>}>
  A buy-X-get-Y discount.

  <Expandable title="fields" lazyRender>
    <ResponseField name="appliesOncePerCustomer" type="Boolean">
      Whether each customer may use the code only once.
    </ResponseField>

    <ResponseField name="combinesWith" type={<a href="/docs/api-reference/v3/reference/marketing/discount-combines-with-input">DiscountCombinesWithInput</a>}>
      Which other discounts this code may stack with.

      <Expandable title="fields" lazyRender>
        <ResponseField name="orderDiscounts" type="Boolean">
          Stack with order discounts. Defaults to false.
        </ResponseField>

        <ResponseField name="productDiscounts" type="Boolean">
          Stack with product discounts. Defaults to false.
        </ResponseField>

        <ResponseField name="shippingDiscounts" type="Boolean">
          Stack with shipping discounts. Defaults to false.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="customerBuys" type={<a href="/docs/api-reference/v3/reference/marketing/discount-bxgy-customer-buys-input">DiscountBxgyCustomerBuysInput!</a>} required>
      What the customer must buy to unlock the Y items.

      <Expandable title="fields" lazyRender>
        <ResponseField name="amount" type="Float">
          Required spend when `triggerType` is MINIMUM\_AMOUNT.
        </ResponseField>

        <ResponseField name="collections" type={<a href="/docs/api-reference/v3/reference/marketing/discount-catalog-item-input">[DiscountCatalogItemInput!]</a>}>
          Collections that count toward X.
        </ResponseField>

        <ResponseField name="products" type={<a href="/docs/api-reference/v3/reference/marketing/discount-catalog-item-input">[DiscountCatalogItemInput!]</a>}>
          Products that count toward X.
        </ResponseField>

        <ResponseField name="quantity" type="Float">
          Required quantity when `triggerType` is MINIMUM\_QUANTITY.
        </ResponseField>

        <ResponseField name="triggerType" type={<a href="/docs/api-reference/v3/reference/marketing/discount-bxgy-trigger-type">DiscountBxgyTriggerType!</a>} required>
          Whether the customer must buy a quantity or spend an amount.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="customerEligibility" type={<a href="/docs/api-reference/v3/reference/marketing/discount-customer-eligibility">DiscountCustomerEligibility</a>}>
      Which customers may use the code.
    </ResponseField>

    <ResponseField name="customerGets" type={<a href="/docs/api-reference/v3/reference/marketing/discount-bxgy-customer-gets-input">DiscountBxgyCustomerGetsInput!</a>} required>
      What the customer gets, and at what discount.

      <Expandable title="fields" lazyRender>
        <ResponseField name="amount" type="Float!" required>
          Percent off (0–100) when `valueType` is PERCENTAGE; otherwise a currency amount.
        </ResponseField>

        <ResponseField name="collections" type={<a href="/docs/api-reference/v3/reference/marketing/discount-catalog-item-input">[DiscountCatalogItemInput!]</a>}>
          Collections the customer gets.
        </ResponseField>

        <ResponseField name="products" type={<a href="/docs/api-reference/v3/reference/marketing/discount-catalog-item-input">[DiscountCatalogItemInput!]</a>}>
          Products the customer gets.
        </ResponseField>

        <ResponseField name="quantity" type="Float!" required>
          How many Y items the customer gets.
        </ResponseField>

        <ResponseField name="valueType" type={<a href="/docs/api-reference/v3/reference/marketing/discount-value-type">DiscountValueType!</a>} required>
          Whether `amount` is a percent or a currency amount off Y.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="customerIds" type="[String!]">
      Platform customer ids when eligibility is SPECIFIC.
    </ResponseField>

    <ResponseField name="segmentIds" type="[String!]">
      Platform segment ids when eligibility is SEGMENTS.
    </ResponseField>

    <ResponseField name="totalUsageLimit" type="Float">
      Maximum times this code may be used in total.
    </ResponseField>

    <ResponseField name="usesPerOrderLimit" type="Float">
      How many times the Y items may be claimed on one order.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="freeShipping" type={<a href="/docs/api-reference/v3/reference/marketing/free-shipping-discount-settings-input">FreeShippingDiscountSettingsInput</a>}>
  A free-shipping discount.

  <Expandable title="fields" lazyRender>
    <ResponseField name="appliesOncePerCustomer" type="Boolean">
      Whether each customer may use the code only once.
    </ResponseField>

    <ResponseField name="combinesWith" type={<a href="/docs/api-reference/v3/reference/marketing/discount-combines-with-input">DiscountCombinesWithInput</a>}>
      Which other discounts this code may stack with.

      <Expandable title="fields" lazyRender>
        <ResponseField name="orderDiscounts" type="Boolean">
          Stack with order discounts. Defaults to false.
        </ResponseField>

        <ResponseField name="productDiscounts" type="Boolean">
          Stack with product discounts. Defaults to false.
        </ResponseField>

        <ResponseField name="shippingDiscounts" type="Boolean">
          Stack with shipping discounts. Defaults to false.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="countryCodes" type="[String!]">
      ISO country codes this free shipping applies to.
    </ResponseField>

    <ResponseField name="customerEligibility" type={<a href="/docs/api-reference/v3/reference/marketing/discount-customer-eligibility">DiscountCustomerEligibility</a>}>
      Which customers may use the code.
    </ResponseField>

    <ResponseField name="customerIds" type="[String!]">
      Platform customer ids when eligibility is SPECIFIC.
    </ResponseField>

    <ResponseField name="maximumShippingPrice" type="Float">
      Shipping priced above this amount is not made free.
    </ResponseField>

    <ResponseField name="minimumRequirement" type={<a href="/docs/api-reference/v3/reference/marketing/discount-min-requirement-input">DiscountMinRequirementInput</a>}>
      A minimum purchase required to use the code.

      <Expandable title="fields" lazyRender>
        <ResponseField name="minimum" type="Float!" required>
          The required quantity or subtotal.
        </ResponseField>

        <ResponseField name="type" type={<a href="/docs/api-reference/v3/reference/marketing/discount-min-requirement-type">DiscountMinRequirementType!</a>} required>
          Whether `minimum` is a quantity or a subtotal.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="purchaseType" type={<a href="/docs/api-reference/v3/reference/marketing/discount-purchase-type">DiscountPurchaseType</a>}>
      Whether the code applies to one-time, subscription, or both.
    </ResponseField>

    <ResponseField name="recurringCycleLimit" type="Float">
      How many subscription cycles the code applies to.
    </ResponseField>

    <ResponseField name="segmentIds" type="[String!]">
      Platform segment ids when eligibility is SEGMENTS.
    </ResponseField>

    <ResponseField name="totalUsageLimit" type="Float">
      Maximum times this code may be used in total.
    </ResponseField>
  </Expandable>
</ResponseField>


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