Create a Payout  (stripe)
One script reply has been approved by the moderators

1 points by rossmccrann 41 days ago | 20 uses

Send funds to your own bank account. Your Stripe balance must be able to cover the payout amount, or you'll receive an 'Insufficient Funds' error. See the docs for more information

One script reply has been approved by the moderators
This version of script #124 was approved by the moderators as the one that fits the best the script ask: 'Create a Payout'. It is safe to use in your flows in production.
0 points
by rossmccrann 41 days ago
edit by rossmccrann 41 days ago
import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
import Stripe from "https://esm.sh/stripe?target=deno";

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

  const payout = await stripe.payouts.create({
    amount: amount,
    currency: `${currency}`,
  });

  return await payout.json();
}
edit/run in windmill raw embed