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

# CreateDiscountCodeInput

> A discount code to create on Shopify or BigCommerce. Pass amount-off, free-shipping, or buy-X-get-Y settings.

<ResponseField name="code" type="String!" required>
  The code customers enter at checkout.
</ResponseField>

<ResponseField name="expiration" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-expiration-input">DiscountCodeExpirationInput!</a>} required>
  When the code stops working.

  <Expandable title="fields" lazyRender>
    <ResponseField name="date" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime</a>}>
      Required when `type` is ON\_DATE.
    </ResponseField>

    <ResponseField name="days" type="Int">
      Required when `type` is AFTER\_DAYS.
    </ResponseField>

    <ResponseField name="type" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-expiration-input-type">DiscountCodeExpirationInputType!</a>} required>
      Whether the code never expires, expires on a date, or after a number of days.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="groupType" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-group-type">DiscountCodeGroupType</a>}>
  Must be STATIC (one shared checkout code). DYNAMIC unique-per-customer codes are not supported.
</ResponseField>

<ResponseField name="provider" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-provider">DiscountCodeProvider!</a>} required>
  The commerce platform that should host this code.
</ResponseField>

<ResponseField name="settings" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-settings-input">DiscountCodeSettingsInput!</a>} required>
  How the discount reduces the order. Pass exactly one of amountOff, freeShipping, or buyXGetY.

  <Expandable title="fields" lazyRender>
    <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.
        </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.
        </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.
        </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.
        </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.
        </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.
        </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.
        </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>
  </Expandable>
</ResponseField>

<ResponseField name="title" type="String!" required>
  The merchant-facing name of the discount.
</ResponseField>


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