Use statuses to identify, filter, and manage products
You can use the status
field to identify, filter, and manage products based on their current product status: draft, active, or archived.
You can save new products as a draft and work on them iteratively until they’re complete and ready to be made available to selected sales channels with an active status. You can also archive products you're no longer selling to keep your product list organized and free of clutter, while retaining all product information.
Get the status of a product
Anchor link to section titled "Get the status of a product"Use the REST Admin API or GraphQL Admin API to query the status of a product. A product can have a status of draft, active, or archived.
GET /admin/api/2022-04/products/3.json
Query: POST /api/2022-04/graphql.json
Get products that have an active status
Anchor link to section titled "Get products that have an active status"You can filter products by their status to return a subset of products from a shop. The following queries return products with an active status:
GET /admin/api/2022-04/products.json?status=active
Query: POST /api/2022-04/graphql.json
Create a new draft product
Anchor link to section titled "Create a new draft product"When you create a new product, you can specify its status. The following examples illustrate how to create a product that has a draft status:
POST /admin/api/2022-04/products.json
The following request example shows how to create a new draft product using the productCreate
mutation.
Request: POST /api/2022-04/graphql.json
Update a product's status
Anchor link to section titled "Update a product's status"At any time, you can change the status of a product. The following examples show how to update a product's status to archived:
PUT /admin/api/2022-04/products/3.json
You can use the productUpdate
or productChangeStatus
mutation to change the status of a product. The following example uses the productUpdate
mutation:
Request: POST /api/2022-04/graphql.json