Anchor to subscriptionDraftDiscountCodeApplysubscription
subscriptionDraftDiscountCodeApply
mutation
Requires access scope. Also: The user must have manage_orders_information permission.
Applies a code discount on the subscription draft.
Anchor to Arguments
Arguments
- Anchor to draftIddraft•
Id ID!required The gid of the subscription contract draft to apply a subscription code discount on.
- Anchor to redeemCoderedeem•
Code String!required Code discount redeem code.
Was this section helpful?
Anchor to SubscriptionDraftDiscountCodeApplyPayload returnsSubscriptionDraftDiscountCodeApplyPayload returns
- Anchor to appliedDiscountapplied•
Discount The added 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 subscriptionDraftDiscountCodeApply($draftId: ID!, $redeemCode: String!) {
subscriptionDraftDiscountCodeApply(draftId: $draftId, redeemCode: $redeemCode) {
appliedDiscount {
# SubscriptionAppliedCodeDiscount fields
}
draft {
# SubscriptionDraft fields
}
userErrors {
field
message
}
}
}
Input
{
"draftId": "gid://shopify/<objectName>/10079785100",
"redeemCode": "<your-redeemCode>"
}
{
"draftId": "gid://shopify/<objectName>/10079785100",
"redeemCode": "<your-redeemCode>"
}