Anchor to subscriptionDraftDiscountUpdatesubscription
subscriptionDraftDiscountUpdate
mutation
Requires access scope. Also: The user must have manage_orders_information permission.
Updates a subscription discount on a subscription draft.
Anchor to Arguments
Arguments
- Anchor to discountIddiscount•
Id ID!required The gid of the Subscription Discount to update.
- Anchor to draftIddraft•
Id ID!required The ID of the Subscription Contract draft to update a subscription discount on.
- Anchor to inputinput•Subscription
Manual requiredDiscount Input! The properties to update on the Subscription Discount.
Was this section helpful?
Anchor to SubscriptionDraftDiscountUpdatePayload returnsSubscriptionDraftDiscountUpdatePayload returns
- Anchor to discountUpdateddiscount•
Updated The updated Subscription Discount.
- Anchor to draftdraft•
The Subscription Contract draft object.
- 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 subscriptionDraftDiscountUpdate($discountId: ID!, $draftId: ID!, $input: SubscriptionManualDiscountInput!) {2 subscriptionDraftDiscountUpdate(discountId: $discountId, draftId: $draftId, input: $input) {3 discountUpdated {4 # SubscriptionManualDiscount fields5 }6 draft {7 # SubscriptionDraft fields8 }9 userErrors {10 field11 message12 }13 }14}
Input
1{2 "discountId": "gid://shopify/<objectName>/10079785100",3 "draftId": "gid://shopify/<objectName>/10079785100",4 "input": {5 "entitledLines": {6 "all": true,7 "lines": ""8 },9 "recurringCycleLimit": 1,10 "title": "<your-title>",11 "value": {12 "fixedAmount": "",13 "percentage": 114 }15 }16}
{
"discountId": "gid://shopify/<objectName>/10079785100",
"draftId": "gid://shopify/<objectName>/10079785100",
"input": {
"entitledLines": {
"all": true,
"lines": ""
},
"recurringCycleLimit": 1,
"title": "<your-title>",
"value": {
"fixedAmount": "",
"percentage": 1
}
}
}
input SubscriptionManualDiscountInput {
entitledLines: SubscriptionManualDiscountEntitledLinesInput
recurringCycleLimit: Int
title: String
value: SubscriptionManualDiscountValueInput
}
input SubscriptionManualDiscountEntitledLinesInput {
all: Boolean
lines: SubscriptionManualDiscountLinesInput
}
input SubscriptionManualDiscountValueInput {
fixedAmount: SubscriptionManualDiscountFixedAmountInput
percentage: Int
}