#Avery246813579

1 messages · Page 1 of 1 (latest)

sudden emberBOT
ionic hornet
#

Basically a way to see the Balance change from activity report through the API

hot condor
#

You can list balance transactions for connected accounts, yes. What exactly are you looking for that you're not finding?

ionic hornet
#

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

hot condor
#

What kind of accounts and payouts are you using?

ionic hornet
#

custom with manual

hot condor
#

This is only possible to track when using automatic payouts, with manual payouts you have to keep track of that yourself

ionic hornet
#

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

hot condor
#

Otherwise I'm not sure what you're trying to do with the granular transactions

ionic hornet
#

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

hot condor
hot condor
ionic hornet
#

so fetch all balance transactions in a time period, expand the source and check the destination of the charge basically?

hot condor
#

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

ionic hornet
#

alright that makes sense

#

thanks for the help

hot condor
#

NP!

ionic hornet
#

alright I might have found a hack around it using the reporting api

hot condor
#

Oh?

ionic hornet
#
  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);