#Akin-charge-to-invoice
1 messages ยท Page 1 of 1 (latest)
Hi ๐ you'll need to work up from the Charge to a higher-level object where you can make that determination.
You can get the ID of the related Payment Intent from the Charge's payment_intent field, and then use that ID to retrieve the Payment Intent.
The Payment Intent will have the ID of the associated Invoice in its invoice field if it associated with an Invoice.
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-invoice
If you're not using Invoices for your one-off payments, then that is likely a good indication the Payment Intent is from a Subscription, but recommend testing with your flow to ensure.
If you are using Invoices for one-off payments, then you'll likely want to retrieve the Invoice and see if its subscription field is populated.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Akin-charge-to-invoice
Ah okay, thanks