#some1ataplace

1 messages ยท Page 1 of 1 (latest)

echo sparrowBOT
jolly copper
#

Hi ๐Ÿ‘‹

#

Those create two different types of objects.

#

stripe.account.create creates an Account object (for use with Stripe Connect)

copper turtle
#

Yes one is for connect and the other for a customer. But for customer.create I am directly linking an existing account to a new customer?

#

Why would you do that exactly?

#

Is that exactly the same as setting up a foreign key in a database

#

link an exsiting account id to a new customer. If I do that, would I need to ever have a customer id in the database? I just need to store account id?

echo sparrowBOT
copper turtle
#

If I have both a customer who buys subscriptions on my website and a user on my website can also use connect for affiliate marketing and getting rewards for sharing a link I give them, which one would I use?

#

I have both scenarios where I would need both an account object and customer object

jolly copper
#

When you use the stripe-account header, you're making a request for your Connected Account:
https://stripe.com/docs/api/connected_accounts

So the difference between:
stripe.customer.create(stripe_account=<accountid>)
and:
stripe.customer.create()
is where the Customer object gets created.

With the first line, the Customer object is created on the Connected Account, so it can be used by other objects on that account. When working with Connect, that is our Direct Charges pattern, where payments are performed directly on the Connected Account so all objects those payments need to reference must also be there. Accounts are blocked from interacting with objects from other accounts.

The latter approach will create the Customer object on the Platform Account. That's typically done when working with Destination Charge flows, where payments happen on the Platform Account and then funds from those payments are transferred to your Connected Accounts.

copper turtle
#

Oh so only when you use direct charges would you ever need stripe.customer.create(stripe_account=<accountid>)?

jolly copper
#

Yup, if you are processing payments on your Platform account, then you likely don't need to create Customers on your Connected Account.

copper turtle
#

Makes sense thank you

#

So I would keep a platform customer id and make a separate account id and store both in my database