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
mutation subscriptionDraftDiscountUpdate($discountId: ID!, $draftId: ID!, $input: SubscriptionManualDiscountInput!) {
subscriptionDraftDiscountUpdate(discountId: $discountId, draftId: $draftId, input: $input) {
discountUpdated {
# SubscriptionManualDiscount fields
}
draft {
# SubscriptionDraft fields
}
userErrors {
field
message
}
}
}
Input
{
"discountId": "gid://shopify/<objectName>/10079785100",
"draftId": "gid://shopify/<objectName>/10079785100",
"input": {
"entitledLines": {
"all": true,
"lines": ""
},
"recurringCycleLimit": 1,
"title": "<your-title>",
"value": {
"fixedAmount": "",
"percentage": 1
}
}
}
{
"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
}