Appying discounts to one time payments

833 views
Skip to first unread message

eatpizza

unread,
Jul 8, 2014, 7:21:29 PM7/8/14
to api-d...@lists.stripe.com
Hi,


I want to offer a discount of 10% on purchases for a given period of time. And a coupon with a given code, expiration date and max number of redemptions is the appropriate object. Why those cannot be used for one time payments?

This post gives some hints: https://pippinsplugins.com/stripe-integration-part-5-accepting-discount-codes/

Basically it suggests to apply the discount manually in the charge request.
But the problem is that the redemptions counter cannot be updated.

I guess the alternative to rely only in the expiration time and check the validity but I don't understand this limitation.

Regards.


Kyle Conroy

unread,
Jul 8, 2014, 7:53:50 PM7/8/14
to api-d...@lists.stripe.com
Jose,

You're correct that coupon codes don't apply to one-time charges.
While we've heard from a number of you that applying coupons to one of
charges would be helpful, I currently don't have an update on that
front.

In the meantime, my suggestions are the same as the article you
posted. Apply the discount yourself at the time of the charge. To keep
track of redemptions, I'd suggest updating a counter in a key-value
store (such as Redis) or updating the count in a database table.

If you'd still like to use coupons, you'll need to do a bit more work.
Instead of creating a charge, you'd need to create a customer, attach
the coupon to the customer, create an invoice item, attach that to a
new invoice, and attach that invoice to a customer.

Cheers,
Kyle
> --
> You received this message because you are subscribed to the Google Groups
> "Stripe API Discussion" group.
> To post to this group, send email to api-d...@lists.stripe.com.
> Visit this group at
> http://groups.google.com/a/lists.stripe.com/group/api-discuss/.
>
> To unsubscribe from this group and stop receiving emails from it, send an
> email to api-discuss...@lists.stripe.com.

eatpizza

unread,
Jul 9, 2014, 3:53:19 AM7/9/14
to api-d...@lists.stripe.com
Hi, thanks for the reply.

I still don't understand the logic behind the limitation. But maybe there isn't any.

In any case I'll try the simplest approach using the expiration date of coupons to make the discount if the coupon is valid.

Cheers,

  Jose

Jim Danz

unread,
Jul 9, 2014, 11:37:01 PM7/9/14
to api-d...@lists.stripe.com
Hi Jose,

The intuition is that charge creation is intended to be a very simple
primitive -- ask to charge $X, and we will charge $X. No ifs, ands,
or buts -- so we don't look at customer account balance, we don't look
at active discounts, we don't consider coupons, etc.

Our suite of recurring billing and invoicing functionality --
subscriptions, coupons, invoice items, invoices -- is, on the other
hand, higher level functionality.

One way to put it is that subscriptions/coupons/invoiceitems/invoices
are intended to be application-level functionality, whereas charge
creation itself is intended to be the simplest primitive possible,
more of a network-level primitive.

That's not to say that this is the only way that we could be thinking
about it, or even that we should be thinking about it this way. But
that's the logic behind the limitation that there's no way to apply
coupons to charge creation itself. That being said, we're always
looking to change and improve based on feedback from users, and I
expect that some form of support for discounts on one-off charges will
be in the works in the future.

Best,
Jim
Reply all
Reply to author
Forward
0 new messages