I am added a coupon for abc product, while create subscription i can apply that coupon for all products. I want it can apply to only abc product. i m using https://cartalyst.com/manual/stripe/2.0#subscriptions documentation.
$stripe->subscriptions()->create($stripe_customer_id, [
'plan' => $request->plan,
'coupon' => $coupon,
'default_payment_method' => $card['id'],
]);
You can apply a coupon to a subscription that will be restricted to a particular product by using the
applies_to
attribute. For example, in the following code, the coupon will only apply toprod_xxx
, so when a subscription is created with a price from prod_xxx but also a price from prod_yyy, the discount will only apply to the amount of prod_xxx/price_xxx