Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Revenue
Platforms and marketplaces
Money management
Developer resources
APIs & SDKsHelp
Overview
About Stripe payments
Upgrade your integration
Payments analytics
Online payments
OverviewFind your use caseUse Managed Payments
Use Payment Links
Use a pre-built checkout page
Build a custom integration with Elements
Build an in-app integration
Payment Methods
Add payment methods
Manage payment methods
Faster checkout with Link
Payment interfaces
Payment Links
Checkout
Web Elements
In-app payments
Payment scenarios
Handle multiple currencies
Custom payment flows
Flexible acquiring
Orchestration
In-person payments
Terminal
    Overview
    Accept in-person payments
    Integration design
    Select your reader
    Design an integration
    Quickstart
    Example applications
    Testing
    Terminal setup
    Set up your integration
    Connect to a reader
    Accepting a payment
    Collect card payments
    Additional payment methods
    Accept offline payments
    Mail order and telephone order payments
    Regional considerations
    During checkout
    Collect tips
    Collect and save payment details for future use
    Flexible authorisations
    After checkout
    Refund transactions
    Provide receipts
    Customize checkout
    Cart display
    Collect on-screen inputs
    Collect swiped data
    Collect tapped data for NFC instruments
    Apps on devices
    Manage readers
    Order, return, replace readers
    Register readers
    Manage locations and zones
    Configure readers
    Monitor Readers
    References
    API references
    Mobile readers
    Smart readers
    Tap to Pay readers
    SDK migration guide
    Deployment checklist
    Stripe Terminal reader product sheets
Beyond payments
Incorporate your company
Crypto
Agentic commerce
Financial Connections
Climate
Understand fraud
Radar fraud protection
Manage disputes
Verify identities
United States
English (United Kingdom)
HomePaymentsTerminal

Set up your integration

Set up a Stripe Terminal SDK or server-driven integration to accept in-person payments.

SDK Reference

If you’re looking for a more detailed reference with all available methods, objects, and errors, consult our full SDK reference.

Getting started with the Android SDK requires four steps:

  1. Install the SDK in your app.
  2. Configure your app.
  3. Set up the connection token endpoint in your app and back end.
  4. Initialise the SDK in your app.

Install the SDK
Client-side

Caution

The SDK is no longer compatible with the support libraries, as we use Room to store and maintain state across the app lifecycle. Make sure your app has migrated to AndroidX.

To install the SDK, add stripeterminal to the dependencies block of your app’s build file:

Next, since the SDK relies on Java 8, your app’s build file needs to specify that as your target Java version:

Note

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.

For information on migrating from earlier beta versions of the Android SDK, see the Stripe Terminal Beta Migration Guide.

Configure your app
Client-side

You must enable the ACCESS_FINE_LOCATION permission. To connect a Bluetooth reader, you must also enable Bluetooth permissions. Add the appropriate permissions to your manifest as shown here:

Before initialising the Terminal object, add the following check to make sure that the ACCESS_FINE_LOCATION permission is enabled in your app:

Also verify that the app user grants location permission—the SDK doesn’t function without it. To do this, override the onRequestPermissionsResult method in your app and check the permission result.

Note

To reduce fraud risks associated with payments, and to minimize disputes, Stripe needs to know where payments occur. If the SDK can’t determine the location of the Android device, payments are disabled until location access is restored.

Set up the ConnectionToken endpoint
Server-side
Client-side

Server-side

To connect to a reader, your back end needs to give the SDK permission to use the reader with your Stripe account, by providing it with the secret from a ConnectionToken. Your back end needs to only create connection tokens for clients that it trusts.

Obtain the secret from the ConnectionToken on your server and pass it to the client side.

Caution

The secret from the ConnectionToken lets you connect to any Stripe Terminal reader and take payments with your Stripe account. Make sure you authenticate the endpoint for creating connection tokens and protect it from cross-site request forgery (CSRF).

Client-side

To give the SDK access to this endpoint, implement the ConnectionTokenProvider interface in your app, which defines a single function that requests a ConnectionToken from your back end.

This function is called whenever the SDK needs to authenticate with Stripe or the Reader. It’s also called when a new connection token is needed to connect to a reader (for example, when your app disconnects from a reader). If the SDK can’t retrieve a new connection token from your backend, connecting to a reader fails with the error from your server.

Caution

Do not cache or hardcode the connection token. The SDK manages the connection token’s lifecycle.

Certificate pinning

In most cases, you shouldn’t configure your application with certificate pinning. If your application does require it, see the certificate pinning docs.

Initialize the SDK
Client-side

The Android SDK is lifecycle aware. To prevent memory leaks and ensure proper cleanup of long-running Terminal SDK processes, your application must implement an Application subclass that uses TerminalApplicationDelegate.onCreate() to inform the SDK about lifecycle events.

Note

If you want to use Tap to Pay on Android (TTPA), the initialisation in Application is slightly different from this example. See Connect to a reader with TTPA.

The Terminal class made available by the Stripe Terminal SDK exposes a generic interface for discovering readers, connecting to a reader, and performing operations on the reader, such as displaying cart details, collecting payments, and saving cards for future use.

To get started, provide the current application context, the ConnectionTokenProvider implemented in Step 3, and a TerminalListener object. You can use this listener to handle events such as payment and connection status updates from the SDK.

Caution

If you’re upgrading from a version below 1.0.0-rc2, note that TerminalLifecycleObserver and Application classes are now mandatory.

SDK updates

Stripe periodically releases updates that can include new functionality, bug fixes, and security updates. Update your SDK as soon as a new version is available. The currently available SDKs are:

  • Stripe Terminal Android SDK
  • Stripe Terminal iOS SDK
  • Stripe Terminal JavaScript SDK
  • Stripe Terminal React Native SDK

Next steps

  • Connect to a reader
Was this page helpful?
YesNo
  • Need help? Contact Support.
  • Check out our changelog.
  • Questions? Contact Sales.
  • LLM? Read llms.txt.
  • Powered by Markdoc