#yurtdweller_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1433884914456985652
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- yurt_subscription-paused, 2 days ago, 40 messages
- yurt_ideal-sepadebit, 2 days ago, 35 messages
- yurtdweller_api, 3 days ago, 7 messages
The price price_1SO8OUEXjRBPmDmBuA5QdjDw in this request is an one-time price. A subscription requires the price to be a recurring price. I'd recommend checking this guide on how to create a recurring price: https://docs.stripe.com/products-prices/pricing-models?dashboard-or-api=api#flat-rate
So what's weird is that the price used to work
It was after I added a coupon to the Dashboard to those prices that it stopped?
The price can work on one-time payment flow, but not subscription
I don't see any subscription created from price_1SO8OUEXjRBPmDmBuA5QdjDw like what you mentioned
OK so I updated the price for the subscription:
https://dashboard.stripe.com/acct_1MBhG5EXjRBPmDmB/test/events/evt_1SONFkEXjRBPmDmBvvXBhnK1
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
But I would like to add a promo code when I create the subscription
I'd recommend checking this guide on how to apply coupon / promo code on a subscription:
OK, so I used that guide to modify my query. The subscription is a trial subscription, and after I advance the clock past the trial time, the promotion seems to not have applied
This is the subscription ID: sub_1SONLQEXjRBPmDmB0LYFjuNr
This is the discount event: evt_1SONLTEXjRBPmDmBnv8HULMr
This was the request ID I used to create the subscription: req_yGfLPJiuQU60Ie
Is there a way to have the promo code apply after the subscription trial is over?
There hasn't been an invoice created
The trial ended and the subscription just paused
Because you configured
end_behavior: {
missing_payment_method: "pause",
},
},```
in the creation request
If the sub had a payment method and an invoice would have been created, you should have seen a discount applied
Oh interesting! I see
So if someone is using a coupon, the invoice needs to be able to be created
Yeah Subscriptions create Invoices and that's how the customer is charged
If no invoice is created then there's no payment and no discount
So with coupons I should use missing_payment_method=create_invoice?
It's up to you
It really depends on what behavior you want in your integration
Do you want to pause subscription or not if the customer doesn't have a payment method on file
It's conditional, I suppose
If the coupon is there, I don't want them to need to have a payment method on file
But if there is no coupon, I want it to pause
Well since you pass coupon in the creation request, you should just be able to write an if statement for that
Ah, yes, that seemed to make it work correctly.
For a monthly subscription, is it possible to have "3 months free" as a type of coupon? Or does that not work because the duration of the subscription doesn't match the coupon?
Ah super cool
Does that work with an annual subscription?
No with an annual subscription, likely you'd just want a one-time coupon with an amount off equal to 3 months (ie a quarter of the subscriptions value)
So you could do a 25% off one-time coupon