subscriptionDraftLineRemove mutation

Removes a subscription line from 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 subscriptionDraftLineRemove($draftId: ID!, $lineId: ID!) { subscriptionDraftLineRemove(draftId: $draftId, lineId: $lineId) {
  1. <font style="color:#1F61A0;">discountsUpdated</font> <font style="color:#555555;">{</font>
  2. <font style="color:#1F61A0;">id</font>
  3. <font style="color:#555555;">}</font>
  4. <font style="color:#1F61A0;">draft</font> <font style="color:#555555;">{</font>
  5. <font style="color:#1F61A0;">id</font>
  6. <font style="color:#555555;">}</font>
  7. <font style="color:#1F61A0;">lineRemoved</font> <font style="color:#555555;">{</font>
  8. <font style="color:#1F61A0;">id</font>
  9. <font style="color:#555555;">}</font>
  10. <font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font>
  11. <font style="color:#1F61A0;">code</font>
  12. <font style="color:#1F61A0;">field</font>
  13. <font style="color:#1F61A0;">message</font>
  14. <font style="color:#555555;">}</font>
} } { “draftId”: “Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=”, “lineId”: “Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=” }

Arguments

Argument Description
draftId
(
[ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)

) REQUIRED
The gid of the Subscription Contract draft to remove a subscription line from.
lineId
(
[ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)

) REQUIRED
The gid of the Subscription Line to remove.

Return fields

  • discountsUpdated ([[SubscriptionManualDiscount!]](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptionmanualdiscount))
    The list of updated subscription discounts impacted by the removed line.
  • draft ([SubscriptionDraft](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptiondraft))
    The Subscription Contract draft object.
  • lineRemoved ([SubscriptionLine](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptionline))
    The removed Subscription Line.
  • userErrors ([[SubscriptionDraftUserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptiondraftusererror))
    List of errors that occurred executing the mutation.