younifyd
Menu

subscriptionDraftLineUpdate

Updates a subscription line on a subscription draft.

Use it in a workflow

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

Query

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

graphql
mutation SubscriptionDraftLineUpdate($draftId: ID!, $lineId: ID!, $input: SubscriptionLineUpdateInput!) {
  subscriptionDraftLineUpdate(draftId: $draftId, lineId: $lineId, input: $input) {
    draft {
      billingCycle {
        billingAttemptExpectedDate
        cycleEndAt
        cycleIndex
        cycleStartAt
        edited
        editedContract
        skipped
        sourceContract
        status
      }
      billingPolicy {
        anchors
        interval
        intervalCount
        maxCycles
        minCycles
      }
      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
      nextBillingDate
      note
      originalContract {
        app
        appAdminUrl
        billingPolicy
        createdAt
        currencyCode
        customAttributes
        customer
        deliveryMethod
        deliveryPolicy
        deliveryPrice
        id
        lastBillingAttemptErrorType
        lastPaymentStatus
        lineCount
        linesCount
        nextBillingDate
        note
        originOrder
        revisionId
        status
        updatedAt
      }
      status
    }
    lineUpdated {
      concatenatedOriginContract {
        app
        appAdminUrl
        billingPolicy
        createdAt
        currencyCode
        customAttributes
        customer
        deliveryMethod
        deliveryPolicy
        deliveryPrice
        id
        lastBillingAttemptErrorType
        lastPaymentStatus
        lineCount
        linesCount
        nextBillingDate
        note
        originOrder
        revisionId
        status
        updatedAt
      }
      currentPrice {
        amount
        currencyCode
      }
      customAttributes {
        key
        value
      }
      discountAllocations {
        amount
        discount
      }
      id
      lineDiscountedPrice {
        amount
        currencyCode
      }
      pricingPolicy {
        basePrice
        cycleDiscounts
      }
      productId
      quantity
      requiresShipping
      sellingPlanId
      sellingPlanName
      sku
      taxable
      title
      variantId
      variantImage {
        altText
        height
        id
        originalSrc
        src
        thumbhash
        width
      }
      variantTitle
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

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

draftIdstringrequired

The gid of the Subscription Contract draft to update a subscription line from.

lineIdstringrequired

The gid of the Subscription Line to update.

inputobjectrequired

The properties of the new Subscription Line.

productVariantIdstring
quantitynumber
sellingPlanIdstring
sellingPlanNamestring
currentPricestring
customAttributesarray<object>2 fields
pricingPolicyobject2 fields
json
{
  "draftId": "string",
  "lineId": "string",
  "input": {
    "productVariantId": "string",
    "quantity": 0,
    "sellingPlanId": "string",
    "sellingPlanName": "string",
    "currentPrice": "string",
    "customAttributes": [
      {
        "key": "string",
        "value": "string"
      }
    ],
    "pricingPolicy": {
      "basePrice": "string",
      "cycleDiscounts": [
        "string"
      ]
    }
  }
}

Response

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

draftobject
billingCycleobject9 fields
billingPolicyobject5 fields
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
nextBillingDatestring
notestring
originalContractobject21 fields
statusstring

One ofACTIVEPAUSEDCANCELLEDEXPIREDFAILED

lineUpdatedobject
concatenatedOriginContractobject21 fields
currentPriceobject2 fields
customAttributesarray<object>
discountAllocationsarray<object>
idstring
lineDiscountedPriceobject2 fields
pricingPolicyobject2 fields
productIdstring
quantitynumber
requiresShippingboolean
sellingPlanIdstring
sellingPlanNamestring
skustring
taxableboolean
titlestring
variantIdstring
variantImageobject7 fields
variantTitlestring
userErrorsarray<object>
codeobject
fieldobject
messageobject

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

subscriptionDraftLineUpdate — Shopify — Documentation