Creating a Checkout Session does not allow $0 (free) items to be included

375 views
Skip to first unread message

Jeff

unread,
Jan 23, 2020, 9:00:28 PM1/23/20
to Stripe API Discussion
I have the following FEATURE REQUEST / IMPROVEMENT for \Stripe\Checkout\Session::create

Currently if you try to create a Checkout Session and forward to Stripe site for processing, it will throw an exception if any of the included line_items have a $0.00 amount.

When creating a Checkout Session (\Stripe\Checkout\Session::create), if the TOTAL of ALL line items being added meets the minimum charge requirement, then an amount of $0 for some line items should not throw an exception, and it should be allowed.

EXAMPLE:
Qty 1 x Adult Ticket @ $10.00
Qty 1 x Child Ticket (age 6+) @ $5.00
Qty 1 x Child Ticket (under age 6) @ $0.00 (FREE)

Since the TOTAL of ALL line items in this case would be $15.00 USD, which is greater than the minimum charge amount of $0.50 USD, all three of these line items should show up on the checkout page, including the FREE item at $0.00.

'line_items' = [
   [ "name"=>"Adult Ticket", "description"=>"Full price adult ticket", "amount"=>"1000", "currency"=>"usd", "quantity"=>"1" ],
   [ "name"=>"Child Ticket (age 6+)", "description"=>"Full price child ticket", "amount"=>"500", "currency"=>"usd", "quantity"=>"1" ],
   [ "name"=>"Child Ticket (under age 6)", "description"=>"Free child ticket", "amount"=>"0", "currency"=>"usd", "quantity"=>"1" ]
];

Thanks

Remi J.

unread,
Jan 23, 2020, 9:03:23 PM1/23/20
to api-d...@lists.stripe.com
Hey Jeff,

Thanks a lot for the feedback here! I definitely see how this could be useful in cases like yours! For now we're pretty strict with what we allow in Sessions, the same way we don't support negative items yet but it's something we want to support in the future!

Cheers,
Remi

--
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.
Reply all
Reply to author
Forward
0 new messages