Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Stripe

Scalekit connector
Open markdown

The Stripe connector lets your AI agent act in each user's Stripe account. Each user connects their own Stripe access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 178 tools.

Tools
178
What they doRead · write · destructive
78 · 77 · 2378 read77 write23 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Stripe connection

    In AgentKit > Connections, create a Stripe connection. The name you give it is the connection_name your code passes. See Configure connections.

    Console steps with screenshots

    Register your Stripe Secret Key with Scalekit so it can authenticate requests on your behalf. This connector uses a Bearer token.

    1. Choose a sandbox or your live account

      Stripe separates every account into isolated environments: one or more sandboxes for testing, and the live account for real payments. Each environment has its own API keys, so pick the right one before you continue:

      • Use a sandbox (shown as Test mode in the dashboard) while you build and test your integration. Sandbox keys are prefixed sk_test_ and pk_test_, and never move real money.
      • Switch to your live account only when you’re ready to process real payments. Live keys are prefixed sk_live_ and pk_live_.
    2. Get your Secret Key

      • Sign in to the Stripe Dashboard and confirm the environment switcher in the top-left corner shows the sandbox or live account you want keys for.

      • Go to Developers → API keys.

      • Under Standard keys, click the Secret key row and reveal or copy its value.

        Stripe Developers > API keys page showing the Publishable key and Secret key under Standard keys

    3. Add a connected account in Scalekit

      Connected accounts link a specific user identifier in your system to a Stripe Secret Key. Add one via the dashboard for testing, or via the Scalekit API in production. Use the Secret Key from step 2 as the token credential field — see Set your credentials above for the request shape.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'stripe'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Stripe:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'stripe_create_invoice_preview_dahlia',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Stripe credentials there. If your app already has a user's credentials, add the account from your backend instead, as the console steps above show. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • stripe_create_invoice_preview_dahliaPreviews the upcoming invoice for a customer or subscription without creating it, showing pending charges, renewal amounts, invoice item charges, and any applicable discounts or prorations.Read-only

    Create Invoice Preview

    Previews the upcoming invoice for a customer or subscription without creating it, showing pending charges, renewal amounts, invoice item charges, and any applicable discounts or prorations.

    Inputs

    currencystring
    The currency to preview this invoice in. Defaults to the customer's currency if not specified.
    customerstring
    The ID of the customer whose upcoming invoice you're previewing.
    expandarray
    List of fields to expand in the response.
    invoice_itemsarray
    List of ad-hoc invoice items to add to the preview (up to 250).
    preview_modestring
    Whether to preview only the next invoice, or a full recurring schedule. Defaults to 'next'.one of nextrecurring
    subscriptionstring
    The ID of the subscription to preview, e.g. to preview the effect of a plan change.
    subscription_detailsobject
    Overrides used to preview a subscription update, such as new items or a proration date.
  • stripe_get_account_dahliaRetrieve the details of the current Stripe account.Read-only

    Get Account

    Retrieve the details of the current Stripe account.

    Inputs

    This tool takes no inputs.

  • stripe_get_account_person_dahliaRetrieves an existing person associated with a connected account's legal entity.Read-only

    Get Account Person

    Retrieves an existing person associated with a connected account's legal entity.

    Inputs

    accountstringrequired
    The ID of the connected account.
    personstringrequired
    The ID of the person to retrieve.
    expandarray
    List of fields to expand in the response.
  • stripe_get_balance_dahliaRetrieve the current balance of the Stripe account, showing available and pending amounts by currency.Read-only

    Get Balance

    Retrieve the current balance of the Stripe account, showing available and pending amounts by currency.

    Inputs

    This tool takes no inputs.

  • stripe_get_balance_transaction_dahliaRetrieve a balance transaction by ID.Read-only

    Get Balance Transaction

    Retrieve a balance transaction by ID. Balance transactions represent funds moving through the Stripe account.

    Inputs

    idstringrequired
    The ID of the balance transaction to retrieve.
  • stripe_get_charge_dahliaRetrieves the details of a charge that has previously been created.Read-only

    Get Charge

    Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information.

    Inputs

    charge_idstringrequired
    The ID of the charge to retrieve.
    expandarray
    List of fields to expand in the response.
  • stripe_get_checkout_session_dahliaRetrieve a Checkout Session by ID.Read-only

    Get Checkout Session

    Retrieve a Checkout Session by ID.

    Inputs

    sessionstringrequired
    The ID of the Checkout Session to retrieve.
  • stripe_get_checkout_session_line_items_dahliaRetrieves the full, paginated list of line items for a Checkout Session.Read-only

    Get Checkout Session Line Items

    Retrieves the full, paginated list of line items for a Checkout Session.

    Inputs

    session_idstringrequired
    The ID of the Checkout Session.
    ending_beforestring
    Line item ID to end pagination before.
    expandarray
    List of fields to expand in the response.
    limitinteger
    Number of line items to return (1-100, default 10).
    starting_afterstring
    Line item ID to start pagination after.