Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Create discount for all sales channels

Create discount for all sales channels

alex_ilin
Shopify Partner
1 0 4

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?