#arvindkgs
1 messages · Page 1 of 1 (latest)
in_1JcjuYLqLSW4Y8iKDMidZZlD
@simple wadi its in_1JcjuYLqLSW4Y8iKDMidZZlD
@simple wadi sorry that's the invoice-id
@simple wadi event id : evt_1JcjuZLqLSW4Y8iK9VizzFaL
@lament cedar the subscription id is returned in that event, to clarify, is it that you are expecting other parameters for a subscription object?
@simple wadi I see subscription: null
it's there, but there is also "subscription": null
you can search for that
the one's where I see subscription id is for individual subscription items
but overall subscription association for this draft invoice is null
If that value is not set, the created invoice will include all pending invoice items for the customer.
i would recommend you check the invoice line item subscription
not the invoice.subscription
so are you saying that invoice.subscription field can be null
yes, that's possible
I am storing subscription and invoices as one-to-many relationship in my db
as you mentioned "This only happens for events manually triggered via API. Automatic invoice generated by Stripe has this field populated."
meaning every invoice is associated with atleast one. subscription
I will not be able to make this association if an invoice is not associated with a subscription
is my understanding of subscription and invoice relationship incorrect?
sorry, i think i got a bit confused earlier. To summarize the problem :
i guess the main problem here is that you want to test the invoice.created webhook, and you're expecting the invoice.created event to contain a value in the subscription parameter. Unfortunately, if you attempt to trigger the invoice manually, you don't get a value in the subscription parameter.
okay, thank you for the clarification
give me a few moments to think about if there is any workaround here and get back to you
thank you
@lament cedar if you're attempting to test invoice.created upon renewal of the subscription. There really isn't a good way to test this - you could use a shorter subscription interval e.g. one day. Or if you are okay with testing invoice.created when a customer first subscribes to a subscription - it should trigger invoice.created event where it should contain the subscription object
@simple wadi thank you, that should work
@simple wadi by customer subscribes to a subscription this is when API https://stripe.com/docs/api/subscriptions/create is called right?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
can you tell me what are the events trigger created when a new subscription is created?
@lament cedar you can test this yourself by creating a new subscription in the Dashboard in test and looking at the timeline or events for that particular subscription