#kasturi-more_api

1 messages ยท Page 1 of 1 (latest)

finite spokeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1365089569384693831

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

tropic sage
onyx hinge
#

I am not seeing request in a dashboard

#

here - req_DarRK7NjIDRNsE

#

Got it from response header

tropic sage
#

What exactly are you trying to retrieve?

onyx hinge
#

connected account related to payout

tropic sage
#

Those payouts will only be for your platform; I don't think you can retrieve all your Connected Accounts' payouts, but let me keep looking.

#

(Or at least not in a single API call, I don't think...)

#

Or I'm wrong.

onyx hinge
#

I would appreciate any input

#

what I am trying to get - All the payouts initiated in last 7 days for weave's connected offices along with their account ID in the response

tropic sage
#

I can't see the results of GET requests, so I don't know what you're getting back when you make that request. Can you share one of the Payout IDs?

onyx hinge
#

that was for test mode. Let me fetch it for live mode

#

here - po_1RHJn9HFzwE4pTgexoXcIVyT

#

req_MosovT2lnHy9ki

tropic sage
#

That po_ was from a payout to your Platform, not to a Connected Account.

onyx hinge
#

how can I get the later?

tropic sage
#

You should see it at result.data.destination.account in your current request; what do you find there?

onyx hinge
#

the weave account id which is same for all the test/live payouts - acct_1EaPCrHFzwE4pTge

tropic sage
#

And the payouts were paid out to the Weave bank account, ya?

onyx hinge
#

yes - "account_holder_name": "Weave",

tropic sage
#

Right, so those are correct, ya?

onyx hinge
#

yes. but I am looking for payouts going out for connected accounts

tropic sage
#

Ok, so there is no way to list Payouts for all Connected Accounts with a single API call.

Can you tell me more about what exactly you're trying to build here?

onyx hinge
#

we want to store all the payouts in a db from stripe to our customers

tropic sage
#

Why?

onyx hinge
#

every time we want to show all the payouts to a customer, we have to fetch all the payouts for related account from stripe which is not efficient

#

also, if it going out to weave , how we get corect customer data when we fetch payout using account_id?

tropic sage
#

If it's going to Weave, it's going to Weave - so I'm not sure what you mean by that?

onyx hinge
#

example request response -

#

location_id is id on our end

tropic sage
#

If you want to store them all on your end you'll have to retrieve them all, for each Connected Account, up to 100 at a time (which is the largest limit you can set).

onyx hinge
#

but we'll have to send account id in the request?

tropic sage
#
for each ConnectedAccount:
  until done:
    payouts = requestPayouts(connectedAccountId, afterPayout)
    
    addToBigList(payouts)

    if payouts.hasMore? then
      afterPayout = payouts.last.id
    else
      done = true
#

That's ~pseudocode for the nested loops you'll have to do here to retrieve them all.

onyx hinge
#

but cant do without looping through connected accounts?

tropic sage
#

Correct.

onyx hinge
#

why - because it is possible that we won't be having payouts for each connected accounts everyday. We wanted it to behave similar like webhook

#

Like whenever a payout is created, we will have that event and store that info. but trying to achieve it with polling

tropic sage
#

Why not use webhooks then?

#

I'm assuming you're showing like ~25 payouts per page, ya? Why not just list Payouts with limit: 25 and paginate from there?

onyx hinge
#

because we are implementing multi-processor behaviour. and it becomes inefficient to fetch data from all the processors for each customer

tropic sage
#

That's fair. I'd suggest listening to the payout.* set of events and use those to add/update payouts to your datastore. You can either use API calls in a loop, or Sigma, to backfill your datastore too.

Does that make sense?

onyx hinge
#

okay. Thank you so much for all the help ๐Ÿ™‚

finite spokeBOT