Sign in
An image of the Stripe logo
Create account
Sign in
Home
Payments
Business operations
Financial services
Developer tools
All products
Home
Payments
Business operations
Home
Payments
Business operations
Financial services
Developer tools
Support
Overview
Get started
Quickstarts
Stripe Shell
Stripe CLI
Dashboard
Stripe for Visual Studio Code
Webhooks
File uploads
Error handling
Security at Stripe
API
Tour
Keys
Libraries
Upgrades
Changelog
Rate limits
Expanding responses
Domains and IP addresses
Search
Building With Stripe
React Stripe.js
Prebuilt iOS UI
Prebuilt Android UI
Extensions
Connectors
Samples
Checklist
Feedback
HomeDeveloper tools

API libraries

Stripe has official libraries for different programming languages and mobile platforms. There are also many more third-party libraries and plugins created by the Stripe community.

Client-side and UI libraries

Use Stripe on the web with Elements, a set of prebuilt UI components for collecting and validating card details. Elements uses Stripe.js, our foundational JavaScript library for building payment flows.

You need to include Stripe.js on your checkout page by either adding the script tag to the head of your HTML file, or importing it from the stripe-js module:

<script src="https://js.stripe.com/v3/"></script>

Next, create an instance of the Stripe object by providing your publishable API key as the first parameter:

var stripe = Stripe(
'pk_test_TYooMQauvdEDq54NiTphI7jx'
);

Finally, create an instance of the Elements UI library:

var elements = stripe.elements();

Now you can use Elements to create payment forms with prebuilt input fields to collect payment method details. See accept a payment for detailed instructions.

Server-side libraries

Terminal
# For detailed setup, see our quickstarts at https://stripe.com/docs/development/quickstart bundle add stripe bundle install

For more details, check out the API reference or see the source code on GitHub.

Versioning

When backwards-incompatible changes are made to the API, a new, dated version is released. Learn more about all API changes in the API changelog.

All requests use your account API settings, unless you override the API version. The upgrades guide lists every available version. Note that by default webhook events are structured according to your account API version, unless you set an API version during endpoint creation.

To override the API version, assign the version to the Stripe.api_version property:

require 'stripe' Stripe.api_key =
sk_test_4eC39HqLyjWDarjtT1zdp7dc
Stripe.api_version = '2022-08-01'

Or set it per-request:

require 'stripe' intent = Stripe::PaymentIntent.retrieve( 'pi_1DlIVK2eZvKYlo2CW4yj5l2C', { stripe_version: '2022-08-01', } ) intent.capture

When overriding it per-request, methods on the returned object reuse the same Stripe version.

You can visit your Dashboard to upgrade your account API version.

Upgrading your server-side library

Minor updates to our libraries are backwards compatible and are generally safe to upgrade to. Major updates often include breaking changes, which may require changes to your code when upgrading. A major version upgrade is sometimes required to use new features.

Major version upgrades may contain breaking changes. When upgrading, carefully review the library changelog, read the relevant migration guide, and test your integration.

Before upgrading your API version in the Dashboard, review both the API changelog and the library changelog.

Update the version in your Gemfile. You can find the latest library version at the top of the changelog file.

Gemfile
# If you use bundler, you can add this line to your Gemfile gem 'stripe', 'X.XX.X'
Terminal
bundle install

Community libraries

Find some of the many community-supported libraries available for Stripe listed below.

Language/FrameworkProjectAuthor
Angularngx-stripeRicardo Sánchez
Capacitor@capacitor-community/stripeMasahiko Sakakibara
Clojurestripe-clojurePrachetas Prabhu
C#ServiceStack.StripeTeamServiceStack
DartStripe DartMartin Flucka and Matias Meno
Djangodj-stripeJerome Leclanche

Elixir

Stripe for Elixir

Stripy

Code Corps

Heresy

Emberember-stripe-elementsAdopted Ember Addons
FlutterFlutter_StripeJonas Bark, Jamie Blasco, and Remon Helmond
HaskellHaskellDavid Johnson

Perl

Business-Stripe

Stripe Perl

Paul Pham

Luke Closs

PHP

Laravel Cashier

Stripe

Laravel

Cartalyst

React Nativestripe-react-nativeStripe

Ruby on Rails

Pay

ActiveMerchant

Spree

Chris Oliver

Ross Boucher and Greg Brockman

Greg Brockman

Rustasync-stripeAlex Lyon
Smalltalkstripe-smalltalkPaul DeBruicker
Sveltesvelte-stripe-jsJoshua Nussbaum
VueVue StripeJoff Tiquez
XamarinXamarinStripeDamian Mehers
Was this page helpful?
Questions? Contact us.
View developer tutorials on YouTube.
Check out our product changelog.
Powered by Markdoc
You can unsubscribe at any time. Read our privacy policy.
On this page
Client-side and UI libraries
Server-side libraries
Community libraries
Stripe Shell
Test mode
▗▄ ▄▟█ █▀▀ ▗▟████▙▖ ██████ ███▗▟█ ███ ███▗▟██▙▖ ▗▟█████▙▖ ███▖ ▀▀ ███ ███▀▀▀ ███ ███▀ ███ ███ ███ ▝▜████▙▖ ███ ███ ███ ███ ███ █████████ ▄▄ ▝███ ███ ▄ ███ ███ ███▄ ███ ███ ▄▄ ▝▜████▛▘ ▝▜███▛ ███ ███ ███▝▜██▛▘ ▝▜█████▛▘ ███ ▀▘
Welcome to the Stripe Shell! Stripe Shell is a browser-based shell with the Stripe CLI pre-installed. Login to Stripe docs and press Control + Backtick on your keyboard to start managing your Stripe resources in test mode. - View supported commands: - Find webhook events: - Listen for webhook events: - Call Stripe APIs: stripe [api resource] [operation] (e.g. )
The Stripe Shell is best experienced on desktop.
$