NAV Navbar
cURL/JSON

Introduction

Welcome to DINKASSA.SE for Developers.
This documentation will focus on the REST API for ES Kassasystem through our cloud service, "Dinkassa.se". The Dinkassa.se REST API is used to fetch data, create orders in the cash register, update inventory items etc. The API is organized around resources using URLs and the different HTTP methods to create and modify these resources. You authenticate using your credentials and basic auth.

Contact information
api@eskassa.se. Contact us for questions related to the API and its relationship to the POS system. For general POS support please see ES Kassa support.

How does it work?
POS: ES Kassasystem
API: Dinkassa.se REST API
Cloud: Dinkassa.se Cloud

API ENDPOINT

https://www.dinkassa.se/api/

# Dinkassa.se is used for all communications to and from any ES Kassasystem setup.

See below for Authentication.

All requests must be made using HTTPS. All data read or written through the API gets staged in the ES Kassasystem servers, the data is then replicated to/from the POS machine the next time it connects to the central system for updates.

Changes made with the API will commit instantly to the cloud. When the POS starts its synchronization it will download the changes and upload its own changes to the cloud servers. There are two possible synchronization times; for dinkassa.se Pro+ synchronization takes place every two minutes or immediately following a sale for transaction and stock information. For dinkassa.se Pro, synchronization takes place every 30 minutes. The API never connects directly to the POS system and works independently even if the POS system is not running. If a POS system was off when API changes were made, the changes will be synchronized to/from the POS system as soon as it starts up again.

Cost
Integrating with the Dinkassa.se REST API for ES Kassasystem is free for integrators. Provisionally based fees may be contractually agreed upon. Customers of the POS pay an additional fee for connecting an external system to the API.

Useful external links
Command-line tool to test HTTP REST APIs. used in documentation examples.
Desktop application to test HTTP REST APIs.

Authentication

API Serialization Format
Erpato Rest API supports JSON.

API Authentication
Authentication is made using three HTTP header values (MachineId, MachineKey, IntegratorId)

Attributes

Example headers

MachineId "9DD39BBF-8E67-4C07-825A-0845F8176075"
MachineKey "743C3270E091477EAF3D79A7D107D579"
IntegratorId "1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

# Do not use these details for testing purposes. They are dummy numbers.

Header Required Description
MachineId Yes To determine which Machine the API will be reading or writing data to we use MachineId.
MachineKey Yes Each cash register machine has its own unique secret key connected to each specific MachineId.
IntegratorId Yes IntegratorId represents the system integrator that is connecting to the API. Each system connecting receives a unique value. The same integrator can manage multiple machines.

Category

API ENDPOINT

https://www.dinkassa.se/api/category

"Category" is used to categorize one or several inventory items. At least one (1) category must be created before any InventoryItem can be created. Without a category, the creation of an InventoryItem will not be possible.

Category Fields

Field Read Only Type Default Description Constraints
Name No String (max 30 chars.) Name of the category.
AccountNumber No String (max 4 chars.) Account number used for accounting. Numerical value only.
ParentCategoryId No 64-bit Integer/null ID of the parent category (null if none). Must be the ID of a valid category.
SortingWeight Yes 32-bit Integer Used to sort categories in a vertical order. Numerical value only.
OnlyAllowCategories No Boolean False Checkbox in POS; "Use as main category without items". Used as a "favorites" or parent category. true/false
DefaultVatPercentage No Decimal Default VAT percentage for new inventory items in this category. Accepts 0, 6, 12 and 25.
Id Yes 64-bit Integer/null Identification number. Unique per category.

Search Category

REQUEST

curl -X GET "https://www.dinkassa.se/api/category"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

{
    "Items" : 
    [
        {
            "CreatedDateTime": "2019-05-15T21:14:32",
            "LastModifiedDateTime": "2019-05-15T21:14:32",
            "Name": "Cider",
            "AccountNumber": null,
            "ParentCategoryId": "636863777946781196",
            "SortingWeight": 0,
            "OnlyAllowCategories": false,
            "DefaultVatPercentage": 25.0000000000,
            "Id": "636935444266525649"
        },
    ]
}

Name Description Parmeter Type Data Type Required Default Constraints
offset Specifies the number of items that will be skipped before starting to return. Query-string 32-bit Integer/null No 0 Must be >= 0
fetch Specified the number of items to fetch after the offset has been skipped. Query-string 32-bit Integer/null No 100 Must be between 1 and 100

Fetch by Category ID

REQUEST

curl -X GET "https://www.dinkassa.se/api/category/636935444266525649"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

{
    "Item":  {
        "CreatedDateTime": "2019-05-15T21:14:32",
        "LastModifiedDateTime": "2019-05-15T21:14:32",
        "Name": "Cider",
        "AccountNumber": null,
        "ParentCategoryId": "636863777946781196",
        "SortingWeight": 0,
        "OnlyAllowCategories": false,
        "DefaultVatPercentage": 25.0000000000,
        "Id": "636935444266525649"
    }
}       

If needed, a Category can be fetched via the ID-number. The ID-number is unique per category.

Create New Category

REQUEST

curl -X POST "https://www.dinkassa.se/api/category"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '
{
    "Item": {
        "Name": "Accessories",
        "AccountNumber": "3031",
        "ParentCategoryId": "636863777946781196",
        "OnlyAllowCategories": true,
        "DefaultVatPercentage": 12
            }
}

RESPONSE

{
    "Item":    {
        "CreatedDateTime": "2019-12-19T23:52:22.8413105",
        "LastModifiedDateTime": "2019-12-19T23:52:22.8413105",
        "Name": "Accessories",
        "AccountNumber": "3031",
        "ParentCategoryId": "636863777946781196",
        "SortingWeight": 0,
        "OnlyAllowCategories": true,
        "DefaultVatPercentage": 12.0,
        "Id": "637123702696607434"
    }
}

Creating a new category is rarely needed via the API, as this is mostly handled by the on-site staff through the physical cash register. But if need be, a Category (item group) can be created through the API.

Update Existing Category

REQUEST

curl -X PUT "https://www.dinkassa.se/api/category"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '
{
    "Item" : {
        "Id": "637123702696607434",
        "Name": "Extras",
        "AccountNumber": "3032",
        "DefaultVatPercentage": 25
    }
}

RESPONSE

{
    "Item" : {
        "Id": "637123702696607434",
        "Name": "Extras",
        "AccountNumber": "3032",
        "DefaultVatPercentage": 25.0
    }
}

If any changes are needed for an already existing category, then a PUT request may be used to update for example the name of the category or perhaps the account number for the bookeeping.

Delete Category

REQUEST

curl -X DELETE "https://www.dinkassa.se/api/category/637123702696607434"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

# The response will be HTTP status code 200 if the delete was successful.

A Category can be deleted through the API, but make sure to check that there are no InventoryItems connected to the about-to-be-deleted Category before deleting. If a Category is deleted with InventoryItems present then the InventoryItems will have no connected parent Category and will therefor be invisible in the physical register, until a parent Category is reconnected either through the API for each InventoryItem, or through the physical register.

InventoryItem

API ENDPOINT

https://www.dinkassa.se/api/inventoryitem

Represents an item that can be sold.

InventoryItem Fields

