younifyd
Menu

subscriptionDraft

Fetch a single subscription draft by its ID.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the subscriptionDraft action (under Subscription).
  3. Fill in the fields below, then reference the result from later steps as {{subscriptiondraft.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 SubscriptionDraft($id: ID!) {
  subscriptionDraft(id: $id) {
    billingCycle {
      billingAttemptExpectedDate
      cycleEndAt
      cycleIndex
      cycleStartAt
      edited
      editedContract {
        app
        appAdminUrl
        createdAt
        currencyCode
        customAttributes
        customer
        deliveryMethod
        deliveryPrice
        lineCount
        linesCount
        note
        updatedAt
      }
      skipped
      sourceContract {
        app
        appAdminUrl
        billingPolicy
        createdAt
        currencyCode
        customAttributes
        customer
        deliveryMethod
        deliveryPolicy
        deliveryPrice
        id
        lastBillingAttemptErrorType
        lastPaymentStatus
        lineCount
        linesCount
        nextBillingDate
        note
        originOrder
        revisionId
        status
        updatedAt
      }
      status
    }
    billingPolicy {
      anchors {
        cutoffDay
        day
        month
        type
      }
      interval
      intervalCount
      maxCycles
      minCycles
    }
    currencyCode
    customAttributes {
      key
      value
    }
    customer {
      amountSpent {
        amount
        currencyCode
      }
      canDelete
      companyContactProfiles {
        company
        createdAt
        customer
        id
        isMainContact
        lifetimeDuration
        locale
        title
        updatedAt
      }
      createdAt
      dataSaleOptOut
      defaultAddress {
        address1
        address2
        city
        company
        coordinatesValidated
        country
        countryCode
        countryCodeV2
        firstName
        formattedArea
        id
        lastName
        latitude
        longitude
        name
        phone
        province
        provinceCode
        timeZone
        validationResultSummary
        zip
      }
      defaultEmailAddress {
        emailAddress
        marketingOptInLevel
        marketingState
        marketingUnsubscribeUrl
        marketingUpdatedAt
        openTrackingLevel
        openTrackingUrl
        sourceLocation
        validFormat
      }
      defaultPhoneNumber {
        marketingCollectedFrom
        marketingOptInLevel
        marketingState
        marketingUpdatedAt
        phoneNumber
        sourceLocation
        whatsAppMarketingConsent
      }
      displayName
      email
      emailMarketingConsent {
        consentUpdatedAt
        marketingOptInLevel
        marketingState
        sourceLocation
      }
      firstName
      hasTimelineComment
      id
      identityProviderSubjects {
        createdAt
        id
        providerName
        subject
        updatedAt
      }
      lastName
      lastOrder {
        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
      }
      legacyResourceId
      lifetimeDuration
      locale
      market {
        catalogsCount
        conditions
        currencySettings
        delivery
        discountsCount
        enabled
        handle
        id
        name
        priceInclusions
        priceList
        primary
        status
        type
        webPresence
      }
      mergeable {
        errorFields
        isMergeable
        mergeInProgress
        reason
      }
      multipassIdentifier
      note
      numberOfOrders
      phone
      productSubscriberStatus
      smsMarketingConsent {
        consentCollectedFrom
        consentUpdatedAt
        marketingOptInLevel
        marketingState
        sourceLocation
      }
      state
      statistics {
        predictedSpendTier
        rfmGroup
      }
      tags
      taxExempt
      taxExemptions
      taxSettings {
        taxId
      }
      unsubscribeUrl
      updatedAt
      validEmailAddress
      verifiedEmail
    }
    deliveryMethod
    deliveryPolicy {
      anchors {
        cutoffDay
        day
        month
        type
      }
      interval
      intervalCount
    }
    deliveryPrice {
      amount
      currencyCode
    }
    id
    nextBillingDate
    note
    originalContract {
      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
    }
    status
  }
}

Variables

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

idstringrequired

The ID of the Subscription Draft to return.

json
{
  "id": "string"
}

Response

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

billingCycleobject
billingAttemptExpectedDatestring
cycleEndAtstring
cycleIndexnumber
cycleStartAtstring
editedboolean
editedContractobject12 fields
skippedboolean
sourceContractobject21 fields
statusstring

One ofBILLEDUNBILLED

billingPolicyobject
anchorsarray<object>
intervalstring

One ofDAYWEEKMONTHYEAR

intervalCountnumber
maxCyclesnumber
minCyclesnumber
currencyCodestring

One ofUSDEURGBPCADAFNALLDZDAOAARSAMDAWGAUDBBDAZNBDTBSDBHDBIFBYNBZDBMDBTNBAMBRLBOBBWPBNDBGNMMKKHRCVEKYDXAFCLPCNYCOPKMFCDFCRCHRK

customAttributesarray<object>
keyobject
valueobject
customerobject
amountSpentobject2 fields
canDeleteboolean
companyContactProfilesarray<object>
createdAtstring
dataSaleOptOutboolean
defaultAddressobject21 fields
defaultEmailAddressobject9 fields
defaultPhoneNumberobject7 fields
displayNamestring
emailstring
emailMarketingConsentobject4 fields
firstNamestring
hasTimelineCommentboolean
idstring
identityProviderSubjectsarray<object>
lastNamestring
lastOrderobject40 fields
legacyResourceIdstring
lifetimeDurationstring
localestring
marketobject15 fields
mergeableobject4 fields
multipassIdentifierstring
notestring
numberOfOrdersstring
phonestring
productSubscriberStatusstring

One ofACTIVECANCELLEDEXPIREDFAILEDNEVER_SUBSCRIBEDPAUSED

smsMarketingConsentobject5 fields
statestring

One ofDECLINEDDISABLEDENABLEDINVITED

statisticsobject2 fields
tagsarray<object>
taxExemptboolean
taxExemptionsarray<object>
taxSettingsobject1 fields
unsubscribeUrlstring
updatedAtstring
validEmailAddressboolean
verifiedEmailboolean
deliveryMethodobject

This field can return one of several different object shapes — properties from every possible shape are shown together.

addressobject21 fields
localDeliveryOptionobject6 fields
pickupOptionobject5 fields
shippingOptionobject5 fields
deliveryPolicyobject
anchorsarray<object>
intervalstring

One ofDAYWEEKMONTHYEAR

intervalCountnumber
deliveryPriceobject
amountstring
currencyCodestring

One ofUSDEURGBPCADAFNALLDZDAOAARSAMDAWGAUDBBDAZNBDTBSDBHDBIFBYNBZDBMDBTNBAMBRLBOBBWPBNDBGNMMKKHRCVEKYDXAFCLPCNYCOPKMFCDFCRCHRK

idstring
nextBillingDatestring
notestring
originalContractobject
appobject35 fields
appAdminUrlstring
billingPolicyobject5 fields
createdAtstring
currencyCodestring

One ofUSDEURGBPCADAFNALLDZDAOAARSAMDAWGAUDBBDAZNBDTBSDBHDBIFBYNBZDBMDBTNBAMBRLBOBBWPBNDBGNMMKKHRCVEKYDXAFCLPCNYCOPKMFCDFCRCHRK

customAttributesarray<object>
customerobject38 fields
deliveryMethodobject4 fields

This field can return one of several different object shapes — properties from every possible shape are shown together.

deliveryPolicyobject3 fields
deliveryPriceobject2 fields
idstring
lastBillingAttemptErrorTypestring

One ofPAYMENT_ERRORCUSTOMER_ERRORINVENTORY_ERROROTHER

lastPaymentStatusstring

One ofSUCCEEDEDFAILED

lineCountnumber
linesCountobject2 fields
nextBillingDatestring
notestring
originOrderobject40 fields
revisionIdstring
statusstring

One ofACTIVEPAUSEDCANCELLEDEXPIREDFAILED

updatedAtstring
statusstring

One ofACTIVEPAUSEDCANCELLEDEXPIREDFAILED

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

subscriptionDraft — Shopify — Documentation