Open BeerBelly opened 1 year ago
DiscountCode
is child resource of PriceRule
, it's should be
$updateInfo = array(
"code" => $code
);
$response = $shopify->PriceRule(PRICE_RULE_ID)->DiscountCode->post($updateInfo);
It looks like Shopify is getting away from using Price Rules.
There's a note on this page about it. Does anybody know why the php-shopify is crashing with you added "write_discounts, read_discounts" scope?
https://shopify.dev/api/admin-rest/2023-01/resources/discountcode
We recommend using the GraphQL Admin API to manage discounts. The Discount types available in the GraphQL Admin API are intended to replace the GraphQL Admin PriceRule object and REST Admin PriceRule and DiscountCode resources.
Hi,
I'm trying to figure out what's the correct way of adding a discount code for a known Price Rule? Something like this doesn't work...
` $updateInfo = array( "code" => $code );
`
Thanks for the help!