Field Read Only Type Default Description Constraints
ButtonColorHex Yes String The selected color of the button, in hex format.
VisibleOnSalesMenu No Boolean true true/false value if InventoryItem should be visible on the physical sales menu or not. true/false
ExtraCategoryIds Yes 64-bit Integer/null Id-number of extra categories for which the InventoryItem is connected to. This is not the main category.
SortingWeight Yes 32-bit Integer Used to sort InventoryItems in an external system in a vertical order.
DictionaryTable Yes Decimal 1 Words used within the register (Bong info) to present extra text on the kitchen ticket for each InventoryItem ordered. Not visible on customer receipt.
SpecialFunctionTypeId Yes 64-bit Integer/null 1 Number corresponds to a specific "Special Function" within the register. Only required if requested by API Support.
CreatedDateTime Yes DateTime Datetime-stamp when the InventoryItem was first created, either via API or through the POS.
LastModifiedDateTime Yes DateTime Datetime-stamp when the InventoryItem was last modified. Any modification to the InventoryItem results in a DateTime update of LastModifiedDateTime.
Description No String (max 30 chars.) Name of the InventoryItem (I.e. Pizza Vesuvio)
SupplierName No String (max 30 chars.) The name of the supplier.
QuantityInStockCurrent No Decimal 0 The number of InventoryItems currently in stock. Can be specified when creating the item. Numerical value.
BarCode No String (max 30 chars.) Barcode used by the InventoryItem. If the item doesn't have a bar code; provide another unique value. BarCode 2-5 represents extra barcodes connected to the same InventoryItem. Must be unique.
Barcode2-5 No String (max 30 chars.) Null Extra barcodes used by the InventoryItem. Usually used if an item has more than 1 barcode from different suppliers.
ProductCode No String (max 30 chars.) Product code used by the item. If the item doesn't have a product code; provide another unique value. Must be unique.
ExternalProductCode No String (max 30 chars.) Same as ProductCode Product code used by the item. If the item doesn't have a product code; provide another unique value. Must be unique.
PriceIncludingVat No Decimal Price for the InventoryItem including VAT. Numerical value
PickupPriceIncludingVat No Decimal 0 Pickup price (TakeAway) for the item including VAT. 0 (no pickup price used)
VatPercentage No Decimal/null From Category VAT percentage for the InventoryItem. Accepts 0, 6, 12 and 25
BongCategoryId Yes 64-bit Integer/null 0 Unique Id-number of the BongCategory for which the item is connected to. For example "Starters". Names & Id's fetched through API/BongCategory.
MultiPriceListId Yes 64-bit Integer/null null Only used if an InventoryItem is connected to a MultiPriceList. See section "MultiPriceList". Numerical value
CategoryName Yes String (max 30 chars.) The name of the category that the item belongs to.
BongCategoryName Yes String (max 30 chars.) The name of the BongCategory for which the InventoryItem is connected to. Used in conjunction with BongCategoryId if necessary. Names & Id's fetched through API/BongCategory.
CategoryId No 64-bit Integer The ID of the category that the item belongs to. Must refer to an existing category.
Id Yes 64-bit Integer/null Unique identification number of each InventoryItem.

Search InventoryItem

REQUEST

curl -X GET "https://www.dinkassa.se/api/inventoryitem/?descriptionContains=Bacon&barcodeContains=12"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

 "Items": [
        {
            "ButtonColorHex": "#FFFF00",
            "VisibleOnSalesMenu": true,
            "ExtraCategoryIds": [],
            "SortingWeight": 10,
            "DictionaryTable": 3,
            "SpecialFunctionTypeId": 7,
            "CreatedDateTime": "2019-06-05T13:25:20",
            "LastModifiedDateTime": "2019-12-02T16:26:36",
            "Description": "Baconburgare",
            "SupplierName": "",
            "QuantityInStockCurrent": 10.0000000000,
            "BarCode": "33791238",
            "BarCode2": null,
            "BarCode3": null,
            "BarCode4": null,
            "BarCode5": null,
            "_Attributes": [],
            "ProductCode": "33791238",
            "ExternalProductCode": "33791238",
            "PriceIncludingVat": 125.0000000000,
            "PickupPriceIncludingVat": 115.0000000000,
            "VatPercentage": 12.0000000000,
            "BongCategoryId": "636953306917068492",
            "CategoryName": "Lunch",
            "BongCategoryName": "LUNCH",
            "CategoryId": "636903420394237638",
            "Id": "636953307123851527"
        }
    ]
}   
Name Description Parmeter Type Data Type Required Default Constraints
offset Specifies the number of items that will be skipped before starting to return. Query-string 32-bit Integer/null No 0 Must be >= 0
fetch Specified the number of items to fetch after the offset has been skipped. Query-string 32-bit Integer/null No 10 Must be between 1 and 200
categoryId Specifies the category to search for items in. Query-string 32-bit Integer/null No Null The category must exist.
descriptionContains Characters that the description must contain, % can be used as a wildcard. Query-string String No Null
barCodeContains Characters that the bar code must contain, % can be used as a wildcard. Query-string String No Null
productCodeContains Characters that the product code must contain, % can be used as a wildcard. Query-string String No Null
VisibleOnSalesMenu Specifices wether or not the InventoryItem is visible in the POS sales menu. Query-string Boolean No true true/false
OrderBy Specifices which order the InventoryItems are visible. Only used with SortingWeight. Query-string String No Null SortingWeight

Fetch by InventoryItem ID

REQUEST

curl -X GET "https://www.dinkassa.se/api/inventoryitem/636874601642150005"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

{
    "Item": {
        "ButtonColorHex": "#32CD32",
        "VisibleOnSalesMenu": true,
        "ExtraCategoryIds": [],
        "SortingWeight": 60,
        "DictionaryTable": 1,
        "SpecialFunctionTypeId": 1,
        "CreatedDateTime": "2019-04-04T22:36:20",
        "LastModifiedDateTime": "2019-07-02T09:44:06",
        "Description": "Kyckling och Ostquesadilla",
        "SupplierName": "",
        "QuantityInStockCurrent": -23.0000000000,
        "BarCode": "46376424",
        "BarCode2": null,
        "BarCode3": null,
        "BarCode4": null,
        "BarCode5": null,
        "_Attributes": [],
        "ProductCode": "46376424",
        "ExternalProductCode": "46376424",
        "PriceIncludingVat": 175.0000000000,
        "PickupPriceIncludingVat": 0.0000000000,
        "VatPercentage": 12.0000000000,
        "BongCategoryId": "636874594496479772",
        "CategoryName": "Huvudrätt",
        "BongCategoryName": "MAIN COURSE",
        "CategoryId": "636874594568996870",
        "Id": "636874601642150005"
    }
}      

If needed, you may fetch any InventoryItem by ID. Include the ID in the request and the API will present the details for you.

Create New InventoryItem

REQUEST

curl -X POST "https://www.dinkassa.se/api/inventoryitem"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '
{
    "Item" : {
        "Description" : "COLA",
        "BarCode" : "21982982",
        "ProductCode" : "43984911",
        "PriceIncludingVat" : 9.00,
        "PickupPriceIncludingVat" : 0.00,
        "QuantityInStockCurrent" : 10,
        "VatPercentage" : 12.00,
        "CategoryId" : "98765432101"
    }
}'

RESPONSE

{
    "Item" : {
        "Id" : "392893829382",
        "Description" : "COLA",
        "BarCode" : "21982982",
        "ProductCode" : "43984911",
        "QuantityInStockCurrent" : 10,
        "PriceIncludingVat" : 9.00,
        "PickupPriceIncludingVat" : 0.00,
        "VatPercentage" : 12.00,
        "CategoryId" : "98765432101",
        "CategoryName" : "DRICKA",
        "ButtonColorHex" : "#F0E68C"
    }
}

Create new InventoryItem.

Update Existing InventoryItem

REQUEST

curl -X PUT "https://www.dinkassa.se/api/inventoryitem"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '
{
    "Item" : {
        "Id" : "392893829382",
        "Description" : "COCA COLA",
        "BarCode" : "21982982",
        "ProductCode" : "43984911",
        "PriceIncludingVat" : 10.00,
        "PickupPriceIncludingVat" : 0.00,
        "VatPercentage" : 12.00,
        "CategoryId" : "98765432101",
        "QuantityInStockCurrent" : 10,
        "QuantityInStockPrevious" : 5 
    }
}'

RESPONSE

{
    "Item" : {
        "Id" : "392893829382",
        "Description" : "COCA COLA",
        "BarCode" : "21982982",
        "ProductCode" : "43984911",
        "PriceIncludingVat" : 10.00,
        "PickupPriceIncludingVat" : 0.00,
        "QuantityInStockCurrent" : 10,
        "VatPercentage" : 12.00,
        "CategoryId" : "98765432101",
        "CategoryName" : "DRICKA",
        "ButtonColorHex" : "#F0E68C"
    }
}

If any changes are needed for an already existing InventoryItem, then a PUT request may be used to update for example the name of the InventoryItem or perhaps PriceIncludingVat.

Change quantity in stock

REQUEST

curl -X POST "https://www.dinkassa.se/api/inventoryitem/392893829382"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/x-www-form-urlencoded"
        -d 'currentQuantity=10
            newQuantity=7'

RESPONSE

{
    "Item" : {
        "Id" : "392893829382",
        "Description" : "COCA COLA",
        "BarCode" : "21982982",
        "ProductCode" : "43984911",
        "PriceIncludingVat" : 10.00,
                "PickupPriceIncludingVat" : 0.00,
        "QuantityInStockCurrent" : 5,
        "VatPercentage" : 12.00,
        "CategoryId" : "98765432101",
        "CategoryName" : "DRICKA",
                "ButtonColorHex" : "#F0E68C"
    }
}   
Name Description Parmeter Type Data Type Required Default Constraints
currentQuantity The current quantity in stock for the item, used to verify no other changes were made and to make the call idempotent. x-www-form-urlencoded Decimal Yes
newQuantity The new quantity in stock of the item. x-www-form-urlencoded Decimal Yes

Delete InventoryItem

REQUEST

curl -X DELETE "https://www.dinkassa.se/api/inventoryitem/392893829382"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

# The response will be HTTP status code 200 if the delete was successful.

