0
votes

I'm using the Stripe's Python library to process subscriptions.

Here's a snippet of my backend Django code.

    susbcriptionID = stripe.Subscription.retrieve("subID")
    stripe.Subscription.modify(
        susbcriptionID,
        items=[{
            "id": subscription["items"]["data"][0].id,
            "plan": "planID",
        }]
    )

The Stripe docs states that Stripe emails customers upon successful charges.

But I tested this out in live mode by having two subscription choices, one for 50 cents a day and the other for 51. When I signed up for the first choice, I inputted my email, and Stripe emailed me a receipt. But when I later switched to the more expensive plan, I got no email.

When I check my Stripe dashboard, I go to Billing > Subscriptions. I click myself under the "Customer" column. When I scroll to "Events," it shows this (I made this pipe-delimited format for easier reading):

[email protected] upgraded to Daily test 2 from Daily test | 2018/04/16 20:02:25
A proration adjustment for $0.51 USD was created for [email protected] | 2018/04/16 20:02:25
A proration adjustment for ($0.50 USD) was created for [email protected] | 2018/04/16 20:02:25
[email protected] subscribed to the Daily test plan | 2018/04/16 19:59:53
[email protected]'s invoice for $0.50 USD was paid | 2018/04/16 19:59:53
[email protected] has a new invoice for $0.50 USD | 2018/04/16 19:59:53

How do I set up Stripe to email a customer when they change their subscription?

1

1 Answers

2
votes

Stripe only emails customers after a successful charge as documented here. In your example though there's no charge so there's no email being sent to the customer.

When you change the plan on a subscription but keep the same billing cycle, Stripe calculates the proration for you. Those proration items are not charged immediately. Instead, they are added as pending invoice items and will be billed on the next invoice when the subscription renews. This is documented here.

If you want to charge the customer for the proration, you have to create an invoice via the API and then pay it via the API.

When you do this, then a charge would be created and an email receipt would be sent for the price difference. If the amount is too small (one cent in your case) though there's no charge as it's below the minimum that Stripe can charge and it would still be added to their upcoming invoice.