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

# discountCodes

> List discount configurations, optionally filtered by title or code text, exact checkout code, platform, group type, or kind.

**Required scopes:** [`campaigns_read`](/docs/api-reference/v3/reference/scopes#scope-campaigns_read)

## Arguments

<ResponseField name="after" type="String">
  Forward pagination cursor — returns items after it. Pass an `edges[].cursor` or `pageInfo.endCursor` from a previous page.
</ResponseField>

<ResponseField name="before" type="String">
  Backward pagination cursor — returns items before it. Pass an `edges[].cursor` or `pageInfo.startCursor` from a previous page.
</ResponseField>

<ResponseField name="code" type="String">
  Only include the discount with this checkout code. Matching is case-insensitive.
</ResponseField>

<ResponseField name="first" type="Int">
  Forward pagination: returns the first N items (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.
</ResponseField>

<ResponseField name="groupType" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-group-type">DiscountCodeGroupType</a>}>
  Only include discounts with this code-generation strategy.
</ResponseField>

<ResponseField name="kind" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-kind">DiscountCodeKind</a>}>
  Only include amount-off, free-shipping, buy-X-get-Y, or dynamic-range discounts.
</ResponseField>

<ResponseField name="last" type="Int">
  Backward pagination: returns the last N items (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.
</ResponseField>

<ResponseField name="orderBy" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-sort-key">DiscountCodeSortKey</a>}>
  Which key to sort by (defaults to the first key, newest-first). Combine with `reverse` to flip direction.
</ResponseField>

<ResponseField name="provider" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-provider">DiscountCodeProvider</a>}>
  Only include discounts hosted on this platform.
</ResponseField>

<ResponseField name="query" type="String">
  Case-insensitive substring match on the discount title or checkout code. At most 200 characters.
</ResponseField>

<ResponseField name="reverse" type="Boolean">
  Reverses the sort direction selected by `orderBy` (or its default).
</ResponseField>

## Returns

<ResponseField name="discountCodes" type={<a href="/docs/api-reference/v3/pagination">DiscountCodeConnection!</a>} required>
  A paginated list of DiscountCode items.

  <Expandable title="fields" lazyRender>
    <ResponseField name="edges" type={<a href="/docs/api-reference/v3/pagination">[DiscountCodeEdge!]!</a>} required>
      The list of edges (each a node plus its pagination `cursor`).

      <Expandable title="fields" lazyRender>
        <ResponseField name="cursor" type="String!" required>
          Opaque cursor for this item; pass to `after`/`before` to page from here.
        </ResponseField>

        <ResponseField name="node" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code">DiscountCode!</a>} required>
          The item at this edge.

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

            <ResponseField name="createdAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime</a>}>
              When the discount was created.
            </ResponseField>

            <ResponseField name="description" type="String!" required>
              A short human-readable summary of what the code does.
            </ResponseField>

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

            <ResponseField name="externalId" type="String!" required>
              The platform's id for this discount (a Shopify GID or a BigCommerce promotion id).
            </ResponseField>

            <ResponseField name="groupType" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-group-type">DiscountCodeGroupType!</a>} required>
              Whether this is one fixed code or a unique code per customer.
            </ResponseField>

            <ResponseField name="id" type="ID!" required>
              The id of this discount code.
            </ResponseField>

            <ResponseField name="kind" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-kind">DiscountCodeKind</a>}>
              How the discount reduces the order. Null when the config has no settings type.
            </ResponseField>

            <ResponseField name="legacyId" type="String!" required>
              The discount's legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.
            </ResponseField>

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

            <ResponseField name="settings" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-settings">DiscountCodeSettings</a>}>
              How the discount reduces the order.
            </ResponseField>

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

            <ResponseField name="updatedAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime</a>}>
              When the discount was last edited.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="nodes" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code">[DiscountCode!]!</a>} required>
      The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

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

        <ResponseField name="createdAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime</a>}>
          When the discount was created.
        </ResponseField>

        <ResponseField name="description" type="String!" required>
          A short human-readable summary of what the code does.
        </ResponseField>

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

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

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

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

        <ResponseField name="externalId" type="String!" required>
          The platform's id for this discount (a Shopify GID or a BigCommerce promotion id).
        </ResponseField>

        <ResponseField name="groupType" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-group-type">DiscountCodeGroupType!</a>} required>
          Whether this is one fixed code or a unique code per customer.
        </ResponseField>

        <ResponseField name="id" type="ID!" required>
          The id of this discount code.
        </ResponseField>

        <ResponseField name="kind" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-kind">DiscountCodeKind</a>}>
          How the discount reduces the order. Null when the config has no settings type.
        </ResponseField>

        <ResponseField name="legacyId" type="String!" required>
          The discount's legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.
        </ResponseField>

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

        <ResponseField name="settings" type={<a href="/docs/api-reference/v3/reference/marketing/discount-code-settings">DiscountCodeSettings</a>}>
          How the discount reduces the order.
        </ResponseField>

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

        <ResponseField name="updatedAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime</a>}>
          When the discount was last edited.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="pageInfo" type={<a href="/docs/api-reference/v3/pagination">PageInfo!</a>} required>
      Pagination metadata for the current page.

      <Expandable title="fields" lazyRender>
        <ResponseField name="endCursor" type="String">
          Cursor of the last edge in this page; pass to `after` to page forward.
        </ResponseField>

        <ResponseField name="hasNextPage" type="Boolean!" required>
          Whether more items exist after this page (drives forward pagination with `first`/`after`).
        </ResponseField>

        <ResponseField name="hasPreviousPage" type="Boolean!" required>
          Whether more items exist before this page (drives backward pagination with `last`/`before`).
        </ResponseField>

        <ResponseField name="startCursor" type="String">
          Cursor of the first edge in this page; pass to `before` to page backward.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

```graphql theme={null}
query {
  discountCodes(after: "...", before: "...", code: "...", first: 10, groupType: DYNAMIC, kind: AMOUNT_OFF, last: 10, orderBy: CREATED_AT, provider: BIG_COMMERCE, query: "...", reverse: true) {
    nodes {
      code
      createdAt
      description
      externalId
      groupType
      id
      kind
      legacyId
      # ...
    }
    pageInfo { hasNextPage endCursor }
  }
}
```


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