Payment

Take a payment, refund, cashback, cash advance or cash deposit.

Message categoryClassDirection
PaymentServiceECR → terminal

Perform a normal payment, e.g. a normal purchase transaction.

Example request and response

payment

All fields

Example request
{
  "SaleToPOIRequest": {
    "MessageHeader": {
      "ProtocolVersion": "3.1",
      "ServiceID": "2",
      "MessageClass": "Service",
      "MessageCategory": "Payment",
      "MessageType": "Request",
      "SaleID": "ECR123",
      "POIID": "AT12345"
    },
    "PaymentRequest": {
      "SaleData": {
        "SaleTransactionID": {
          "TransactionID": "12345678",
          "TimeStamp": "2024-04-18T22:16:13.178+02:00"
        },
        "AeSaleToHostData": "{\"VoucherProductcode\":\"200001#\"}",
        "AeDisplayText": "Loyalty registered"
      },
      "PaymentTransaction": {
        "AmountsReq": {
          "RequestedAmount": 123
        },
        "TransactionConditions": {
          "AllowedPaymentBrand": [
            "VISA",
            "MASTERCARD"
          ],
          "AeAllowedPaymentBrandCategory": [
            "VOUCHER"
          ],
          "AeAccessibilityMode": true
        }
      },
      "PaymentData": {
        "PaymentType": "Normal"
      }
    }
  }
}
FieldRequiredDescription
PaymentRequestRequiredContains the fields below
↳ SaleDataRequiredContains the fields below
    ↳ SaleTransactionIDRequiredContains the fields below
        ↳ TransactionIDRequiredECR provided transaction ID. Max length: 35
        ↳ TimeStampRequiredTimestamp of request from ECR
    ↳ AeSaleToHostDataOptionalStringified Json. Used to pass through data from the ECR to the acquirer or issuer. E.g., for C-TAP Product Code or for a list of purchased items, see supported keys/values below.
    ↳ AeDisplayTextOptionalText that will be displayed on the transaction completion screen for approved transactions.
    ↳ AeIFlagOptionalBankAxept KIB ("kontanttjenester i butikk") "fraud suspicion" flag, also called I-flag.
↳ PaymentTransactionRequiredContains the fields below
    ↳ AmountsReqRequiredContains the fields below
        ↳ RequestedAmountRequiredPayment amount
    ↳ TransactionConditionsOptionalSpecify transaction conditions or restrictions for the current transaction
        ↳ AllowedPaymentBrandOptionalList of allowed payment brands for the current transaction. See Payment methods and card brands
        ↳ AeAllowedPaymentBrandCategoryOptionalList of allowed payment brand categories for the current transaction. See Payment methods and card brands
        ↳ AeAccessibilityModeOptionalBoolean. Enable accessibility mode for transaction. Default is false.
↳ PaymentDataRequiredContains the fields below
    ↳ PaymentTypeRequiredEnum: Normal, Refund, CashAdvance, CashDeposit.
"Normal": standard purchase, also with cashback.
"Refund": see Refund.
"CashAdvance": see Cash advance.
"CashDeposit": see Cash deposit.
    ↳ CardAcquisitionReferenceOptionalMandatory if referring to a prior CardAcquisition (e.g. for loyalty lookup), otherwise absent
        ↳ TransactionIDOptionalTransactionID in POITransactionID from the CardAcquisitionResponse
        ↳ TimeStampOptionalTimestamp in POITransactionID from the CardAcquisitionResponse

Note

The AeSaleToHostData is a field used for passing data from ECR to the Acquirer or Issuer. The AeHostToSaleData is a similar additional field in the response message, used for passing data the other way, from Issuer or Acquirer to ECR.

Generally, there may be more than one JSON structure in the fields, e.g. "{\"Structure1\":{\"DataElementList1\":[100, 200]},\"Structure2\":{\"DataElementList2\":[\"xxx\",\"yyy\",\"zzz\"]}}" Structures not relevant or not supported by the ECR must be ignored.