Delete existing inventoryitem

Employee

API ENDPOINT

https://www.dinkassa.se/api/employee

Represents entities that interact with the POS system.

Employee Fields

Field Read Only Type Default Description Constraints
EmployeeCode No String (max 30 chars.) Code used to represent the employee, such as personnel number.
Name No String (max 30 chars.) Name of the employee
Permissions Yes 32-bit Integer Employee permission type 0 = Standard
1 = Denied
2 = Admin
3 = N/A
4 = Moderator
Id Yes 64-bit Integer Identification number (not the same as EmployeeCode)
EmployeePassword No String (max 4 chars.) Employee password, used when logging in to POS.

Search Employee

REQUEST

curl -X GET "https://www.dinkassa.se/api/employee"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

{
    "Items": [
        {
            "CreatedDateTime": "2019-12-04T22:37:25",
            "LastModifiedDateTime": "2019-12-18T16:48:03",
            "EmployeeCode": "5",
            "Name": "Petra Fredriksson",
            "Permissions": 0,
            "Id": "636874676151895901"
        }
    ]
}  
Name Description Parmeter Type Data Type Required Default Constraints
offset Specifies the number of items that will be skipped before starting to return. Query-string 32-bit Integer/null No 0 Must be >= 0
fetch Specified the number of items to fetch after the offset has been skipped. Query-string 32-bit Integer/null No 100 Must be between 1 and 100

Fetch by Employee ID

REQUEST

curl -X GET "https://www.dinkassa.se/api/employee/636874676151895901"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

{
    "Item": {
        "CreatedDateTime": "2019-04-04T22:37:25",
        "LastModifiedDateTime": "2019-10-18T16:48:03",
        "EmployeeCode": "5",
        "Name": "Petra Fredriksson",
        "Permissions": 0,
        "Id": "636874676151895901"
    }
}      

Fetch the employees by Id. Every Id-number is unique for each employee. An Id-number is created automatically through the physical register (or the API) and cannot be set manually. Id is used to distinguish each employee in the database.

Create New Employee

REQUEST

curl -X POST "https://www.dinkassa.se/api/employee"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '
{
    "Item" : {
        "EmployeeCode" : "3",
        "Name" : "Niclas Persson",
        "EmployeePassword" : "1234",
    }
}'

RESPONSE

{
    "Item" : {
        "Id" : "348230984320984",
        "EmployeeCode" : "3",
        "Name" : "Niclas Persson",
    }
}

If a Permissions-parameter is not set, it will be set to default 0 (Standard). All other fields are mandatory.

Update Existing Employee

REQUEST

curl -X PUT "https://www.dinkassa.se/api/employee"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '
{
    "Item" : {
        "Id" : "636863776731055417",
        "EmployeeCode" : "35",
        "EmployeePassword" : "1235",
        "Name" : "Niclas Persson",
    }
}

RESPONSE

{
    "Item": {
        "CreatedDateTime": "2019-02-21T21:28:15",
        "LastModifiedDateTime": "2019-12-19T12:34:00.3103758",
        "EmployeeCode": "35",
        "Name": "Niclas Persson",
        "Permissions": 2,
        "Id": "636863776731055417"
    }
}

Updating an existing employee should be used with caution, especially in cases where the staff are using the built-in personal ledger within ES Kassasystem. Id-number is mandatory to be used in the Request as it is used to identify the employee. All other fields can be edited.

If a Permissions-parameter is not set, it will not be affected.

BongCategory

API ENDPOINT

https://www.dinkassa.se/api/bongcategory

A "bong" is a kitchen ticket. The "bong" tells the kitchen what food to make. Each InventoryItem is always connected to a BongCategory. The default BongCategory is always "STANDARD".

The BongCategory can, only per InventoryItem, be manually set to for example "STARTER", "MAIN COURSE", "DESSERT" etc. It's used to separate all the InventoryItems on the pysically printed (alternatively shown on a TV-screen) ticket. All InventoryItems selected as BongCategory=STARTER will then be shown under the heading "STARTER" on the kitchen ticket, all main courses will be shown under the heading "MAIN COURSE" etc. It makes it easier for the kitchen to read the ticket instead of all InventoryItems ending up helter-skelter.

BongCategory Fields

Field Read Only Type Default Description Constraints
Name No String (max 30 chars.) STANDARD Name of the BongCategory, i.e. "STARTER", "MAIN COURSE" etc.
SortingWeight No 32-bit Integer Represents where on the kitchen ticket the BongCategory-header is shown. Lower number = higher up on the ticket Numerical value
Id Yes 64-bit Integer Identification number of the BongCategory

Search BongCategory

REQUEST

curl -X GET "https://www.dinkassa.se/api/bongcategory"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

    "Items": [
        {
            "Name": "STANDARD",
            "SortingWeight": 1,
            "Id": "636874594495168052"
        },
        {
            "Name": "STARTER",
            "SortingWeight": 10,
            "Id": "636874594495921313"
        },
        {
            "Name": "MAIN COURSE",
            "SortingWeight": 20,
            "Id": "636874594496479772"
        },
        {
            "Name": "DESSERT",
            "SortingWeight": 30,
            "Id": "636874594497038873"
        }
    ]
} 
Name Description Parmeter Type Data Type Required Default Constraints
offset Specifies the number of items that will be skipped before starting to return. Query-string 32-bit Integer/null No 0 Must be >= 0
fetch Specified the number of items to fetch after the offset has been skipped. Query-string 32-bit Integer/null No 100 Must be between 1 and 100

Fetch by BongCategory ID

REQUEST

curl -X GET "https://www.dinkassa.se/api/bongcategory/636874594496479772"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

{
    "Item": {
        "Name": "MAIN COURSE",
        "SortingWeight": 20,
        "Id": "636874594496479772"
    }
}     

Fetch a BongCategory by Id. Every Id-number is unique for each BongCategory. An Id-number is created automatically through the physical register (or when the BongCategory is created through the API) and cannot be set manually. Id is used to distinguish each BongCategory in the database.

Create New BongCategory

REQUEST

curl -X POST "https://www.dinkassa.se/api/bongcategory"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '
{
    "Item" : {
        "Name" : "BREAD",
        "SortingWeight" : "10",
    }
}

RESPONSE

{
    "Item": {
        "Name": "LUNCH",
        "SortingWeight": 10,
        "Id": "637209860377028991"
    }
}

Creating a new BongCategory will only create the actual BongCategory. If needed, InventoryItems can be updated with a PUT request to assign a new BongCategory. The new BongCategory will also be visible in the physical POS, so it can be changed manually by the onsite staff as well.

Each BongCategory has to have it's own unique SortingWeight. If a SortingWeight that already exists (for example "10") is entered when creating a new BongCategory, the API will respond with which BongCategory already exist with the SortingWeight you are requesting.

Update Existing BongCategory

REQUEST

curl -X PUT "https://www.dinkassa.se/api/BongCategory"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '
{
    "Item" : {
        "Id" : "637209860377028991",
        "Name" : "PIZZA",
        "SortingWeight" : "20",
    }
}

RESPONSE

{
    "Item": {
        "Name": "PIZZA",
        "SortingWeight": 20,
        "Id": "637209860377028991"
    }
}

Id-number is mandatory to be used in the Request as it is used to identify the BongCategory. All other fields can be edited.

Delete BongCategory

REQUEST

curl -X DELETE "https://www.dinkassa.se/api/bongcategory/637209860377028991"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

# The response will be HTTP status code 200 if the delete was successful.

Delete an existing BongCategory. Please be cautious when deleting a BongCategory. Make sure no InventoryItems are connected to the affected BongCategoryId before deleting the BongCategory. If a BongCategory is deleted and InventoryItems are connected to it, they will completely lose the BongCategory and will no longer show up on the kitchen ticket before they are manually changed to fetch a new BongCategoryId, either via the POS system or via the API.

TableMap

API ENDPOINT

https://www.dinkassa.se/api/tablemap

Represents a table map where within PreSaleTransactionParkings can be created. PreSaleTransactionParking co-exists with api/TableMap. For a PreSaleTransactionParking to exist, a tablemap within api/TableMap must exist and be activated. A TableMap are by default named 1, 2, 3 etc. in the physical register.
A TableMap can for example be called "INSIDE", "OUTSIDE," VIP SECTION" etc. to more easily distinguish each one.

TableMap Fields

Field Read Only Type Default Description Constraints
Id Yes Decimal Identification number of each TableMap. From 0-9 or 0-4 depending on cash register version.
Name Yes String 1 to 5 The name of the table map
Active Yes Boolean false Defines wether or not the table map is activated. true/false

Search TableMap

REQUEST

