Anchor to productPublishproduct
productPublish
mutationDeprecated
Requires access scope. Also: The user must have a permission to publish a product.
Publishes a product. Products that are sold exclusively on subscription () can only be published on online stores. Use
instead.
Anchor to Arguments
Arguments
- Anchor to inputinput•Product
Publish requiredInput! Specifies the product to publish and the channels to publish it to.
Was this section helpful?
Anchor to ProductPublishPayload returnsProductPublishPayload returns
- Anchor to productproduct•
The product that has been published.
- Anchor to shopshop•Shop!non-null
The user's shop.
- Anchor to userErrorsuser•
Errors [UserError!]! non-null The list of errors that occurred from executing the mutation.
- Anchor to productPublicationsproduct•
Publications [ProductPublication!] Deprecated The channels where the product is published.
Was this section helpful?
Mutation Reference
mutation productPublish($input: ProductPublishInput!) {
productPublish(input: $input) {
product {
# Product fields
}
productPublications {
# ProductPublication fields
}
shop {
# Shop fields
}
userErrors {
field
message
}
}
}
Input
{
"input": {
"id": "gid://shopify/<objectName>/10079785100",
"productPublications": [
{
"channelHandle": "<your-channelHandle>",
"channelId": "gid://shopify/<objectName>/10079785100",
"publicationId": "gid://shopify/<objectName>/10079785100",
"publishDate": "2019-09-07T15:50:00Z"
}
]
}
}
{
"input": {
"id": "gid://shopify/<objectName>/10079785100",
"productPublications": [
{
"channelHandle": "<your-channelHandle>",
"channelId": "gid://shopify/<objectName>/10079785100",
"publicationId": "gid://shopify/<objectName>/10079785100",
"publishDate": "2019-09-07T15:50:00Z"
}
]
}
}
input ProductPublishInput {
id: ID!
productPublications: [ProductPublicationInput!]!
}
input ProductPublicationInput {
channelHandle: String
channelId: ID
publicationId: ID
publishDate: DateTime
}