productUnpublish mutation
Deprecation warning
Use publishableUnpublish
instead
Unpublishes a product.
Required access
write_publications
access scope. This scope is currently available only to private apps installed on Shopify Plus stores.
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 productUnpublish($input: ProductUnpublishInput!) { productUnpublish(input: $input) {} } { “input”: {
<font style="color:#1F61A0;">product</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">id</font>
<font style="color:#555555;">}</font>
<font style="color:#1F61A0;">shop</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;">field</font>
<font style="color:#1F61A0;">message</font>
<font style="color:#555555;">}</font>
} }
<font style="color:#8B2BB9;">"id"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE="</font><font style="color:#555555;">,</font>
<font style="color:#8B2BB9;">"productPublications"</font><font style="color:#555555;">:</font> <font style="color:#555555;">[</font>
<font style="color:#555555;">{}</font>
<font style="color:#555555;">]</font>
Arguments
ProductUnpublishInput fields
- id (
[ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)
) REQUIRED
The ID of the product to create or update publications for. - productPublications (
[[ProductPublicationInput!]!](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/productpublicationinput)
) REQUIRED
The channels to unpublish the product from.
Return fields
- product (
[Product](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/product)
)
The product that has been unpublished. - shop (
[Shop!](https://shopify.dev/docs/admin-api/graphql/reference/store-properties/shop)
)
The user’s shop. - userErrors (
[[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror)
)
List of errors that occurred executing the mutation.