curl -X GET "https://www.dinkassa.se/api/tablemap"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

    "Items": [
        {
            "Id": 0,
            "Name": "INSIDE",
            "Active": true
        },
        {
            "Id": 1,
            "Name": "OUTSIDE",
            "Active": true
        },
        {
            "Id": 2,
            "Name": "VIP SECTION",
            "Active": true
        },
        {
            "Id": 3,
            "Name": "3",
            "Active": false
        },
        {
            "Id": 4,
            "Name": "4",
            "Active": false
        }
    ]
}    
Name Description Parmeter Type Data Type Required Default Constraints
offset Specifies the number of items that will be skipped before starting to return. Query-string 32-bit Integer/null No 0 Must be >= 0
fetch Specified the number of items to fetch after the offset has been skipped. Query-string 32-bit Integer/null No 10 Must be between 1 and 200

Fetch by TableMap ID

REQUEST

curl -X GET "https://www.dinkassa.se/api/tablemap/1"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

{
    "Id": 1,
    "Name": "INSIDE",
    "Active": true
}    

Fetch the TableMap by Id. Every Id-number is unique for each TableMap. The Id-numbers are created automatically through the physical register and cannot be set manually. Id is used to distinguish each TableMap in the database.

DictionaryWord

API ENDPOINT

https://www.dinkassa.se/api/dictionaryword

Each DictionaryWord represents an item which is normally sent as "ExtraInformation" for a PreSaleTransaction. Each DictionaryWord has been manually entered through the POS system through a functionality called "Bong info". DictionaryWords are used to inform the kitchen of extra information pertaining to the order. For example "no cheese", "extra onion", "no ketchup" etc.

DictionaryWord Fields

Field Read Only Type Default Description Constraints
NewLine Yes Boolean false Defines if a carriage return shall be performed after the Word-row true/false
Word Yes String The name of the actual DictionaryWord
SortingWeight Yes 32-bit Integer The order of which the DictionaryWord is visually presented in the POS. Lower number = higher vertically Numerical value
DictionaryTable Yes Decimal 1 Defines the ID-number of the DictionaryTable. (typically 0-4) Numerical value
InventoryItemId Yes String/null null Available if a DictionaryWord is connected to an InventoryItem, i.e. “EXTRA CHEESE” for 10 SEK. Numerical value
Id Yes 64-bit Integer Unique identification number of each DictionaryWord, independent of InventoryItemId Numerical value

Search DictionaryWord

REQUEST

curl -X GET "https://www.dinkassa.se/api/dictionaryword"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

 "Items": [
        {
            "NewLine": false,
            "Word": "AVOCADO",
            "SortingWeight": 1,
            "DictionaryTable": 1,
            "InventoryItemId": "",
            "Id": "636874593132327134"
        },
        {
            "NewLine": true,
            "Word": "EXTRA SALAMI",
            "SortingWeight": 2,
            "DictionaryTable": 2,
            "InventoryItemId": "636940712352421109",
            "Id": "636940710777581272"
        },
        {
            "NewLine": true,
            "Word": "EXTRA CHEESE",
            "SortingWeight": 3,
            "DictionaryTable": 2,
            "InventoryItemId": "",
            "Id": "637114808697888691"
        }
    ]
}

The DictionaryWord-table can only be searched as a whole. Fetch, Offset, and By Id are not avaiable for DictionaryWord.

PreSaleTransaction

API ENDPOINT

https://www.dinkassa.se/api/presaletransaction

Represents an order/shopping cart before the sale is finalized. When a sale is finalized the PreSaleTransaction is deleted and a Transaction is created.

PreSaleTransaction Fields

Field Read Only Type Default Description Constraints
ExternalReference1 No String (max 30 chars.) A text string that can be used to refer to this object from another system.
TransactionName No String (max 50 chars.) A text string that will be printed on the receipt, often used to indicate customer.
ExternalOrderContactInfo No String (max 250 chars.) A text string that will be printed on the kitchen order ticket, used for contact information to the customer. For example the customers phone number.
State Yes 32-bit Integer State of the item. Items of state 0 (None) cannot be managed through the API as they originate from the POS system. Can only be changed through a separate API call (submit). 0 = None, 1 = Not submitted, 2 = Submitted.
Items Yes PreSaleTransactionItem The items to be sold in the PreSaleTransaction.
Id Yes 64-bit Integer/null Identification number
Payments Yes PreSaleTransactionPayment Any payments made for the PreSaleTransaction. Note that payments can be added later on the POS system. For a customer that pre-orders online and pays in the store payments would remain empty. PreSaleTransactionPayments of type WebShop can not be combined with a different Type. The total amount paid must also match the total cost of InventoryItems.
EmployeeId No 64-bit Integer The employee posting this PreSaleTransaction. Must match a existing Employee.
CreatedDateTime Yes DateTime Datetime-stamp when the PreSaleTransaction was first created, either via API or through the POS.
LastModifiedDateTime Yes DateTime Datetime-stamp when the PreSaleTransaction was last modified. Any modification to the PreSaleTransaction results in a DateTime update of LastModifiedDateTime.
ParkingId No Decimal null Used in the header of the POST to park the InventoryItems on a table. Refer to PreSaleTransactionParking and TableMap within this documentation.

Search PreSaleTransaction

REQUEST

curl -X GET "https://www.dinkassa.se/api/presaletransaction"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

{
  "Items": [
          {
            "ExternalReference1": "2694",
            "TransactionName": "Order 2694",
            "ExternalOrderContactInfo": "Take Away\Pickup 11:00\nTel: 0841050990",
            "State": 1,
            "Items": [
                {
                    "ExternalReference1": null,
                    "IsTakeAway": true,
                    "ExtraInformation": "No cheese",
                    "PricePerItemIncludingVat": 89.0,
                    "DiscountAllowed": true,
                    "CreatedDateTime": "2020-03-24T01:42:17.227",
                    "LastModifiedDateTime": "2020-03-28T17:13:53",
                    "VatPercentage": 12.0000000000,
                    "TotalDiscount": 0.0,
                    "Quantity": 1.0000000000,
                    "QuantityPerPackage": 1.0000000000,
                    "ParentItemId": null,
                    "BongCategoryId": "636863777915994469",
                    "InventoryItemDescription": "Capricciosa",
                    "InventoryItemId": "637205118056046636",
                    "Id": "637206109372415147"
                }
            ],
            "Payments": [
                {
                    "Type": 18,
                    "TotalAmount": 89.0000000000,
                    "ExternalReference1": "e45ts-4strg3-11vz3",
                    "Id": "637206109372503148"
                }
            ],
            "EmployeeId": "636863776731055417",
            "CreatedDateTime": "2020-03-24T01:42:17.21",
            "LastModifiedDateTime": "2020-03-24T01:42:17.24",
            "ParkingId": "",
            "Id": "637206109372271466"
        }
    ]
}   
Name Description Parmeter Type Data Type Required Default Constraints
offset Specifies the number of items that will be skipped before starting to return. Query-string 32-bit Integer/null No 0 Must be >= 0
fetch Specified the number of items to fetch after the offset has been skipped. Query-string 32-bit Integer/null No 100 Must be between 1 and 100
onlyParked Include only parked items (used mostly for parking on tables in TableMap) Query-string Boolean/null No false
state Include items of a certain state. Query-string 32-bit Integer/null No Null 0 = Created in POS
1 = Not submitted (editable)
2 = Submitted for webshop (not editable)
3+ = For internal use

Fetch by PreSaleTransaction ID

REQUEST

curl -X GET "https://www.dinkassa.se/api/presaletransaction/637205513331907038"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

{
    "Item": {
        "ExternalReference1": "2645",
        "TransactionName": "Order 2645",
        "ExternalOrderContactInfo": "Take Away\Pickup 15:00\nTel: 0841050990",
        "State": 1,
        "Items": [
            {
                "ExternalReference1": null,
                "IsTakeAway": true,
                "ExtraInformation": "",
                "PricePerItemIncludingVat": 89.0,
                "DiscountAllowed": true,
                "CreatedDateTime": "2020-03-23T09:08:53.307",
                "LastModifiedDateTime": "2020-03-28T17:13:53",
                "VatPercentage": 12.0000000000,
                "TotalDiscount": 0.0,
                "Quantity": 1.0000000000,
                "QuantityPerPackage": 1.0000000000,
                "ParentItemId": null,
                "BongCategoryId": "636863777915994469",
                "InventoryItemDescription": "VESUVIO",
                "InventoryItemId": "637205117815623729",
                "Id": "637205513332077394"
            },
            {
                "ExternalReference1": null,
                "IsTakeAway": true,
                "ExtraInformation": "",
                "PricePerItemIncludingVat": 79.0,
                "DiscountAllowed": true,
                "CreatedDateTime": "2020-03-23T09:08:53.307",
                "LastModifiedDateTime": "2020-03-28T17:13:53",
                "VatPercentage": 12.0000000000,
                "TotalDiscount": 0.0,
                "Quantity": 1.0000000000,
                "QuantityPerPackage": 1.0000000000,
                "ParentItemId": null,
                "BongCategoryId": "636863777915994469",
                "InventoryItemDescription": "HAWAII",
                "InventoryItemId": "637205117980104695",
                "Id": "637205513332119968"
            }
        ],
        "Payments": [
            {
                "Type": 18,
                "TotalAmount": 168.0000000000,
                "ExternalReference1": "sdf3as-452sa-4564a",
                "Id": "637205513332153358"
            }
        ],
        "EmployeeId": "636863776731055417",
        "CreatedDateTime": "2020-03-23T09:08:53.293",
        "LastModifiedDateTime": "2020-03-23T09:08:53.323",
        "ParkingId": "",
        "Id": "637205513331907038"
    }
}

