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
1mutation subscriptionDraftLineAdd($draftId: ID!, $input: SubscriptionLineInput!) {2 subscriptionDraftLineAdd(draftId: $draftId, input: $input) {3 draft {4 # SubscriptionDraft fields5 }6 lineAdded {7 # SubscriptionLine fields8 }9 userErrors {10 field11 message12 }13 }14}
Input
1{2 "draftId": "gid://shopify/<objectName>/10079785100",3 "input": {4 "currentPrice": "29.99",5 "customAttributes": [6 {7 "key": "<your-key>",8 "value": "<your-value>"9 }10 ],11 "pricingPolicy": {12 "basePrice": "29.99",13 "cycleDiscounts": [14 ""15 ]16 },17 "productVariantId": "gid://shopify/<objectName>/10079785100",18 "quantity": 1,19 "sellingPlanId": "gid://shopify/<objectName>/10079785100",20 "sellingPlanName": "<your-sellingPlanName>"21 }22}
{
"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!]!
}