Z Reports
Read about the record type Z Report before going through the examples below.
The reportId must be unique and a Z Report can only contain data for one currency.
Fields
The following fields are used:
reportDay
,reportId
,currency
- These fields are required. In the example the report will be for 2022-01-02 with the reportId=1. The reportId can contain any string as long as it is unique per reportDay.
cashRegister
- This is a reference to the cash register in the integration platform. The field is mandatory.
cashRegisterId
- This is an external reference for a cash register. The field is mandatory.
totalSalesExclTax
- The sales amount for the day. Only for goods, coupons and gratuity is NOT included here.
totalSalesTax
- The tax for the sales during the day. Only for goods, coupons and gratuity is NOT included here.
salesPerTax
- A list of sales per tax. The amount is represented using the Tax model. The sum of these must equal sales totals.
salesPayments
- a list of sales divided per payment method.
salesPaymentRounding
- The total amount of rounding for the sales. The summary of each part much match up in the totals.
totalReturnsExclTax
- The returns amount for the day. Only for goods. Coupons and gratuity is NOT included here.
totalReturnsTax
- The tax for the returns during the day. Only for goods. Coupons and gratuity is NOT included here.
returnsPerTax
- A list of returns per tax. The amount is represented using the Tax model.
returnsRefunds
- a list of returns divided per payment method.
returnsRefundRounding
- The total amount of rounding for the returns. The summary of each part much match up in the totals.
receivedGratuity
- The total amount of the received gratuity.
returnedGratuity
- The total amount of the returned gratuity.
couponSalesSum
- The total sum of sold coupons.
couponReturnsSum
- The total sum of returned coupons (not used coupon)
See API references for information about format.
Example
Scenario
The example below creates a report that represents the following register sales:
- A total sale of
150 SEK
where- 50 SEK for payment method X
- 100 SEK for payment method Y
- The tax for the sales where
- 90 SEK for product with 25% VAT
- 60 SEK for a product with 12% VAT
- A total return of 20 SEK for products with 25% VAT and the returns is related to payment method Y.
API-call
Request body for the scenario above
{
"reportDay": "2022-01-01",
"reportId": "20220101-SEK-register1-1",
"cashRegister": {
"localId": "0006aec72bd69aaf76040e43014830b3"
},
"cashRegisterId": "register1",
"currency": "SEK",
"totalSalesExclTax": {
"currency": "SEK",
"amount": "120.30",
"decimals": 2
},
"totalSalesTax": {
"currency": "SEK",
"amount": "29.70",
"decimals": 2
},
"salesPerTax": [
{
"taxType": "vat",
"percentage": "25.0",
"taxableAmount": {
"currency": "SEK",
"amount": "90.00",
"decimals": 2
},
"tax": {
"currency": "SEK",
"amount": "22.50",
"decimals": 2
}
},
{
"taxType": "vat",
"percentage": "12.0",
"taxableAmount": {
"currency": "SEK",
"amount": "60.00",
"decimals": 2
},
"tax": {
"currency": "SEK",
"amount": "7.20",
"decimals": 2
}
}
],
"salesPayments": [
{
"paymentMethodId": "[ID for payment method X]",
"totalInclTax": {
"currency": "SEK",
"amount": "50.00",
"decimals": 2
}
},
{
"paymentMethodId": "[ID for payment method Y]",
"totalInclTax": {
"currency": "SEK",
"amount": "100.00",
"decimals": 2
}
}
],
"totalReturnsExclTax": {
"currency": "SEK",
"amount": "16.00",
"decimals": 2
},
"totalReturnsTax": {
"currency": "SEK",
"amount": "4.00",
"decimals": 2
},
"returnsPerTax": [
{
"taxType": "vat",
"percentage": "25.0",
"taxableAmount": {
"currency": "SEK",
"amount": "20.00",
"decimals": 2
},
"tax": {
"currency": "SEK",
"amount": "4.00",
"decimals": 2
}
}
],
"returnsRefunds": [
{
"paymentMethodId": "[ID for payment method Y]",
"totalInclTax": {
"currency": "SEK",
"amount": "20.00",
"decimals": 2
}
}
]
}
Example with curl
$ curl \
-u '<USERNAME>':'<PASSWORD>' \
-F 'User-Agent: my-app/1.0 (YOURADDRESS@example.com)' \
-H 'X-Tenant: <TENANT CODE>' \
-H 'X-ConnectionId: <CONNECTION ID>' \
https://api.{HOSTNAME}/api/zreport \
-XPOST \
-d \
'{
"reportDay": "2022-01-01",
"reportId": "20220101-SEK-register1-1",
"cashRegister": {
"localId": "0006aec72bd69aaf76040e43014830b3"
},
"cashRegisterId": "register1",
"currency": "SEK",
"totalSalesExclTax": {
"currency": "SEK",
"amount": "120.30",
"decimals": 2
},
"totalSalesTax": {
"currency": "SEK",
"amount": "29.70",
"decimals": 2
},
"salesPerTax": [
{
"taxType": "vat",
"percentage": "25.0",
"taxableAmount": {
"currency": "SEK",
"amount": "90.00",
"decimals": 2
},
"tax": {
"currency": "SEK",
"amount": "22.50",
"decimals": 2
}
},
{
"taxType": "vat",
"percentage": "12.0",
"taxableAmount": {
"currency": "SEK",
"amount": "60.00",
"decimals": 2
},
"tax": {
"currency": "SEK",
"amount": "7.20",
"decimals": 2
}
}
],
"salesPayments": [
{
"paymentMethodId": "[ID for payment method X]",
"totalInclTax": {
"currency": "SEK",
"amount": "50.00",
"decimals": 2
}
},
{
"paymentMethodId": "[ID for payment method Y]",
"totalInclTax": {
"currency": "SEK",
"amount": "100.00",
"decimals": 2
}
}
],
"totalReturnsExclTax": {
"currency": "SEK",
"amount": "16.00",
"decimals": 2
},
"totalReturnsTax": {
"currency": "SEK",
"amount": "4.00",
"decimals": 2
},
"returnsPerTax": [
{
"taxType": "vat",
"percentage": "25.0",
"taxableAmount": {
"currency": "SEK",
"amount": "20.00",
"decimals": 2
},
"tax": {
"currency": "SEK",
"amount": "4.00",
"decimals": 2
}
}
],
"returnsRefunds": [
{
"paymentMethodId": "[ID for payment method Y]",
"totalInclTax": {
"currency": "SEK",
"amount": "20.00",
"decimals": 2
}
}
]
}'