Records
Type | Base Path | Trigger Name |
---|---|---|
REST resource | ~{realm}/journal/{client-id}/ | records |
RPC resource | ~{realm}/journal/{client-id}/external-record | N/A. |
By far the most complex resource, the electronic journal logs all activities from the trusted clients (that is, the cash registers). In particular, all sales/refund receipts and X/Z-reports/reconciliations are stored here.
Only trusted devices are allowed to write to the journal directly (hence the client-id
in the base path). However,
some actions from Backoffice—like product and product group modifications—are logged to a special journal with ID #0.
Additionally, there is a special kind of journal called external journal (whose corresponding Till
is of
type external-journal
), that allows external systems to log sales records using the addExternalRecord
endpoint. This
endpoint is only available to clients using an Access Token
that has been explicitly bound to
the external journal as part of an OAuth Authorization Code Flow flow. See the
documentation of ExternalRecord
below for more information about external journals and
records.
Endpoints
Name | Method | Relative Path | Payload | Response | Description |
---|---|---|---|---|---|
addRecord | POST | ~{realm}/journal/{client-id}/ | Record | Stored_Record | Adds a new record to the journal. |
listRecords | GET | ~{realm}/journal/{client-id}/ | N/A | Stored_Record[] | Retrieves a list of records. |
getRecord | GET | ~{realm}/journal/{client-id}/{id} | N/A | Stored_Record | Retrieves a record. |
putRecord | PUT | ~{realm}/journal/{client-id}/{id} | Record | Stored_Record | Replaces a record. |
updateRecord | PATCH | ~{realm}/journal/{client-id}/{id} | Partial_Record | Stored_Record | Updates specified record fields. |
removeRecord | DELETE | ~{realm}/journal/{client-id}/{id} | N/A | N/A | Deletes a record. |
addExternalRecord | POST | ~{realm}/journal/{client-id}/external-record | ExternalRecord | Stored_Record | Adds a new external record to the journal. |
Permissions
Permission | Description |
---|---|
add-records | Client is allowed to add records to its own journal. |
edit-records | Client is allowed to modify or delete existing records. |
show-records | Client is allowed to query the journal and to fetch individual records. |
add-external-records | Client is allowed to add external records via a special Access Token . |
Entities
Entities in this resource are self-contained. That is, while they may refer to entities in other resources, everything required to print a receipt copy (for instance) should be directly available in the record.
Interface Record
namespace Record {
type Type = 'receipt' | 'report' | 'tab' | 'batch' | 'cash-drawer' | 'product-update' | 'usage' |
'invalid-payload' | 'card-transaction' | 'order-ticket' | 'entertainment-bill';
}
interface Record {
'date': DateTime;
'currency'?: string;
'locale'?: string;
'timezone-offset'?: number;
'type': Record.Type;
'batch-id': number;
'copy-from'?: number;
'copy-of'?: number;
'training': boolean;
'copies': number;
'external'?: boolean;
'queued'?: DateTime;
'location'?: number;
'client'?: number;
'client-name'?: string;
'cashier': number;
'cashier-name': string;
'control-code'?: string;
'control-unit-id'?: string;
'description'?: string;
'company-name': string;
'org-number': string;
'address': string;
'phone-number'?: string;
'web-address'?: string;
'email'?: string;
'store-name'?: string;
'store-address'?: string;
'receipt-header'?: string;
'receipt-footer'?: string;
'batch'?: Batch;
'card-transaction'?: CardTransaction;
'cash-drawer'?: CashDrawer;
'entertainment-bill'?: EntertainmentBill;
'invalid-payload'?: InvalidPayload;
'order-ticket'?: OrderTicket;
'product'?: ProductEntry;
'receipt'?: Receipt;
'report'?: Report;
'tab'?: Tab;
'usage'?: UsageEntry;
'accounting'?: AccountingEntry[];
'recipient-uri'?: string;
'id'?: number;
'created'?: DateTime;
'updated'?: DateTime;
'deleted'?: DateTime;
'updated-by'?: number;
'updated-from'?: number;
'tags'?: string[];
'labels'?: number[];
}
Property | Data Type | Description |
---|---|---|
date | DateTime | The date when this record was created (set by the client). |
currency | String? | The currency code (ISO 4217) used by the trusted device that created this record. If not present, the default currency is assumed. |
locale | String? | The locale used by the trusted device that created this record. If not present, the default locale is assumed. |
timezone-offset | Int32? | The client's timezone offset (in minutes from UTC) when this record was created. |
type | Type | The record type. |
batch-id | Int64 | The batch ID; a counter that increments by one for each Z-report/reconciliation. |
copy-from | Int64? | In case this is a receipt or report copy, the original record's client ID. |
copy-of | Int64? | In case this is a receipt or report copy, the original record's ID. |
training | Boolean | true if the cash register was in training mode when this record was created. |
copies | Int32 | The number of copies that have been made of this record. |
external | Boolean? | true if the record was created by an external system. Defaults to false . |
queued | DateTime? | If the record was stored in the clients Store and Forward queue, this is the timestamp when it was added to the queue. |
location | Int64? | The ID of the Location the trusted device where part of when this record was created. |
client | Int64? | The ID of the Till (trusted device) that created this record. |
client-name | String? | The name of the device that created this record. |
cashier | Int64 | The Id of the User that created this record. |
cashier-name | String | The name of the user that created this record. |
control-code | String? | If the record was signed by a fiscal control unit, this property holds the signature/code. |
control-unit-id | String? | The ID of the fiscal control unit, if applicable. |
description | String? | A cashier-entered description of this record. |
company-name | String | The legal name of the company this record belongs to. |
org-number | String | The legal organization number/ID of the company this record belongs to. |
address | String | The legal address of the company this record belongs to. |
phone-number | String? | The company's phone number. |
web-address | String? | The company's web address. |
email | String? | The company's email address. |
store-name | String? | The store name, i.e., the company name that's printed on the receipt header. If empty, no name will be printed, while if not present, company-name will be used instead. |
store-address | String? | The store address, i.e., the company address that's printed on the receipt header. If empty, no address will be printed, while if not present, address will be used instead. |
receipt-header | String? | The custom receipt header text. |
receipt-footer | String? | The custom receipt footer text. |
batch | Batch? | Additional record data if type is batch . |
card-transaction | CardTransaction? | Additional record data if type is card-transaction . |
cash-drawer | CashDrawer? | Additional record data if type is cash-drawer . |
entertainment-bill | EntertainmentBill? | Additional record data if type is entertainment-bill . |
invalid-payload | InvalidPayload? | Additional record data if type is invalid-payload . |
order-ticket | OrderTicket? | Additional record data if type is order-ticket . |
product | ProductEntry? | Additional record data if type is product-update (deprecated). |
receipt | Receipt? | Additional record data if type is receipt . |
report | Report? | Additional record data if type is report . |
tab | Tab? | Additional record data if type is tab . |
usage | UsageEntry? | Additional record data if type is usage . |
accounting | AccountingEntry[]? | Accounting records for this receipt, or a summary of all receipts in a given batch for X/Z-reports/reconciliations. |
recipient-uri | URI? | If a receipt was sent digitally as E-mail or SMS, this is the recipient URI (using the mailto: or sms: scheme). |
id | Int64? | The resource ID of this entity. |
created | DateTime? | Date and time when this entity was first created. |
updated | DateTime? | Date and time when this entity was last modified. |
deleted | DateTime? | Date and time when this entity was deleted. |
updated-by | Int64? | ID of User who last modified this entity. |
updated-from | Int64? | ID of Till (trusted device) which last modified this entity. |
labels | Int64[]? | A list of Label IDs associated with this entity. |
Interface AccountingEntry
interface AccountingEntry {
'account': number;
'amount': number;
}
Property | Data Type | Description |
---|---|---|
account | Int32 | The account number. Note that this refers to the account property of the Account entity, not its id . |
amount | Money | The amount, in default currency, that should be registered for this account. |
Interface Batch
The Batch
record is used to open and close a daily transaction period, but
also to register changes in cash float during the day.
namespace Batch {
type Type = 'open' | 'close' | 'change';
}
interface Batch {
'type': Batch.Type;
'cash-amount'?: number;
'amounts'?: Payment[];
'mismatches'?: Payment[];
'vat-summaries'?: VATSummary[];
}
Property | Data Type | Description |
---|---|---|
type | Batch.Type | The batch record type. open registers the cash float at the start of the day, change is for deposits/withdrawals and close is used to record the state of the cash float at the end of the day. |
cash-amount | Money? | This property is deprecated. |
amounts | Payment[]? | A list of amounts that have been added/removed from the cash drawer. |
mismatches | Payment[]? | A list of amounts that have been lost or stolen from the cash drawer. |
vat-summaries | VATSummary[]? | The VAT amounts grouped by the VAT rate (for VAT-enabled payment methods). |
Interface CardTransaction
namespace CardTransaction {
type Type = 'card-receipt' | 'card-batch-summary';
}
interface CardTransaction {
'id': string;
'type': CardTransaction.Type;
'card-receipt'?: CardReceiptMetadata;
'card-batch-summary'?: CardBatchSummaryMetadata;
}
Interface CashDrawer
namespace CashDrawer {
type Type = 'open' | 'close';
}
interface CashDrawer {
'type': CashDrawer.Type;
}
Property | Data Type | Description |
---|---|---|
type | CashDrawer.Type | Whether the cash drawer was opened or closed. |
Interface EntertainmentBill
interface EntertainmentBill {
'original-receipt-id': string;
'id': string;
'type': Receipt.Type;
'tab'?: number;
'order'?: number;
'items': Item[];
'rounding': number;
'payments': Payment[];
'change': number;
'total-amount': number;
'total-sales-amount'?: number;
'total-vat-amount': number;
'total-sales-vat-amount'?: number;
'vat-summaries': VATSummary[];
'customer'?: Customer;
'reference'?: string;
'our-reference'?: string;
}
The EntertainmentBill
is a trivial extension of Receipt. It contains the following
extra properties:
Property | Data Type | Description |
---|---|---|
original-receipt-id | String | The original receipt's ID. |
Interface InvalidPayload
interface InvalidPayload {
'content-type': string;
'data': string;
'key-id': string;
'hmac': Base64String;
}
Interface OrderTicket
namespace OrderTicket {
type Type = 'kitchen';
}
interface OrderTicket {
'id': string;
'type': OrderTicket.Type;
'name': string;
'delivery-date'?: DateTime;
'items': Item[];
}
Interface Payment
interface Payment {
'payment-method'?: number;
'method': PaymentMethod.Type;
'amount': number;
'vat-rate'?: number;
'vat-amount'?: number;
'foreign-amount'?: number;
'metadata'?: Metadata;
'name'?: string;
'gratuity'?: number;
}
Property | Data Type | Description |
---|---|---|
payment-method | Int64? | ID of custom PaymentMethod , if any. Required if type is anything except cash , card or credit . |
method | PaymentMethod.Type | Type of payment method. |
amount | Money | The amount in the default currency. |
vat-rate | Int32? | The VAT rate (in percent; if applicable). |
vat-amount | Money? | How much of amount that is VAT (if applicable). |
foreign-amount | Money? | If the payment method is a foreign currency, the amount in that currency. Exchange rate is thus foreign-amount divided by amount . |
metadata | Metadata? | Extra metadata about the payment. |
name | String? | The name of the payment method. |
gratuity | Money? | How much of amount that is gratuity, using opposite sign to amount . |
Interface ProductEntry
This record entry is deprecated and is no longer produced. See
UsageEntry
below instead.
namespace ProductEntry {
type Type = 'product-created' | 'product-updated' | 'product-deleted' | 'product-group-created' |
'product-group-updated' | 'product-group-deleted';
}
interface ProductEntry {
'type': ProductEntry.Type;
'product'?: Product;
'product-group'?: ProductGroup;
}
Interface Receipt
This record represents a sales, refund or credit receipt. Note that credit receipts are not really receipts and are not included in the sales summaries etc.
namespace Receipt {
type Type = 'sale' | 'return' | 'credit';
}
interface Receipt {
'id': string;
'type': Receipt.Type;
'tab'?: number;
'order'?: number;
'items': Item[];
'rounding': number;
'payments': Payment[];
'change': number;
'total-amount': number;
'total-sales-amount'?: number;
'total-vat-amount': number;
'total-sales-vat-amount'?: number;
'vat-summaries': VATSummary[];
'customer'?: Customer;
'reference'?: string;
'our-reference'?: string;
}
Property | Data Type | Description |
---|---|---|
id | String | The receipt ID. Note that this is not the record entity ID but a separate identifier, which is also printed on the customer's receipt copy. |
type | Receipt.Type | Receipt type. |
tab | Int64? | If this receipt was previously a tab, the tab's ID. |
order | Int64? | If this receipt was previously part of an order, the order's ID. |
items | Item[] | The line items. |
rounding | Money | Rounding. |
payments | Payment[] | A list of payments used to fulfill the purchase/refund. |
change | Money | Change given back to the customer, in the default currency. |
total-amount | Money | The total amount to be paid/refunded, in default currency and including VAT. |
total-sales-amount | Money? | Like total-amount , but does not include liability products (gift cards, vouchers etc) and rounding. |
total-vat-amount | Money | The total VAT amount, in the default currency. |
total-sales-vat-amount | Money | Like total-vat-amount , but does not include VAT on liability products (gift cards, vouchers etc). |
vat-summaries | VATSummary[] | The VAT amounts grouped by the VAT rate. |
customer | Customer? | If a customer was linked to the sale, a copy of the Customer object, as it was when the record was created. |
reference | String? | A general external reference property. Can be the name of a contact person, an external order number etc. |
our-reference | String? | A general internal reference property. Can be the name of a contact person, an internal order number etc. |
Interface Report
namespace Report {
type Type = 'x-report' | 'z-report';
}
interface Report {
'id': string;
'type': Report.Type;
'start-date'?: DateTime;
'end-date'?: DateTime;
'total-amount'?: number;
'total-sales-amount': number;
'total-vat-amount'?: number;
'total-sales-vat-amount'?: number;
'total-change-amount'?: number;
'gratuity-summaries'?: GratuitySummary[];
'incoming-cash-amount'?: number;
'cash-deposits'?: Summary;
'cash-withdrawals'?: Summary;
'outgoing-cash-amount'?: number;
'cash-drawer-openings': number;
'incoming-petty-cash'?: Payment[];
'petty-cash-deposits'?: PaymentSummary[];
'petty-cash-withdrawals'?: PaymentSummary[];
'petty-cash-mismatch'?: Payment[];
'outgoing-petty-cash'?: Payment[];
'product-group-summaries'?: ProductGroupSummary[];
'vat-summaries'?: VATSummary[];
'payments'?: Payment[];
'payment-sale-summaries'?: PaymentSaleSummary[];
'payment-batch-summaries'?: PaymentBatchSummary[];
'goods': Summary;
'services': Summary;
'discounts': Summary;
'liabilities'?: Summary;
'losses': Summary;
'sales-receipts': Summary;
'return-receipts': Summary;
'training-receipts': Summary;
'receipt-copies': Summary;
'credit-sales'?: Summary;
'credit-returns'?: Summary;
'open-tabs'?: Summary;
'grand-total-sales': Summary;
'grand-total-returns': Summary;
'grand-total-amount': Summary;
}
Property | Data Type | Description |
---|---|---|
id | String | The report ID. Note that this is not the record entity ID but a separate report identifier. |
type | Report.Type | The report type. X-reports can be created by the cashier any number of times during a sales period, but Z-reports are only created by the cash register as part of the end-of-day/reconciliation process. |
start-date | DateTime? | When the report period started. |
end-date | DateTime? | When the report period ended. |
total-amount | Money? | Sum of all receipt's total amounts, in default currency, including VAT and liability products. |
total-sales-amount | Money | The total sales amount, in default currency and including VAT. Like total-amount , but does not include liability products (gift cards, vouchers etc.) and rounding. |
total-vat-amount | Money? | The sum of all VAT amounts, in default currency. |
total-sales-vat-amount | Money? | The total sales VAT amounts, in default currency. Like total-vat-amount , but does not include VAT for liability products. |
total-change-amount | Money? | The sum of all change amounts given, in default currency. |
gratuity-summaries | GratuitySummary[]? | A summary of all gratuities, summed per cashier. |
incoming-cash-amount | Money? | Deprecated and no longer used. |
cash-deposits | Summary? | Deprecated and no longer used. |
cash-withdrawals | Summary? | Deprecated and no longer used. |
outgoing-cash-amount | Money? | Deprecated and no longer used. |
incoming-petty-cash | Payment? | Initial cash float or petty cash amounts when sales period is opened. |
petty-cash-deposits | PaymentSummary? | A summary of all cash float/petty cash deposits during the period. |
petty-cash-withdrawals | PaymentSummary? | A summary of all cash float/petty cash withdrawals during the period. |
petty-cash-mismatch | Payment? | Cash float/petty cash mismatches found during reconciliation. Not currently used. |
outgoing-petty-cash | Payment? | The final cash float or petty cash when sales period is closed. |
product-group-summaries | ProductGroupSummary? | The sales amounts per product group (default currency, including VAT) . |
vat-summaries | VATSummary? | The sales and VAT amounts (default currency) per VAT rate. |
payments | Payment? | A summary of all payments received. |
payment-sale-summaries | PaymentSaleSummary? | The sales amounts per payment method (default currency, including VAT). |
payment-batch-summaries | PaymentBatchSummary[]? | A summary of reconciliations from all directly attached card terminals. |
goods | Summary | A summary of all products of type goods , in default currency. |
services | Summary | A summary of all products of type services , in default currency. |
discounts | Summary | A summary of all discounts, in default currency. |
liabilities | Summary? | A summary of all products of type liabilities , in default currency. |
losses | Summary | A summary of all other amounts, including rounding, in default currency. |
sales-receipts | Summary | A summary of all sales receipts (liability products are not included in the amount, which is in the default currency). |
return-receipts | Summary | A summary of all return receipts (liability products are not included in the amount, which is in the default currency). |
training-receipts | Summary | A summary of all training receipts (liability products are not included in the amount, which is in the default currency). |
receipt-copies | Summary | A summary of all receipt copies (liability products are not included in the amount, which is in the default currency). |
credit-sales | Summary? | A summary of all credit sales receipts (liability products are included in the amount, which is in the default currency). |
credit-returns | Summary? | A summary of all credit return receipts (liability products are included in the amount, which is in the default currency). |
open-tabs | Summary? | A summary of all open tabs (amounts are in default currency). |
grand-total-sales | Summary | A summary of all sales since the cash register was first activated (liability products are not included in the amount, which is in the default currency). |
grand-total-returns | Summary | A summary of all returns since the cash register was first activated (liability products are not included in the amount, which is in the default currency). |
grand-total-amount | Summary | A summary of all sales or returns since the cash register was first activated (liability products are not included in the amount, which is in the default currency). |
Interface GratuitySummary
An object used to sum all gratuities a cashier has received during the X/Z-report period.
export interface GratuitySummary {
'user': number;
'user-name': string;
'count': number;
'amount': number;
}
Property | Data Type | Description |
---|---|---|
user | Int64 | A reference to the User (cashier). |
user-name | String | The name of the user/cashier. |
count | Int32 | The number of gratuities received. |
amount | Money | The sum of all gratuities received (always in the default currency). |
Interface Summary
An object used to sum operations in the X/Z-report record.
interface Summary {
'count': number;
'amount': number;
}
Property | Data Type | Description |
---|---|---|
count | Int32 | The number of times the event happened. |
amount | Money | The sum of all amounts (always in the default currency). |
Interface PaymentBatchSummary
A summary of the data in a card terminal reconciliation report.
interface PaymentBatchSummary {
'name': string;
'transaction-summary': TransactionSummary;
'acquirers-transaction-summary'?: TransactionSummary;
'status'?: CardMetadata.Status;
}
Property | Data Type | Description |
---|---|---|
name | String | The summary name. Usually a card issuer code or card name. |
transaction-summary | TransactionSummary | A summary of all transactions in the batch, as recorded by the terminal. |
acquirers-transaction-summary | TransactionSummary | A summary of all transactions in the batch, as recorded by the acquirer/bank. |
status | CardMetadata.Status? | The reconciliation status. |
Interface PaymentSaleSummary
An object used to sum sales per payment method in the X/Z-report record. Note
that while this object looks exactly like
PaymentSummary
, the amounts are negated.
interface PaymentSaleSummary {
'payment-method'?: number;
'method': PaymentMethod.Type;
'vat-rate'?: number;
'vat-amount'?: number;
'foreign-amount'?: number;
'name'?: string;
'gratuity'?: number;
'count': number;
'amount': number;
}
Property | Data Type | Description |
---|---|---|
payment-method | Int64? | A reference to the payment method, if a user-defined payment method. |
method | PaymentMethod.Type | The type of payment method. |
vat-rate | Int32? | The VAT rate (in percent; if applicable). |
vat-amount | Money? | The sum of all VAT amounts (if applicable). |
foreign-amount | Money? | If the payment method is a foreign currency, the amount in that currency. Mean exchange rate is thus foreign-amount divided by amount . |
name | String? | The name of the payment method. |
gratuity | Money? | The sum of all gratuities (if applicable). |
count | Int32 | The number of times the event happened. |
amount | Money | The sum of all amounts (always in the default currency) |
Interface PaymentSummary
An object used to sum all payment methods used in the X/Z-report record. Note
that while this object looks exactly like
PaymentSaleSummary
, the amounts are negated.
interface PaymentSummary {
'payment-method'?: number;
'method': PaymentMethod.Type;
'vat-rate'?: number;
'vat-amount'?: number;
'foreign-amount'?: number;
'name'?: string;
'gratuity'?: number;
'count': number;
'amount': number;
}
Property | Data Type | Description |
---|---|---|
payment-method | Int64? | A reference to the payment method, if a user-defined payment method. |
method | PaymentMethod.Type | The type of payment method. |
vat-rate | Int32? | The VAT rate (in percent; if applicable). |
vat-amount | Money? | The sum of all VAT amounts (if applicable). |
foreign-amount | Money? | If the payment method is a foreign currency, the amount in that currency. Mean exchange rate is thus foreign-amount divided by amount . |
name | String? | The name of the payment method. |
gratuity | Money? | The sum of all gratuities (if applicable). |
count | Int32 | The number of times the event happened. |
amount | Money | The sum of all amounts (always in the default currency) |
Interface ProductGroupSummary
An object used to sum sales per product group in the X/Z-report record.
interface ProductGroupSummary {
'product-group': number;
'product-group-name': string;
'amount': number;
}
Property | Data Type | Description |
---|---|---|
product-group | Int64 | The ID of the product group. |
product-group-name | String | The name of the product group. |
amount | Money | The sum of the total sales amount, in default currency and including VAT. |
Interface TransactionSummary
interface TransactionSummary {
'purchase-count': number;
'purchase-amount': number;
'cb-amount': number;
'vat-amount': number;
'extra-amount': number;
'refund-count': number;
'refund-amount': number;
}
Interface UsageEntry
namespace UsageEntry {
type Type =
| 'cashier-login-online'
| 'cashier-login-offline'
| 'cashier-logout'
| 'cashier-lock'
| 'cashier-unlock'
| 'tab-suspend'
| 'tab-resume'
| 'tab-close'
| 'tab-merge'
| 'voucher-create'
| 'voucher-update'
| 'voucher-transaction'
| 'voucher-delete'
| 'product-create'
| 'product-update'
| 'product-delete'
| 'product-group-create'
| 'product-group-update'
| 'product-group-delete'
| 'inventory-adjustment-create'
| 'inventory-adjustment-update'
| 'inventory-adjustment-delete'
| 'stock-balance-transaction'
| 'password-reset-challenge'
| 'password-reset'
| 'shift-history'
;
}
interface UsageEntry {
'type': UsageEntry.Type;
'inventory-adjustment'?: number;
'location'?: number;
'product'?: number;
'product-group'?: number;
'tab'?: number;
'user'?: number;
'voucher'?: number;
'voucher-transaction'?: VoucherTransaction;
'stock-balance-transaction'?: StockBalanceTransaction;
'password-reset-challenge'?: PasswordResetChallenge;
'password-reset'?: PasswordReset;
'shift-history'?: ShiftHistoryExport;
}
Interface VATSummary
A sum of all sales and VAT amounts for a specific VAT rate.
interface VATSummary {
'vat-rate': number;
'vat-amount': number;
'net-amount': number;
'gross-amount': number;
}
Property | Data Type | Description |
---|---|---|
vat-rate | Int32 | The VAT rate (in percent). |
vat-amount | Money | The summed VAT amounts. |
net-amount | Money | The summed sales amounts, excluding VAT. |
gross-amount | Money | The summed sales amounts, including VAT. |
Interface ExternalRecord
A definition of an external record that is to be added to an external journal. This is a simplified version of the
Record
entity that only allows for records of type batch
, receipt
or report
to be added. Normally, batch
and
report
records are generated automatically by the system, and only external receipt
records are actually added by
clients.
External journals can be used to merge sales data from external sources, such as a web shop, into Onslip 360. This way, sales data from multiple sources can be consolidated into the same sales reports that are generated from Onslip POS devices. Accounting data is automatically calculated according to the same rules and definitions as used by the rest of the system. Additionally, Z-reports for external journals may be generated by the system daily; these will also be automatically exported to connected ERP systems, just like "normal" Z-reports.
interface ExternalRecord {
'date': DateTime;
'type': Record.Type;
'timezone-offset'?: number;
'client-name'?: string;
'cashier'?: number;
'cashier-name'?: string;
'description'?: string;
'labels'?: number[];
'recipient-uri'?: string;
'control-code'?: string;
'control-unit-id'?: string;
'batch'?: ExternalBatch;
'receipt'?: ExternalReceipt;
'report'?: ExternalReport;
}
Property | Data Type | Description |
---|---|---|
date | DateTime | The date when this record was created (set by the client). |
type | Type | The record type (must be batch , receipt or report ). |
timezone-offset | Int32? | The client's timezone offset (in minutes from UTC) when this record was created. Default is the server's timezone offset. |
client-name | String? | May be specified in order to override the name of the device that created this record. |
cashier | Int64? | May be specified in order to override the ID of the user that created this record. |
cashier-name | String? | May be specified in order to override the name of the user that created this record. |
description | String? | A custom description of this record. |
labels | Int64[]? | A list of Label IDs associated with this entity. |
recipient-uri | URI? | If a receipt is to be sent digitally as E-mail or SMS, this is the recipient URI (using the mailto: or sms: scheme). |
control-code | String? | If the record was signed by a fiscal control unit, this property holds the signature/code. |
control-unit-id | String? | The ID of the fiscal control unit, if applicable. |
batch | ExternalBatch? | Additional record data if type is batch . |
receipt | ExternalReceipt? | Additional record data if type is receipt . |
report | ExternalReport? | Additional record data if type is report . |
Interface ExternalBatch
Used to instruct the system to open a new batch (a daily sales period), close an existing batch and register changes in cash float.
Batches are normally opened and closed automatically by the system daily, but this record type allows for manual control.
interface ExternalBatch {
'type': Batch.Type;
'amounts'?: Payment[];
}
Property | Data Type | Description |
---|---|---|
type | Batch.Type | The batch record type (open , close or change ). |
amounts | Payment[]? | An optional list of amounts that have been added/retrieved from the cash drawer. |
When a batch is opened, amounts
specifies the initial cash float, i.e. how much was initially added to the cash
drawer.
When a batch is closed, the amounts
specifies exactly how much was retrieved from the cash drawer at the time of
closing. Any discrepancies between the expected and actual closing cash float amounts will be recorded as
mismatches. Leave amounts
unset to let the system calculate the expected closing cash float.
Closing a batch will trigger the generation of a Z-report automatically.
Manual cash float changes are registered as change
batch records, where amounts
specifies the change in cash float
(negative amounts for deposits and positive amounts for withdrawals).
Interface ExternalReceipt
This record type is used to register an external sale or refund event. These records will be including in sales reports and accounting data will be automatically calculated.
interface ExternalReceipt {
'type': Receipt.Type;
'tab'?: number;
'order'?: number;
'items': Item[];
'rounding'?: number;
'payments': Payment[];
'change': number;
'customer'?: Customer;
'reference'?: string;
'our-reference'?: string;
}
Property | Data Type | Description |
---|---|---|
type | Receipt.Type | The receipt type. |
tab | Int64? | If this receipt was previously a tab, the tab's ID. |
order | Int64? | If this receipt was previously part of an order, the order's ID. |
items | Item[] | The line items. |
rounding | Money? | Rounding. Calculated automatically based on items , payments and change if omitted. |
payments | Payment[] | A list of payments used to fulfill the purchase/refund. |
change | Money | Change given back to the customer, in the default currency. |
customer | Customer? | If a customer was linked to the sale, a copy of the Customer object, as it was when the record was created. |
reference | String? | A general external reference property. Can be the name of a contact person, an external order number etc. |
our-reference | String? | A general internal reference property. Can be the name of a contact person, an internal order number etc. |
As usual, item prices are normally positive (refunds have negative quantities, not negative prices; see the
documentation of Item
for more information about how to construct the line item list).
Payments, on the other hand, are always negative for sales/deposits and positive for refunds/withdrawals.
Interface ExternalReport
interface ExternalReport {
'type': Report.Type;
}
Use this record type to trigger generation of an X-report (type
must be x-report
). z-report
is currently not
supported; instead, Z-reports will be generated automatically by the system when a batch is closed.
Property | Data Type | Description |
---|---|---|
type | Report.Type | The report type (must be x-report for now). |