Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

Time To First API Call - Stripe

Steps to reproduce:

  1. 00:00 - Sign in to Stripe

  2. 00:42 - Retrieve your API Key

  3. 01:01 - Prepare your Stripe API integration

    mkdir ttfac-stripe
    cd ttfac-stripe
    npm init --yes
    yarn add stripe
    touch index.js
    code .
  4. 02:08 - In your editor, copy/paste the code below to retrieve your Stripe's balance

    const Stripe = require("stripe");
    const stripe = Stripe(process.env.STRIPE_API_KEY);
    stripe.balance.retrieve(function (err, balance) {

    You can look at the Stripe API reference and copy/paste snippets. Here's the one in use above.

  5. 04:31 - Run the code with STRIPE_API_KEY="..." node index.js and press enter.

  6. 05:00 - TTFAC for Stripe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment