productPublish mutation
Deprecation warning
Use publishablePublish
instead
Publishes a product. Products that are sold exclusively on subscription (requiresSellingPlan: true
) can only be published on online stores.
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 productPublish($input: ProductPublishInput!) { productPublish(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
ProductPublishInput fields
- id (
[ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)
) REQUIRED
The product to create or update publications for. - productPublications (
[[ProductPublicationInput!]!](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/productpublicationinput)
) REQUIRED
The publication that the product is published to.
Return fields
- product (
[Product](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/product)
)
The product that has been published. - 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.
Deprecated return fields
Show/Hide
- productPublications (
[[ProductPublication!]](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/productpublication)
) DEPRECATED
The channels where the product is published.
Deprecation warning
Use Product.publications instead.