Core Management API
startCore
Call at app startup. Launches the Core application in the background, ensuring it is ready when the first transaction is needed. Avoids delays on the first payment.
Api.startCore(context); // Optionally provide your app's name for diagnostic logs Api.startCore(context, "MyApp");
requestConfig
Request the current terminal configuration. Core broadcasts CONFIG_RESULT_ACTION with a Config JSON object.
Api.requestConfig(context);
Core also sends CONFIG_RESULT_ACTION automatically at startup. See Configuration Fields for the full field list.
updateParameter
Update one or more runtime settings. Core reloads its configuration after applying the changes.
HashMap<String, String> params = new HashMap<>(); params.put(Parameters.PRINT_RECEIPT_SETTING, "true"); params.put(Parameters.AUDIO_SETTING, "MUTE"); // AUDIO | SILENT_KEYBOARD | MUTE params.put(Parameters.THEME_SETTING, "DARK"); // DARK | LIGHT Api.updateParameter(context, params);
Supported settings keys: PRINT_RECEIPT_SETTING, USE_SIGNATURE_ON_SCREEN_SETTING, AUDIO_SETTING, THEME_SETTING, MERCHANT_RECEIPT_SETTING.
switchMerchant
Switch the active merchant. Only applicable when multi-merchant is configured. The merchantId value comes from MerchantConfig.getId(), obtained via requestConfig or getAvailableMerchants.
Api.switchMerchant(context, merchantId);
Note
If the supplied merchantId does not exist on the device, the switch is silently ignored.
getAvailableMerchants
Fetch the list of merchants configured on the device. Result is broadcast as ACTION_GET_AVAILABLE_MERCHANTS_RESULT.
Api.getAvailableMerchants(context);
// In your receiver:
case Messages.ACTION_GET_AVAILABLE_MERCHANTS_RESULT: {
String json = intent.getStringExtra(Messages.AVAILABLE_MERCHANTS_RESULT);
List<MerchantResult> merchants = WrapperUtils.getMerchantsFromJson(json);
break;
}
updateLanguage
Change the device system language. This affects the language used in Core's own UI and receipts.
Api.updateLanguage(context, "sv_SE");
updateMerchantPassword
Update the PIN/password for a specific merchant.
Api.updateMerchantPassword(context, merchantId, newPassword);
cycleKeys
Cycle the terminal encryption keys.
Api.cycleKeys(context); // With locale override HashMap<String, String> params = new HashMap<>(); params.put(Parameters.LOCALE, "en_GB"); Api.cycleKeys(context, params);
shutdownCore
Shut down the Core application.
Api.shutdownCore(context);