younifyd
Menu

giftCards

Returns a paginated list of GiftCard objects issued for the shop. You can filter gift cards by attributes such as status, last characters of the code, balance status, and other values using the query parameter.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the giftCards action (under Gift).
  3. Fill in the fields below, then reference the result from later steps as {{giftcards.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 GiftCards($first: Int, $after: String, $last: Int, $before: String, $reverse: Boolean, $sortKey: GiftCardSortKeys, $query: String, $savedSearchId: ID) {
  giftCards(
    first: $first
    after: $after
    last: $last
    before: $before
    reverse: $reverse
    sortKey: $sortKey
    query: $query
    savedSearchId: $savedSearchId
  ) {
    edges {
      cursor
      node {
        balance
        createdAt
        crossCurrencyRedemptionStrategy
        customer
        deactivatedAt
        enabled
        expiresOn
        id
        initialValue
        isRedeemable
        lastCharacters
        lineItem
        maskedCode
        note
        order
        recipientAttributes
        templateSuffix
        updatedAt
      }
    }
    nodes {
      balance {
        amount
        currencyCode
      }
      createdAt
      crossCurrencyRedemptionStrategy
      customer {
        amountSpent
        canDelete
        companyContactProfiles
        createdAt
        dataSaleOptOut
        defaultAddress
        defaultEmailAddress
        defaultPhoneNumber
        displayName
        email
        emailMarketingConsent
        firstName
        hasTimelineComment
        id
        identityProviderSubjects
        lastName
        lastOrder
        legacyResourceId
        lifetimeDuration
        locale
        market
        mergeable
        multipassIdentifier
        note
        numberOfOrders
        phone
        productSubscriberStatus
        smsMarketingConsent
        state
        statistics
        tags
        taxExempt
        taxExemptions
        taxSettings
        unsubscribeUrl
        updatedAt
        validEmailAddress
        verifiedEmail
      }
      deactivatedAt
      enabled
      expiresOn
      id
      initialValue {
        amount
        currencyCode
      }
      isRedeemable
      lastCharacters
      lineItem {
        canRestock
        contract
        currentQuantity
        customAttributes
        discountAllocations
        discountedTotal
        discountedUnitPrice
        discountedUnitPriceAfterAllDiscountsSet
        discountedUnitPriceSet
        duties
        fulfillableQuantity
        fulfillmentService
        fulfillmentStatus
        id
        isGiftCard
        lineItemGroup
        merchantEditable
        name
        nonFulfillableQuantity
        originalTotal
        originalTotalSet
        originalUnitPrice
        originalUnitPriceSet
        priceAfterAllDiscountsBeforeTaxesSet
        product
        quantity
        refundableQuantity
        requiresShipping
        restockable
        sellingPlan
        sku
        staffMember
        taxable
        title
        totalDiscount
        totalDiscountSet
        unfulfilledDiscountedTotal
        unfulfilledDiscountedTotalSet
        unfulfilledOriginalTotal
        unfulfilledOriginalTotalSet
        unfulfilledQuantity
        variant
        variantTitle
        vendor
        weight
      }
      maskedCode
      note
      order {
        additionalFees
        alerts
        app
        attribution
        billingAddress
        billingAddressMatchesShippingAddress
        canMarkAsPaid
        canNotifyCustomer
        cancelReason
        cancellation
        cancelledAt
        capturable
        cartDiscountAmount
        cartDiscountAmountSet
        cartToken
        channel
        channelInformation
        checkoutToken
        clientIp
        closed
        closedAt
        confirmationNumber
        confirmed
        createdAt
        currencyCode
        currentCartDiscountAmountSet
        currentShippingPriceSet
        currentSubtotalLineItemsQuantity
        currentSubtotalPriceSet
        currentTaxLines
        currentTotalAdditionalFeesSet
        currentTotalDiscountsSet
        currentTotalDutiesSet
        currentTotalPriceSet
        currentTotalTaxSet
        currentTotalWeight
        customAttributes
        customer
        customerAcceptsMarketing
        customerJourney
        customerJourneySummary
        customerLocale
        discountCode
        discountCodes
        displayAddress
        displayFinancialStatus
        displayFulfillmentStatus
        disputes
        dutiesIncluded
        edited
        email
        estimatedTaxes
        fulfillable
        fulfillmentsCount
        fullyPaid
        hasTimelineComment
        id
        landingPageDisplayText
        landingPageUrl
        legacyResourceId
        merchantBusinessEntity
        merchantEditable
        merchantEditableErrors
        merchantOfRecordApp
        name
        netPayment
        netPaymentSet
        note
        number
        originalTotalAdditionalFeesSet
        originalTotalDutiesSet
        originalTotalPriceSet
        paymentCollectionDetails
        paymentGatewayNames
        paymentTerms
        phone
        physicalLocation
        poNumber
        presentmentCurrencyCode
        processedAt
        productNetwork
        publication
        purchasingEntity
        referralCode
        referrerDisplayText
        referrerUrl
        refundDiscrepancySet
        refundable
        registeredSourceUrl
        requiresShipping
        restockable
        retailLocation
        returnStatus
        risk
        riskLevel
        shippingAddress
        shippingLine
        shopifyProtect
        sourceIdentifier
        sourceName
        staffMember
        subtotalLineItemsQuantity
        subtotalPrice
        subtotalPriceSet
        tags
        taxExempt
        taxLines
        taxesIncluded
        test
        totalCapturable
        totalCapturableSet
        totalCashRoundingAdjustment
        totalDiscounts
        totalDiscountsSet
        totalOutstandingSet
        totalPrice
        totalPriceSet
        totalReceived
        totalReceivedSet
        totalRefunded
        totalRefundedSet
        totalRefundedShippingSet
        totalShippingPrice
        totalShippingPriceSet
        totalTax
        totalTaxSet
        totalTipReceived
        totalTipReceivedSet
        totalWeight
        transactionsCount
        unpaid
        updatedAt
      }
      recipientAttributes {
        message
        preferredName
        recipient
        sendNotificationAt
      }
      templateSuffix
      updatedAt
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
  }
}

Variables

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

firstnumber

The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

afterstring

The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

lastnumber

The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

beforestring

The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

reverseboolean

Reverse the order of the underlying list.

sortKeystring

Sort the underlying list using a key. If your query is slow or returns an error, then [try specifying a sort key that matches the field used in the search](https://shopify.dev/api/usage/pagination-graphql#search-performance-considerations).

One ofAMOUNT_SPENTBALANCECODECREATED_ATCUSTOMER_NAMEDISABLED_ATEXPIRES_ONIDINITIAL_VALUEUPDATED_AT

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 a [saved search](https://shopify.dev/api/admin-graphql/latest/objects/savedsearch#field-id). The search’s query string is used as the query argument.

json
{
  "first": 0,
  "after": "string",
  "last": 0,
  "before": "string",
  "reverse": false,
  "sortKey": "AMOUNT_SPENT",
  "query": "string",
  "savedSearchId": "string"
}

Response

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

edgesarray<object>
cursorobject
nodeobject
nodesarray<object>
balanceobject
createdAtobject
crossCurrencyRedemptionStrategyobject
customerobject
deactivatedAtobject
enabledobject
expiresOnobject
idobject
initialValueobject
isRedeemableobject
lastCharactersobject
lineItemobject
maskedCodeobject
noteobject
orderobject
recipientAttributesobject
templateSuffixobject
updatedAtobject
pageInfoobject
endCursorstring
hasNextPageboolean
hasPreviousPageboolean
startCursorstring

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