The content of those fields must be in stringified Json format and the keys / properties used inside must be supported by Aera before they can be used.

Currently supported keys

KeyDescription
VoucherProductcodeThe value of the Voucher Product code, f.ex "200001#" for meal voucher
PurchasedItemsStructure containing a list of purchased items with the keys listed below. Example: "{\"PurchasedItems\": [{\"ProductCode\":\"1000\",\"GrossAmount\":125.00,\"VatAmount\":25.00,\"ItemQuantity\":2,\"UnitOfMeasure\":\"Pieces\"}]}"
↳ ProductCodeThe product code of the purchased item (string)
↳ GrossAmountThe gross amount for the purchased amount, i.e. including tax/VAT (decimal)
↳ VatAmountThe VAT/Tax amount (included in the GrossAmount) (decimal)
↳ VatPercentVAT/tax percent used to calculate the VatAmount (VatAmount = Net amount * VatPercent, GrossAmount = Net amount + VatAmount) (decimal)
↳ ItemQuantityThe quantity of the purchased item (decimal)
↳ UnitOfMeasureUnit of the ItemQuantity, allowed values are “Litre”, “Pieces”, “Kilo” (string)

See Voucher product codes for the complete list.

Example response
{
  "SaleToPOIResponse": {
    "MessageHeader": {
      "MessageCategory": "Payment",
      "MessageClass": "Service",
      "MessageType": "Response",
      "POIID": "AT12345",
      "ProtocolVersion": "3.1",
      "SaleID": "ECR123",
      "ServiceID": "2"
    },
    "PaymentResponse": {
      "Response": {
        "AeStan": "123456",
        "AeAcquirerResponseCode": "00",
        "AeResponseCode": "000",
        "AdditionalResponse": "",
        "Result": "Success"
      },
      "SaleData": {
        "SaleTransactionID": {
          "TransactionID": "12345678",
          "TimeStamp": "2024-04-18T22:16:13.178+02:00"
        },
        "AeSaleToHostData": "{\"VoucherProductcode\":\"200001#\"}",
        "AeHostToSaleData": "  "
      },
      "POIData": {
        "POITransactionID": {
          "TransactionID": "87654321",
          "TimeStamp": "2024-04-18T22:16:20.178+02:00"
        }
      },
      "PaymentResult": {
        "PaymentInstrumentData": {
          "CardData": {
            "SensitiveCardData": {
              "ExpiryDate": "2701"
            },
            "CardCountryCode": "578",
            "MaskedPAN": "540481******1761",
            "PaymentBrand": "MASTERCARD",
            "AeCardBrandCode": "05"
          },
          "PaymentInstrumentType": "Card"
        },
        "AmountsResp": {
          "AuthorizedAmount": 123
        },
        "PaymentAcquirerData": {
          "ApprovalCode": "541639",
          "MerchantID": "6815413"
        },
        "AuthenticationMethod": [
          "OfflinePIN"
        ],
        "OnlineFlag": "true"
      },
      "PaymentReceipt": [
        {
          "DocumentQualifier": "CustomerReceipt",
          "OutputContent": {
            "OutputText": [
              {
                "Text": "Receipt text 1"
              },
              {
                "Text": "Receipt text 2"
              },
              {
                "Text": "Receipt text 3"
              }
            ]
          }
        }
      ]
    }
  }
}
FieldRequiredDescription
PaymentResponseRequiredContains the fields below
↳ ResponseRequiredContains the fields below
    ↳ ResultRequiredSuccess, Failure or Partial
    ↳ AeStanOptionalSTAN of transaction
    ↳ AeAcquirerResponseCodeOptionalResponse code from the acquirer. For information and logging purposes only.
    ↳ AeResponseCodeRequiredAera response code. The ECR shall use this response code. See Response codes
    ↳ AdditionalResponseOptionalAdditional information related to processing status of a message request .
↳ SaleDataRequiredCopied from request, optionally AeHostToSaleData in addition.
↳ POIDataRequiredContains the fields below
    ↳ POITransactionIDRequiredContains the fields below
        ↳ TransactionIDRequiredTransaction ID generated by Aera
        ↳ TimeStampRequired
    ↳ POIReconciliationIDOptionalThe global ReconciliationID provided by Aera
