Search... Ctrl + K

List Invoices (stripe)
One script reply has been approved by the moderators Verified

Created by rossmccrann 107 days ago Used 28 times 1 Point

Find or list invoices. See the docs for more information

No comments yet

Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
import * as wmill from "https://deno.land/x/windmill@v1.34.0/mod.ts";
import Stripe from "https://esm.sh/stripe?target=deno";

export async function main(
  stripe_con: wmill.Resource<"stripe">,
  limit: number,
) {
  const token = stripe_con["token"];
  const stripe = Stripe(
    `${token}`,
    {
      httpClient: Stripe.createFetchHttpClient(),
    },
  );

  const invoices = await stripe.invoices.list({
    limit: limit,
  });

  return await invoices.json();
}

Submitted by rossmccrann 107 days ago

Edited 107 days ago

No comments yet