#asif-account-update
1 messages · Page 1 of 1 (latest)
You should be able to set the application fee percent: https://stripe.com/docs/api/subscriptions/update#update_subscription-application_fee_percent
Hello @prime turtle did you get it correclty what i am trying to ask please?
I believe so. You want the platform to take a percent fee of the subscription, right? You can do that through application fees
Can i do that from sub account not from platform account?
In my example above Account A is sub account
You need to make the request with the platform's api key passing the stripe account header
No no not from sub account
But we already have subscriptions in sub account
Not for new subs that come through platform
What I mean is that you can update the sub account's subscription with the platform's api keys
This is what you need to do: https://stripe.com/docs/connect/authentication
let me share snippets that gives this error:
\Stripe\Stripe::setApiKey($STRIPE_API_KEY);
$account = \Stripe\Account::update(
"sub_1MT76nICHme*******",
[
"application_fee_percent" => 10,
'transfer_data' => [
'destination' => 'acct_1CgIG3ICHm***'
]
]
);
@prime turtle Error is
Uncaught (Status 403) The provided key 'sk_test_******************************************************************************************QISVzG' does not have access to account 'sub_1MT76nICHmegBB
But in reality its have access to that
Am i calling the right endpoint?
where i can find request id?
This is was the last request i made to list customers but not the update endpoint here
right now i am calling update endpoint
I am looking at platform account also using platform account test keys
you're updated a connected account, that's where the logs would live
"sub_1MT76nICHme**",
[```
your code is trying to update an Account but passing a Subscription id which doesn't really make sense
asif-account-update
What do i need to pass then ??
will it update all subscriptions in that account at once?
The code you wrote calls the https://stripe.com/docs/api/accounts/update account. It's trying to update one of your connected accounts assuming you are a platform.
Thanks
But this is what i see now
Error Message is:
Uncaught (Status 400) (Request req_YJWSyJpIfWzdFL) You can't change the application_fee_percent on a subscription that was not created by your application.
Am i still doing something wrong?
Well the code you wrote works and does the thing you expect. And it clearly tells you what the error message is now
also you leaked your API key and need to roll it immediately
The Subscription you mentioned was not created by you. So you're not allowed to change it and add an ApplicationFee to it
@fluid nebula was my question not clear at the begning?
This one:
`*We have account A where we have already Subscriptions and also we have a platform where we connected Account A...
So Account A is now listed as connect Account on the platform account .... Now we want a percentage fee from Account A to the Platform account .... Can I update subscriptions in Account A so that every time a subscription reoccurs platform gets its fee?*`
yeah that is impossible
you'd have to create a brand new subscription in that case and cancel the old one
we have to crate subscription from platform not directly in sub account (connected accont)
Right?
This was my initial question but the previous stripe representative** said it's possible**.
It is impossible to take an existing Subscription that you haven't created yourself and then set an ApplicationFee on it. So you'll have to create a new Subscription yourself with code yes
What do you mean by **yourself **here?
do you mean by** yourself** is platform account?
Yes we created those subscriptions by API but not from the platform rather directly from the connected account.
yes sorry, it's really rare to have an account and a separate platform. So you, as the platform, have to create the Subscription
@gusty dune did you have more questions?
Yes one please
My client want this:
Can we turn guest customers to real customers with their attached payment methods?
no that's not possible. A Guest customer is a feature specific to our Dashboard that takes one-time payments never attached to a Customer and shows you how they relate
Ok thanks good day great help