# SDK Methods Reference

This reference documents the public managers, methods, and data objects available in the Get Mini Android SDK.

---

## 1. Authentication & Merchant Configuration
Access features via `RedCLSMerchantConfigurationManager`. Most operations follow a pattern: instantiate a **Data object** for input and receive a **Response object** containing the results and a `Code` indicator (0 for success).

### Standard & Transparent Login
Methods to authenticate the user or register the device for passwordless access.

| Method | Parameters / Input | Return Type | Description |
| :---- | :---- | :---- | :---- |
| `login()` | `RedCLSLoginData` | `RedCLSLoginSsmResponse` | Full credential validation. |
| `autoLogin()` | `Context`, `RedCLSLoginTransAutoLoginData`| `RedCLSLoginTransLoginResponse` | Registers device for passwordless entry. |
| `loginWithoutUser()`| `Context` | `RedCLSLoginTransLoginResponse` | Login using registered device token. |
| `addTerminal()` | `Context`, `RedCLSLoginTransPetNuevoTerminal`| `ResponseData` | Links a new terminal to the device. |
| `disableLoginTrans()`| `Context` | `void` | Revokes the device registration. |

### Account & Profiles
Methods for profile queries and security maintenance.

| Method | Parameters / Input | Return Type | Description |
| :---- | :---- | :---- | :---- |
| `changePass()` | `RedCLSChangePassData` | `RedCLSChangePassSsmResponse` | Updates the merchant password. |
| `peticionPerfilEntidad()`| `RedCLSTerminalData` | `RedCLSPerfilResponse` | Queries enabled profile features. |
| `recordarPassword()` | `Context`, `user: String` | `Boolean` | Triggers a recovery email. |

---

## 2. Shared Data Models
These core objects are reused across multiple managers to identify the merchant or represent a completed transaction.

### RedCLSTerminalData (Identification Token)
The fundamental identification token required by every payment and query manager in the SDK.

| Field | Type | Mandatory | Description |
| :---- | :---- | :---- | :---- |
| `MerchantName` | `String` | Yes | The complete business name. |
| `Fuc` | `String` | Yes | Unique Merchant Category Code (MCC/FUC). |
| `Terminal` | `String` | Yes | Unique terminal identification number. |
| `NSerie` | `String` | Yes | Hardware serial number of the PIN pad. |
| `Type` | `String` | Yes | Classification ("1" for Virtual, "2" for PC). |
| `Csb` | `String` | Yes | Bank entity code. |
| `Currency` | `Integer` | Yes | Numeric ISO currency code (e.g., 978). |
| `CurrencyCode` | `String` | Yes | Alphanumeric ISO currency code ("EUR"). |

### RedCLSTransactionData (Transaction Record)
The primary model representing a completed transaction, containing host details and receipt literals. Used for signatures, refunds, and query results.

| Field | Type | Description |
| :---- | :---- | :---- |
| `type` | `String` | Operation type (e.g., "PAGO", "PREAUTORIZACIÓN"). |
| `card` | `String` | Masked card number (or `panToken`) for merchant receipt. |
| `cardClient` | `String` | Masked card number for the customer copy of the receipt. |
| `Literals` | `List` | Raw text lines for the customer copy of the receipt. |
| `LiteralsComercio`| `List` | Raw text lines for the merchant copy of the receipt. |
| `identifierRTS` | `String` | Unique transaction ID required for refunds and queries. |
| `autorizationNumber` | `String` | Host-generated authorization approval code. |
| `responseCode` | `String` | Standard response code ("00" for approval). |
| `TokenRecurrente` | `String` | Recurring payment token (if requested). |

---

## 3. Hardware Connectivity & Ready Status
Manage the link between the Android device and the PIN pad via `RedCLSPinPadManager`.

| Method | Parameters | Return Type | Description |
| :---- | :---- | :---- | :---- |
| `connectWithPinPad()` | None | `void` | Initiates Bluetooth/USB link. |
| `inicializarPinpad()` | None | `RedCLSInitPinpadResponse` | Syncs terminal and checks readiness. |
| `isPinPadConnected()` | None | `Boolean` | Checks current connection status. |
| `cerrarConexiones()` | None | `RedCLSCloseConnectionsResponse`| Performs forced cleanup/disconnection. |
| `getNumberOfPendingOfflineOperations()`| `Context` | `int` | Returns count of stored offline payments. |

---

## 4. Payment Operations (Card-Present)
Core financial operations handled by `RedCLSPinPadManager`. These methods interact with the hardware to read cards and process host requests.

