younifyd
Menu

discountCodesCount

The total number of discount codes for the shop. Limited to a maximum of 10000 by default.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the discountCodesCount action (under Discount).
  3. Fill in the fields below, then reference the result from later steps as {{discountcodescount.response.data}}.

Query

This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
query DiscountCodesCount($query: String, $limit: Int) {
  discountCodesCount(query: $query, limit: $limit) {
    count
    precision
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

querystring

A filter made up of terms, connectives, modifiers, and comparators. | name | type | description | acceptable_values | default_value | example_use | | ---- | ---- | ---- | ---- | ---- | ---- | | default | string | Filter by a case-insensitive search of multiple fields in a document. | | | - `query=Bob Norman`<br/> - `query=title:green hoodie` | | id | id | Filter by `id` range. | | | - `id:1234`<br/> - `id:>=1234`<br/> - `id:<=1234` | | times_used | integer | You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).

limitnumber

The upper bound on count value before returning a result. Use `null` to have no limit.

json
{
  "query": "string",
  "limit": 0
}

Response

Read the result with {{discountcodescount.response.data.data.discountCodesCount}}. If the API returns errors, the step fails and they are at {{discountcodescount.response.data.errors}}.

countnumber
precisionstring

One ofEXACTAT_LEAST

Need more? See the Shopify guide for connection setup and behaviour shared by every action.

discountCodesCount — Shopify — Documentation