#justintime42

1 messages · Page 1 of 1 (latest)

swift jayBOT
soft snow
#

No problem at all

#

Also, since the connected account is a Standard account, you can just create the invoice on the connected account directly by specifying a Stripe-Account header in the request.

By specifying a stripe_account, you are telling Stripe that you want to make an API call on behalf of a connected account. You can refer to this doc to learn more about making API request for connected account (https://stripe.com/docs/connect/authentication)

halcyon parcel
#

So I should be making the invoice like so:

await stripe.invoices.create({
      customer: customer.stripeID,
      due_date: dueDate,
      pending_invoice_items_behavior: "include",
      collection_method: 'send_invoice',
    },
    {
      stripeAccount: stripeAccount
    })

Is that right? If so what is the difference between passing the stripeAccount header versus using the on_behalf_of field?

soft snow
#

You don't need to set on_behalf_of in this case since the invoice is directly created on the account

halcyon parcel
#

oh I think I see. so I can use that stripeAccount header to make any API call on the connected account? Like creating customers, invoices, etc?

soft snow
#

Yes you are right

swift jayBOT
halcyon parcel
#

Ok, and just to clarify, if I do the stripeAccount header, I don't need to do on_behalf_of, because the connected account will be the settlement merchant since I created the invoice directly on their account.

sick pilot
#

Yes! If you have Stripe-Account header, on_behalf_of is not needed

halcyon parcel
#

ok awesome. thanks so much for all the help!