Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
I want to create a simple Price Rule to offer $50 coupons on a specific collection.
Is there a step by step tutorial for non-devs to create a Price Rule?
Not sure which language you're using but in PHP it would be something like this:
use Shopify\Clients\Rest;
$client = new Rest("your-development-store.myshopify.com", $accessToken);
$response = $client->post(
"price_rules",
[
"price_rule" => [
"title" => "YOURDISCOUNTTITLE",
"target_type" => "line_item",
"target_selection" => "entitled",
"allocation_method" => "across",
"value_type" => "fixed_amount",
"value" => "-50.0",
"customer_selection" => "all",
"starts_at" => "2017-01-19T17:59:10Z",
"entitled_collection_ids" => [
0=>1234325435 //collection id
]
]
]
);