Getnet DocsGetnet Docs

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

ParameterTypeRequiredDescription
reportTypeStringYesReport type. Set to "0" for detailed sales.
allowPrintCurrentTransactionStringNoSet 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

ParameterTypeDescription
resultStringTransaction result code (e.g., "0" for success).
resultDetailsStringDetailed message about the transaction result.
reportDetailsStringA 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:

FieldTypeDescription
paymentIdStringInternal payment ID
paymentTypeStringPayment type (currently returns empty string)
opReasonMessageStatusStringOperation status message
capturedStateStringCaptured state (currently returns empty string)
timestampStringTimestamp in ISO8601 format with timezone
brandTypeStringCard brand
cardLastNumberStringLast 4 digits of the card used
operationValueStringOperation value
operationStringType of operation: credit, debit, voucher, qrcode, or cancellation
opDescriptionStringOperation 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

ParameterTypeRequiredDescription
reportTypeStringYesReport type. Set to "1" for total of sales.
allowPrintCurrentTransactionStringNoSet 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

ParameterTypeDescription
resultStringTransaction result code (e.g., "0" for success).
resultDetailsStringDetailed message about the transaction result.
reportDetailsStringA 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):

FieldTypeDescription
salesAmountStringTotal amount of sales
salesQuantityStringNumber of sales
refundsAmountStringTotal amount of refunds
refundsQuantityStringNumber of refunds
tipAmountStringTotal amount of tips
tipQuantityStringNumber of tips
qrPctAmountStringTotal amount of QR Codes
qrPctQuantityStringNumber of QR Codes
totalCreditStringTotal amount of credit sales
totalDebitStringTotal amount of debit sales
totalPrepaidStringTotal 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:

FeatureDetailed Report ("0")Totals Summary ("1")
Response FieldreportDetails (JSON Array)reportDetails (JSON Object)
Use CaseAudit trails, specific transaction lookupDaily closing, cash reconciliation
ContentList of Operation objects with payment detailsAggregated totals by operation type
ScopeAll transactions in current batchAll transactions in current batch
Operation FieldspaymentId, operation, operationValue, timestamp, brandType, cardLastNumbersalesAmount, salesQuantity, refundsAmount, tipAmount, totalCredit, totalDebit
Response SizeLarger (scales with transaction count)Compact (fixed structure)
ProcessingRequires array iterationDirect 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:

  1. Always validate that response data is not null or empty before parsing JSON content.
  2. Use detailed reports for audit trails and specific transaction lookups to avoid processing unnecessary data.
  3. Use totals summaries for end-of-day reconciliation to minimize data transfer and processing time.
  4. Cache report data locally if you need to reference it multiple times to avoid redundant requests.
  5. Implement proper error handling for JSON parsing to ensure application stability.
  6. Include unique callerId values in each request to facilitate troubleshooting and support follow-up.

Next steps