#asif-account-update

1 messages · Page 1 of 1 (latest)

mellow marshBOT
prime turtle
gusty dune
#

Hello @prime turtle did you get it correclty what i am trying to ask please?

prime turtle
#

I believe so. You want the platform to take a percent fee of the subscription, right? You can do that through application fees

gusty dune
#

Can i do that from sub account not from platform account?

#

In my example above Account A is sub account

prime turtle
#

You need to make the request with the platform's api key passing the stripe account header

#

No no not from sub account

gusty dune
#

But we already have subscriptions in sub account

#

Not for new subs that come through platform

prime turtle
#

What I mean is that you can update the sub account's subscription with the platform's api keys

gusty dune
#

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?

prime turtle
#

Did you pass the stripe account header?

#

Can you share the request id?

gusty dune
#

where i can find request id?

gusty dune
#

@prime turtle i am afraid to say that i seems recent request are not being logged

prime turtle
#

What account are you looking at there?

#

The connect or platform account?

gusty dune
#

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

fluid nebula
#

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

gusty dune
#

What do i need to pass then ??

will it update all subscriptions in that account at once?

fluid nebula
gusty dune
#

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?

fluid nebula
#

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

gusty dune
#

@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?*`

fluid nebula
#

yeah that is impossible

#

you'd have to create a brand new subscription in that case and cancel the old one

gusty dune
#

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**.

fluid nebula
#

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

gusty dune
#

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.

fluid nebula
#

yes sorry, it's really rare to have an account and a separate platform. So you, as the platform, have to create the Subscription

fluid nebula
#

@gusty dune did you have more questions?

gusty dune
#

Yes one please

#

My client want this:

Can we turn guest customers to real customers with their attached payment methods?

fluid nebula
#

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

gusty dune
#

Ok thanks good day great help