Search

Are you looking for test card numbers?

Would you like to contact support?

Point-of-sale icon

Retrieve totals from the terminal

Return payment totals from a terminal and filter for totals by group or operator.

Use GetTotalsRequest to retrieve totals from a terminal without starting a new reconciliation period. 

Before you begin

Endpoint

The URL used to send Terminal API messages depends on your type of implementation. For more information on the architectures available, see the Terminal API Overview.

GetTotalsRequest

For a list of GetTotalsRequest fields, see GetTotalsRequest fields

The SaleID and ServiceID in the MessageHeader should be unique. SaleID and ServiceID combinations are rejected if used recently, within 48 hours.

The fields described below are the fields you specify when making a GetTotalsRequest call to the Terminal API. 

{
   "SaleToPOIRequest":{
      "MessageHeader":{
         "ProtocolVersion":"3.0",
         "MessageClass":"Service",
         "MessageCategory":"GetTotals",
         "MessageType":"Request",
         "ServiceID":"0518144235",
         "SaleID":"CashRegB3",
         "POIID":"P400Plus-275008565"
      },
      "GetTotalsRequest":{
         "TotalFilter":{
            "POIID":"P400Plus-275008565"
         }
      }
   }
}
String serviceID = "YOUR_UNIQUE_ATTEMPT_ID";
String saleID = "YOUR_CASH_REGISTER_ID";
String POIID = "YOUR_TERMINAL_ID";

SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest();
MessageHeader messageHeader = new MessageHeader();
messageHeader.setProtocolVersion("3.0");
messageHeader.setMessageClass( MessageClassType.SERVICE );
messageHeader.setMessageCategory( MessageCategoryType.GET_TOTALS );
messageHeader.setMessageType( MessageType.REQUEST );
messageHeader.setServiceID(serviceID);
messageHeader.setSaleID(saleID);
messageHeader.setPOIID(POIID);
saleToPOIRequest.setMessageHeader(messageHeader);

GetTotalsRequest getTotalsRequest = new GetTotalsRequest();
TotalFilter totalFilter = new TotalFilter();
totalFilter.setPOIID(POIID);
getTotalsRequest.setTotalFilter(totalFilter);
saleToPOIRequest.setGetTotalsRequest(getTotalsRequest);
terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest);

Use the TotalFilter to limit the totals to the presented field/value combinations.

Use the  TotalDetails cluster to group the results on the specified fields.

GetTotalsRequest - Specific totalsGroupID

Returns totals for a specific group of totals. Specified with the totalsGroupID

{
  "SaleToPOIRequest": {
    "MessageHeader": {
      "ProtocolVersion": "3.0",
      "MessageClass": "Service",
      "MessageCategory": "GetTotals",
      "MessageType": "Request",
      "ServiceID": "0821163913",
      "SaleID": "CashRegB3",
      "POIID": "P400Plus-275008565"
    },
    "GetTotalsRequest": {
      "TotalFilter": {
        "POIID": "P400Plus-275008565",
        "TotalsGroupID": "GroupA"
      }
    }
  }
}
String serviceID = "YOUR_UNIQUE_ATTEMPT_ID";
String saleID = "YOUR_CASH_REGISTER_ID";
String POIID = "YOUR_TERMINAL_ID";

SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest();
MessageHeader messageHeader = new MessageHeader();
messageHeader.setProtocolVersion("3.0");
messageHeader.setMessageClass( MessageClassType.SERVICE );
messageHeader.setMessageCategory( MessageCategoryType.GET_TOTALS );
messageHeader.setMessageType( MessageType.REQUEST );
messageHeader.setServiceID(serviceID);
messageHeader.setSaleID(saleID);
messageHeader.setPOIID(POIID);
saleToPOIRequest.setMessageHeader(messageHeader);

GetTotalsRequest getTotalsRequest = new GetTotalsRequest();
TotalFilter totalFilter = new TotalFilter();
totalFilter.setPOIID(POIID);
totalFilter.setTotalsGroupID("GroupA");
getTotalsRequest.setTotalFilter(totalFilter);
saleToPOIRequest.setGetTotalsRequest(getTotalsRequest);
terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest);

 GetTotalsRequest - Group by OperatorID

Return a list of totals for an operator. Specified with the OperatorID.

{
  "SaleToPOIRequest": {
    "MessageHeader": {
      "ProtocolVersion": "3.0",
      "MessageClass": "Service",
      "MessageCategory": "GetTotals",
      "MessageType": "Request",
      "ServiceID": "0821164804",
      "SaleID": "CashRegB3",
      "POIID": "P400Plus-275008565"
    },
    "GetTotalsRequest": {
      "TotalFilter": {
        "POIID": "P400Plus-275008565"
      },
      "TotalDetails": [
        "OperatorID"
      ]
    }
  }
}
String serviceID = "YOUR_UNIQUE_ATTEMPT_ID";
String saleID = "YOUR_CASH_REGISTER_ID";
String POIID = "YOUR_TERMINAL_ID";

SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest();
MessageHeader messageHeader = new MessageHeader();
messageHeader.setProtocolVersion("3.0");
messageHeader.setMessageClass( MessageClassType.SERVICE );
messageHeader.setMessageCategory( MessageCategoryType.GET_TOTALS );
messageHeader.setMessageType( MessageType.REQUEST );
messageHeader.setServiceID(serviceID);
messageHeader.setSaleID(saleID);
messageHeader.setPOIID(POIID);
saleToPOIRequest.setMessageHeader(messageHeader);

GetTotalsRequest getTotalsRequest = new GetTotalsRequest();
TotalFilter totalFilter = new TotalFilter();
totalFilter.setPOIID(POIID);
getTotalsRequest.setTotalFilter(totalFilter);
getTotalsRequest.getTotalDetails().add( TotalDetailsType.OPERATORID );
saleToPOIRequest.setGetTotalsRequest(getTotalsRequest);
terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest);

GetTotalsResponse

For a list of GetTotalsResponse fields, see GetTotalsResponse fields.

{
   "SaleToPOIResponse":{
      "MessageHeader":{
         "ProtocolVersion":"3.0",
         "SaleID":"CashRegB3",
         "MessageClass":"Service",
         "MessageCategory":"GetTotals",
         "ServiceID":"0518144235",
         "POIID":"P400Plus-275008565",
         "MessageType":"Response"
      },
      "GetTotalsResponse":{
         "POIReconciliationID":"1000",
         "Response":{
            "Result":"Success"
         },
         "TransactionTotals":[
            {
               "SaleID":"CashRegB3",
               "PaymentInstrumentType":"StoredValue",
               "PaymentCurrency":"EUR",
               "PaymentTotals":[
                  {
                     "TransactionType":"Debit",
                     "TransactionCount":1,
                     "TransactionAmount":100.99
                  }
               ],
               "OperatorID":"",
               "CardBrand":"SVS",
               "TotalsGroupID":"GroupA",
               "ShiftNumber":""
            },
            {
               "SaleID":"CashRegB3",
               "PaymentInstrumentType":"Card",
               "PaymentCurrency":"EUR",
               "PaymentTotals":[
                  {
                     "TransactionType":"Debit",
                     "TransactionCount":51,
                     "TransactionAmount":1841.52
                  }
               ],
               "OperatorID":"",
               "CardBrand":"mc",
               "TotalsGroupID":"GroupA",
               "ShiftNumber":""
            }
         ]
      }
   }