↳ PaymentResultOptionalContains the fields below
    ↳ PaymentInstrumentDataOptionalInformation about the payment instrument used for transaction. CardCountryCode is provided in ISO 3166-1 numeric See Payment methods and card brands for PaymentBrand values. AeCardBrandCode contains the PIT/Card Type. See Card brand codes.
    ↳ OnlineFlagOptionalIndicate that the payment transaction processing has required the approval of a host.
    ↳ AmountsRespIf Result is Success or PartialContains the fields below
        ↳ AuthorizedAmountIf Result is Success or PartialThe amount authorized by the Acquirer for the payment transaction. This will be the partially authorized amount in case of partial approval.
    ↳ PaymentAcquirerDataOptionalContains the fields below
        ↳ ApprovalCodeOptionalTransaction authorisation code
        ↳ MerchantIDRequiredMerchant ID
    ↳ AuthenticationMethodOptionalMethod used for customer authentication.
↳ PaymentReceiptOptionalPre-formatted terminal receipt provided to the ECR for printing. Note: the content is for printing purposes only - the ECR must not parse the strings, as they could change between application versions

Note: if DCC support is configured on the terminal and the transaction is eligible for DCC, the cardholder will be shown the DCC terms and asked to select currency. A transaction performed with DCC does not affect the messages between ECR and terminal, other than that the receipt texts will include the mandated DCC information.

Payment with loyalty lookup

If the ECR wants a loyalty lookup before initiating a payment, the ECR first initiates a CardAcquisition request. Based on the LoyaltyId in the CardAcquisition response, the ECR may choose to store loyalty points earned and/or update the amount in the Payment request that follows the CardAcquisition request. The following Payment request refers to the preceding CardAcquisition request. In this way, no additional acquisition of card data is needed, and the payment can be performed as a single tap transaction.

In the CardAcquisition request, relevant payment data needs to be provided, including the amount. The amount in the following Payment request must not exceed the amount of the CardAcquisition request. if cashback amount was spesified in the CardAcquisition request, it must also be sent in the following Payment request. The PaymentType value must also be the same as was used in the CardAcquisition request.

The Payment request must include a reference to the preceding CardAcquisition reference. The data are found in the POITransactionID data structure of the CardAcquisition response and are added to the CardAcquisitionReference of the PaymentData data structure of the Payment request.

🚧

Card acquisition aborted

If the card acquisition is aborted before the card is read (by sending AbortRequest from ECR, pressing the STOP button on the terminal, or by timeout), then the CardAcquisitionResponse 'ErrorCondition' field will contain the value 'Aborted'. In such cases, the ECR must not automatically send a PaymentRequest since the intention of the cashier or customer was to abort.

Example Payment request including CardAcquisitionReference
{
  "SaleToPOIRequest": {
    "MessageHeader": {
      "ProtocolVersion": "3.1",
      "ServiceID": "2",
      "MessageClass": "Service",
      "MessageCategory": "Payment",
      "MessageType": "Request",
      "SaleID": "ECR123",
      "POIID": "AT12345"
    },
    "PaymentRequest": {
      "SaleData": {
        "SaleTransactionID": {
          "TransactionID": "12345678",
          "TimeStamp": "2024-04-18T22:16:13.178+02:00"
        }
      },
      "PaymentTransaction": {
        "AmountsReq": {
          "RequestedAmount": 123
        }
      },
      "PaymentData": {
        "PaymentType": "Normal",
        "CardAcquisitionReference": {
          "TransactionID": "87654321"
        }
      }
    }
  }
}

Payment with cashback

Payment with cashback is used when the customer requests an amount to be paid in cash from the merchant to the customer. The amount is then added to the requested amount in the payment request.

