I've been reading Stripe's api documentation (v3) and it's not apparent to me when to use Stripe's Invoice vs PaymentIntent objects. From reading the documentation, here's what I understand:
Stripe sees payment intents being the primary way of facilitating payments through their API going forward and Charges will be deprecated at some point.
Processing an Invoice creates a
PaymentIntentunder the hood and and initiates payment right away. What I don't understand is why is there no destination account field for theInvoice? If the Invoice is defaulted to be sent to the platform's Stripe account (this is an assumption I am making since there is no destination field), why there is anapplication_fee_amountfield which is essentially the platform's "cut" of the transaction?A
PaymentIntentallow you to specify a destination account while taking an "application" or "platform" fee so you don't have to generate a transfer yourself.- A
PaymentIntentandInvoicecan be processed at time of creation or deferred until later in your payment lifecycle.
- A
My use case requires me to conduct payments between two parties and take a "platform fee" for each transaction. I have successfully done this by creating a PaymentIntent and using the connected Customer account's credit card on file and populating the transfer_data field with the amount to send to the 2nd party involved in the transaction.
I started looking into Stripe's invoicing api since I am planning on building an invoicing solution for my platform and thought it'd be best to leverage what Stripe has to offer, but I'm failing to see a benefit for me to leverage it since I also need to keep track of transaction ids for the payment intents and taxes based on zip code (it looks like Stripe doesn't do this automatically so I might be out of luck here).
I couldn't find a way to get a transactionId for processing an Invoice but I see that the chargeId gets returned as part of the response when you confirm a PaymentIntent (https://stripe.com/docs/api/payment_intents/confirm).
So the questions I have are:
- Why is there no destination account field for the
Invoice? Does it automatically get send to the platform's Stripe account and require you to manually create a transfer? - Is there an easy way to get a
transactionIdfrom anInvoice? - Is there a way to get a
transactionIdwhen creating aPaymentIntentand setting theconfirm=trueso thePaymentIntentgets processed immediately? - For a platform that will have an invoicing flow and facilitate transactions on behalf of two parties, is it recommended to use payment intents, invoicing, or both?
- What's the difference between a charge and transaction? When paying an Invoice, a charge id gets returned in the response but when paying a payment intent, a transaction id gets returned.
Thanks in advance!