Terminal H2H SDK for Android (Kotlin)
The Xendit’s Payment Terminal H2H Android SDK enables you to integrate secure payment processing into your Android applications. Connect to physical payment terminals and process transactions seamlessly using our Kotlin-based SDK.Version information
v1.2.2 — 24-Aug-2026
v1.2.2 — 24-Aug-2026
- BRI payment method mapping: Fixed case sensitivity in BRI mapping logic. BRI payment methods (such as QRIS) now map correctly regardless of string casing.
v1.2.1 — 13-May-2026
v1.2.1 — 13-May-2026
- Activity Lifecycle Management: Introduced
TerminalActivityLifecycleObserverinterface for reusable activity lifecycle tracking, intent queuing, and dispatch logic - Enhanced Provider App Launching: Refactored Atom and SHC provider app launchers with improved background app launch handling
- Launch Failure Notifications: Added notification mechanism to prompt users when provider app launch fails while app is in background
- Callback Interface: New
TerminalAppLauncherCallbackinterface for custom handling of provider app launch failures - Improved Maintainability: Centralized lifecycle and launcher logic for better extensibility across different application contexts
v1.2.0 — 8-May-2026
v1.2.0 — 8-May-2026
- Core Stability: Fixed activity tracking bug in TerminalApplication where paused activities were not properly removed from internal tracking list
v1.1.3 — 26-Apr-2026
v1.1.3 — 26-Apr-2026
- Fixed casting issue on C2C request payload to improve compatibility and prevent runtime errors.
View all versions
View all versions
v1.1.1 — 23-Apr-2026
v1.1.1 — 23-Apr-2026
- Added Cashup provider support for Indonesian terminals
v1.0.0 — 19-Feb-2026
v1.0.0 — 19-Feb-2026
- Renamed class name
TerminalGatewaytoTerminalH2Hfor better consistency
v0.7.0 — 5-Dec-2025
v0.7.0 — 5-Dec-2025
- Fixed NTT payment method value maping to ensure correct provider selection
- Updated BRI payment flow to validate transaction data before executing terminal actions
- Added timeout configuration for card and QR transactions to auto-cancel and retry stalled requests
- Added support to handle retry requests via
/v1/terminal/sessions/{id}/retryendpoint
v0.6.0 — 20-Nov-2025
v0.6.0 — 20-Nov-2025
- Added support for multiple concurrent device connections, enabling simultaneous transactions across different terminals
- [BRI] Fixed status value handling in void and cancel API responses for improved transaction status accuracy
v0.5.0 — 30-Oct-2025
v0.5.0 — 30-Oct-2025
- Introduced command ID handling for settlement operations
- Enhanced retry logic with configurable attempt counts
- Improved error handling and logging throughout the gateway service
v0.4.1 — 7-Oct-2025
v0.4.1 — 7-Oct-2025
- Fix data mapping for terminal responses
- [BRI] Enhanced status verification after transaction timeout for improved reliability
v0.4.0 — 13-May-2025
v0.4.0 — 13-May-2025
Installation
Follow these steps to add the Terminal H2H Android SDK to your project.Configure Gradle settings
mavenCentral() to your Gradle configuration so Gradle can resolve the SDK artifacts.- Modern Approach (Recommended)
- Old Android Project
mavenCentral() is available in the repository list used by your app module.Add dependencies
build.gradle.kts or build.gradle file:TerminalDevice instances. Include only the dependencies for providers you plan to use.Getting Started
Before you begin, ensure you have the following:- Client key: Request an In-Person Payment
CLIENT_KEYfrom the Xendit team - Terminal device information: Obtain the Terminal ID and IP address for each device
- Android project: Set up with minimum SDK version 21 (Android 5.0)
Step 1: Initialize the SDK
Initialize the Terminal H2H SDK in your Application class:TerminalMode.INTEGRATION for development and testing. Switch to TerminalMode.LIVE for production with a live client key.Step 2: Add Terminal Providers
Add the specific terminal providers you need for your integration:- BRI Provider (Indonesia)
- NTT Provider (Thailand)
- Cashup (Indonesia)
- Multiple Providers
Step 3: Register Terminal Devices
CreateTerminalDevice entries for each terminal and register them with the gateway:
active = true for terminals that should be available immediately. You can keep an entry with active = false to stage devices without establishing a connection.Step 4: Calling Terminal API
With Terminal H2H SDK configured, you can now process payments using the Terminal API. The SDK handles communication with physical terminals through the local gateway service.Configuring App for Terminal Device
- Cashup Indonesia
- SHC Malaysia
Configure AndroidManifest.xml
AndroidManifest.xml file:Configure Application Class
- Extend TerminalApplication
- Use TerminalAppLauncherCallback
Application class extend TerminalApplication and configure the Cashup provider launcher:Application class in the AndroidManifest.xml:Configure Receipt Printing
Configuration and Management
Set Operation Timeout
Configure the timeout for terminal operations:Restart Terminal Connection
Manage and restart terminal service connections:- Restart All Connections
- Restart Single Connection
Monitor Connection State
Observe terminal connection states in real-time:- Using Coroutine Scope
- Using Flow
observeConnection method with a coroutine scope:Connection States
Monitor Error States
Observe and handle errors across all terminal devices:Error Handling
Error Data Structure
All errors returned by the Terminal H2H SDK follow this structure:Error Codes Reference
Error Handling Best Practices
Implement comprehensive error handling for robust payment processing:Troubleshooting
Common Issues and Solutions
Unresponsive EDC Machine
Unresponsive EDC Machine
- Restart the EDC machine by holding the power button and selecting “Restart”
- Wait for the device to fully boot up and reconnect
- Verify the terminal is back online using the connection monitoring features
Kiosk Mode Configuration
Kiosk Mode Configuration
- Ensure all transactions are initiated only through the SDK
- Contact the Xendit EDC team to enable POS-only mode for your Terminal IDs
- Configure terminal settings to disable manual transaction entry
No Response After Payment Completion
No Response After Payment Completion
- Query the Payment Session using the Terminal API to retrieve the latest status
- Check network connectivity between the EDC and your application
- Verify the callback URL configuration in your payment session
- Implement retry logic for failed status updates
Transaction Stuck or Missing Callback After Receipt Printed
Transaction Stuck or Missing Callback After Receipt Printed
/v1/terminal/sessions/{id}/retry instructs the app to verify the current transaction status with the terminal and automatically redo the transaction if it’s found to be incomplete.Connection Issues
Connection Issues
- Check network connectivity: Ensure both devices are on the same network
- Verify IP addresses: Confirm terminal IP addresses are correct and accessible
- Firewall settings: Check if firewall is blocking the connection ports
- Terminal status: Ensure the terminal is powered on and in ready state
- SDK initialization: Verify client key and terminal configuration
Finding Terminal Information
- BRI Terminals
- NTT Terminals
- Cashup Terminals
- Atom Terminals
Find Terminal ID (TID)

Find IP Address






