1
List Balance History
One script reply has been approved by the moderators Verified

Returns the last 100 transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. See the docs for more information

Created by rossmccrann 850 days ago Viewed 9417 times
0
Submitted by rossmccrann Deno
Verified 850 days ago
1
import Stripe from "https://esm.sh/stripe?target=deno";
2

3
type Stripe = {
4
  token: string;
5
};
6
export async function main(stripe_con: Stripe, limit: number) {
7
  const token = stripe_con["token"];
8
  const stripe = Stripe(`${token}`, {
9
    httpClient: Stripe.createFetchHttpClient(),
10
  });
11

12
  const balanceTransactions = await stripe.balanceTransactions.list({
13
    limit: limit,
14
  });
15

16
  return await balanceTransactions.json();
17
}
18