#Equilibrium
1 messages · Page 1 of 1 (latest)
Hi there!
I'm not sure I understand what you mean by "not to include confirmed payment intents that are confirmed/paid on the Connect account Y in the invoice". Can you share a concrete example of this? When you create an invoice, it automatically create a new PaymentIntent for you, it doesn't include any existing PaymentIntent.
We are a b2b business and our implementation is as follows:
for each partner we create a customer.. for every purchase made through our API or dashboard ( we don't charge the end-user ) we add an invoice item.. at the end of the month we just email our partner the invoice
we had a use case that our partner wanted us to be the merchant of record.. so we recommended they use Stripe Connect and to create direct charges on the account
Now we have 2 sources of data ( payments intents under the connected account ) & ( invoice items under the main account )
Is there a way not to include the confirmed payment intents under the connected account in the customer's invoice? we would like to inoivce the partner with the dahsboard/test purchases but not the charges that are confirmed on the connect account
Happy to share example & images if this is not clear
Is there a way not to include the confirmed payment intents under the connected account in the customer's invoice?
You can create invoiceitem that represents these PaymentIntents, but there is no way to link those PaymentIntents to the invoice.
( invoice items under the main account )
Why not using invoices for all cases. You can use Invoice for connect also
one image is customer Y under CELITECH account
and the 2nd image is Celitech-Y
the invoice items under CELITECH customer can be from multiple sources ( API, dashboard, ) .. and we would like not to include the invoice items that were successfuly charges on the connect account
you mean invoice item?
You can use invoice items with Invoice but not linking PaymentIntent to an Invoice.
I got your point, I dont want to link them
I would just like to filter our invoice items that are paid in the connected account from the customer
Do you have an idea how to do that?
Yes, you can use Stripe Auth Headers in order to request your Connected Account resources:
https://stripe.com/docs/connect/authentication#stripe-account-header
You can search for the Connected Account's Invoice:
https://stripe.com/docs/api/invoices/search
However status, isn't a queryable field:
https://stripe.com/docs/search#query-fields-for-invoices
Can you clarify the flow a bit more please
I would just like to filter our invoice items that are paid in the connected account from the customer
In general if you want to fetch resources (Invoice, PaymentIntents, Customer) of a Connected Account from a Platform Account, you can use the Stripe Header authentication (https://stripe.com/docs/connect/authentication#stripe-account-header)
const stripe = require('stripe')('PLATFORM_ACCOUNT_SECRET_KEY');
const paymentIntent = await stripe.paymentIntents.create(
{
amount: 1000,
currency: 'usd',
automatic_payment_methods: {
enabled: true,
},
},
{
stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
}
);
The PaymentIntent will be created for the Connected Account. This is valid most of Stripe APIs.
Now you can search for the invoices created on your Connected Account using the same approach.
the payment intents are created in the connected account, all the customers and their invoices are under our main account
in the connected account its immediate settlement using the application_fee feature .. so we can send our customer directly their markup
Can you share a resourceId that you want to fetch/search from the Connected Account ?
Sure, the payment intent under our connect account: pi_3NAOIVHilKDY4Svv1TB1ph9V
should not be included in the invoice items of customer: cus_MW6nGT5aFeJj33
hopefully this is a bit more clear
because we did immediate settlement for the payment intent ( so we dont want to include it in the monthly invoice for the same customer under our main account )
the monthly invoice should include everything else ( test purchases without connect & dashboard purchases )
Sure, the payment intent under our connect account: pi_3NAOIVHilKDY4Svv1TB1ph9V
So you want to search for this PaymentIntent?
You use the Search API :
https://stripe.com/docs/api/payment_intents/search
and filter on these queries:
https://stripe.com/docs/search#query-fields-for-payment-intents
and for all payment intents in "Succeeded" status, i should not include/remove them from the customer's invoice?
This is depending if you still need to charge them or not.... but as I said at the beginning you should use same API (e.g. invoices) for all use cases and standarize your flow
I agree regarding having a standard flow,
but yeah we would like to charge them for all other invoice items that are not in "Succeeded" status on the Connect account
Is there a way to detect which invoice item is linked to a payment intent? so we can remove it if its in "Succeeded" status?
Is there a way to detect which invoice item is linked to a payment intent? so we can remove it if its in "Succeeded" status?
How are you linking invoice items to a Paymentintent in your integration/sytem?
for stripe side, you can't achieve this, because invoice items are still pending in your case and are issued only at the end of the month
Currently, they are not being linked, so it's hard for us to differentiate between the two ( to filter them out etc )
I'm reaching out to see if there's any possible feature/solution from Stripe's end that can help
But i agree on the part that they should be linked
Nope if you don't link them in your itnegration, there's no way to link them in Stripe. I think one option to add metadata (uniq id) in the invoiceitem in your side, add same metadata in the PaymentIntent object (same uniq id) and then search and match to see if there is a match
We actually came to a very similar conclusion, we just thought that maybe you have something from your end that can help.
otherwise, I appreciate the metadata approach, do have any other solution in your mind that can work? we thought about saving purchases to the payment intent map.. and based on a cron job we can create invoice items for purchases that are unpaid
otherwise, I appreciate the metadata approach, do have any other solution in your mind that can work?
I think also you can create the invoiceItem at the end of the month for only unpaid PaymentIntent.
much appreciated, I believe the conversation was really helpful
Happy to help!