Create discount for all sales channels

alex_ilin
Shopify Partner
1 0 2

I would like to create a discount using Shopify API and apply it to all my sales channels.

I do not see any field that I can use to specify channel ids in https://shopify.dev/docs/api/admin-graphql/2023-07/mutations/discountCodeBasicCreate mutation. However when I am creating the discount using Shopify UI the request contains channelIds field. When I am trying to add channelIds field to my mutation I got an error.

 

Screenshot 2023-09-22 at 12.14.50.png

 

I've also tried to use https://shopify.dev/docs/api/admin-graphql/2023-07/mutations/publishablePublish mutation to publish discount to a channel but it returns me an error.

Please advice.

Reply 1 (1)

SauloB
Shopify Partner
5 0 2

How did you manage to resolve it?