younifyd
Menu

subscriptionContracts

Returns a SubscriptionContractConnection containing subscription contracts. Subscription contracts are agreements between customers and merchants for recurring purchases with defined billing and delivery schedules.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the subscriptionContracts action (under Subscription).
  3. Fill in the fields below, then reference the result from later steps as {{subscriptioncontracts.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 SubscriptionContracts($first: Int, $after: String, $last: Int, $before: String, $reverse: Boolean, $sortKey: SubscriptionContractsSortKeys, $query: String) {
  subscriptionContracts(
    first: $first
    after: $after
    last: $last
    before: $before
    reverse: $reverse
    sortKey: $sortKey
    query: $query
  ) {
    edges {
      cursor
      node {
        app
        appAdminUrl
        billingPolicy
        createdAt
        currencyCode
        customAttributes
        customer
        deliveryMethod
        deliveryPolicy
        deliveryPrice
        id
        lastBillingAttemptErrorType
        lastPaymentStatus
        lineCount
        linesCount
        nextBillingDate
        note
        originOrder
        revisionId
        status
        updatedAt
      }
    }
    nodes {
      app {
        apiKey
        appStoreAppUrl
        appStoreDeveloperUrl
        availableAccessScopes
        banner
        description
        developerName
        developerType
        developerUrl
        embedded
        failedRequirements
        features
        feedback
        handle
        icon
        id
        installUrl
        installation
        isPostPurchaseAppInUse
        launchUrl
        navigationItems
        optionalAccessScopes
        previouslyInstalled
        pricingDetails
        pricingDetailsSummary
        privacyPolicyUrl
        publicCategory
        published
        requestedAccessScopes
        screenshots
        shopifyDeveloped
        title
        uninstallMessage
        uninstallUrl
        webhookApiVersion
      }
      appAdminUrl
      billingPolicy {
        anchors
        interval
        intervalCount
        maxCycles
        minCycles
      }
      createdAt
      currencyCode
      customAttributes {
        key
        value
      }
      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
      }
      deliveryMethod
      deliveryPolicy {
        anchors
        interval
        intervalCount
      }
      deliveryPrice {
        amount
        currencyCode
      }
      id
      lastBillingAttemptErrorType
      lastPaymentStatus
      lineCount
      linesCount {
        count
        precision
      }
      nextBillingDate
      note
      originOrder {
        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
      }
      revisionId
      status
      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 ofCREATED_ATIDSTATUSUPDATED_AT

querystring

A filter made up of terms, connectives, modifiers, and comparators. | name | type | description | acceptable_values | default_value | example_use | | ---- | ---- | ---- | ---- | ---- | ---- | | created_at | time | | customer_id | id | Filter subscription contracts by the customer [`id`](https://shopify.dev/api/admin-graphql/latest/objects/Customer#field-Customer.fields.id) field. | | | - `customer_id:123` | | id | id | Filter by `id` range. | | | - `id:1234`<br/> - `id:>=1234`<br/> - `id:<=1234` | | last_billing_attempt_error_type | string | | product_id | id | Filter subscription contracts by the [`id`](https://shopify.dev/api/admin-graphql/latest/objects/Product#field-Product.fields.id) of any product on the contract's lines. | | | - `product_id:123` | | product_variant_id | id | Filter subscription contracts by the [`id`](https://shopify.dev/api/admin-graphql/latest/objects/ProductVariant#field-ProductVariant.fields.id) of any product variant on the contract's lines. | | | - `product_variant_id:123` | | status | string | | updated_at | time | You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).

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

Response

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

edgesarray<object>
cursorobject
nodeobject
nodesarray<object>
appobject
appAdminUrlobject
billingPolicyobject
createdAtobject
currencyCodeobject
customAttributesobject
customerobject
deliveryMethodobject
deliveryPolicyobject
deliveryPriceobject
idobject
lastBillingAttemptErrorTypeobject
lastPaymentStatusobject
lineCountobject
linesCountobject
nextBillingDateobject
noteobject
originOrderobject
revisionIdobject
statusobject
updatedAtobject
pageInfoobject
endCursorstring
hasNextPageboolean
hasPreviousPageboolean
startCursorstring

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