If needed, you may fetch any PreSaleTransaction by ID. Include the ID in the request and the API will present the details for you.

Create New PreSaleTransaction

REQUEST

curl -X POST "https://www.dinkassa.se/api/presaletransaction?requestKey=AFDA6368-6C91-45E6-A309-4900986A5212"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '
{
    "Item": {
        "EmployeeId": "636874675803407543",
        "State": 1,
        "ExternalReference1": "2384",
        "ExternalOrderContactInfo": "08-41050990",
        "TransactionName": "Order 2384",
        "Items": [
            {
                "ExtraInformation": "No Cheese",
                "PricePerItemIncludingVat": 95,
                "Quantity": 1,
                "InventoryItemId": "636874600387269846"
            },
            {
                "PricePerItemIncludingVat": 15,
                "Quantity": 1,
                "InventoryItemId": "636874601642150005"
            }
        ],
        "Payments": [
            {
                "Type": 18,
                "Amount": 110
            }
        ]
    }
}

RESPONSE

{
    "Item": {
        "ExternalReference1": "2384",
        "TransactionName": "Order 2384",
        "ExternalOrderContactInfo": "08-41050990",
        "State": 1,
        "Items": [
            {
                "ExternalReference1": null,
                "IsTakeAway": false,
                "ExtraInformation": "No Cheese",
                "PricePerItemIncludingVat": 95.00,
                "DiscountAllowed": true,
                "CreatedDateTime": "2020-03-28T20:24:07.6333475",
                "LastModifiedDateTime": "2020-03-28T20:24:07.6333475",
                "VatPercentage": 12.0000000000,
                "TotalDiscount": 0.0,
                "Quantity": 1.0,
                "QuantityPerPackage": 1.0,
                "ParentItemId": null,
                "BongCategoryId": "636874594495921313",
                "InventoryItemDescription": "Pizza Capricciosa",
                "InventoryItemId": "636874600387269846",
                "Id": "637210238475945120"
            },
            {
                "ExternalReference1": null,
                "IsTakeAway": false,
                "ExtraInformation": "",
                "PricePerItemIncludingVat": 15.00,
                "DiscountAllowed": true,
                "CreatedDateTime": "2020-03-28T20:24:07.6333475",
                "LastModifiedDateTime": "2020-03-28T20:24:07.6333475",
                "VatPercentage": 12.0000000000,
                "TotalDiscount": 0.0,
                "Quantity": 1.0,
                "QuantityPerPackage": 1.0,
                "ParentItemId": null,
                "BongCategoryId": "636874594496479772",
                "InventoryItemDescription": "Fanta",
                "InventoryItemId": "636874601642150005",
                "Id": "637210238475969235"
            }
        ],
        "Payments": [
            {
                "Type": 18,
                "TotalAmount": 110.0,
                "ExternalReference1": null,
                "Id": "637210238475989954"
            }
        ],
        "EmployeeId": "636874675803407543",
        "CreatedDateTime": "2020-03-28T20:24:07.6333475",
        "LastModifiedDateTime": "2020-03-28T20:24:07.6489831",
        "ParkingId": "",
        "Id": "637210238475909876"
    }
}

Use the provided example of how to create a new PreSaleTransaction. A creating of a PreSaleTransaction towards the API is directly connected to the WEBORDER-system within ES Kassasystem.

Update Existing PreSaleTransaction

REQUEST

curl -X PUT "https://www.dinkassa.se/api/presaletransaction"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '
{
    "Item": {
        "Id": "637210242100904840",
        "EmployeeId": "636874675803407543",
        "State": 1,
        "Items": [
            {
                "PricePerItemIncludingVat": 95,
                "Quantity": 1,
                "InventoryItemId": "636874600387269846"
            }
        ],
        "Payments": [
            {
                "Type": 18,
                "Amount": 95
            }
        ]
    }
}

RESPONSE

{
    "Item": {
        "ExternalReference1": null,
        "TransactionName": null,
        "ExternalOrderContactInfo": null,
        "State": 1,
        "Items": [
            {
                "ExternalReference1": null,
                "IsTakeAway": false,
                "ExtraInformation": "",
                "PricePerItemIncludingVat": 95.00,
                "DiscountAllowed": true,
                "CreatedDateTime": "2020-03-28T20:30:22.3179758",
                "LastModifiedDateTime": "2020-03-28T20:30:22.3179758",
                "VatPercentage": 12.0000000000,
                "TotalDiscount": 0.0,
                "Quantity": 1.0,
                "QuantityPerPackage": 1.0,
                "ParentItemId": null,
                "BongCategoryId": "636874594495921313",
                "InventoryItemDescription": "Ostbollar",
                "InventoryItemId": "636874600387269846",
                "Id": "637210242222798230"
            }
        ],
        "Payments": [
            {
                "Type": 18,
                "TotalAmount": 95.0,
                "ExternalReference1": null,
                "Id": "637210242222824821"
            }
        ],
        "EmployeeId": "636874675803407543",
        "CreatedDateTime": "2020-03-28T20:30:10.13",
        "LastModifiedDateTime": "2020-03-28T20:30:22.3336027",
        "ParkingId": "",
        "Id": "637210242100904840"
    }
}

If any changes are needed for an already existing PreSaleTransaction, then a PUT request may be used to update for example the State or the InventoryItems.

Delete PreSaleTransaction

REQUEST

curl -X DELETE "https://www.dinkassa.se/api/presaletransaction/637210242100904840"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '

RESPONSE

# The response will be HTTP status code 200 if the delete was successful.

Delete existing PreSaleTransaction.

Delete all old + empty

REQUEST

curl -X DELETE "https://www.dinkassa.se/api/presaletransaction?deleteOldEmpty=true&minSecondsOldToDelete=30"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '

RESPONSE

# The response will be HTTP status code 200 if the delete was successful.
Name Description Parmeter Type Data Type Required Default Constraints
deleteOldEmpty Must be set to true to delete old items. Query-string Boolean Yes
minSecondsOldToDelete The number of seconds ago that items have to have been created to be deleted. Query-string 32-bit Integer Yes
maxDeleteCount The max number of items to delete in this request. Query-string 32-bit Integer No 100 1-200

Submit for processing

REQUEST

curl -X POST "https://www.dinkassa.se/api/presaletransaction/635588210231306742"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/x-www-form-urlencoded"
        -d 'submit=true'

RESPONSE

{
    "Item": {
        "ExternalReference1": null,
        "TransactionName": "Order: 1825",
        "ExternalOrderContactInfo": "08-41050990",
        "State": 2,
        "Items": [
            {
                "ExternalReference1": null,
                "IsTakeAway": false,
                "ExtraInformation": "Extra Mushroom",
                "PricePerItemIncludingVat": 95.0,
                "DiscountAllowed": true,
                "CreatedDateTime": "2020-03-28T20:38:45.993",
                "LastModifiedDateTime": "2020-03-28T20:38:45.993",
                "VatPercentage": 12.0000000000,
                "TotalDiscount": 0.0,
                "Quantity": 1.0000000000,
                "QuantityPerPackage": 1.0000000000,
                "ParentItemId": null,
                "BongCategoryId": "636874594495921313",
                "InventoryItemDescription": "Pizza Capricciosa",
                "InventoryItemId": "636874600387269846",
                "Id": "637210247259416977"
            }
        ],
        "Payments": [
            {
                "Type": 18,
                "TotalAmount": 95.0000000000,
                "ExternalReference1": null,
                "Id": "637210247259482943"
            }
        ],
        "EmployeeId": "636874675803407543",
        "CreatedDateTime": "2020-03-28T20:38:45.977",
        "LastModifiedDateTime": "2020-03-28T20:42:17.0933748",
        "ParkingId": "",
        "Id": "637210247259381834"
    }
}
Name Description Parmeter Type Data Type Required Default Constraints
submit Must be set to true to submit the PreSaleTransaction. After submit the item cannot be changed or deleted and is now managed by the POS system. x-www-form-urlencoded Boolean Yes

