subscriptionDraftDiscountAdd mutation
Adds a subscription discount to a subscription draft.
Required access
write_own_subscription_contracts
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
mutation subscriptionDraftDiscountAdd($draftId: ID!, $input: SubscriptionManualDiscountInput!) { subscriptionDraftDiscountAdd(draftId: $draftId, input: $input) {} } { “draftId”: “Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=”, “input”: {} }
<font style="color:#1F61A0;">discountAdded</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">id</font>
<font style="color:#555555;">}</font>
<font style="color:#1F61A0;">draft</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">id</font>
<font style="color:#555555;">}</font>
<font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">code</font>
<font style="color:#1F61A0;">field</font>
<font style="color:#1F61A0;">message</font>
<font style="color:#555555;">}</font>
Arguments
SubscriptionManualDiscountInput fields
- entitledLines (
[SubscriptionManualDiscountEntitledLinesInput](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptionmanualdiscountentitledlinesinput)
)
Entitled line items used to apply the subscription discount on. - recurringCycleLimit (
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)
)
The maximum number of times the subscription discount will be applied on orders. - title (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
The title associated with the subscription discount. - value (
[SubscriptionManualDiscountValueInput](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptionmanualdiscountvalueinput)
)
Percentage or fixed amount value of the discount.
Return fields
- discountAdded (
[SubscriptionManualDiscount](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptionmanualdiscount)
)
The added Subscription Discount. - draft (
[SubscriptionDraft](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptiondraft)
)
The Subscription Contract draft object. - userErrors (
[[SubscriptionDraftUserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptiondraftusererror)
)
List of errors that occurred executing the mutation.