Creating Custom Product Category via Admin Graphql

Hi,

We are developing apps for distributors. The distributor will import products from merchant’s ERP via API. One of the curcial data is Product Category but we cannot find any graphql mutation to create categories.

Is there any possible ways to create category? or we will have to use shopify’s predefined categories at any matter.

The categories are a fixed list as it stands from what I know, refer to the below:

Hey @illusionist3886 -

@Luke is on point here, product categories in Shopify are part of a standardized, predefined taxonomy so there’s no way to create custom ones via the API at the moment. You’ll need to map your ERP categories to Shopify’s taxonomy instead.

The good news is you can assign them programmatically though. As of API version 2024-07, ProductInput accepts a category field where you pass the GID of a taxonomy category in your productCreate or productUpdate mutations. You can fetch the full list of available categories via the taxonomy.categories query to build out your mapping, and the taxonomy is also browsable here (as Luke shared):

Let me know if you run into anything!