#Avery246813579
1 messages · Page 1 of 1 (latest)
Basically a way to see the Balance change from activity report through the API
You can list balance transactions for connected accounts, yes. What exactly are you looking for that you're not finding?
The balance transactions on the platform account that passed between a specific connect account
Using the stripeAccount parameter through the API only send me the balance transactions that would have been done on that connect account, not the ones that interacted with them on the platform account
I'm just trying to find the non-paid-out balance transactions for a specific connect account
What kind of accounts and payouts are you using?
custom with manual
This is only possible to track when using automatic payouts, with manual payouts you have to keep track of that yourself
For automatic payouts where those can be tied together, this use case is explained here: https://stripe.com/docs/expand/use-cases#charges-in-payout
Yeah I am just trying to find the balance transactions that show the available soon portion of a connected account
Since that will show me when they can be payed out
You can use the "Balance change from activity" to pull these balance transactions for a specific custom connect account but I am trying to do this through the API so I don't have to export 200+ reports
Since available soon is just where the balance transaction available_on is after the current time
For the current available balance for payouts I think you might just want to look at the Balances API, not balance transactions:
https://stripe.com/docs/api/balance/balance_object#balance_object-available
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Otherwise I'm not sure what you're trying to do with the granular transactions
you can figure out when payments can be payed out depending on the balance transactions
I want to be able to input that information into my system and backfill payments
so I want to find the balance transactions between my platform account with a specific connect account during a period of time
which is exactly what you can do with the "Balance change from activity" report on the stripe dashboard, but I want to do that through the api
the balance object will only give the summation of the available funds, not the days the funds will be available on
You'd likely want to go backwards from the connected account in this case, but either way you'd use expansion to find the destination transfer or the source charge depending on which side you started from
Right, then you'd probably want to use the BT List endpoint for an account, filtering to ones starting_after the last one you have a record of, then examining the available_on time
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so fetch all balance transactions in a time period, expand the source and check the destination of the charge basically?
You don't need to filter on destination that if you do it in the context of a connected account, but thats up to you
Yes you could do the same from the platform side and expand and do the connected account mapping
NP!
alright I might have found a hack around it using the reporting api
Oh?
const reportType = await stripe.reporting.reportTypes.retrieve(
"balance_change_from_activity.itemized.3",
{stripeAccount: "acct_1GlVhHLhaVpGwiDI"}
);
console.log("Fetching report information");
const {data_available_start, data_available_end} = reportType;
const startReport = await stripe.reporting.reportRuns.create({
report_type: "balance_change_from_activity.itemized.3",
parameters: {
interval_start: data_available_start,
interval_end: data_available_end,
timezone: "America/Los_Angeles",
columns: ["created", "reporting_category", "net", "available_on"],
},
});
console.log("Creating report");
setTimeout(async () => {
const reportRun = await stripe.reporting.reportRuns.retrieve(startReport.id);
console.log("Refetching report");
let headers = {
Authorization: "Bearer " + process.env.STRIPE_API_KEY,
};
const data = await request({
url: reportRun.result.url,
method: false,
headers,
});
console.log("We got our data", data);
}, 30 * 1000);