Skip to content

Instantly share code, notes, and snippets.

@Frenchcooc
Last active July 21, 2020 14:31
Show Gist options
  • Save Frenchcooc/32dfc8a2dbbd5a3acb54e8e705d958a7 to your computer and use it in GitHub Desktop.
Save Frenchcooc/32dfc8a2dbbd5a3acb54e8e705d958a7 to your computer and use it in GitHub Desktop.

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) {
     console.log(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