---
title: "automaticDiscountNodes"
description: "List of automatic discounts."
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/queries/automatic-discount-nodes'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/queries/automatic-discount-nodes.md'
---
# automaticDiscountNodes

List of automatic discounts.

- **Required Scopes:** `read_discounts`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Query

## Type Signature

`DiscountAutomaticNodeConnection`

## Required Permissions

* `read_discounts`

An access token is required to call this API. Refer to [Authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md) for more information about how to obtain the token.

## Arguments

* `first`

  [Int](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/int.md)

  Returns the first n elements in the list. 

* `last`

  [Int](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/int.md)

  Returns the last n elements in the list. 

* `reverse`

  [Boolean](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/boolean.md)

  Whether to reverse the order of the list. 
  
  ● true: reverse
  
  ● false: do not reverse
  
  Default value: false

* `query`

  [String](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/string.md)

  Apply one or multiple filters to the query. Currently supported filter fields and selectable values:
  
  status: Represents the activity status, with selectable
  
  values: active (enabled), expired (expired), scheduled (upcoming)
  
  type: Represents the type of discount, with selectable
  
  values: fix_amount (reduce the amount), percentage (reduce percentage discount)
  
  Example: To query for an active automatic discount event that reduces a fixed amount, use the following: `query:"type:fix_amount AND status:active"`.
  
  

* `sortKey`

  [AutomaticDiscountSortKeys](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/enums/automatic-discount-sort-keys.md)

  Valid sorting key set for automatic discount list query
  Selectable enumeration values:
  
  1. `CREATED_AT`: Sort by creation time
  2. `ID`: Sort by ID
  

* `after`

  [String](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/string.md)

  Returns elements following the specified cursor. The `first` argument must also be specified when using this argument.

* `before`

  [String](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/string.md)

  Returns elements preceding the specified cursor. The `last` argument must also be specified when using this argument.

## Returns

* `edges`

  [[DiscountAutomaticNodeEdge!]](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-automatic-node-edge.md)

  A list of edges

* `nodes`

  [[DiscountAutomaticNode]](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-automatic-node.md)

  A list of the nodes contained in DiscountAutomaticNodeEdge.

* `pageInfo`

  [PageInfo!](https://developer.shopline.com/docs/admin-graph-ql-api/common-objects/objects/page-info.md)

  Information to aid in pagination.
  
  

## Code Example

```graphql
 {
	automaticDiscountNodes(first, last, reverse, query, sortKey, after, before ) 
		 {
			# DiscountAutomaticNodeConnection fields
		}
}
```

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes).

