#exxmaxx
1 messages ยท Page 1 of 1 (latest)
HI ๐
There's not a lot of context here. This appears to be an invoice but how did you create it? Have you completed payment for it? What status is it in?
ok here is the context.
I am integrating stripe for a SaaS platform collecting subscriptions. I am using the pricing tables. I managed to send the call and also succesfully listening to 7 events
"checkout.session.completed":
"invoice.paid":
"customer.subscription.created":
"customer.subscription.updated":
"invoice.payment_failed":
"customer.subscription.deleted":
customer.subscription.trial_will_end":
Now I am testing the stripe webhook responses in test mode. I triggered a subscription in the Front end of my application and managed to ger checkout.session.completed as expected
in the invoice.paid response i channot see a charge_id (ie. char_3213)
I was planning on keeping this in my DB as a reference.
I am already keeping the customer_id and invoice_id .. But now i can see the charge property is empty even when i trigger it from the stripe CLI. Why is that ? what is that field.
If there is another reccomended payment reference to keep what would that be?
Have you tried retrieving the Invoice via the API? https://stripe.com/docs/api/invoices/retrieve
yes but my question is more around the charge concept
What I am saying is that this ID may not be returned in the webhook event but that you can request more data be returned when you use the Retrieve API.
Can you provide the invoice id?
yea that's what i was wondering
Yeah the Charge object is only created when we attempt to collect funds
so basically if a user is starting a free-trial or is in test mode. There wont be a charge id
is this statement valid ?:))
ok i will basically make this value nullable in my database and it should be good. Although, maybe i dont even need to hold this id as i am already keeping the invoice _id
If you need it you can always retrieve the ID from the Invoice object.
That should be enough i guess mate. Thank you
Happy to help ๐