PreSaleTransactionItem

API ENDPOINT

NOT AN ENDPOINT

Represents an item to be sold as part of a PreSaleTransaction.

PreSaleTransactionItem Fields

Field Read Only Type Default Description Constraints
ExternalReference1 No String (max 30 chars.) A text string that can be used to refer to this object from another system, i.e. order number.
IsTakeAway No Boolean false Used to distinguish between "Dine In" and "Take Away". If True, the kitchen ticket will display "TAKE AWAY". true/false
ExtraInformation No String (max 500 chars.) Additional information for the item. Example: Extra veggies, no cheese.
PricePerItemIncludingVat No Decimal/null The PriceIncludingVat from the InventoryItem. Price per item including VAT. If the item has a quantity != 1 the price is for each item, i.e. total price = this price * quantity.
DiscountsAllowed Yes Boolean true Shows whether or not the Category the InventoryItem is connected to is marked as "allowed" for discounts or not. Alcohol-categories are not allowed for discount.
CreatedDateTime Yes DateTime Datetime-stamp when the PreSaleTransactionItem was first created, either via API or through the POS.
LastModifiedDateTime Yes DateTime Datetime-stamp when the PreSaleTransactionItem was last modified. Any modification to the PreSaleTransactionItem results in a DateTime update of LastModifiedDateTime.
VatPercentage Yes Decimal Shows the VatPercentage of each PreSaleTransactionItem. Fetched automatically from InventoryItem and cannot be manually edited through the API due to risk. 0, 6, 12 or 25.
TotalDiscount Yes Decimal 0 Shows the total discount of each PreSaleTransactionItem. Fetched automatically from the POS and cannot (yet) be manually edited through the API.
Quantity No Decimal Number of items being sold. 0 – 1000000
QuantityPerPackage No Decimal Used to select X/unit. Example: 2 Vodka-shots with 4cl each; choose "Quantity": 8 and "QuantityPerPackage": 2. Set automatically to the same as Quantity if not used.
ParentItemId Yes 64-bit Integer/null null Not used as of yet.
BongCategoryId No 64-bit Integer/null Used to determine BongCategory for each InventoryItem. Used normally if an InventoryItem has "MAIN COURSE" as standard and client wants "MAIN COURSE" as "STARTER" instead.
InventoryItemDescription Yes Decimal The description of the InventoryItem being sold.
InventoryItemId No 64-bit Integer The ID of the InventoryItem being sold. Must match existing InventoryItem.

PreSaleTransactionPayment

API ENDPOINT

NOT AN ENDPOINT

Represents a payment for a PreSaleTransaction.

PreSaleTransactionPayment Fields

Field Read Only Type Default Description Constraints
Type No 32-bit Integer The type of payment used. Must be one of:
Cash = 1
Card = 2
Coupon = 3
BankAccount = 7
WebShop = 18
Amount No Decimal The amount paid. 0 – 1000000
ExternalReference1 No String (max 30 chars.) A text string that can be used to refer to this object from another system.
Id Yes 64-bit Integer Identification number of the complete PreSaleTransaction. Numerical value

PreSaleTransactionParking

API ENDPOINT

https://www.dinkassa.se/api/presaletransactionparking

Represents a place where a PreSaleTransaction can be parked (for ex. a table). PreSaleTransactionParking co-exists with api/TableMap. For a PreSaleTransactionParking to exist, a tablemap within api/TableMap must exist and be activated. A PreSaleTransactionParking is essentially a table within the physical registers table map where the names of the tables are usually "1", "2", "3" etc.

PreSaleTransactionParking Fields

Field Read Only Type Default Description Constraints
Id Yes 64-bit Integer Identification number
Name Yes String The name of the table
TableMap Yes 32-bit Integer The map where this parking should be shown (typically 0-4).

Search PreSaleTransactionParking

REQUEST

curl -X GET "https://www.dinkassa.se/api/presaletransactionparking"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

   "Items": [
        {
            "Name": "100",
            "TableMap": 1,
            "Id": "636936094895645899"
        }
    ]
}    
Name Description Parmeter Type Data Type Required Default Constraints
offset Specifies the number of items that will be skipped before starting to return. Query-string 32-bit Integer/null No 0 Must be >= 0
fetch Specified the number of items to fetch after the offset has been skipped. Query-string 32-bit Integer/null No 10 Must be between 1 and 200

Transaction

API ENDPOINT

https://www.dinkassa.se/api/transaction

Represents a transaction once the sale/return has been finalized. Transactions can only be fetched for a period of 7 days from current date. Data needed from dates later than 7 days are not fetchable. The reason for this is to not overload the API.

Transaction Fields

Field Read Only Type Default Description Constraints
Id Yes 64-bit Integer/null Identification number
Number Yes 32-bit Integer The number of the transaction if the transaction represents a receipt (and not an invoice)
InvoiceNumber Yes 32-bit Integer/null The invoice number if the transaction represents an invoice.
DateTime Yes DateTime The date and time of the transaction.
TransactionName Yes String (max 50 chars.) A text string that will be printed on the receipt, often used to indicate customer.
EnteredByEmployeeCode Yes 64-bit Integer The code of the employee that posted this transaction.
EnteredByEmployeeName Yes 64-bit Integer The name of the employee that posted this transaction.
TotalAmountIncludingVat Yes Decimal Total price including VAT.
TotalVat Yes Decimal Total VAT.
Items Yes TransactionItem The InventoryItems sold or returned.
Payments Yes TransactionPayment Any payments made as part of this transaction.

Search Transaction

REQUEST

curl -X GET "https://www.dinkassa.se/api/transaction/?offset=1&fetch=1&startDateTime=2019-12-13&endDateTime=2019-12-19"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

    "Items": [
        {
            "Number": 57476,
            "DateTime": "2019-12-18T10:09:19",
            "TransactionName": null,
            "InvoiceNumber": null,
            "CreatedDateTime": "2019-12-18T10:09:19",
            "LastModifiedDateTime": "2019-12-18T10:09:19",
            "TotalAmountIncludingVat": 150.0000000000,
            "TotalVat": 16.0714290000,
            "EnteredByEmployeeCode": "1",
            "EnteredByEmployeeName": "Admin",
            "Items": [
                {
                    "InventoryItemDescription": "Pasta Carbonara",
                    "ProductCode": "46365120",
                    "ProductBarCode": "46365120",
                    "TotalAmountIncludingVat": 150.0000000000,
                    "TotalVat": 16.07142857142857142857142857,
                    "Quantity": 1.0000000000,
                    "Id": "637122569595835337"
                }
            ],
            "Payments": [
                {
                    "CreatedDateTime": "2019-12-18T10:09:19",
                    "LastModifiedDateTime": "2019-12-18T10:09:19",
                    "PaymentDateTime": "2019-12-18T10:09:19",
                    "Type": 2,
                    "Amount": 150.0000000000,
                    "Id": "637122569595835071"
                }
            ],
            "Id": "637122569595834746"
        }
    ]
}   
Name Description Parmeter Type Data Type Required Default Constraints
offset Specifies the number of items that will be skipped before starting to return. Query-string 32-bit Integer/null No 0 Must be >= 0
fetch Specified the number of items to fetch after the offset has been skipped. Query-string 32-bit Integer/null No 10 Must be between 1 and 200
startDateTime The date to include transaction starting from. Query-string DateTime Yes Must be within 7 days of the end date.
endDateTime The date to include transactions up until. Query-string DateTime Yes Must be within 7 days of the start date.

Get by number

REQUEST

curl -X GET "https://www.dinkassa.se/api/category/636935444266525649"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

{
    "Item": {
        "Number": 57474,
        "DateTime": "2019-12-18T10:06:49",
        "TransactionName": null,
        "InvoiceNumber": null,
        "CreatedDateTime": "2019-12-18T10:06:49",
        "LastModifiedDateTime": "2019-12-18T10:06:49",
        "TotalAmountIncludingVat": 75.0000000000,
        "TotalVat": 8.0357150000,
        "EnteredByEmployeeCode": "1",
        "EnteredByEmployeeName": "Admin",
        "Items": [
            {
                "InventoryItemDescription": "Melon och skinka",
                "ProductCode": "46360440",
                "ProductBarCode": "46360440",
                "TotalAmountIncludingVat": 75.0000000000,
                "TotalVat": 8.035714285714285714285714286,
                "Quantity": 1.0000000000,
                "Id": "637122568091988971"
            }
        ],
        "Payments": [
            {
                "CreatedDateTime": "2019-12-18T10:06:49",
                "LastModifiedDateTime": "2019-12-18T10:06:49",
                "PaymentDateTime": "2019-12-18T10:06:49",
                "Type": 2,
                "Amount": 75.0000000000,
                "Id": "637122568091988664"
            }
        ],
        "Id": "637122568091988272"
    }
}        

