The Terminal C2C SDK is a convenience wrapper around the Terminal C2C API. For providers other than BRI and NTT, you can call the Terminal C2C API directly without the SDK. BRI and NTT terminals require either the Gateway App or the C2C SDK as a pre-install.
The Terminal C2C SDK for Android enables you to integrate secure payment processing directly into your Android applications. This SDK provides a client-to-client communication interface that allows your POS system to interact with the Terminal Gateway over the local network.
TerminalC2C is a singleton object that provides both synchronous (suspend) and asynchronous methods for payment operations. It handles HTTP communication with the Terminal Gateway, request serialization, response parsing, and comprehensive error handling.
Provider-specific dependencies are optional and enable convenient helper methods for creating TerminalDevice instances. Include only the dependencies for providers you plan to use.
Before starting, you’ll need an In-Person Payment CLIENT_KEY from the Xendit In-Person Payment team. You will also need the terminal IP address and Terminal ID (TID).
import co.xendit.terminal.core.TerminalApp// In your Application class or ActivityTerminalApp.initialize(context, CLIENT_KEY, TerminalMode.LIVE)// or TerminalMode.INTEGRATION for testing
Replace CLIENT_KEY with your actual client key from the Xendit dashboard.
For Share Commerce (SHC) and Cashup terminals, make sure the Gateway app is installed on the device. If it is missing, install it from the Gateway download page or contact inpersonpayments@xendit.co for assistance.
BRI Indonesia
NTT Thailand
Cashup Indonesia (Coming Soon)
SHC Malaysia
Multiple Providers
Copy
// Add BRI provider for Indonesian terminalsTerminalC2C.addProvider(TerminalBRI)
This setup allows your app to work with different terminal types based on your merchant’s configuration.
Provider dependencies are optional. You can use the generic TerminalDevice.create() method without adding provider-specific dependencies. Provider frameworks enable access to specialized helper methods like TerminalDevice.bri(), TerminalDevice.ntt(), and TerminalDevice.cashup().
When using co.xendit.terminal:id-bri-android dependency:
Payment Method
Description
Code Example
Insert Card
Chip card transactions
BRIPaymentMethod.insertCard
Contactless
Tap-to-pay transactions
BRIPaymentMethod.contactless
QRIS
QR code payments
BRIPaymentMethod.qris
Brizzi
E-money card payments
BRIPaymentMethod.brizzi
BRI terminals support both physical card payments and digital payment methods popular in Indonesia.
When using co.xendit.terminal:id-cashup-android dependency:
Payment Method
Description
Code Example
Card
Standard card transactions
CashupPaymentMethod.card
QRIS
QR code payments
CashupPaymentMethod.qris
Cashup terminals focus on essential payment methods with card and QRIS support.
When using co.xendit.terminal:th-ntt-android dependency for Thailand market:
Payment Method
Description
Code Example
Card
Credit/debit card transactions
NTTPaymentMethod.card
MultiIPP
Installment payments
NTTPaymentMethod.multiIpp
Alipay+
Alipay transactions
NTTPaymentMethod.alipayPlus
WeChat Pay
WeChat payments
NTTPaymentMethod.wechatPayCil
TrueMoney
TrueMoney wallet
NTTPaymentMethod.trueMoney
LINE Pay
LINE Pay wallet
NTTPaymentMethod.linePay
ShopeePay
Shopee wallet
NTTPaymentMethod.shopee
ThaiQR
Thai QR standard
NTTPaymentMethod.thaiQrCode
BBL QRCS
Visa/Master QR
NTTPaymentMethod.bblQrcs
Atome
Atome BNPL
NTTPaymentMethod.atome
Sabuy Money
Sabuy wallet
NTTPaymentMethod.sabuyMoney
Max Me
Max Me wallet
NTTPaymentMethod.maxMe
NTT terminals provide comprehensive payment method support for the Thai market, including local e-wallets and QR payment standards.
Provider-specific payment enums require the corresponding provider dependency. They expose the exact string values expected by each terminal while keeping your code type-safe.
Replace the enum with the provider you integrate: CashupPaymentMethod, NTTPaymentMethod, or SHCPaymentMethod mirror the samples above.
For non-coroutine environments, call TerminalC2C.createPaymentAsync which returns an ActionJob you can cancel if the UI is dismissed. The callback signature is (TerminalResult?, Throwable?).
Use simulation mode to validate your integration without connecting to a physical terminal.
Copy
import co.xendit.terminal.c2c.TerminalC2C// Optional: toggle simulation globally for all subsequent requestsTerminalC2C.isSimulation = true// Or pass the flag per payment requestval result = TerminalC2C.createPayment( payment = payment, isSimulation = true)
Disable simulation (TerminalC2C.isSimulation = false and isSimulation = false) before running against real hardware. Use the special simulation amounts (400508 decline, 400509 unavailable, 400711 cancel) documented in the quickstart to trigger test scenarios.
Problem: SDK cannot reach the Terminal Gateway service.Solution:
Verify Terminal Gateway service is running locally
Check the terminal device IP address is correct
Verify network connectivity between your app and gateway
Copy
// Verify terminal device configuration// Using generic methodval device = TerminalDevice.create( id = "TERMINAL_ID", ipAddress = "192.168.1.100", // Verify this IP provider = "BRI" // or "CASHUP", "NTT")// Or using provider-specific helper (requires provider dependency)// val device = TerminalDevice.bri("TERMINAL_ID", "192.168.1.100")// val device = TerminalDevice.cashup("TERMINAL_ID", "192.168.1.100")// val device = TerminalDevice.ntt("TERMINAL_ID", "192.168.1.100")TerminalC2C.setTerminalDevice(device)
No Terminal Device Provided
Problem: Error indicating no terminal device is configured.Solution: Set a default terminal device before making requests:
Copy
// Set default deviceTerminalC2C.setTerminalDevice(terminalDevice)// Then make requestsval result = TerminalC2C.createPayment(payment)
Authentication Failed
Problem: Requests fail with authentication errors.Solutions:
Verify TerminalApp is initialized with correct client key
Check terminal ID matches the configured device
Ensure client key has Terminal C2C permissions
Copy
// Re-initialize with correct client keyTerminalApp.initialize(context, CLIENT_KEY, TerminalMode.LIVE)
Network Errors
Problem: Network-level errors when communicating with gateway.Solutions:
Check network connectivity
Verify firewall settings allow connections to gateway port
Ensure Terminal Gateway service is accessible
Check terminal device IP address is reachable
Use network debugging tools to verify connectivity between your app and the Terminal Gateway service.
Open the BRI FMS app on the terminal device and locate the Terminal ID in the device information section.
2
Find IP Address
Open the ECRLink app on the terminal and check the network settings for the IP address.
1
Find Terminal ID (TID)
Look for the Terminal ID on the physical sticker attached to the device.
2
Find IP Address
Open the NTT LinkPOS app on the terminal and navigate to network settings to find the IP address.
1
Find Terminal ID (TID)
Open the Cashlez app and navigate to the User Account tab to locate the Terminal ID.
2
Find IP Address
Open the Terminal Gateway app and check the device list for the terminal IP address.
1
Find Terminal ID (TID)
Open the Xendit app on the device and review the terminal details screen to locate the Terminal ID.
2
Find IP Address
Open the Terminal Gateway app and check the device list for the terminal IP address.
1
Find Terminal ID (TID)
Open the payment app on the Atom terminal, then go to Settings → Device Info to view the Terminal ID.
2
Find IP Address
Open the Terminal Gateway app and check the device list for the terminal IP address.
Screenshots and UI layouts may vary by firmware or app version. Refer to the latest vendor documentation if the interface differs from these instructions.