Anchor to section titled 'undefined'

subscriptionDraftUpdate
mutation

Requires write_own_subscription_contracts access scope. Also: The user must have manage_orders_information permission.

Updates a Subscription Draft.


Anchor to draftId
draftId
required

The gid of the Subscription Draft to update.

The properties of the new Subscription Contract.


Was this section helpful?

The Subscription Draft object.

The list of errors that occurred from executing the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation subscriptionDraftUpdate($draftId: ID!, $input: SubscriptionDraftInput!) {
  subscriptionDraftUpdate(draftId: $draftId, input: $input) {
    draft {
      # SubscriptionDraft fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "draftId": "gid://shopify/<objectName>/10079785100",
  "input": {
    "billingPolicy": {
      "anchors": [
        {
          "cutoffDay": 1,
          "day": 1,
          "month": 1,
          "type": "MONTHDAY"
        }
      ],
      "interval": "DAY",
      "intervalCount": 1,
      "maxCycles": 1,
      "minCycles": 1
    },
    "customAttributes": [
      {
        "key": "<your-key>",
        "value": "<your-value>"
      }
    ],
    "deliveryMethod": {
      "localDelivery": {
        "address": {
          "address1": "<your-address1>",
          "address2": "<your-address2>",
          "city": "<your-city>",
          "company": "<your-company>",
          "country": "<your-country>",
          "countryCode": "AC",
          "firstName": "<your-firstName>",
          "id": "gid://shopify/<objectName>/10079785100",
          "lastName": "<your-lastName>",
          "phone": "<your-phone>",
          "province": "<your-province>",
          "provinceCode": "<your-provinceCode>",
          "zip": "<your-zip>"
        },
        "localDeliveryOption": {
          "code": "<your-code>",
          "description": "<your-description>",
          "instructions": "<your-instructions>",
          "phone": "<your-phone>",
          "presentmentTitle": "<your-presentmentTitle>",
          "title": "<your-title>"
        }
      },
      "pickup": {
        "pickupOption": {
          "code": "<your-code>",
          "description": "<your-description>",
          "locationId": "gid://shopify/<objectName>/10079785100",
          "presentmentTitle": "<your-presentmentTitle>",
          "title": "<your-title>"
        }
      },
      "shipping": {
        "address": {
          "address1": "<your-address1>",
          "address2": "<your-address2>",
          "city": "<your-city>",
          "company": "<your-company>",
          "country": "<your-country>",
          "countryCode": "AC",
          "firstName": "<your-firstName>",
          "id": "gid://shopify/<objectName>/10079785100",
          "lastName": "<your-lastName>",
          "phone": "<your-phone>",
          "province": "<your-province>",
          "provinceCode": "<your-provinceCode>",
          "zip": "<your-zip>"
        },
        "shippingOption": {
          "carrierServiceId": "gid://shopify/<objectName>/10079785100",
          "code": "<your-code>",
          "description": "<your-description>",
          "presentmentTitle": "<your-presentmentTitle>",
          "title": "<your-title>"
        }
      }
    },
    "deliveryPolicy": {
      "anchors": [
        {
          "cutoffDay": 1,
          "day": 1,
          "month": 1,
          "type": "MONTHDAY"
        }
      ],
      "interval": "DAY",
      "intervalCount": 1
    },
    "deliveryPrice": "29.99",
    "nextBillingDate": "2019-09-07T15:50:00Z",
    "note": "<your-note>",
    "paymentMethodId": "gid://shopify/<objectName>/10079785100",
    "status": "ACTIVE"
  }
}
input SubscriptionDraftInput {
  billingPolicy: SubscriptionBillingPolicyInput
  customAttributes: [AttributeInput!]
  deliveryMethod: SubscriptionDeliveryMethodInput
  deliveryPolicy: SubscriptionDeliveryPolicyInput
  deliveryPrice: Decimal
  nextBillingDate: DateTime
  note: String
  paymentMethodId: ID
  status: SubscriptionContractSubscriptionStatus
}

input SubscriptionBillingPolicyInput {
  anchors: [SellingPlanAnchorInput!]
  interval: SellingPlanInterval!
  intervalCount: Int!
  maxCycles: Int
  minCycles: Int
}

input AttributeInput {
  key: String!
  value: String!
}

input SubscriptionDeliveryMethodInput {
  localDelivery: SubscriptionDeliveryMethodLocalDeliveryInput
  pickup: SubscriptionDeliveryMethodPickupInput
  shipping: SubscriptionDeliveryMethodShippingInput
}

input SubscriptionDeliveryPolicyInput {
  anchors: [SellingPlanAnchorInput!]
  interval: SellingPlanInterval!
  intervalCount: Int!
}