#yurtdweller_api

1 messages ¡ Page 1 of 1 (latest)

spice timberBOT
#

👋 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.

scenic gale
blissful smelt
#

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?

scenic gale
#

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

blissful smelt
#

But I would like to add a promo code when I create the subscription

scenic gale
spice timberBOT
blissful smelt
#

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?

sinful badger
#

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

blissful smelt
#

Oh interesting! I see

#

So if someone is using a coupon, the invoice needs to be able to be created

sinful badger
#

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

blissful smelt
#

So with coupons I should use missing_payment_method=create_invoice?

sinful badger
#

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

blissful smelt
#

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

sinful badger
#

Well since you pass coupon in the creation request, you should just be able to write an if statement for that

blissful smelt
#

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?

sinful badger
#

You can have the coupon of duration repeating and set duration_in_months to 3

blissful smelt
#

Ah super cool

blissful smelt
#

Does that work with an annual subscription?

sinful badger
#

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

spice timberBOT