#Serdar
1 messages ยท Page 1 of 1 (latest)
Hi i already managed to create custom accounts and also to create products
Now i'm wondering, how i can create subscriptions for a product to a custom account
๐ Hi there, Happy to help!
Yes you can use Connect with Subscription
const subscription = await this._stripe.subscriptions.create({
customer: 'acct_1MBxoLRVyaGmD9zr',
items: [{ price: 'price_1MByFzD1fTq5Z6HuS6yKY6BX' }],
expand: ['latest_invoice.payment_intent'],
});
You can check this guide:
https://stripe.com/docs/connect/subscriptions
i tried this code
but then i get the message, No such customer: 'acct_1MBxoLRVyaGmD9zr'
Do i need to set the account id on another field?
Yes because you are passing the AccountId and not the Customer Please check the guide I shared above
You need to do something like this: for direct charges:
const subscription = await stripe.subscriptions.create(
{
customer: '{{CUSTOMER}}',
items: [{price: '{{PRICE}}'}],
expand: ['latest_invoice.payment_intent'],
},
{stripeAccount: '{{CONNECTED_ACCOUNT_ID}}'}
);
https://stripe.com/docs/connect/subscriptions#use-direct-charges-to-create-a-subscription
Or this if you are using :
const subscription = await stripe.subscriptions.create({
customer: '{{CUSTOMER}}',
items: [{price: '{{PRICE}}'}],
expand: ['latest_invoice.payment_intent'],
transfer_data: {destination: '{{CONNECTED_STRIPE_ACCOUNT_ID}}'},
});
https://stripe.com/docs/connect/subscriptions#use-destination-charges-to-create-a-subscription
The Connect Account is creating a subscription for whom ?
I as platform
want to create a subscription
to custom accounts
so as soon as they create a account on my platform, they do the onboarding for custom accounts
and after that i want to create a subscription to them
that they pay monthly / yearly to use my platform
Let me explain again for you
So the customer comes to our platform and create an account to manage his events and to sell tickets.
After the creation of the account, we forward him to the onboarding process to create a custom-account on stripe connect.
For the use of our platform, we want to create a subscription him as example 10โฌ per month.
Is that not possible?
I think i miss this step can it be:
Create a customer on the platform with the intended payment method for every connected account you want to bill. In the gym management software example, you create a customer for each gym business:
So i need to create afterwards a customer for each connected account?
Ah ...
I think i need to follow this
But still my question is
Do i need to create a customer for every connected account then?
Exactly, so you need to treat your Connected Account as a Customer for your platform Account not as a partner (Stripe Connected Account Object)
Yes that we already do ๐
Yes exactly:
https://stripe.com/docs/api/customers/create
But the Connected Account does not have a Customer ID
ah okay ..
thank you i will check
Np!
One more question
Do you recommend to create the customer before the custom account?
is there any possiblity to link customer <-> custom account?
That will depends on your business logic, but for Stripe point of view there is no difference AFAIK
You can use customer metadata to have that link for your integration, but for Stripe point of view there is no link
Hmmm
I tried this:
And there i pass the account id of the custom account
But then it is more like, that i create a customer for the custom account .. which is not what i wanted
or do it think wrong?
What are you trying to do?
This is what i want
Therefore your colleague told me, that i need to create a customer to the connected account
So i can create a billing for the custom account
I have expected, that the customere is shown under my customers, and not the customers of the connected account?
Because at the end, i want to make a subscription to that customer with one of my products
Then yes, you'd create the customer on the platform without the stripeAccount parameter. But that Customer object is a representation of a connected account, so you need to add a reference to that account on the customer (e.g. metadata as my colleague suggested).
Ah okay
I thought there was a possible linking between them
How does the system understand, that the customer is the representation of the connected account?
Because the banking details are in the connected account ..
Or how do i bill then the customer when there is no direct connection? ๐
It doesn't automatically, It's up to your to build and maintain that
For example, you might store a metadata field on the Customer object that maps to the related connected account:
account: "acct_xxx"
Yes i understood that
Can i somehow use the banking data from the connected account for the customer?
Because imagine the flow would be:
- Customer makes Onboarding for the Custom Account and provides his banking data
- Customer needs to provide again his banking data for the customer account?
That would be not so nice
One for payouts, one for payments?
Payments
Let me explain again our usecase
We are Platform x
Customer Y comes to our platform and creates an account. He wants to sell tickets for his event.
Our system creates now for his account a custom account on stripe. He is doing the onboarding process and also provides banking data for the payouts.
But to use our platform, we have different products. We want as example subscription 10โฌ per month from him.
How to handle this case?
As i understood, we need to create a customer on stripe for him, so we can make subscription to him. And we "link" them over metadata. Ok but how can our customer now provide his banking details, so stripe nows where to get the 10โฌ per month from?
You've found the documentation link that describes how to build this. What particular issues are you encountering?
You would collect those during the process of the subscription creation, via our hosted UIs (Checkout, Payment Element)
So the customer needs to two times Stripe-Link stuff?
- Onboarding for the Custom Account
- Subscription
The APIs/objects used for collecting payments and payout out money are different, and can't really be used interoperable
What kind of payment methods did you want to use? https://stripe.com/docs/payments/payment-methods/integration-options
For what exactly?
The payment methods are not the problem
Use flow the user has to go through is not nice
He first would do the onboarding for the custom account
And afterwards he would need to go to a checkout page to make the subscription
I'm trying to understand what banking rails you want to leverage for your customer to pay you, form the options we support
Well, credit card is entirely different then
Yeah i see ..
Ok we need to overthink how we can use stripe connect then
Seems like its not that easy how we thought
They're 2 entirely separate entities. You shouldn't assume that the bank account that I want to deposit proceeds from my tickets sales into is the same account I want to pay my subscription from
Equally, there's often additional requirements for banking mechanisms to make payments from (e.g. authentication)
np!