#kemel-connect-list-subscriptions

1 messages · Page 1 of 1 (latest)

umbral yacht
#

Hello! Yes you'd use the list endpoint (https://stripe.com/docs/api/subscriptions/list) whilst passing the stripeAccount parameter for the specific connected account: https://stripe.com/docs/api/connected_accounts

queen lance
#

thanks for reply

#

I can not see stripeAccount in the param list

#

for subcsription list end point

umbral yacht
#

Which Stripe library are you using?

queen lance
#

java usually

#

but curl is fine for me too

umbral yacht
#

Something like:

RequestOptions requestOptions = RequestOptions.builder()
  .setStripeAccount("acct_xxx")
  .build();

SubscriptionCollection subscriptions =
  Subscription.list(params, requestOptions);
queen lance
#

i see, thank you

#

i ll try it

#

Hi again , i just tried

#

created subscription with platform account

#

curl https://api.stripe.com/v1/subscriptions
-u sk_test_TRpeYc9q5FHNYipWLIudkwYd:
-d customer=cus_Klj7ypFk0zlBxP
-d "items[0][price]"=price_1K4qcQBXEXgJIGE1HDpaHo5i
-d "expand[]"="latest_invoice.payment_intent"
-d "transfer_data[destination]"="acct_1GGkmFKU6sq3ZaRg"

#

then tried to fetch with this

#

it returned empty list

umbral yacht
#

Your subscription create call wasn't made on behalf of the connected account - you just created a subscription on the platform but passing a connected account as the destination

queen lance
#

should i add on_behalf_of while creating subscription ?

umbral yacht
#

What are you trying to do? I think your wires are crossed

#

There's no way to list all subscriptions on an account with a specific destination account, no

queen lance
#

we have clients, all of them are custom connected accounts

#

we charge things for them by using destination param

#

we want to do similar by using subscription api

#

clients want to see only their subscriptions

#

does that make sense ?

umbral yacht
#

Yep, got it. So currently your subscription create calls are being made on your platform account. The transfer_data[destination] parameter has no bearing on that – it's just relevant for flow of funds

#

And as you're using custom accounts it's unlikely you'll be making API calls on their behalf (the platform does the majority of the transacting)

#

So in this instance you'll likely need to persist the subscription IDs relevant for each connected account somewhere else for you to lookup using the platform API keys

queen lance
#

ok, i see

#

thanks for it

#

we will have look at that way