TransactionItem

API ENDPOINT

NOT AN ENDPOINT

Represents an item that was sold or returned as part of a Transaction.

TransactionItem Fields

Field Read Only Type Default Description Constraints
InventoryItemId Yes 64-bit Integer The ID of the InventoryItem being sold.
ProductCategory Yes String (max 30 chars.) The category of the InventoryItem being sold.
ProductDescription Yes String (max 30 chars.) The description of the InventoryItem being sold.
ProductBarCode Yes String (max 50 chars.) The bar code of the InventoryItem being sold.
ProductCode Yes String (max 50 chars.) The product code of the InventoryItem being sold.
TotalAmountIncludingVat Yes Decimal Total price including VAT.
TotalVat Yes Decimal Total VAT.
TotalDiscount Yes Decimal Total discount including VAT.
Quantity Yes Decimal Number of items being sold. 0 – 1000000

TransactionPayment

API ENDPOINT

NOT AN ENDPOINT

Represents a payment that was made or returned as part of a Transaction.

TransactionPayment Fields

Field Read Only Type Default Description Constraints
Amount Yes Decimal The amount paid. 0 – 1000000
Type Yes 32-bit Integer The type of payment used. Cash = 1
Card = 2
Coupon = 3
BankAccount = 7
WebShop = 18
PaymentDateTime Yes DateTime The date and time that the payment was made.

MultiPriceList

API ENDPOINT

https://www.dinkassa.se/api/multipricelist

MultiPriceLists are not actual InventoryItem's. Each Multipricelist contains different pricing levels. MultiPriceList are created at for example a Pizzeria where one MultiPriceList is called "Pizza Vesuvio". The pricing levels can be "Childrens Pizza", "Regular Pizza", "Family Size Pizza" etc; each one with a different price. The prices for a "Regular Pizza" can be split into columns, whereas ColumnName1 can be "Eat in" and ColumnName2 can be "Take Away". Whenever a Column is marked as Take Away (IsTakeAwayColumn1-6), the item will be automatically marked as "Pickup" when sent to the register as well as on the business reports of the cash register.

MultiPriceList Fields

Field Read Only Type Default Description Constraints
Description Yes String The name of the MultiPriceList, i.e. "Pizza Vesuvio"
NumberOfColumns Yes 32-bit Integer 2 The number of columns activated Numerical value
ColumnName1-6 Yes String/null The name of each respective column
IsTakeAwayColumn1-6 Yes Boolean false True/false value if column is marked as "TakeAway" or not true/false
ColumnColor1-6 Yes String PaleGreen The visual color of the respective column
Id Yes 64-bit Integer Unique identification number of each MultiPriceList Numerical value

Search MultiPriceList

REQUEST

curl -X GET "https://www.dinkassa.se/api/multipricelist"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

    "Items": [
        {
            "Description": "Pizza Vesuvio",
            "NumberOfColumns": 2,
            "ColumnName1": "Dine In",
            "ColumnName2": "Take Away",
            "ColumnName3": "",
            "ColumnName4": "",
            "ColumnName5": "",
            "ColumnName6": "",
            "IsTakeAwayColumn1": false,
            "IsTakeAwayColumn2": true,
            "IsTakeAwayColumn3": false,
            "IsTakeAwayColumn4": false,
            "IsTakeAwayColumn5": false,
            "IsTakeAwayColumn6": false,
            "ColumnColor1": "PaleGreen",
            "ColumnColor2": "Yellow",
            "ColumnColor3": "PaleGreen",
            "ColumnColor4": "PaleGreen",
            "ColumnColor5": "PaleGreen",
            "ColumnColor6": "PaleGreen",
            "Id": "637206765420183087"
        }
    ]
} 
Name Description Parmeter Type Data Type Required Default Constraints
offset Specifies the number of items that will be skipped before starting to return. Query-string 32-bit Integer/null No 0 Must be >= 0
fetch Specified the number of items to fetch after the offset has been skipped. Query-string 32-bit Integer/null No 100 Must be between 1 and 100

Fetch by MultiPriceList ID

REQUEST

curl -X GET "https://www.dinkassa.se/api/multipricelist/637206765420183087"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

{
    "Item": {
        "Description": "Pizza Vesuvio",
        "NumberOfColumns": 2,
        "ColumnName1": "Äta här",
        "ColumnName2": "Ta med",
        "ColumnName3": "",
        "ColumnName4": "",
        "ColumnName5": "",
        "ColumnName6": "",
        "IsTakeAwayColumn1": false,
        "IsTakeAwayColumn2": true,
        "IsTakeAwayColumn3": false,
        "IsTakeAwayColumn4": false,
        "IsTakeAwayColumn5": false,
        "IsTakeAwayColumn6": false,
        "ColumnColor1": "PaleGreen",
        "ColumnColor2": "Yellow",
        "ColumnColor3": "PaleGreen",
        "ColumnColor4": "PaleGreen",
        "ColumnColor5": "PaleGreen",
        "ColumnColor6": "PaleGreen",
        "Id": "637206765420183087"
    }
}     

Fetch the MultiPriceList by Id. Every Id-number is unique for each MultiPriceList. An Id-number is created automatically through the physical register (or the API) and cannot be set manually. Id is used to distinguish each MultiPriceList in the database.

MultiPriceItem

API ENDPOINT

https://www.dinkassa.se/api/multipriceitem

MultiPriceItems are not actual InventoryItems. A MultiPriceItem cannot exist without being directly connected to a MultiPriceList. A MultiPriceItem can only be created after creating a MultiPriceList. Each MultiPriceItem is defined in the register as a "Pricing level"; for example "Regular Pizza" or "Family Size Pizza". Each MultiPriceItem can be connected to an InventoryItem (mainly for stock-keeping and result tracking) and therefor pick up the price from the InventoryItem, or just be set up with a manual pre-defined price.

MultiPriceItem Fields

Field Read Only Type Default Description Constraints
MultiPriceListId Yes 64-bit Integer/null The ID of the connected MultiPriceList for which the MultiPriceItem is connected to. Always refers to an existing MultiPriceList
Description Yes String The name of the MultiPriceItem.
SortingWeight Yes 32-bit Integer The order of which the MultiPriceItem is visually presented in the MultiPriceList. Lower number = higher vertically Numerical value
PriceToUseColumn1-6 Yes Decimal/null The price of the MultiPriceItem for each column within the MultiPriceList. Numerical value
InventoryItemIdColumn1-6 Yes 64-bit Integer/null The InventoryItemId of the connected InventoryItem for each MultiPriceItem. Numerical value
Id Yes 64-bit Integer Unique identification number of each MultiPriceItem. Numerical value

Search MultiPriceItem

REQUEST

curl -X GET "https://www.dinkassa.se/api/multipriceitem"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

 "Items": [
     {
            "MultiPriceListId": 637206776564267789,
            "Description": "Family Size",
            "SortingWeight": 20,
            "PriceToUseColumn1": 100.0000000000,
            "PriceToUseColumn2": 90.0000000000,
            "PriceToUseColumn3": null,
            "PriceToUseColumn4": null,
            "PriceToUseColumn5": null,
            "PriceToUseColumn6": null,
            "InventoryItemIdColumn1": 637206771558031961,
            "InventoryItemIdColumn2": 637206771558031961,
            "InventoryItemIdColumn3": null,
            "InventoryItemIdColumn4": null,
            "InventoryItemIdColumn5": null,
            "InventoryItemIdColumn6": null,
            "Id": "637206776566034359"
        }
    ]
}
Name Description Parmeter Type Data Type Required Default Constraints
offset Specifies the number of items that will be skipped before starting to return. Query-string 32-bit Integer/null No 0 Must be >= 0
fetch Specified the number of items to fetch after the offset has been skipped. Query-string 32-bit Integer/null No 100 Must be between 1 and 100
multiPriceListId Used to filter levels for a specific MultiPriceList. Query-string 64-bit Integer/null No MultiPriceList must exist

Fetch by MultiPriceItem ID

REQUEST

curl -X GET "https://www.dinkassa.se/api/multipriceitem/637206776566034359"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

{
    "Item": {
        "MultiPriceListId": 637206776564267789,
        "Description": "Family Size",
        "SortingWeight": 20,
        "PriceToUseColumn1": 100.0000000000,
        "PriceToUseColumn2": 90.0000000000,
        "PriceToUseColumn3": null,
        "PriceToUseColumn4": null,
        "PriceToUseColumn5": null,
        "PriceToUseColumn6": null,
        "InventoryItemIdColumn1": 637206771558031961,
        "InventoryItemIdColumn2": 637206771558031961,
        "InventoryItemIdColumn3": null,
        "InventoryItemIdColumn4": null,
        "InventoryItemIdColumn5": null,
        "InventoryItemIdColumn6": null,
        "Id": "637206776566034359"
    }
}     

