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
1mutation subscriptionDraftDiscountCodeApply($draftId: ID!, $redeemCode: String!) {2 subscriptionDraftDiscountCodeApply(draftId: $draftId, redeemCode: $redeemCode) {3 appliedDiscount {4 # SubscriptionAppliedCodeDiscount fields5 }6 draft {7 # SubscriptionDraft fields8 }9 userErrors {10 field11 message12 }13 }14}
Input
1{2 "draftId": "gid://shopify/<objectName>/10079785100",3 "redeemCode": "<your-redeemCode>"4}
{
"draftId": "gid://shopify/<objectName>/10079785100",
"redeemCode": "<your-redeemCode>"
}