Create a catalog for a specific market
Not all merchant stores are eligible for the new markets experience. As an app developer, you must check if the shop is onboarded on the new markets experience before you can use the new marketCreate
and marketUpdate
mutations.
Catalogs define the set of products that are available to customers in a market, and the prices of each product. The market that's associated to a catalog defines the target audience. For example, a catalog that's associated to a market with a European region condition might allow customers shipping to Europe to purchase all items except electronics lacking CE certification. With a few exceptions, customers need to pay 10% higher prices.
In this guide, you’ll learn how to create a catalog that includes a price list and publication settings to manage prices and control product availability, and then link the catalog to a specific market.
Anchor to RequirementsRequirements
- Your app can make authenticated requests to the GraphQL Admin API.
- Your app has the
write_products
access scope. Learn how to configure your access scopes using Shopify CLI. - You've created products and product variants in your store.
Anchor to Step 1: Create a new catalogStep 1: Create a new catalog
By default, markets aren't automatically associated with catalogs. You must create a catalog and associate it with a market. The catalog determines the products that are published to customers in that market. You can use the catalogCreate
mutation to create a new catalog:
POST https://{shop}.myshopify.com/api/{api_version}/graphql.json
GraphQL mutation
JSON response
To create a catalog that you'll later associate to a market, you need to specify the empty marketIds
array in the context
field. If you have a market ID, then you can use it to assign the catalog to the market immediately, but you won't be able to control pricing or product availability until you associate a price list and publication with it.
You can create a catalog for a business-to-business (B2B) company location using the catalogCreate
mutation. Learn how to create a B2B catalog.
Anchor to Step 2: Associate a publication with the catalogStep 2: Associate a publication with the catalog
After you create a catalog, you can use the catalog ID to associate a publication with the catalog. The publication determines the products that are published to customers in a market.
POST https://{shop}.myshopify.com/api/{api_version}/graphql.json
GraphQL mutation
JSON response
Anchor to Step 3: Associate a price list with the catalogStep 3: Associate a price list with the catalog
After you create a catalog, you can use the catalog ID to associate a price list with the catalog. The price list determines the prices that are shown to customers in a market. If a price list isn’t associated with the catalog, then customers in the associated market receive the initial variant prices converted to the market currency.
Anchor to Create a new price listCreate a new price list
Use the priceListCreate
mutation to create a new price list for the catalog. You can set the name, a percentage-based adjustment, a currency, and the ID of the catalog to associate.
POST https://{shop}.myshopify.com/api/{api_version}/graphql.json
GraphQL mutation
Variables
{
"input": {
"name": "European prices",
"currency": "EUR",
"catalogId": "gid://shopify/MarketCatalog/CATALOG-ID",
"parent": {
"adjustment": {
"type": "PERCENTAGE_INCREASE",
"value": 10.0
}
}
}
}
{
"input": {
"name": "Prices for Company's European location",
"currency": "EUR",
"catalogId": "gid://shopify/CompanyLocationCatalog/CATALOG-ID",
"parent": {
"adjustment": {
"type": "PERCENTAGE_DECREASE",
"value": 30.0
},
"settings": {
"compareAtMode": "NULLIFY"
}
}
}
}
JSON response
Anchor to Associate an existing price listAssociate an existing price list
Use the priceListUpdate
mutation to associate an existing price list with a catalog. You can also make changes to the name, currency, or percentage-based adjustments with the priceListUpdate
mutation.
POST https://{shop}.myshopify.com/api/{api_version}/graphql.json
GraphQL mutation
Variables
{
"id": "gid://shopify/PriceList/ID",
"input": {
"catalogId": "gid://shopify/MarketCatalog/CATALOG-ID"
}
}
{
"id": "gid://shopify/PriceList/ID",
"input": {
"catalogId": "gid://shopify/CompanyLocationCatalog/CATALOG-ID"
}
}
JSON response
Anchor to Step 4: Set fixed prices for specific product variantsStep 4: Set fixed prices for specific product variants
Use the priceListFixedPricesAdd
mutation to set a fixed price for specific product variants.
If a product variant is published to the catalog and doesn’t have a set fixed price, then its price is automatically calculated using the percentage-based adjustment that’s specified in the PriceListParent
object.
The priceListFixedPricesAdd
mutation accepts a maximum of 250 prices for each request and acts as an add and replace operation. If a fixed price for a given variant already exists on the price list, then it’s replaced.
POST https://{shop}.myshopify.com/api/{api_version}/graphql.json
GraphQL mutation
Variables
JSON response
Anchor to Delete fixed pricesDelete fixed prices
To delete a partial set of fixed prices on a price list, you can use the priceListFixedPricesDelete
mutation. After a fixed price is deleted, the price for the affected product variant is automatically calculated using the price list parent's percentage-based adjustment.
To delete fixed prices, you need to specify the variant ID. You can specify a maximum of 250 variant IDs in the array.
POST https://{shop}.myshopify.com/api/{api_version}/graphql.json
GraphQL mutation
Variables
JSON response
Anchor to Step 5: Unpublish specific products to restrict them from saleStep 5: Unpublish specific products to restrict them from sale
If there are specific products that must be restricted from sale in the market, then use the publicationUpdate
mutation to remove them from the market’s publication. The publicationUpdate
mutation allows you to republish a product to the market.
Associating catalogs to markets is just one part of the product publication story. Sales channels have their own publications that determine what products are available to a customer. Only products that are published in all applicable catalogs are available for purchase. For example, if a European customer accesses an online store, then they can purchase a product that’s published both to the European market and to the Online Store channel. However, a product that’s unpublished in either the European market or the Online Store channel can’t be purchased by the customer.
POST https://{shop}.myshopify.com/api/{api_version}/graphql.json
GraphQL mutation
JSON response
Anchor to Step 6 (Optional): Delete a price listStep 6 (Optional): Delete a price list
You can use the priceListDelete
mutation to delete a price list so that it no longer applies for products in that market catalog. To delete a price list, you need to specify the price list ID. When deleting a priceList
, all of the priceListPrices
are also deleted.
If you delete a price list for a market using the API and then also use the Shopify admin to save an adjustment, then a new price list for the market is created.
POST https://{shop}.myshopify.com/api/{api_version}/graphql.json
GraphQL mutation
Variables
JSON response
Anchor to Step 7: Associate the catalog with a marketStep 7: Associate the catalog with a market
With a catalog created and a publication and price list associated, you can now associate the catalog with a market. Ensure you have a market ID to use in the context
field and then use the marketUpdate
mutation to add the catalog to the market.