younifyd
Menu

giftCardsCount

Returns the total count of gift cards that have been issued by the shop. Use this for dashboard summaries or to understand the scale of a merchant's gift card program.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the giftCardsCount action (under Gift).
  3. Fill in the fields below, then reference the result from later steps as {{giftcardscount.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 GiftCardsCount($query: String, $savedSearchId: ID, $limit: Int) {
  giftCardsCount(query: $query, savedSearchId: $savedSearchId, 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, including gift card codes. | | | - `query=a5bh6h64b329j4k7`<br/> - `query=Bob Norman` | | balance_status | string | | - `full`<br/> - `partial`<br/> - `empty`<br/> - `full_or_partial` | | - `balance_status:full` | | created_at | time | | | | - `created_at:>='2020-01-01T12:00:00Z'` | | customer_id | id | | expires_on | date | | | | - `expires_on:>=2020-01-01` | | id | id | Filter by `id` range. | | | - `id:1234`<br/> - `id:>=1234`<br/> - `id:<=1234` | | initial_value | string | | | | - `initial_value:>=100` | | recipient_id | id | | source | string | | - `manual`<br/> - `purchased`<br/> - `api_client` | | - `source:manual` | | status | string | | - `disabled`<br/> - `enabled`<br/> - `expired`<br/> - `expiring` | | - `status:disabled OR status:expired` | You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).

savedSearchIdstring

The ID of an existing saved search. The search’s query string is used as the query argument. Refer to the [`SavedSearch`](https://shopify.dev/api/admin-graphql/latest/objects/savedsearch) object.

limitnumber

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

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

Response

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

countnumber
precisionstring

One ofEXACTAT_LEAST

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