Fetch the MultiPriceItem by Id. Every Id-number is unique for each MultiPriceItem. An Id-number is created automatically through the physical register (or the API) and cannot be set manually. Id is used to distinguish each MultiPriceItem in the database.

Settings

API ENDPOINT

https://www.dinkassa.se/api/settings

api/Settings represents all global settings available through the API. These settings may be used to understand what to display on your application. At the moment, the only thing available in api/Settings is "Unit". Unit is what the default global unit of the POS system is set to. It could for example be kg, cl, l, g etc. depending on the preference of the customer.

The way api/settings is currently used is in our POS application called "WaiterApp". Within the waiter application you are able to select for example 1x 4cl of Vodka. The way this works is with PreSaleTransactionItem.QuantityPerPackage and PreSaleTransactionItem.Quantity.

Example: you want to sell 2 Vodka-shots with 4cl each; then you would set QuantityPerPackage to 4 and Quantity to 8 (total amount of cl sold) within the creating of PreSaleTransaction for each PreSaleTransactionItem.

Settings Fields

Field Read Only Type Default Description Constraints
Unit Yes String st Default global unit of the POS system. I.e kg, cl, l, g etc.

Search Settings

REQUEST

curl -X GET "https://www.dinkassa.se/api/settings"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"

RESPONSE

{
    "Unit": "st"
}

No search parameters such as offset or fetch available.

Session

API ENDPOINT

https://www.dinkassa.se/api/session

"Session" is an authorization of login to the Dinkassa.se API for a total of 12h from the time of login - no more, no less.

Session is used when an employee logs into a system for which he or she should have limited access to. Session is normally used for onsite applications. An example of an application using Session is the ES Kassasystem WaiterApp. The way the ES Kassasystem WaiteApp works is that the SessionKey is extracted directly from the POS system (per each employee) and entered as the login code in the WaiterApp. The SessionKey can only be used once. When it has been authorized one time it's then seen as used and will not work again. If the SessionKey has been lost by the employee, he or she need to request a new one directly from the POS system.
The ability to extract a SessionKey from the POS is available for all our POS systems using Windows 7 and upwards.

Session Authorization

Session is different from the regular setup of MachineId, MachineKey and IntegratorId. Session is authorized through the endpoint by setting the parameters "EmployeeId" and "MachineId" as a part of the request.

An authorized Session is visually presented as a 12-digit 32-bit Integer to the employee, while it internally contains a MachineId and an EmployeeId for the POS system is was extracted from.

When Session has been authorized, a GUID will be provided to you to be used together with a, From the ES Kassasystem API-team, provided IntegratorId.

Create New Session

REQUEST

curl -X POST "https://www.dinkassa.se/api/Session?employeeId=636900074226919670&MachineId=5712D2DB-D4EF-41A1-AFD1-F832594EAC8A"
        -H "Content-Type: application/json"
        -d '

RESPONSE

"654365432777"

Session can be created manually if necessary, even though this normally is done through the POS, whereas the POS contacts the API to retreive the SessionKey. As previously mentioned; to be able to create a Session, an EmployeeId and a MachineId is required. If your integration plan consists of only using one single employee at all times, then the creating of Session is not for your type of integration. Details can be provided to you from the ES Kassasystem API-team.

What you are presented with after creating a Session is the 12-digit SessionKey. Use this SessionKey in the next step; Authentication.

Authenticate Session

REQUEST

curl -X POST "https://www.dinkassa.se/api/Session"
        -H "Content-Type: application/json"
        -d '
"654365432777"

RESPONSE

{
    "Id": "200eff42-dda1-4159-b649-c5f1767ce23f",
    "Type": 1,
    "EmployeeId": "636900074226919670",
    "ExpiresDateTime": "2020-03-28T08:31:26.373"
}

When authenticating a previously created Session, all you need to input in the body is just the SessionKey. The API is listening for the provided SessionKey for 12h from the time it was created. When the SessionKey is activated via authentication, the API responds with a unique SessionId-number. With this Id-number, you will be able to use the API to it's fullest with all other type of requests. The Id-number is still just active for the limited amount of time from the orginal SessionKey creation. See example below on how to, for example, create a PreSaleTransaction using the SessionId and your previously provided IntegratorId.

Create New Order

REQUEST

curl -X POST "https://www.dinkassa.se/api/PreSaleTransaction"
        -H "SessionId: 200eff42-dda1-4159-b649-c5f1767ce23f"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '
{
    "Item": {
        "EmployeeId": "636900074226919670",
        "State": 4,
        "TransactionName": "TABLE 1",
        "ParkingId": "636874593402171667",
        "Items": [
            {
                "Quantity": 1,
                "InventoryItemId": "636874601642150005"
            }
        ],
        "Payments": []
    }
}

RESPONSE

{
    "Item": {
        "ExternalReference1": null,
        "TransactionName": "TABLE 1",
        "ExternalOrderContactInfo": null,
        "State": 4,
        "Items": [
            {
                "ExternalReference1": null,
                "IsTakeAway": false,
                "ExtraInformation": "",
                "PricePerItemIncludingVat": 175.00,
                "DiscountAllowed": true,
                "CreatedDateTime": "2020-03-29T23:14:45.89181",
                "LastModifiedDateTime": "2020-03-29T23:14:45.89181",
                "VatPercentage": 12.0000000000,
                "TotalDiscount": 0.0,
                "Quantity": 1.0,
                "QuantityPerPackage": 1.0,
                "ParentItemId": null,
                "BongCategoryId": "636874594496479772",
                "InventoryItemDescription": "Chicken & Cheese quesadilla",
                "InventoryItemId": "636874601642150005",
                "Id": "637211168855298783"
            }
        ],
        "Payments": [],
        "EmployeeId": "636900074226919670",
        "CreatedDateTime": "2020-03-29T23:14:45.89181",
        "LastModifiedDateTime": "2020-03-29T23:14:45.9074388",
        "ParkingId": "636874593402171667",
        "Id": "637211168855265546"
    }
}

Creating a new order (PreSaleTransaction) with a SessionId is no different than creating a PreSaleTransaction with MachineId, MachineKey and IntegratorId. This is just a simple example using SessionId instead. If needed, please see the section PreSaleTransaction for more in-depth information.

In the Headers, the SessionId and IntegratorId are provided instead.

RequestKey (Param)

REQUEST

curl -X POST "https://www.dinkassa.se/api/employee?requestKey=AFDA6368-6C91-45E6-A309-4900986A5215"
        -H "MachineId: 9DD39BBF-8E67-4C07-825A-0845F8176075"
        -H "MachineKey: 3E836351-5E66-496A-9BF1-91053CDAFDB5"
        -H "IntegratorId: 1CF3DD98-787F-4ER4-9681-ADE1D1A408C2"
        -H "Content-Type: application/json"
        -d '
{
    "Item" : {
        "EmployeeCode" : "3",
        "Name" : "Niclas Persson",
        "EmployeePassword" : "1234",
    }
}'

RESPONSE

The requestKey (AFDA6368-6C91-45E6-A309-4900986A5215) has already been received.

RequestKey is not an endpoint in itself but rather a parameter, however, it's important enough to be given notice within it's own section of the API documentation.

In order to avoid getting for example duplicate orders (PreSaleTransaction), the Dinkassa.se API support idempotent requests for all API methods. The request requires a GUID/UUID to be provided as a query-string named “requestKey”.

With all requests, and especially for PreSaleTransaction, you add the requestKey and provide a new GUID/UUID for each request. if you get an error back on the request you can safely retry using the same GUID/UUID. If it has already been used then HTTP code 409 will be returned with an error message and you will know that the previous request succeeded.

For an example of how this is used within PreSaleTransaction, please see PreSaleTransaction under "Create new PreSaleTransaction". The approach is exactly the same for all API methods. In this section, an example of a declined API rqequest for the creation of an Employee with a previously used RequestKey is presented.

If the previous request was already accepted, HTTP code 409 will be returned. If not, HTTP 200 would be returned and you know the new request has been accepted.

Make sure you generate a new GUID/UUID for each request. A previously used GUID/UUID can never be used again and will immediately return 409.

Errors

The Dinkassa.se API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized
403 Forbidden -- The request is hidden for administrators only.
404 Not Found
405 Method Not Allowed
406 Not Acceptable -- You requested a format that isn't json.
409 RequestKey provided has already been received and may not be used again or the requestkey is not a valid GUID/UUID.
410 Gone
429 Too Many Requests
500 Internal Server Error -- Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.