Generate Sales Reports
This guide explains how to retrieve transaction data from the Getnet Payment App terminal. You will learn how to request detailed transaction lists for audit trails or consolidated totals summaries for reconciliation purposes.
Before you begin
Before following the steps, ensure:
- The Getnet Payment App is installed and operational on the terminal
- At least one transaction has been processed in the current batch
- Your application can handle JSON response parsing
Sales reports provide transaction data for the current batch. Batches are typically closed at end-of-day during settlement processing (Cierre de Lote).
Report types
The Getnet Payment App supports two types of sales reports, each designed for different use cases:
Detailed Report (reportType="0")
Returns a JSON array of individual transactions with complete details for each operation. This report is ideal for:
- Audit trails and compliance verification
- Finding specific transactions by NSU
- Verifying the status of individual payments
- Detailed reconciliation and troubleshooting
Totals Summary (reportType="1")
Returns a JSON object with aggregated totals for all transactions in the current batch. This report is ideal for:
- Daily closing and cash reconciliation
- Quick overview of batch performance
- End-of-day settlement verification
- Summary reporting to back-office systems
Report generation process
This section guides you through requesting both types of reports and handling their responses.
Request a detailed sales report
To retrieve a complete list of individual transactions, create an Intent with reportType="0". The response will include detailed information for every transaction in the current batch.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
reportType | String | Yes | Report type. Set to "0" for detailed sales. |
allowPrintCurrentTransaction | String | No | Set to "true" to let Getnet handle receipt printing (default), "false" to receive raw receipt data. |
fun getDetailedReport() {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("getnet://payment/v1/reports")).apply {
putExtra("reportType", "0")
}
startActivityForResult(intent, REPORT_REQ_CODE)
}Response Parameters
| Parameter | Type | Description |
|---|---|---|
result | String | Transaction result code (e.g., "0" for success). |
resultDetails | String | Detailed message about the transaction result. |
reportDetails | String | A JSON formatted string containing the list of Operation objects. |
The reportDetails field contains a JSON array with Operation objects. Each Operation has the following structure:
| Field | Type | Description |
|---|---|---|
paymentId | String | Internal payment ID |
paymentType | String | Payment type (currently returns empty string) |
opReasonMessageStatus | String | Operation status message |
capturedState | String | Captured state (currently returns empty string) |
timestamp | String | Timestamp in ISO8601 format with timezone |
brandType | String | Card brand |
cardLastNumber | String | Last 4 digits of the card used |
operationValue | String | Operation value |
operation | String | Type of operation: credit, debit, voucher, qrcode, or cancellation |
opDescription | String | Operation description (currently returns empty string) |
Example response handling:
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REPORT_REQ_CODE && resultCode == RESULT_OK) {
val result = data?.getStringExtra("result")
val reportDetails = data?.getStringExtra("reportDetails")
if (result == "0" && !reportDetails.isNullOrEmpty()) {
val operations = JSONArray(reportDetails)
for (i in 0 until operations.length()) {
val op = operations.getJSONObject(i)
val paymentId = op.getString("paymentId")
val operation = op.getString("operation")
val operationValue = op.getString("operationValue")
// Process each operation
}
}
}
}Request a totals summary
To retrieve aggregated totals for the current batch, create an Intent with reportType="1". The response will include consolidated sums and counts for all transactions.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
reportType | String | Yes | Report type. Set to "1" for total of sales. |
allowPrintCurrentTransaction | String | No | Set to "true" to let Getnet handle receipt printing (default), "false" to receive raw receipt data. |
fun getTotalsSummary() {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("getnet://payment/v1/reports")).apply {
putExtra("reportType", "1")
}
startActivityForResult(intent, REPORT_REQ_CODE)
}Response Parameters
| Parameter | Type | Description |
|---|---|---|
result | String | Transaction result code (e.g., "0" for success). |
resultDetails | String | Detailed message about the transaction result. |
reportDetails | String | A JSON formatted string containing summarized operations and totals. |
The reportDetails field contains a JSON object with operation sections and aggregated totals:
Operation Totals (operationTotals section):
| Field | Type | Description |
|---|---|---|
salesAmount | String | Total amount of sales |
salesQuantity | String | Number of sales |
refundsAmount | String | Total amount of refunds |
refundsQuantity | String | Number of refunds |
tipAmount | String | Total amount of tips |
tipQuantity | String | Number of tips |
qrPctAmount | String | Total amount of QR Codes |
qrPctQuantity | String | Number of QR Codes |
totalCredit | String | Total amount of credit sales |
totalDebit | String | Total amount of debit sales |
totalPrepaid | String | Total amount of prepaid sales |
The report also includes detailed operation sections: debitOperation, creditOperation, qrcodeCreditOperation, qrcodeDebitOperation, qrcodePrePaidOperation, devolutionOperation, prePaidOperation, qrcodeOperation, each containing transaction counts, amounts, and operation lists.
Report type comparison
The following table helps you choose the appropriate report type for your use case:
| Feature | Detailed Report ("0") | Totals Summary ("1") |
|---|---|---|
| Response Field | reportDetails (JSON Array) | reportDetails (JSON Object) |
| Use Case | Audit trails, specific transaction lookup | Daily closing, cash reconciliation |
| Content | List of Operation objects with payment details | Aggregated totals by operation type |
| Scope | All transactions in current batch | All transactions in current batch |
| Operation Fields | paymentId, operation, operationValue, timestamp, brandType, cardLastNumber | salesAmount, salesQuantity, refundsAmount, tipAmount, totalCredit, totalDebit |
| Response Size | Larger (scales with transaction count) | Compact (fixed structure) |
| Processing | Requires array iteration | Direct object access |
Handling errors
When generating reports, you may encounter the following error scenarios:
Empty Report
If the terminal returns result="3", no transactions have been processed since the last batch closure. This is normal at the beginning of a new batch. Wait for transactions to be processed before requesting a report.
Parsing Errors
Always verify that the reportDetails field is not null or empty before attempting to parse it. Handle JSON parsing exceptions gracefully to avoid application crashes.
Invalid Report Type
If you provide an invalid reportType value (not "0" or "1"), the request will be rejected. Ensure you use the correct report type for your intended use case.
Best practices
When working with sales reports, follow these best practices:
- Always validate that response data is not null or empty before parsing JSON content.
- Use detailed reports for audit trails and specific transaction lookups to avoid processing unnecessary data.
- Use totals summaries for end-of-day reconciliation to minimize data transfer and processing time.
- Cache report data locally if you need to reference it multiple times to avoid redundant requests.
- Implement proper error handling for JSON parsing to ensure application stability.
- Include unique
callerIdvalues in each request to facilitate troubleshooting and support follow-up.
Next steps
- Deeplink parameters reference - the report request and response parameters.
- Result codes and data structures - interpret the codes returned by a report request.
- Manage operator shifts - configure the shifts that a shift report summarizes.