Payment with cashback is performed as a Payment request. The cashback amount is added as CashBackAmount in the AmountsReq data structure of the Payment request. The format is the same as for RequestedAmount. The RequestedAmount includes the CashBackAmount. The approved cashback amount is included as CashBackAmount in the AmountsResp data structure. The AuthorizedAmount includes the CashBackAmount.

For BankAxept KIB ("kontanttjenester i butikk") cashback the merchant must set a "fraud suspicion" flag, also called I-flag in the message. This flag is included by adding the 'AeIFlag' property into the SaleData data structure as indicated in the example. The value 1 is used if the cashier suspects fraud, otherwise 0. Since the I-flag is sensitive the value of the I-flag shall be masked in the logs.

Example Payment request with cashback amount and I-flag (Iflag) set
{
  "SaleToPOIRequest": {
    "MessageHeader": {
      "ProtocolVersion": "3.1",
      "ServiceID": "2",
      "MessageClass": "Service",
      "MessageCategory": "Payment",
      "MessageType": "Request",
      "SaleID": "ECR123",
      "POIID": "AT12345"
    },
    "PaymentRequest": {
      "SaleData": {
        "SaleTransactionID": {
          "TransactionID": "12345678",
          "TimeStamp": "2024-04-18T22:16:13.178+02:00"
        },
        "AeIFlag": 0
      },
      "PaymentTransaction": {
        "AmountsReq": {
          "RequestedAmount": 223.56,
          "CashBackAmount": 100
        }
      },
      "PaymentData": {
        "PaymentType": "Normal"
      }
    }
  }
}
📘

Note

A merchant may accept both normal cashback and cashback as part of the KIB service. If the I-flag (Iflag) is included, the Payment request is interpreted as a KIB-request, otherwise not. Generally, support for KIB or normal cashback needs to be included in the Aera merchant agreement. If not, Payment requests with cashback are declined. For services not offered through the Aera acquiring agreement, such as ("kontanttjenester i butikk") services, the merchant must enter into a separate merchant agreement directly with the issuer/ acquirer in order for these services to be accepted.

Cash advance

Cash advance (also called cash withdrawal or cashout) is similar to payment with cashback, but the full amount is paid as cash to the customer.

Cash advance is performed as a Payment request with PaymentType = "CashAdvance". Opposite to payment with cashback, CashBackAmount is neither set in the Payment Request nor included in the Payment response.

For BankAxept KIB ("kontanttjenester i butikk") cash advance the merchant must set a "fraud suspicion" flag, also called I-flag in the message. This flag is included by adding the 'AeIFlag' property into the SaleData data structure, as shown in the example under Payment with cashback. The value 1 is used if the cashier suspects fraud, otherwise 0. Since the I-flag is sensitive the value of the I-flag shall be masked in the logs.

Cash deposit

Cash deposit is used for cash deposits crediting the account associated with the card presented by the customer.

Cash deposit is performed as a Payment request with PaymentType = "CashDeposit".

For BankAxept KIB ("kontanttjenester i butikk") cash deposit the merchant must set a "fraud suspicion" flag, also called I-flag in the message. This flag is included by adding the 'AeIFlag' property into the SaleData data structure, as shown in the example under Payment with cashback. The value 1 is used if the cashier suspects fraud, otherwise 0. Since the I-flag is sensitive the value of the I-flag shall be masked in the logs.

Refund

Payment refund is used for return of goods. The customer presents the card he wants the money refunded to. The refund amount is transferred from the merchant account to the account associated with the payment card presented by the customer.

Refund is performed as a Payment request but the PaymentType is set to "Refund" instead of "Normal".

In the terminal the customer is requested to present the card (tap or insert).

Note: The current version requires the customer to present the card. There is no link or reference to the original transaction and the card used for that transaction. It is up to the merchant to define the amount to be refunded.

Normally, the amount would be equal to or less than the original payment, but the merchant may initiate a higher amount. A refund may be declined by the issuer based on issuer-specific rules and policies. These may include factors such as amount recognition, time elapsed since the original purchase, and the match of specific Merchant IDs. These checks are performed and enforced by the issuer and are therefore outside of Aera's control.