#cyrez-subscriptions
1 messages ยท Page 1 of 1 (latest)
for subscriptions i currently use "latest_invoice" in the subscription object
via api
but this doesn't cover manual invoices
if you have the invoice id you can retrieve it https://stripe.com/docs/api/invoices/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
it's a page where i display the customers invoices, payment method, billing address. i would like to give them a warning if the latest payment failed and they need to update their payment method
yes you can expand on the https://stripe.com/docs/api/invoices/object#invoice_object-charge when retrieving
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
sorry my bad it's the PaymentIntent instead of charge https://stripe.com/docs/api/invoices/object#invoice_object-payment_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and there you can find all the information: payment method, status etc... https://stripe.com/docs/api/payment_intents/object#payment_intent_object-status
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and the last_payment_error if any
and how can i get the latest "relevant" invoice?
would it make sense to query https://stripe.com/docs/api/invoices/list (with customer) and take the first item in the list and check the payment intent object?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
but that wouldn't filter the one that is not related to a subscription
you could use instead the https://stripe.com/docs/api/invoices/search
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
my current logic: check subscription.latest_invoice <- check for errors
and use the query subscription:null
i would replace this logic and just check the latest invoice for an customer
regardless of it's belonging to an subscription or is a manual invoice
that could be a solution yes
ok thanks i will try that.
let me know if you need any more help
one more question:
yes sure
could i just directly call https://stripe.com/docs/api/payment_intents/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and directly take the first one in this list
that should always be the latest payment right?
we use Payment Intents for mostly all of our products
but if you feel it's a better choice for you and that it corresponds to what you're trying to achieve then yes
am not quite sure yet, just trying not to miss anything
i will look into this approaches and come back if neccessary, thanks for your help
sure let me know if you need any more help