#shubh_webhooks

1 messages ยท Page 1 of 1 (latest)

lyric pilotBOT
#

๐Ÿ‘‹ 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/1296380758445002793

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

feral pilot
#

discounts will only be available if there is coupon or promotion code applied on a subscription

lyric pilotBOT
covert lark
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

crimson mirage
#

Thank you for your response!
Plz. refer to this invoice.payment_succeeded event evt_1QAYhhJrW4qoE0zypoE7slAp you'll see discount is applied

"discount_amounts": [
"0": {
"amount": 
1500,
"discount": 
"di_1QAYheJrW4qoE0zyrClWoGnZ",
},
],
"discountable": 
true,
"discounts": [],

however in customer.subscription.created event
evt_1QAYhgJrW4qoE0zyc0LpUP6T discount is still null. So, basically in invoice I see the discount coupon is being applied but in events related to subscription is not giving the proper data.
FYI, this subscription and coupon I have manually created in test mode to check if I am missing anything in the API integration but result was same.

#

We've already reviewed the doc that you shared in the thread and have implemented the same. Is there anyway we can connect for quick debugging?

covert lark
#

is the coupon meant to be applied one time?

crimson mirage
#

Yes

covert lark
#

if that's the case, it's normal that you would only see it on the invoice

#

in all cases, you should rely on the invoice.* events

#

instead of customer.subscription.* events

crimson mirage
#

Is this an ideal response from webhook? As it looks like discrepancy in the data.

And in case we're not generating invoice from Stripe and going to generate from our end, so that we can add the credit logic and also make invoice available to download from our portal, what should we do to acheive the correct data from webhooks?

covert lark
#

you just take the data directly from the generated invoice

#

whether you want to send the invoice_pdf generated by Stripe or generate your own, you should rely on the invoice data

crimson mirage
#

Noted, so by default stripe creates invoice on every subscription?

Also, it looks like credit feature in billing is in public preview. How to get access to do that, maybe we can try that as credit will be keep adjusted in the recurring billing until it expires or exhaust, so in case we use the credit feature from stripe itself then will it give the proper data or still we have to rely on invoice data.

covert lark
#

Noted, so by default stripe creates invoice on every subscription?
yes that's correct, for each cycle or each change on the subscription that requires invoicing Stripe will automatically generate the invoices

#

Also, it looks like credit feature in billing is in public preview. How to get access to do that, maybe we can try that as credit will be keep adjusted in the recurring billing until it expires or exhaust, so in case we use the credit feature from stripe itself then will it give the proper data or still we have to rely on invoice data.
you need to contact https://support.stripe.com/?contact=true

crimson mirage
#

noted.

At the time of renewal of subscription in the next billing cycle will I be able to apply the coupon again? (As we are managing the credit limit from our end, we plan to creating a coupon on every billing cycle by checking the remaining credit for that user and accordingly we'll create and apply the coupon at the time of subscription renewal.

Another question I have is related to pay-as-you-go, where we just use stripe payment. In this method we would like to charge multiple times in a single billing cycle in case they are reaching threshold to avoid payment defaults, so do we have some best practices for this, and should we create a separate for each payment intent or create a single invoice by adjusting all the charged payment in a single invoice. (PS: we would like to handle invoice generation from our end itself).

covert lark
#

At the time of renewal of subscription in the next billing cycle will I be able to apply the coupon again? (As we are managing the credit limit from our end, we plan to creating a coupon on every billing cycle by checking the remaining credit for that user and accordingly we'll create and apply the coupon at the time of subscription renewal.
why not just create customer credit balance in that case? instead of coupons

#

Another question I have is related to pay-as-you-go, where we just use stripe payment. In this method we would like to charge multiple times in a single billing cycle in case they are reaching threshold to avoid payment defaults, so do we have some best practices for this, and should we create a separate for each payment intent or create a single invoice by adjusting all the charged payment in a single invoice. (PS: we would like to handle invoice generation from our end itself).
you could charge multiple times in a single billing cycle using subscriptions, no need to manually invoice yourself

lyric pilotBOT
crimson mirage
#

Is there any doc available for credit balance? I will explore both the options and will go with the lean one which works best.

For coupons:
Is it possible to get the webhook events before the renewal of subscription so that we can create a coupon and apply for the renewal billing payment?

meager frost
#

Hey! Taking over for my colleague. Let me catch up.