Setu Recipes: reusable digital workers across every app.Browse templates

Integrations / Stripe

Stripe

Payments data, read only: balance, charges, payouts, customers, invoices, subscriptions and balance transactions.

9 actions API key 9 read0 write Calls api.stripe.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "stripe" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

This toolkit uses a single credential and requests no scopes.

Actions

Get balancereadstripe.get_balanceRetrieve the current Stripe account balance: available and pending amounts per currency.

No input.

TypeScript
await setu.execute({
  userId: "user_1",
  action: "stripe.get_balance",
  input: {},
});
Get chargereadstripe.get_chargeRetrieve one charge by id, including status, amount, refund state and its balance transaction.
InputTypeDescription
charge_idstringRequiredCharge id, e.g. ch_...
TypeScript
await setu.execute({
  userId: "user_1",
  action: "stripe.get_charge",
  input: {
    "charge_id": "<charge_id>"
  },
});
Get customerreadstripe.get_customerRetrieve one customer by id.
InputTypeDescription
customer_idstringRequiredCustomer id, e.g. cus_...
TypeScript
await setu.execute({
  userId: "user_1",
  action: "stripe.get_customer",
  input: {
    "customer_id": "<customer_id>"
  },
});
List balance transactionsreadstripe.list_balance_transactionsList balance transactions (charges, fees, payouts, refunds) that make up the Stripe balance, newest first.
InputTypeDescription
limitintegerOptionalNumber of objects to return (1 to 100, default 10)
starting_afterstringOptionalObject id to start after, for the next page
typestringOptionalOnly this transaction type, e.g. charge, payout, refund
TypeScript
await setu.execute({
  userId: "user_1",
  action: "stripe.list_balance_transactions",
  input: {},
});
List chargesreadstripe.list_chargesList charges, newest first, optionally for one customer. Amounts are in the smallest currency unit (cents).
InputTypeDescription
limitintegerOptionalNumber of objects to return (1 to 100, default 10)
starting_afterstringOptionalObject id to start after, for the next page
customerstringOptionalOnly charges for this customer id
TypeScript
await setu.execute({
  userId: "user_1",
  action: "stripe.list_charges",
  input: {},
});
List customersreadstripe.list_customersList customers, newest first, optionally filtered by exact email address.
InputTypeDescription
limitintegerOptionalNumber of objects to return (1 to 100, default 10)
starting_afterstringOptionalObject id to start after, for the next page
emailstringOptionalOnly customers with exactly this email
TypeScript
await setu.execute({
  userId: "user_1",
  action: "stripe.list_customers",
  input: {},
});
List invoicesreadstripe.list_invoicesList invoices, newest first, optionally for one customer or status.
InputTypeDescription
limitintegerOptionalNumber of objects to return (1 to 100, default 10)
starting_afterstringOptionalObject id to start after, for the next page
customerstringOptionalOnly invoices for this customer id
statusstringOptionalInvoice status
TypeScript
await setu.execute({
  userId: "user_1",
  action: "stripe.list_invoices",
  input: {},
});
List payoutsreadstripe.list_payoutsList payouts to the connected bank account, newest first, optionally filtered by status.
InputTypeDescription
limitintegerOptionalNumber of objects to return (1 to 100, default 10)
starting_afterstringOptionalObject id to start after, for the next page
statusstringOptionalPayout status
TypeScript
await setu.execute({
  userId: "user_1",
  action: "stripe.list_payouts",
  input: {},
});
List subscriptionsreadstripe.list_subscriptionsList subscriptions, optionally for one customer or status (canceled and ended ones need status=all or canceled).
InputTypeDescription
limitintegerOptionalNumber of objects to return (1 to 100, default 10)
starting_afterstringOptionalObject id to start after, for the next page
customerstringOptionalOnly subscriptions for this customer id
statusstringOptionalSubscription status
TypeScript
await setu.execute({
  userId: "user_1",
  action: "stripe.list_subscriptions",
  input: {},
});