Development quickstart
Integrating Stripe into your app or website can begin as soon as you create a Stripe account, and requires three steps:
- Obtain your API keys so Stripe can authenticate your integration’s API requests
- Install a client library so your integration can interact with the Stripe API
- Make a test API request to confirm everything is up and running
Obtain your API keys
Stripe authenticates your API requests using your account’s API keys. If you don’t include your key when making an API request, or use one that is incorrect or outdated, Stripe returns an error.
Every account has two pairs of keys: one for testing and one for running live transactions. All API requests exist in either test or live mode, and objects—customers, prices, coupons, and so forth—in one mode can’t be manipulated by objects in the other.
Your API keys are always available in the Dashboard. For your convenience, your test API keys for your account are:
Key | Value |
---|---|
Publishable | pk_test_TYooMQauvdEDq54NiTphI7jx |
Secret | sk_test_4eC39HqLyjWDarjtT1zdp7dc |
Stripe automatically populates code examples in our documentation with your test API keys while you’re logged in—only you can see these values.
Use only your test API keys for testing and development. This ensures that you don’t accidentally modify your live customers or charges.
If you can’t see your secret API keys in the Dashboard, this means you don’t have access to them. Contact your Stripe account’s owner and ask to be added to their team as a developer.
Install a client library
We provide official libraries for different programming languages and mobile platforms.
iOS SDK
The iOS SDK is open source, fully documented, and compatible with apps supporting iOS 11 or above.
For details on the latest SDK release and past versions, see the Releases page on GitHub. To receive notifications when a new release is published, watch releases for the repository.
When your app starts, configure the SDK with your Stripe publishable key so that it can make requests to the Stripe API.
Android SDK
The Android SDK is open source and fully documented.
To install the SDK, add stripe-android
to the dependencies
block of your app/build.gradle
file:
apply plugin: 'com.android.application' android { ... } dependencies { // ... // Stripe Android SDK implementation 'com.stripe:stripe-android:18.2.0' }
For details on the latest SDK release and past versions, see the Releases page on GitHub. To receive notifications when a new release is published, watch releases for the repository.
Configure the SDK with your Stripe publishable key so that it can make requests to the Stripe API, such as in your Application
subclass:
There are also many third-party libraries created by the Stripe community so you can use a language we don’t officially support.
Make a test API request
To check that your integration is working correctly, make a test API request using your test secret key to create a PaymentIntent. We’ve pre-filled this code example with your test secret API key—only you can see this value.
Stripe returns a PaymentIntent object in response to your API request.
{ "id": "pi_1DRuHnHgsMRlo4MtwuIAUe6u", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, "amount_received": 0, "application": null, "application_fee_amount": null, "canceled_at": null, "cancellation_reason": null,
Next Steps
After you successfully make an API request, pick a guide to continue your integration.