Anchor to subscriptionDraftLineAddsubscription
subscriptionDraftLineAdd
mutation
Requires access scope. Also: The user must have manage_orders_information permission.
Adds a subscription line to a subscription draft.
Anchor to Arguments
Arguments
- Anchor to draftIddraft•
Id ID!required The gid of the Subscription Contract draft to add a subscription line to.
- Anchor to inputinput•Subscription
Line requiredInput! The properties of the new Subscription Line.
Was this section helpful?
Anchor to SubscriptionDraftLineAddPayload returnsSubscriptionDraftLineAddPayload returns
- Anchor to draftdraft•
The Subscription Contract draft object.
- Anchor to lineAddedline•
Added The added Subscription Line.
- Anchor to userErrorsuser•
Errors [SubscriptionDraft non-nullUser Error!]! The list of errors that occurred from executing the mutation.
Was this section helpful?
Mutation Reference
mutation subscriptionDraftLineAdd($draftId: ID!, $input: SubscriptionLineInput!) {
subscriptionDraftLineAdd(draftId: $draftId, input: $input) {
draft {
# SubscriptionDraft fields
}
lineAdded {
# SubscriptionLine fields
}
userErrors {
field
message
}
}
}
Input
{
"draftId": "gid://shopify/<objectName>/10079785100",
"input": {
"currentPrice": "29.99",
"customAttributes": [
{
"key": "<your-key>",
"value": "<your-value>"
}
],
"pricingPolicy": {
"basePrice": "29.99",
"cycleDiscounts": [
""
]
},
"productVariantId": "gid://shopify/<objectName>/10079785100",
"quantity": 1,
"sellingPlanId": "gid://shopify/<objectName>/10079785100",
"sellingPlanName": "<your-sellingPlanName>"
}
}
{
"draftId": "gid://shopify/<objectName>/10079785100",
"input": {
"currentPrice": "29.99",
"customAttributes": [
{
"key": "<your-key>",
"value": "<your-value>"
}
],
"pricingPolicy": {
"basePrice": "29.99",
"cycleDiscounts": [
""
]
},
"productVariantId": "gid://shopify/<objectName>/10079785100",
"quantity": 1,
"sellingPlanId": "gid://shopify/<objectName>/10079785100",
"sellingPlanName": "<your-sellingPlanName>"
}
}
input SubscriptionLineInput {
currentPrice: Decimal!
customAttributes: [AttributeInput!]
pricingPolicy: SubscriptionPricingPolicyInput
productVariantId: ID!
quantity: Int!
sellingPlanId: ID
sellingPlanName: String
}
input AttributeInput {
key: String!
value: String!
}
input SubscriptionPricingPolicyInput {
basePrice: Decimal!
cycleDiscounts: [SubscriptionPricingPolicyCycleDiscountsInput!]!
}