| Method | Parameters | Return Type | Description |
| :---- | :---- | :---- | :---- |
| `operativaConTarjeta()` | `RedCLSOperativeWithCardData`| `RedCLSOperativeWithCardResponse`| Sales, Pre-auth, and Installments. |
| `pagoConReferencia()` | `ref: String`, `amount: double`, `tid: String?` | `RedCLSOperativeWithCardResponse`| Tokenized recurring payments. |
| `devolucionSinOriginal()`| `amount: Double`, `invoice: String` | `RedCLSRefundResponse` | Card-present refund (Manual/Banda). |
| `lecturaTarjetaPrivada()`| None | `RedCLSReadPrivateCardResponse` | Reads proprietary/private fuel cards. |

### Payment Response Hierarchy
The `operativaConTarjeta` method returns a nested structure to handle both technical errors and transaction results.

#### RedCLSOperativeWithCardResponse (Main Container)
| Field | Type | Description |
| :---- | :---- | :---- |
| `status` | `int` | Success indicator (0 for OK, others for error). |
| `Response` | `String` | Server response or error details. |
| `msgKO` | `String` | User-facing error message. |
| `stackTraceKO` | `String` | Technical stack trace for troubleshooting. |
| `transactionData`| `RedCLSTransactionData`| [Transaction details](#redclstransactiondata-transaction-record) if status is OK. |

---

## 5. Detailed Data Models
Detailed field definitions for the input and output objects described above.

### Authentication Objects

#### RedCLSLoginData (Input)
| Field | Type | Mandatory | Description |
| :---- | :---- | :---- | :---- |
| `user` | `String` | Yes | Unique merchant username. |
| `pass` | `String` | Yes | Password for the account. |

#### RedCLSLoginSsmResponse (Output)
| Field | Type | Description |
| :---- | :---- | :---- |
| `merchantList` | `List` | Authorized merchants and their terminals (`RedCLSMerchantData`). |
| `daysExpire` | `Integer`| Days until password expiration. |
| `Code` | `Integer`| Result code (0: Success). |
| `Desc` | `String` | Result description. |

#### RedCLSLoginTransAutoLoginData (Input)
| Field | Type | Mandatory | Description |
| :---- | :---- | :---- | :---- |
| `merchantTerminals`| `List` | Yes | Terminals to authorize for "Login Transparente". |
| `loginData` | `RedCLSLoginData` | Yes | Credentials from the initial login. |
| `loginResponse` | `RedCLSLoginSsmResponse` | Yes | Response from the initial login. |

#### RedCLSChangePassData (Input)
| Field | Type | Mandatory | Description |
| :---- | :---- | :---- | :---- |
| `Oldpass` | `String` | Yes | Current password. |
| `Newpass` | `String` | Yes | New password (must meet security rules). |

#### RedCLSPerfilResponse (Output)
| Field | Type | Description |
| :---- | :---- | :---- |
| `esAlipay` | `Boolean` | Alipay support enabled. |
| `permitePreauto` | `Boolean` | Pre-authorizations enabled. |
| `permiteDevolSinOrigin`| `Boolean` | Refunds without original ID enabled. |
| `permiteDCC` | `Boolean` | Dynamic Currency Conversion enabled. |

---

## 6. Advanced Payment Flows
Specialized managers for specific payment types or post-authorization actions.

### Post-Authorization & Refunds
Managed by `RedCLSRefundManager` and `RedCLSPreautorizationManager`.

| Manager | Method | Return Type | Description |
| :---- | :---- | :---- | :---- |
| **Refund** | `peticionDevolucion()` | `RedCLSRefundResponse` | Standard network-only refund. |
| **Pre-auth** | `peticionConfirmacion()` | `RedCLSPreautorizationResponse`| Captures (closes) a pre-auth. |
| **Pre-auth** | `peticionAnulacionPreautorizacion()`| `String` | Cancels an open pre-auth. |
| **Pre-auth** | `peticionReemplazoPreautorizacion()`| `String` | Updates pre-auth amount. |

#### RedCLSRefundData (Input)
Mandatory constructor: `RedCLSRefundData(terminalData, comercioOriginal, pedidoOriginal, importeDevolucion, fechaOriginal, numAutorizacion)`.

| Field | Type | Mandatory | Description |
| :---- | :---- | :---- | :---- |
| `terminalData` | `RedCLSTerminalData` | Yes | Authorized terminal token. |
| `comercioOriginal` | `String` | Yes | FUC of the original sale. |
| `pedidoOriginal` | `String` | Yes | Original order number. |
| `importeDevolucion`| `String` | Yes | Amount as string (e.g., "1.00"). |
| `fechaOriginal` | `String` | Yes | Date in `yyyyMMdd` format. |
| `numAutorizacion` | `String` | Yes | Original approval code. |

### Specialized Payment Methods
Managers for alternative payment schemes and digital documentation.

| Manager | Method | Return Type | Description |
| :---- | :---- | :---- | :---- |
| **Alipay** | `peticionAlipay()` | `RedCLSOperativeWithCardResponse`| Processes QR-based Alipay. |
| **Signature** | `envioFirmaDigitalizada()` | `RedCLSSignatureSendResponse` | Uploads captured signature image. |

#### RedCLSSignatureData (Input)
| Field | Type | Mandatory | Description |
| :---- | :---- | :---- | :---- |
| `terminalData` | `RedCLSTerminalData` | Yes | Authorized terminal token. |
| `transactionData`| `RedCLSTransactionData` | Yes | The transaction to sign. |
| `Signature` | `ByteArray`| Yes | Image payload (max 4999 bytes). |
| `Format` | `Int` | Yes | Image format (use `RedCLSConstantes.FORMAT_SIGNATURE_*`). |

---

## 7. Transaction History & Queries
Access historical data and session totals via `RedCLSQueryManager`.

| Method | Parameters | Return Type | Description |
| :---- | :---- | :---- | :---- |
| `peticionConsultaFecha()` | `Context`, `RedCLSQueryData` | `RedCLSDateQueryResponse` | List operations by date range. |
| `peticionConsultaRts()` | `Context`, `RedCLSQueryData` | `RedCLSRtsQueryResponse` | Specific transaction detail. |
| `peticionConsultaRangoImportes()`| `Context`, `RedCLSQueryRangeAmountData`| `RedCLSQueryRangeAmountResponse`| Filter by amount. |
| `queryTicket()` | `Context`, `RedCLSQueryTicketCloudData`| `RedCLSQueryTicketCloudResponse`| Detailed receipt literals. |
| `cierreSesion()` | `RedCLSTerminalData` | `RedCLSCloseSessionResponse` | Daily totals and closure count. |

#### RedCLSQueryData (Input Filters)
| Field | Type | Default Mandatory | Description |
| :---- | :---- | :---- | :---- |
| `terminalData`| `RedCLSTerminalData` | Yes | Authorized terminal token. |
| `startDate` | `String` | Yes | `yyyy-MM-dd HH:mm:ss` |
| `endDate` | `String` | Yes | `yyyy-MM-dd HH:mm:ss` |
| `idRts` | `String` | No | Match specific RTS identifier. |
| `operationType` | `String` | No | Filter by type (PAGO, DEVOLUCION). |

---

## 8. Virtual Terminal (Paygold & Bizum)
Remote payment links and mobile-wallet operations via `RedCLSVirtualManager`.

| Method | Parameters | Return Type | Description |
| :---- | :---- | :---- | :---- |
| `peticionPaygold()` | `RedCLSVirtualPaymentData` | `RedCLSVirtualPaymentResponse`| Sends payment link (SMS/Email). |
| `peticionDevolucionVirtual()` | `RedCLSVirtualRefundData` | `RedCLSVirtualPaymentResponse`| Refund for virtual payments. |
| `peticionConsultaFechaTPV_Virtual()`| `Context`, `RedCLSVirtualQueryData`| `RedCLSDateVirtualQueryResponse` | Virtual history by date. |
| `queryRTP()` | `RedCLSVirtualPaymentData` | `RedCLSBizumRtpResponse` | Checks Bizum availability. |
| `rtpRestPayment()` | `RedCLSVirtualPaymentData` | `RedCLSVirtualPaymentResponse`| Requests Bizum payment. |

#### RedCLSVirtualPaymentData (Input)
| Field | Type | Mandatory | Description |
| :---- | :---- | :---- | :---- |
| `Amount` | `Double` | Yes | Payment amount. |
| `Order` | `String` | Yes | Alphanumeric order reference. |
| `description` | `String` | Yes | Identifying text. |
| `phone` | `String` | No | Mobile for Bizum/SMS. |
| `eMail` | `String` | No | Email for Paygold. |

---

## 9. Utilities
General SDK maintenance and debugging.

| Manager/Class | Method | Return Type | Description |
| :---- | :---- | :---- | :---- |
| **Logger** | `activateFileLogs()` | `boolean` | Enables local debug file traces. |

---

## Related Resources
* [Initialize the SDK](/en/get-mini/android-sdk/guides/initialize-sdk-lifecycle)
* [Create a Single-Step Payment](/en/get-mini/android-sdk/guides/process-single-step-payments)
* [Transaction Receipt Management](/en/get-mini/android-sdk/guides/send-digital-receipts)