Stripe is a top provider of payment infrastructure and long known for having a fantastic developer experience and really high quality documentation.
Stripe exposes a number of APIs that cover various use cases of their platform. In this guide, we’ll walk you through how to use Bruno to explore and test Stripe’s Payment, Billing, and Identity APIs.
We've curated a public repo on Github that contain Stripe API collections for Bruno which allow you to create request templates for all API resources, list available parameters, and configure variables for authenticating API requests with your account.
Let's get started! 👨💻👩💻
To begin, you’ll need to download and install Bruno, which is available for Windows, macOS, and Linux.
Once installed, you’ll fetch 🐕 your API collection for Stripe.
Step 1: Clone the repo from Github into Bruno
If unfamiliar with Git, follow these instructions on cloning a repository.
Step 2: Set Up the Environment
secret_key
and set the value to your test Stripe secret key. Mark this as 'secret'.
You can get a test secret key by registering for a Stripe account. Once registered, navigate to the Stripe Dashboard, switch to Test Mode, click Developers in the bottom-left corner, select API keys, and then click Reveal test key
Step 3: Configure Authentication
.Step 4: Configure Environment
baseURL
and set the value to https://api.stripe.com
At this point, you’re ready to explore Stripe’s APIs using Bruno.
The Stripe API is organized into several key resources, including Customers, Payments, and Checkout Sessions. Each resource in the collection includes all possible request methods (GET, POST, DELETE, etc.) and parameters.
Here’s an example of creating a customer using Bruno.
To create a customer, follow these steps:
If everything is set up correctly, you’ll receive a response from Stripe with the newly created customer’s information. Bruno’s response viewer makes it easy to review and understand the data.
The Checkout API lets you create prebuilt hosted forms for checkout that can accept a variety of payments.
Here’s how to generate a checkout form for a 😳 $4,000 dog bone 🍖 for Bruno (what a treat!):
line_items[0][price_data][product_data][name] | dog bone |
line_items[0][price_data][product_data][description] | outrageously expensive bone |
line_items[0][price_data][unit_amount] | 400000 |
line_items[0][quantity] | 1 |
payment_method_types[0] | card |
mode | payment |
success_url |
https://example.com/success |
cancel_url | https://example.com/cancel |
4. Change Auth to Inherit
5. Click Send in Bruno. If successful, you’ll receive a response that includes a checkout URL which you can use to preview the checkout form.
You can make a test payment using the 4242 4242 4242 4242 card number, any future expiration date, and any 3-digit CVC.
Once you’re familiar with how to make API requests to the Stripe API with Bruno, try combining multiple Stripe APIs to test more advanced scenarios. Here are a few ideas:
Here’s a few reasons why devs are choosing Bruno as an API client:
Feature | Bruno | Others |
---|---|---|
Pricing | Open Source & Affordable Paid Plans | Free & Expensive Paid Plans |
Data Storage | All data stored locally | Required Cloud sync |
Collaboration | Local projects, Native Git sync | Cloud-based sharing |
UI/UX | Clean, modern interface | Complex, Bloated |
Bruno Advantages
Using Bruno to test and explore Stripe’s APIs is simple, powerful, and available through git. From setting up authentication to building complex API requests, Bruno offers a lightweight, open-source way to manage your API workflows.
With Bruno, you can:
We look forward to seeing what you create using Stripe and Bruno. If you'd like Stripe to maintain their own Bruno collections on Github, let them know @StripeDev !