External Api v2

OnlinePOS Api v2
https://api.onlinepos.dk/api
Fejlkoder & Beskeder

Gælder for alle kald:

Fejlkoder er i form af http status koder.

403 Forbidden Firmaid og token er ugyldige; betyder at du ikke har tilladelse til kaldet eller hashen ikke er korrekt.

Ved 403 er der typisk en nærmere forklaring for fejen i svarets body. 500 Internal Server Error; betyder der er sket en anden uventet fejl

Gælder for campaign api kald:

Når JSON er valgt som responstype

Ved et successfuldt kald returneres et json objekt med følgende struktur:

content_copy { "status": "Card successfully Activated!" } Hvor status kan enten være en besked om handlingen der blev udført, eller andet forventet svar fra kaldet. Herunder er et eksempel fra campaignList.

content_copy { "status": { "Campaigns": [ { "campaign": { "campaignID": 26, "campaignName": "asd", "free_split": 0, "free_msg": 0, "auto_add": 0, "info_view": 0 } }, ] } Ved et fejlet kald returneres et json objekt med følgende struktur:

content_copy { "ERROR": "Unknown Card - ActivateCard" } Hvor ERROR er en fejbesked samt hvilket kald fejlen er sket ved. I dette eksempel er fejlen sket ved “ActivateCard” kaldet.

Product

API calls for Product functionality

GET /getProducts
POST /addProduct
GET /getProductStructure
Get products
GET /getProducts

Get products

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Responses

200 200

OK

Body
application/xml
application/json
Array
Object
ID
integer

The product id

name
string

The product name

groupid
string

The product group id

groupname
string

The product group name

price_1
string

Price 1

price_2
string

Price 2

price_3
string

Price 3

price_4
string

Price 4

price_5
string

Price 5

cost_price
string

The cost price

standard_price
string

The standard price

categories
Array

list of categories the product appears in

Object
category_id
string

the id of the category

category_name
string

the name of the category

additional_price_groups
Object

array of pricegroups indexed by their group number

group_number
Object

individual group number for each pricegroup

price
string
Example:
6
name
string
Example:
5th
description
string

Product description

Examples

JSON Response

[
    {
        "ID": 1,
        "name": "",
        "groupid": "",
        "groupname": "",
        "price_1": "",
        "price_2": "",
        "price_3": "",
        "price_4": "",
        "price_5": "",
        "cost_price": "",
        "standard_price": "",
        "categories": [
            {
                "category_id": "",
                "category_name": ""
            }
        ],
        "additional_price_groups": {
            "6": {
                "price": "25",
                "name": "middag"
            }
            "8": {
                "price": "60",
                "name": "aften"
            }
        },
        "description": ""
    }
]

XML Response

<?xml version="1.0" encoding="ISO-8859-1"?>
<list>
	<products>
		<product id="0">
		</product>
		<product_group id="0">
		</product_group>
		<price price_1="string" price_2="string" price_3="string" price_4="string" price_5="string">
		</price>
		<indkbspris>string</indkbspris>
        <categories>
            <category id="123" name="category_1" />
            <category id="456" name="category_1" />
        </categories>
        <additional_price_groups>
            <price_group id="6" price="25" name="middag" />
            <price_group id="8" price="60" name="aften" />
        </additional_price_groups>
		<normalpris>string</normalpris>
		<description></description>
	</products>
</list>
New product
POST /addProduct

Create a new product

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Request body

application/x-www-form-urlencoded
Object
hash
string required

HMAC hash of the request values Read more

productname
string required

The produkt name

Pattern: Faxe Kondi 33cl
productgroup
string required

The name of the product group the product should belong to. A new group will be created if the name does not exsist.

Example:
Sodavand
price
integer

The price of the produkt

Example:
15
costprice
integer

The cost price of the product

Example:
6

Responses

200 OK
Body
application/xml
Object
Examples

Successfull response returns a status message

<?xml version="1.0" encoding="ISO-8859-1"?>
<status> Product 123456 created </status>

Unsuccessfull response returns a fail with a message

<?xml version="1.0" encoding="ISO-8859-1"?>
<fail> No product name </fail>
Example 1
POST https://api.onlinepos.dk/api/addProduct HTTP/1.1 

token: <company token>
firmaid: <company id>
Content-Type: application/x-www-form-urlencoded

hash=
&productname=
&productgroup=Sodavand
&price=15
&costprice=6
Get Product Structure
GET /getProductStructure

Get products

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Responses

200 200

OK

Body
application/json
Object
ProductGroups
Array

List of active product groups

Object
ProductGroupID
integer

ID of product group

Example:
1234
ProductGroupName
string

Name of product group

Example:
Fruits
ProductGroupDescription
string

Description of product group

Example:
Fresh fruits
Products
Array

List of products in product group

Object
ProductID
integer

ID of product

Example:
1234
ProductName
string

Name of Product

Example:
Banana
ProductPrice
number

Price of product

Example:
14.95
ProductDescription
string

Description of product

Example:
Banana
ProductCostPrice
number

Cost price of product

Example:
5.44
ProductCategories
Array

Product Categories of product

Object
CategoryID
integer

ID of category

Example:
1234
CategoryName
string

Name of category

Example:
Fresh Produce
EAN_1
string

Custom PLU 1

Example:
A123E21
EAN_2
string

Custom PLU 2

Example:
B8979F22
MasterID
integer

ID of the Master of this product. (0 means no master)

Examples:
12340
AdditionalPriceGroups
Array

Other registered prices (if any exists)

Object
PriceGroupNumber
string

Pricegroup number

Example:
3
PriceGroupName
string

Name of pricegroup

Example:
'Early bird'
PriceGroupValue
number

Price of product when pricegroup is active

Example:
8.93
ProductSplit
Array

If the product is a split product (it contains sub products), then this list shows its content.

Object
ProductID
integer

ID of sub product

Example:
1234
Amount
number

Amount of sub product added

Example:
3
Price
number

Total sales price of sub products (line price, not a unit price)

Example:
34.55
ProductMSG
integer

If the product is a MSG product, then this contains the ID of the MSG page connected to the product

Example:
1234
MSGPages
Array

List of all MSG pages

Object
MSG_ID
integer

ID of MSG Page

Example:
1234
MSG_Name
string

Name of MSG page

Example:
'Choice of drink'
MSG_Min
integer

Minimum number of selections required

Example:
0
MSG_Max
string

Maximum number of selections allowed

Example:
4
MSG_Price
number

If this field is present, then the total price of all selections should be this value

Example:
33.66
MSG_Default
string

If field is present, contains the Product ID(s) of default selections.

Example:
1234:5678
MSG_Options
Array of integer

List of Product ID’s available for selection

Examples

JSON Response

Sales

API calls for Sales functionality

GET /debtorExportSales/{from}/{to}
GET /getByUnixTimeSales/{from}/{to}
GET /exportSales/v20
GET /exportSales/v20/{date}
GET /exportSales/v20/withId/{orderid}
List debtor sales
GET /debtorExportSales/{from}/{to}

Get list of debtor sales

Path variables

from
string required

Start of the period in unix time

to
string required

End of the period in unix time

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Responses

200 OK
application/xml
List of sales
GET /getByUnixTimeSales/{from}/{to}

There can be multiple locations

Path variables

from
string required

Start of the period in unix time

to
string required

End of the period in unix time

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Responses

200 OK
Body
application/json
application/xml
Object
period
string

2016.01.01 00:00:00 - 2018.07.24 00:00:00

location
Array
Object
userid
integer
amount
number
pax
string
Examples

Xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<XML>
	<period>string</period>
	<location>
		<userId>1</userId>
		<amount>2</amount>
		<pax>2</pax>
	</location>
</XML>

Json

{
    "period": "2016.01.01 00:00:00 - 2018.07.24 00:00:00",
    "location": [
        {
            "userid": 1,
            "amount": 1.1,
            "pax": "0"
        }
    ]
}
List sales from department or cardnumber
POST /exportSales

Get list of sales for a specific department or cardnumber

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Request body

application/x-www-form-urlencoded

Unix time

Unix time represents the seconds passed since Jan 01 1997.


Using unix time

Most programming languages have built in functions for converting a date to unix time.

You can also use an online tool like unixtimestamp.com

Object
from
string required

Start of the period in unix time

Example:
1597141149
to
string required

End of the period in unix time

Example:
1597100000
department
string

Get all sales from a specific terminal or group of terminals. Department is the name of the terminal(s)

Example:
kasse 1
cardnumber
integer

Get all sales from a specific cardnumber

Example:
1234567890
map_to_koncern
boolean

Whether to map product- and group-ids to the koncern ids

Default:
false

Responses

200 OK

Response in JSON

Body
application/json
Object
sales
Array
Object
line
Object
id
integer
chk
integer
date
string

dd.mm.yyyy

time
string

hh:mm

product_id
integer

If map_to_koncern is enabled this will show the id from the koncern

product
string
product_group_id
integer

If map_to_koncern is enabled this will show the id from the koncern

product_group
string
amount
integer
price
string
payment_type
string

The method of payment for the sale.

clerk
string
pax
integer

Number of guests involved with the sale.

department
string

The terminal or group of terminals a sale was made from.

ean_1
string

Product id

ean_2
string

Manufacturer product id

ean_3
string
ean_4
string
Examples

Successfull response returns an array of lines representing individual sales

{
    "sales": [
        {
            "line": {
                "id": 1,
                "chk": 1,
                "date": "15.03.2016",
                "time": "17:00",
                "product_id": 1,
                "product": "",
                "product_group_id": 1,
                "product_group": "",
                "amount": 1,
                "price": "10,00",
                "payment_type": "",
                "clerk": "",
                "pax": 1,
                "department": "",
                "ean_1": "",
                "ean_2": "",
                "ean_3": "",
                "ean_4": ""
            }
        }
    ]
}

Unsuccessfull response returns an error key with a message

{
    "error": "Input fail!"
}
200 OK

Response in XML (Default)

application/xml
Example 1
POST https://api.onlinepos.dk/api/exportSales HTTP/1.1 

token: <company token>
firmaid: <company id>
Content-Type: application/x-www-form-urlencoded
Accept: application/json

from=1597141149
&to=1597100000
&department=kasse 1
&cardnumber=1234567890
List of sales extended
GET /exportSales/v20

Get extended list of sales grouped by order lines

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Responses

200 Sales extended response
Body
Object
current_page
integer
Example:
1
data
Array
Object
datetime
string
Example:
2014-03-08 00:09:20
timestamp_pay
string

Timestamp for payment of the order line

Example:
2014-03-08 00:09:20
timestamp_order
string

Timestamp for when order is created

Example:
2014-03-08 00:09:20
orderlineid
integer

The ID of the order line

Example:
23410534
orderid
integer

The ID of the order that the order line is related to

Example:
15039525
chkno
integer

OnlinePOS check number

Example:
2039
productid
integer

The ID of the product on the order line

Example:
74631
productname
string

The name of the product on the order line

Example:
Stor Fadøl - BAR
account
string

Account

Example:
1616
MasterID
integer

ID of the Master of this product. (0 means no master)

Example:
12345678
accountnumber
string

Account number

Example:
1010
productgroupid
integer

The ID of the product group that the product is related to

Example:
4109
productgroup
string

The name of the product group that the product is related to

Example:
Øl - BAR
ean_1
string

EAN 1

Example:
649528775290
ean_2
string

EAN 2

ean_3
string

EAN 3

ean_4
string

EAN 4

count
integer

The amount of product sold on the order line

Example:
1
price
integer

The price/value of the order line

Example:
45
priceexclvat
integer

The price/value of the order line excl. VAT

Example:
45
costprice
integer

The cost price of the product

vatrate
string

The VAT rate related to the order line

discount
integer

The discount given on the order line

paymenttype
string

The payment type for the order line

Example:
Kontant
paymenttypecode
string

The payment type ID for the order line

Example:
k
clerk
string

The clerk who received payment for the order line

Example:
0
ordernumber
integer

The order number that the order line is related to

Example:
2039
pax
integer

The number of guests registred on the order

pid
string
table
string

The table number that the order line is related to

department
string

The terminal that the order line is sold on

Example:
Kasseterminal
firmaid
integer

The OnlinePOS customer number that the order line is registred on

Example:
9000
companyname
string

The name of the company

Example:
OnlinePOS Udvikling
cardnumber
string nullable

Card number

cardcountry
string

The country that the card is related to

pnumber
string

OnlinePOS pnumber (employee number)

Example:
0
debtornumber
string

The debtor number

debtorname
string

The name of the debtor

from
integer
Example:
1
next_page_url
string
Example:
http://api.onlinepos.dk/api/exportSales/v20?page=2
path
string
Example:
http://api.onlinepos.dk/api/exportSales/v20
per_page
integer
Example:
10000
prev_page_url
string nullable
Example:
http://api.onlinepos.dk/api/exportSales/v20?page=1
to
integer
Example:
10000
Examples
{
    "current_page": 1,
    "data": [
        {
            "datetime": "2014-03-08 00:09:20",
            "timestamp_pay": "2014-03-08 00:09:20",
            "timestamp_order": "2014-03-08 00:09:20",
            "orderlineid": 23410534,
            "orderid": 15039525,
            "chkno": 2039,
            "productid": 74631,
            "productname": "Stor Fadøl - BAR",
            "account": "1616",
            "MasterID" : 0,
            "accountnumber": "1010",
            "productgroupid": 4109,
            "productgroup": "Øl - BAR",
            "ean_1": "649528775290",
            "ean_2": "",
            "ean_3": "",
            "ean_4": "",
            "count": 1,
            "price": 45,
            "priceexclvat": 45,
            "costprice": 1,
            "vatrate": "",
            "discount": 1,
            "paymenttype": "Kontant",
            "paymenttypecode": "k",
            "clerk": "0",
            "ordernumber": 2039,
            "pax": 1,
            "pid": "",
            "table": "",
            "department": "Kasseterminal",
            "firmaid": 9000,
            "companyname": "OnlinePOS Udvikling",
            "cardnumber": "",
            "cardcountry": "",
            "pnumber": "0",
            "debtornumber": "",
            "debtorname": ""
        }
    ],
    "from": 1,
    "next_page_url": "http://api.onlinepos.dk/api/exportSales/v20?page=2",
    "path": "http://api.onlinepos.dk/api/exportSales/v20",
    "per_page": 10000,
    "prev_page_url": "http://api.onlinepos.dk/api/exportSales/v20?page=1",
    "to": 10000
}
List of sales extended with date
GET /exportSales/v20/{date}

Get extended list of sales grouped by order lines and date

Path variables

date
integer required

Get data from date and forward. type UNIX Timestamp

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Responses

200 Sales extended response
Body
Object
current_page
integer
Example:
1
data
Array
Object
datetime
string
Example:
2014-03-08 00:09:20
timestamp_pay
string

Timestamp for payment of the order line

Example:
2014-03-08 00:09:20
timestamp_order
string

Timestamp for when order is created

Example:
2014-03-08 00:09:20
orderlineid
integer

The ID of the order line

Example:
23410534
orderid
integer

The ID of the order that the order line is related to

Example:
15039525
chkno
integer

OnlinePOS check number

Example:
2039
productid
integer

The ID of the product on the order line

Example:
74631
productname
string

The name of the product on the order line

Example:
Stor Fadøl - BAR
account
string

Account

Example:
1616
MasterID
integer

ID of the Master of this product. (0 means no master)

Example:
12345678
accountnumber
string

Account number

Example:
1010
productgroupid
integer

The ID of the product group that the product is related to

Example:
4109
productgroup
string

The name of the product group that the product is related to

Example:
Øl - BAR
ean_1
string

EAN 1

Example:
649528775290
ean_2
string

EAN 2

ean_3
string

EAN 3

ean_4
string

EAN 4

count
integer

The amount of product sold on the order line

Example:
1
price
integer

The price/value of the order line

Example:
45
priceexclvat
integer

The price/value of the order line excl. VAT

Example:
45
costprice
integer

The cost price of the product

vatrate
string

The VAT rate related to the order line

discount
integer

The discount given on the order line

paymenttype
string

The payment type for the order line

Example:
Kontant
paymenttypecode
string

The payment type ID for the order line

Example:
k
clerk
string

The clerk who received payment for the order line

Example:
0
ordernumber
integer

The order number that the order line is related to

Example:
2039
pax
integer

The number of guests registred on the order

pid
string
table
string

The table number that the order line is related to

department
string

The terminal that the order line is sold on

Example:
Kasseterminal
firmaid
integer

The OnlinePOS customer number that the order line is registred on

Example:
9000
companyname
string

The name of the company

Example:
OnlinePOS Udvikling
cardnumber
string nullable

Card number

cardcountry
string

The country that the card is related to

pnumber
string

OnlinePOS pnumber (employee number)

Example:
0
debtornumber
string

The debtor number

debtorname
string

The name of the debtor

from
integer
Example:
1
next_page_url
string
Example:
http://api.onlinepos.dk/api/exportSales/v20?page=2
path
string
Example:
http://api.onlinepos.dk/api/exportSales/v20
per_page
integer
Example:
10000
prev_page_url
string nullable
Example:
http://api.onlinepos.dk/api/exportSales/v20?page=1
to
integer
Example:
10000
Examples
{
    "current_page": 1,
    "data": [
        {
            "datetime": "2014-03-08 00:09:20",
            "timestamp_pay": "2014-03-08 00:09:20",
            "timestamp_order": "2014-03-08 00:09:20",
            "orderlineid": 23410534,
            "orderid": 15039525,
            "chkno": 2039,
            "productid": 74631,
            "productname": "Stor Fadøl - BAR",
            "account": "1616",
            "MasterID" : 0,
            "accountnumber": "1010",
            "productgroupid": 4109,
            "productgroup": "Øl - BAR",
            "ean_1": "649528775290",
            "ean_2": "",
            "ean_3": "",
            "ean_4": "",
            "count": 1,
            "price": 45,
            "priceexclvat": 45,
            "costprice": 1,
            "vatrate": "",
            "discount": 1,
            "paymenttype": "Kontant",
            "paymenttypecode": "k",
            "clerk": "0",
            "ordernumber": 2039,
            "pax": 1,
            "pid": "",
            "table": "",
            "department": "Kasseterminal",
            "firmaid": 9000,
            "companyname": "OnlinePOS Udvikling",
            "cardnumber": "",
            "cardcountry": "",
            "pnumber": "0",
            "debtornumber": "",
            "debtorname": ""
        }
    ],
    "from": 1,
    "next_page_url": "http://api.onlinepos.dk/api/exportSales/v20?page=2",
    "path": "http://api.onlinepos.dk/api/exportSales/v20",
    "per_page": 10000,
    "prev_page_url": "http://api.onlinepos.dk/api/exportSales/v20?page=1",
    "to": 10000
}
List of sales extended with order id
GET /exportSales/v20/withId/{orderid}

Get extended list of sales grouped by order lines and starting order ID

Path variables

orderid
integer required

Get data from order id and forward

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Responses

200 Sales extended response
Body
Object
current_page
integer
Example:
1
data
Array
Object
datetime
string
Example:
2014-03-08 00:09:20
timestamp_pay
string

Timestamp for payment of the order line

Example:
2014-03-08 00:09:20
timestamp_order
string

Timestamp for when order is created

Example:
2014-03-08 00:09:20
orderlineid
integer

The ID of the order line

Example:
23410534
orderid
integer

The ID of the order that the order line is related to

Example:
15039525
chkno
integer

OnlinePOS check number

Example:
2039
productid
integer

The ID of the product on the order line

Example:
74631
productname
string

The name of the product on the order line

Example:
Stor Fadøl - BAR
account
string

Account

Example:
1616
MasterID
integer

ID of the Master of this product. (0 means no master)

Example:
12345678
accountnumber
string

Account number

Example:
1010
productgroupid
integer

The ID of the product group that the product is related to

Example:
4109
productgroup
string

The name of the product group that the product is related to

Example:
Øl - BAR
ean_1
string

EAN 1

Example:
649528775290
ean_2
string

EAN 2

ean_3
string

EAN 3

ean_4
string

EAN 4

count
integer

The amount of product sold on the order line

Example:
1
price
integer

The price/value of the order line

Example:
45
priceexclvat
integer

The price/value of the order line excl. VAT

Example:
45
costprice
integer

The cost price of the product

vatrate
string

The VAT rate related to the order line

discount
integer

The discount given on the order line

paymenttype
string

The payment type for the order line

Example:
Kontant
paymenttypecode
string

The payment type ID for the order line

Example:
k
clerk
string

The clerk who received payment for the order line

Example:
0
ordernumber
integer

The order number that the order line is related to

Example:
2039
pax
integer

The number of guests registred on the order

pid
string
table
string

The table number that the order line is related to

department
string

The terminal that the order line is sold on

Example:
Kasseterminal
firmaid
integer

The OnlinePOS customer number that the order line is registred on

Example:
9000
companyname
string

The name of the company

Example:
OnlinePOS Udvikling
cardnumber
string nullable

Card number

cardcountry
string

The country that the card is related to

pnumber
string

OnlinePOS pnumber (employee number)

Example:
0
debtornumber
string

The debtor number

debtorname
string

The name of the debtor

from
integer
Example:
1
next_page_url
string
Example:
http://api.onlinepos.dk/api/exportSales/v20?page=2
path
string
Example:
http://api.onlinepos.dk/api/exportSales/v20
per_page
integer
Example:
10000
prev_page_url
string nullable
Example:
http://api.onlinepos.dk/api/exportSales/v20?page=1
to
integer
Example:
10000
Examples
{
    "current_page": 1,
    "data": [
        {
            "datetime": "2014-03-08 00:09:20",
            "timestamp_pay": "2014-03-08 00:09:20",
            "timestamp_order": "2014-03-08 00:09:20",
            "orderlineid": 23410534,
            "orderid": 15039525,
            "chkno": 2039,
            "productid": 74631,
            "productname": "Stor Fadøl - BAR",
            "account": "1616",
            "MasterID" : 0,
            "accountnumber": "1010",
            "productgroupid": 4109,
            "productgroup": "Øl - BAR",
            "ean_1": "649528775290",
            "ean_2": "",
            "ean_3": "",
            "ean_4": "",
            "count": 1,
            "price": 45,
            "priceexclvat": 45,
            "costprice": 1,
            "vatrate": "",
            "discount": 1,
            "paymenttype": "Kontant",
            "paymenttypecode": "k",
            "clerk": "0",
            "ordernumber": 2039,
            "pax": 1,
            "pid": "",
            "table": "",
            "department": "Kasseterminal",
            "firmaid": 9000,
            "companyname": "OnlinePOS Udvikling",
            "cardnumber": "",
            "cardcountry": "",
            "pnumber": "0",
            "debtornumber": "",
            "debtorname": ""
        }
    ],
    "from": 1,
    "next_page_url": "http://api.onlinepos.dk/api/exportSales/v20?page=2",
    "path": "http://api.onlinepos.dk/api/exportSales/v20",
    "per_page": 10000,
    "prev_page_url": "http://api.onlinepos.dk/api/exportSales/v20?page=1",
    "to": 10000
}
Card

API calls for Card functionality

GET /getCard/{cardnumber}
GET /getCardsList/{debtor}/{type}/{offset}
GET /getCardForKoncern/{cardnumber}
GET /getCards/{offset}
GET /card/getStatusOfCards
GET /card/getCampaignValues
POST /addCard
POST /addCards
POST /editCard
POST /card/editCards
POST /deposit
GET /createVoucher
POST /createVoucherFromInterval
GET /getCardMovements/{firmaid}/{from}/{to}
GET /getCardHistory/{cardnumber}
Get card by cardnumber
GET /getCard/{cardnumber}

Get card info from card number

Path variables

cardnumber
string required

The card number

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

To return json use application/json, default return xml

Responses

200 200

OK

Body
application/xml
application/json
Examples

Xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<list>
    <card>
        <id>1</id>
        <name>John Smith</name>
        <phone>88888888</phone>
        <email>example@email.com</email>
        <debtor></debtor>
        <cardgroup> Kvartkort </cardgroup>
        <RFID></RFID>
        <cardnumber>090000100000000</cardnumber>
        <cardtype>Default</cardtype>
        <balance>100,00</balance>
        <deleted>yes</deleted>
    </card>
</list>

Json

[
    {
        "id": 1,
        "name": "",
        "phone": 1,
        "email": "example@email.com"
        "debtor": "",
        "cardgroup": "",
        "RFID": "",
        "cardnumber": "",
        "cardtype": "",
        "balance": "",
        "deleted": ""
    }
]
Get cards by debtor and type
GET /getCardsList/{debtor}/{type}/{offset}

Get card list by debtor and type, return 1000 cards start from offset

Path variables

debtor
string required

Customer’s debtor number

type
string required

The type must be between 1-3

Enumeration:
1

Staff card

2

Prepaid card

3

Giftcard

offset
integer optional

if not set default = 0

Default:
0

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

To return json use application/json, default return xml

Responses

200 200

OK

Body
application/xml
application/json
Examples

Xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<list>
	<card>
		<id>0</id>
		<name>string</name>
		<phone>string</phone>
		<debtor>string</debtor>
		<cardgroup>string</cardgroup>
		<RFID>string</RFID>
		<cardnumber>string</cardnumber>
		<cardtype>string</cardtype>
		<balance>string</balance>
		<deleted>string</deleted>
	</card>
</list>

Json

[
    {
        "id": 1,
        "name": "",
        "phone": 1,
        "debtor": "",
        "cardgroup": "",
        "RFID": "",
        "cardnumber": "",
        "cardtype": "",
        "balance": "",
        "deleted": ""
    }
]
Get koncern card by card number
GET /getCardForKoncern/{cardnumber}

Get card info for a card within the koncern.

Path variables

cardnumber
string required

The card number

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Responses

200 200

OK

Body
application/xml
application/json
Object
id
string

The card id

name
string

The card name

phone
string

The card holders phone

debtor
string
pinkode
string

The card pin code

cardgroup
string

The card group

RFID
string

The cards RFID if it has one

cardnumber
string

The card number

cardtype
string

The type of card

balance
string

The balance on the card if it has one

Examples

Xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<card>
	<id>0</id>
	<name>string</name>
	<phone>string</phone>
	<debtor>string</debtor>
	<pinkode>string</pinkode>
	<cardgroup>string</cardgroup>
	<RFID>string</RFID>
	<cardnumber>string</cardnumber>
	<cardtype>string</cardtype>
	<balance>string</balance>
</card>

Json

{
    "id": "",
    "name": "",
    "phone": "",
    "debtor": "",
    "pinkode": "",
    "cardgroup": "",
    "RFID": "",
    "cardnumber": "",
    "cardtype": "",
    "balance": ""
}
Get cards
GET /getCards/{offset}

Returns 1000 cards, starting from the defined offset. Offset default is 0.

Path variables

offset
integer optional

if not set default = 0

Default:
0

Request parameters

filter[email]
string optional

Filter results to only show cards with this registered email

Example:
example@email.com
filter[mobile]
string optional

Filter results to only show cards with this registered phone number

Example:
888888

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

To return json use application/json, default return xml

Responses

200 200

OK

Body
application/xml
application/json
Examples

Xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<list>
    <card>
        <id>1</id>
        <name>John Smith</name>
        <phone>88888888</phone>
        <email>example@email.com</email>
        <debtor></debtor>
        <cardgroup> Kvartkort </cardgroup>
        <RFID></RFID>
        <cardnumber>090000100000000</cardnumber>
        <cardtype>Default</cardtype>
        <balance>100,00</balance>
        <deleted>yes</deleted>
    </card>
    <card>
        <id>2</id>
        <name>John Smith</name>
        <phone>88888888</phone>
        <email>example@email.com</email>
        <debtor></debtor>
        <cardgroup>Personale</cardgroup>
        <RFID></RFID>
        <cardnumber>9000010000</cardnumber>
        <cardtype>Default</cardtype>
        <balance>100,00</balance>
        <deleted>no</deleted>
    </card>
</list>

Json

[
    {
        "id": 1,
        "name": "",
        "phone": 1,
        "email": "",
        "birthday": 19950101,
        "debtor": "",
        "discount": "20",
        "cardgroup": "",
        "RFID": "",
        "cardnumber": "",
        "cardtype": "",
        "balance": "",
        "deleted": ""
    }
]
Get cards with extended information
GET /card/getStatusOfCards

Get a list of cards for a customer/koncern with extended card information on each card. Koncern-feature needs to be enabled on the customer to find cards throughout the koncern.

Request parameters

cardNumbers
array of string optional

Only list cards with a card number existing in this comma separated list.

Collection format: csv
Example:
012341234123413,012341234123414
fromCardNumber
string optional

Only list cards with card numbers equal to or higher than this card number.

Example:
012341234123413
toCardNumber
string optional

Only list cards with card numbers equal to or lower than this card number.

Example:
012341234123416
groups
array of string optional

Only list cards with a card group name existing in this comma separated list.

Collection format: csv
Example:
VIP,Special guest
lookForClosed
boolean optional

If closed cards should be included in the list or not.

Default:
false
page
integer optional

The current page in a paginated results.

Default:
1
Example:
10

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Responses

200 OK

A non-paginated result was returned.

Body
Object
data
Array
Object
id
integer required

The card’s database id

Example:
1
cardNumber
string required

The card’s number

Example:
12345435453
name
string required

The name of the card’s owner

Example:
John Doe
phone
string nullable

The phone number of the card’s owner

Example:
86123456
debtor
string nullable

The card’s debtor

Example:
1234
pincode
string nullable

The card’s pincode

Example:
1234
RFID
string nullable

The card’s RFID

Example:
13123214324324324
cardGroupName
string nullable

The name of the card’s card group

Example:
VIP
priceGroupNo
integer nullable

The card’s price group

Example:
1
discountPct
integer nullable

The card’s discount in pct

Example:
25
firmaid
integer nullable

The firmaid the card belongs to. Only given when a card is in a koncern.

waiterId
integer nullable

The id of the waiter

Example:
1
balance
number

The card’s balance

Example:
25.5
cardType
string required

The card’s type. Se values in examples.

Examples:
DefaultPrepaidGift card
closed
boolean

False if the card is active. True if the card is closed or deleted. Note that “closed” cards will only appear if lookForClosed = true in request.

Example:
false
204 No Content

No cards were found with the filters used!

206 Partial Content

A paginated result was returned. Page size = 50.

Body
Object
total
integer

The total number of pages in the paged result

Example:
200
perPage
integer

The number of cards in every page of the paged result

Example:
50
currentPage
integer

The current page returned in the page result

lastPage
integer

The last page in the paged result

data
Array

The cards of the current page in the paged result

Object
id
integer required

The card’s database id

Example:
1
cardNumber
string required

The card’s number

Example:
12345435453
name
string required

The name of the card’s owner

Example:
John Doe
phone
string nullable

The phone number of the card’s owner

Example:
86123456
debtor
string nullable

The card’s debtor

Example:
1234
pincode
string nullable

The card’s pincode

Example:
1234
RFID
string nullable

The card’s RFID

Example:
13123214324324324
cardGroupName
string nullable

The name of the card’s card group

Example:
VIP
priceGroupNo
integer nullable

The card’s price group

Example:
1
discountPct
integer nullable

The card’s discount in pct

Example:
25
firmaid
integer nullable

The firmaid the card belongs to. Only given when a card is in a koncern.

waiterId
integer nullable

The id of the waiter

Example:
1
balance
number

The card’s balance

Example:
25.5
cardType
string required

The card’s type. Se values in examples.

Examples:
DefaultPrepaidGift card
closed
boolean

False if the card is active. True if the card is closed or deleted. Note that “closed” cards will only appear if lookForClosed = true in request.

Example:
false
400 Bad input

Bad input was set in one of the parameters.

403 Forbidden

Hash Not Matching! or You don’t have access to this call! or User not found!

Example 1

Get a list cards with status(incl. closed) in the koncern of the company with no 1234, where the card group is either “VIP” or “Special guest” and the card number is equal to or higher than “012341234123413”. Show page 2 of the paginated result.

GET https://api.onlinepos.dk/api/getStatusOfCards?from_number=012341234123413&look_for_closed=1&page=7&groups=VIP,Special guest HTTP/1.1 

token: 8cd120a338e7b0335c5c2f853ac55f2aa459e5ca64013c48d0043935202672f1
firmaid: 1234
hash: 99a4d576af9d21bfb535a1df7018064fc16ac5ecf21fbbf5985bb7079b09a68f

HTTP/1.1 206 Partial Content 

Content-Type: application/json

{
    "look_for_closed": "1",
    "groups": "VIP,Special guest",
    "from_number": "012341234123413",
    "pagination": {
        "total": 51,
        "per_page": 50,
        "current_page": 2,
        "last_page": 2
    },
    "cards": [
        {
            "id": 1234,
            "name": "Fornavn Efternavn",
            "phone": "+45 12345678",
            "debtor": "",
            "pinkode": "1234",
            "RFID": "",
            "cardnumber": "012341234123414",
            "cardgroup": "VIP",
            "balance": "120.00",
            "cardtype": "Default"
        }
    ]
}
Get cards with campaign information
GET /card/getCampaignValues

Get a list of cards for a customer/koncern with campaign information on each card. Koncern-feature needs to be enabled on the customer to find cards throughout the koncern.

Request parameters

cardNumbers
array of string optional

Only list cards with a card number existing in this comma separated list.

Collection format: csv
Example:
012341234123413,012341234123414
fromCardNumber
string optional

Only list cards with card numbers equal to or higher than this card number.

Example:
012341234123413
toCardNumber
string optional

Only list cards with card numbers equal to or lower than this card number.

Example:
012341234123413
groups
array of string optional

Only list cards with a card group name existing in this comma separated list.

Collection format: csv
Example:
VIP,Special guest
lookForClosed
boolean optional

If closed cards should be included in the list or not.

Default:
false
page
integer optional

The current page in a paginated results.

Default:
1
Example:
10

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Responses

200 OK

A non-paginated result was returned.

Body
Object
data
Array
Object
cardNumber
string

The card number

Example:
8767020044
name
string

The name on the card

Example:
John Doe
RFID
string nullable

The card’s RFID no

Example:
808080801234567890123456
phone
string nullable

The phone number on the card

Example:
861234567
status
string

The status of the card. “Active” or “Closed”

Example:
Active
firmaid
integer nullable

The firmaid the card belongs to. Only given when a card is in a koncern.

group
string nullable

The card group the card belongs to - if any

Example:
VIP
campaignInfo
Array

Points listed by campaign

Object
name
string

The name of the campaign

Example:
Pant
campaignId
integer

The unique id of the campaign

Example:
1234
points
integer

The current number of points for this campaign

Example:
20
204 No Content

No cards were found with the filters used!

206 Partial Content

A paginated result was returned. Page size = 50.

Body
Object
total
integer

The total number of pages in the paged result

Example:
200
perPage
integer

The number of cards in every page of the paged result

Example:
50
currentPage
integer

The current page returned in the page result

lastPage
integer

The last page in the paged result

data
Array

The cards of the current page in the paged result

Object
cardNumber
string

The card number

Example:
8767020044
name
string

The name on the card

Example:
John Doe
RFID
string nullable

The card’s RFID no

Example:
808080801234567890123456
phone
string nullable

The phone number on the card

Example:
861234567
status
string

The status of the card. “Active” or “Closed”

Example:
Active
firmaid
integer nullable

The firmaid the card belongs to. Only given when a card is in a koncern.

group
string nullable

The card group the card belongs to - if any

Example:
VIP
campaignInfo
Array

Points listed by campaign

Object
name
string

The name of the campaign

Example:
Pant
campaignId
integer

The unique id of the campaign

Example:
1234
points
integer

The current number of points for this campaign

Example:
20
400 Bad input

Bad input was set in one of the parameters.

403 Forbidden

Hash Not Matching! or You don’t have access to this call! or User not found!

Create new card
POST /addCard

Create a new staffcard, prepaid card or giftcard.

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Request body

application/x-www-form-urlencoded
Object
hash
string required

HMAC hash of the request values Read more

type
integer required

The card type, 1 = standard card, 2 = prepaid card, 3 = giftcard

name
string

The new card name

phone
string

The new card phone number

debtor
string

The new card debtor number. (Must be unique)

rfid
string

RFID for the card

eksnr
integer

Ekspedient number. (Must be unique)

allow_manual_input
integer

0 or 1, if 1 use cardnumber as pnr

use_debtor_input
integer

0 or 1, if 1 use debtor as pnr

group
string

The name of the group the card should belong to. A new group will be created if the name does not exist.

Example:
Personale
pin_code
string

Only relevant if Staff Card. (Must be 6 digits or less)

Example:
123456
price_group
integer

The id of the price group the card will order products from

discount
integer

The discount of the card in percentage.

Example:
25
email
string

The cardholders email address

birthday
string

The cardholders birthdate (formatted as yyyymmdd)

Example:
19991205
block_card_payment
integer

Block the card for being use for payment. 1 to block card and 0 to not block. Default is 0

Example:
1

Responses

200 200

OK

Body
application/xml
Object
Examples

Successfull response returns the cardnumber.

<?xml version="1.0" encoding="ISO-8859-1"?>
<cardnumber> 1234567890 </cardnumber>

Unsuccessfull response returns a fail with a message.

<?xml version="1.0" encoding="ISO-8859-1"?>
<fail> eksnr is not unique! </fail>
Example
POST https://api.onlinepos.dk/api/addCard HTTP/1.1 

token: <company token>
firmaid: <company id>
Content-Type: application/x-www-form-urlencoded

hash=
&type=1
&name=
&phone=
&debtor=
&rfid=
&eksnr=1
&allow_manual_input=1
&use_debtor_input=1
&group=
&pin_code=
&price_group=1
&discount=25
&email=
&birthday=19991205
Create new cards
POST /addCards

Create multible cards at the same time. The limit is creating 1000 cards at the same time.

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Request body

Object
cards
Array

List of card to make

Object
hash
string required

HMAC hash of the request values Read more

Example:
nvsdajknbvijodsafbha
type
integer required

The card type, 1 = standard card, 2 = prepaid card, 3 = giftcard

Example:
3
name
string

The new card name

Example:
TestCard
phone
string

The new card phone number

Example:
88888888
debtor
string

The new card debtor number. (Must be unique)

Example:
09090
rfid
string

RFID for the card, if set it will be the cardnumber of the card to

Example:
90003000010
eksnr
string

Only relevant if standard card(type 1). Ekspedient number. (Must be unique)

Example:
1
allow_manual_input
integer

0 or 1, if 1 use cardnumber as pnr

Example:
1
use_debtor_input
integer

0 or 1, if 1 use debtor as pnr

Example:
1
group
string

The name of the group the card should belong to. A new group will be created if the name does not exist.

Example:
1
pin_code
string

Only relevant if standard card (type 1). (Must be 6 digits or less)

Example:
1234
price_group
integer

The id of the price group the card will order products from

Example:
1
discount
integer

The discount of the card in percentage.

Example:
25
email
string

The cardholders email address

Example:
test@onlinepos.dk
birthday
integer

The cardholders birthdate (formatted as yyyymmdd)

Example:
19810220
block_card_payment
integer

Block the card for being use for payment. 1 to block card and 0 to not block. Default is 0

Example:
1
Examples
{
    "cards": [
        {
            "hash": "nvsdajknbvijodsafbha",
            "type": 3,
            "name": "TestCard",
            "phone": "88888888",
            "debtor": "09090",
            "rfid": "90003000010",
            "eksnr": "1",
            "allow_manual_input": 1,
            "use_debtor_input": 1,
            "group": "1",
            "pin_code": "1234",
            "price_group": 1,
            "discount": 25,
            "email": "test@onlinepos.dk",
            "birthday": 19810220,
            "block_card_payment": 1
        }
    ]
}

Responses

200 OK
Body
Array
Object
status
string
Example:
fail
error
string
Example:
RFID is not unique!
name
string
Example:
BulkTestP0
rfid
string
Example:
90000
cardNumber
string
Examples

Response when JSON is valid cardNumber is empty on fail. Name and rfid is empty when not send with in request

[
    {
        "status": "fail",
        "error": "RFID is not unique!",
        "name": "BulkTestP0",
        "rfid": "90000",
        "cardNumber": ""
    },
    {
        "status": "success",
        "error": "",
        "name": "BulkTestP1",
        "rfid": "900030001",
        "cardNumber": "900030001"
    }
]

Response when json is invalid The number tells what part of the JSON is invalid So cards.0.hash is the hash in the first card in the cards list

{
    "status": "ERROR",
    "error": "The cards.0.hash field is required."
}
Edit existing card
POST /editCard

Edit an existing card

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Request body

application/x-www-form-urlencoded
Object
hash
string required

HMAC hash of the request values Read more

cardnumber
string required

The carnumber of desired card you want to modify

Example:
1234567890
name
string

The new name for card

phone
string

The new phone number for card

debtor
string

The new debtor number for card

rfid
string

The new RFID for card

group
string

The id of the group the card should be moved to.

delete
string

Set true if you want to delete card

Example:
"true"
email
string

The cardholders email address

birthday
string

The cardholders birthdate (formatted as yyyymmdd)

Example:
19991208
discount
integer

The discount of the card in percentage.

Example:
25
Examples

Responses

200 OK
Body
application/xml
Object
Examples

Successfull response returns a status message

<?xml version="1.0" encoding="ISO-8859-1"?>
<status> Card 1234567890 successfully updated! </status>

Unsuccessfull response returns a fail with a message

<?xml version="1.0" encoding="ISO-8859-1"?>
<fail> Unknown cardnumber - edit </fail>
Example
POST https://api.onlinepos.dk/api/editCard HTTP/1.1 

token: <company token>
firmaid: <company id>
Content-Type: application/x-www-form-urlencoded

hash=
&cardnumber=1234567890
&name=
&phone=
&debtor=
&rfid=
&group=
&delete=
&email=
&birthday=19991205
Edit multiple existing cards
POST /card/editCards

Edit multiple cards at the same time. Cards can be edited throught the koncern the customer belongs to(if any), but koncern-feature needs to be enabled on the customer to edit cards throughout the koncern.

Request headers

hash
Hash required

HMAC SHA256 hash of the request body json Read more

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Request body

Object
firmaid
integer

Firmaid at OnlinePOS. Must match the one sent in the header.

updateCards
Array required

The updates per card that is to be made.

Object
cardNumber
string required

The number of the card to update

Example:
1212423434
updates
Object

The updates that is to be made on a card

rfid
string

Update the card’s RFID no

Example:
808080801234567890123456
name
string

Update the owner of the card’s name

Example:
John Doe
phone
string

Update the owner of the card’s phone number

Example:
86123456
email
string

Update the owner of the card’s email

Example:
johh@doe
birthday
string date

Update the owner of the card’s birthday

Example:
1998-12-31
groupId
integer

Update the id of the card’s card group

Example:
3
discountPct
integer

Update the card’s discount(in pct)

Example:
25
priceGroupNo
integer

Update the no of the card’s price group

Example:
43
balance
number

Update the card’s balance

Example:
25.25
delete
integer

If the card needs to be deleted. 0 = No, 1 = Yes.

Example:
1

Responses

200 OK
Body
Object
updatedCards
Array required

The updates per card that was to be made. Incl. status.

Object
cardNumber
string required
updates
Object
rfid
string
name
string
phone
string
email
string
birthday
string date
Example:
1998-12-31
groupId
integer
discount
integer
priceGroup
integer
delete
integer
status
Array
Object
code
integer

A number that representat an info/error message.

Enumeration:
200

Card was updated

201

Card was deleted

301

Card was already updated

401

Card was not found.

411

No updates was given for this card

412

Information was missing on whether to update or deleted the card

421

Birthday is not formatted correctly

422

Birthday is not a valid date in the calendar

423

RFID is not unique

424

Debtor number is not unique

425

A group with this id doesn’t exist

426

Failed validation of input for update.

501

Other. See a more specific error code in ‘message’.

502

The value of a field wasn’t updated.

message
string

An info/error message.

firmaid
integer nullable

The firmaid the card belongs to. Only given when a card is in a koncern.

Deposit to a card
POST /deposit

Deposit a value to a specific card

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Request body

application/x-www-form-urlencoded
Object
hash
string required

HMAC hash of the request values Read more

cardnumber
string required

The card number

Example:
1234567890
amount
integer required

The amount you want to deposit

Example:
10
overwrite_balance
boolean

Use this parameter to set the cards balance to amount. Default behaviour the balance is modified by amount.

Example:
true

Responses

200 200

OK

Body
application/xml
Object
Examples

Successfull response returns a status with the new balance

<?xml version="1.0" encoding="ISO-8859-1"?>
<status> New balance: XX.XX </status>

Unsuccessfull response returns a fail with a message

<?xml version="1.0" encoding="ISO-8859-1"?>
<fail> Unknown cardnumber: 1234567890 - Deposit </fail>
Example 1
POST https://api.onlinepos.dk/api/deposit HTTP/1.1 

token: <company token>
firmaid: <company id>
Content-Type: application/x-www-form-urlencoded

hash=
&cardnumber=1234567890
&amount=10
&overwrite_balance=true
Create Voucher
GET /createVoucher

Create a new voucher

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Request body

application/x-www-form-urlencoded
Object
hash
string

Hash of the data

name
string

Name of the new voucher

voucherno
string required

Voucher number, must be unique

campaignid
string required

Id of the campaign the voucher is associated with

start_date
string required

Date the voucher is valid from. Following the format YYYYMMDD

Example:
20200802 (Aug. 02nd 2020)
end_date
string required

Date the voucher is valid to. Following the format YYYYMMDD

Example:
20200802 (Aug. 02nd 2020)

Responses

200 OK JSON

When using JSON response

Body
Object
Examples

Successful operation

{
    "status": "Voucher created",
    "cardnumber": "1000000007"
}

Failed operation

{
    "ERROR": "voucherno is not unique!"
}
200 OK
Body
application/xml
string
Examples

Successfull operation

<?xml version="1.0" encoding="ISO-8859-1"?> <cardnumber> 1234567890 </cardnumber>

Failed operation

<?xml version="1.0" encoding="ISO-8859-1"?> <fail> voucherno is not unique! </fail>
403 Forbidden

Incorrect credentials, privledges or hash.

500 Internal Server Error
Create Voucher From Interval
POST /createVoucherFromInterval

Create multipe vouchers from an interval of card numbers

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Request body

application/json;charset=UTF-8
Object
hash
string required

Hash of the data. Data order: token, firmaid, voucherNoFrom, voucherNoTo, name, campaignid, points, startDate and endDate. Read more

Example:
Test
voucherNoFrom
string

Start card number for voucher

Example:
1550000
voucherNoTo
string

End card number for voucher

Example:
1550005
points
integer required

Amount of points on voucher/card

Example:
10
campaignid
integer required

Id of campaign the voucher/card is part of

Example:
26
name
string

Name of the voucher/card. Default is Gavekort

Example:
Test
startDate
integer

Start date for voucher/card to be active if the is one. Format is YYYYMMDD

Example:
20210304
endDate
integer

End date for voucher/card to be active if the is one. Format is YYYYMMDD

Example:
20210304
Examples

Example of json body

{
    "hash": "Test",
    "voucherNoFrom": "10000",
    "voucherNoTo": "15000",
    "points": 10,
    "campaignid": 26,
    "name": "Test",
    "startDate": 20210304,
    "endDate": 20210304
}

Responses

200 OK
Body
Object
status
string required

Status of call can be Vouchers created or ERROR

Example:
Vouchers created
error
string

Error message, error is only the if status is ERROR

Example:
Hash Not Matching!
Examples

On Error

{
    "status": "ERROR",
    "error": "Hash Not Matching!"
}

On Succes

{
    "status": "Vouchers created"
}
getCardMovements
GET /getCardMovements/{firmaid}/{from}/{to}

Get a list of deposits and withdrawals per card in the given time period.

Path variables

firmaid
integer required

Customer number

from
integer required

From time as unix timestamp

to
integer required

to time as unix timestamp

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Responses

200 200

OK

Body
application/json
Examples

Returns a list with an entry for each used card.

[
    {
        "cardnumber": "000230300000001",
        "cardname": "Giftcard",
        "deposit": "2927.30",
        "withdrawal": "2927.30",
        "subtotal": "0.00"
    },
    {
        "cardnumber": "000230300000002",
        "cardname": "Giftcard",
        "deposit": "900.00",
        "withdrawal": "-566.00",
        "subtotal": "334.00"
    }
]
getCardHistory
GET /getCardHistory/{cardnumber}

Get historic data for all balance changes on the given card.

Path variables

cardnumber
string required

Card number

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Responses

200 200

OK

Body
application/json
Examples

Returns a list with an entry for each card balance change.

[
    {
        "date": "2019-03-06 10:21:52",
        "type": "Purchase",
        "amount": 60,
        "location": "Test Venue,
        "receipt": {
            "receipt_product_lines": [
                {
                    "qty": 1,
                    "tekst": "Test Produkt",
                    "price": "65.00",
                    "discount": "0.00"
                }
            ],
            "receipt_payment_lines": [
                {
                    "payment_type": "Betalingskort",
                    "amount": "20.00"
                },
                {
                    "payment_type": "Gavekort",
                    "amount": "60.00"
                }
            ]
        }
    }
]
Campaign
GET /campaign/campaignList
GET /campaign/campaignProducts/{campaign_id}
POST /campaign/editCampaign/{campaignid}
POST /campaign/adjustValue
POST /campaign/adjustValues
POST /campaign/cardInfo
List campaigns
GET /campaign/campaignList

Request parameters

show_inactive
integer optional

Whether or not to show inactive campaigns

Default:
0
Example:
1

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Responses

200 OK
Body
Object
Campaigns
Array

List of campaigns

Object
campaign
Object
campaignID
integer

Id of campaign

campaignName
string

Name of campaign

active
integer

whether the campaign is active or not

Example:
1
type
string

The type of the campaign (amount, price, points)

Example:
points
free_split
integer
free_msg
integer
auto_add
integer
info_view
integer
whitelisted_company_ids
Array of string

List of company ids the campaing works on.

Example:
[1,2]
Examples
{
    "Campaigns": [
        {
            "campaign": {
                "campaignID": 1,
                "campaignName": "",
                "active": 1,
                "type": "points",
                "free_split": 1,
                "free_msg": 1,
                "auto_add": 1,
                "info_view": 1
            }
        }
    ]
}
Example 1
GET https://api.onlinepos.dk/api/campaign/campaignList?show_inactive=0 HTTP/1.1 

token: <company token>
firmaid: <company id>

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "Campaigns": [
        {
            "campaign": {
                "campaignID": 1,
                "campaignName": "",
                "active": 1,
                "type": "points",
                "free_split": 1,
                "free_msg": 1,
                "auto_add": 1,
                "info_view": 1
            }
        }
    ]
}
Get campaign products
GET /campaign/campaignProducts/{campaign_id}

Path variables

campaign_id
integer required

The campaign id you wish to look up products for

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Responses

200 OK
Body
Object
reward_products
Array

List of reward products

Object
product_id
integer
Example:
1
product_name
string
Example:
Lille Fadøl
cost
integer

The cost to activate the campaign deal

Example:
1
campaign_price
number

The price of the product after activation

collection_products
Array

list of collection products

Object
product_id
integer
Example:
2
product_name
string
Example:
burger
reward
integer

The reward for buying the product

Examples
{
    "reward_products": [
        {
            "product_id": 1,
            "product_name": "Lille Fadøl",
            "cost": 1,
            "campaign_price": 1
        }
    ],
    "collection_products": [
        {
            "product_id": 2,
            "product_name": "burger",
            "reward": 1
        }
    ]
}
Example 1
GET https://api.onlinepos.dk/api/campaign/campaignProducts/99 HTTP/1.1 

token: <company token>
firmaid: <company id>

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "reward_products": [
        {
            "product_id": 1,
            "product_name": "Lille Fadøl",
            "cost": 1,
            "campaign_price": 1
        }
    ],
    "collection_products": [
        {
            "product_id": 2,
            "product_name": "burger",
            "reward": 1
        }
    ]
}
Edit campaign
POST /campaign/editCampaign/{campaignid}

Path variables

campaignid
string required

id of the campaign to edit

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Request body

application/x-www-form-urlencoded
application/json
Object
hash
string required

HMAC hash of the request values Read more

name
string

New name of the campaign

cardgroup
integer

valid id of the new cardgroup for the campaign

Example:
12
free_msg
boolean
Example:
false
free_split
boolean
Example:
false
auto_add
boolean
Example:
false
info_view
boolean
Example:
false
active
boolean

Whether the campaign is active or not

Example:
true
whitelist
Array of integer

List of company id the campaign can be use on, if no company id is set it runs on all in the concern

Example:
[1, 2]
remove_from_whitelist
Array of integer

List of company id to remove from whitelist

Example:
[1, 2]

Responses

200 OK

JSON Success

Body
Object
status
string
Example:
Campaign 30 successfully updated!
200 ERROR

JSON Error

Body
Object
ERROR
string
Example:
cardgroup is invalid!
Example 1
GET https://api.onlinepos.dk/api/campaign/editCampaign/12 HTTP/1.1 

token: <company token>
firmaid: <company id>
Content-Type: application/x-www-form-urlencoded

hash=204c7d7dfd32fde50ffe148f317fa0ab854e834c
&name=
&cardgroup=12
&free_msg=false
&free_split=false
&auto_add=false
&info_view=false
&active=true
Adjust campaign point on a card
POST /campaign/adjustValue

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Request body

application/x-www-form-urlencoded
Object
CardNo
string

The cardnumber of the card to adjust the value of

CardID
string

The rfid of the card to adjust the value of

CampaignID
string

The campaign to adjust the value of the card on

value
string

What value to adjust the card with (positive or negative)

Example:
25, -80

Responses

200 OK

JSON

Example 1
POST https://api.onlinepos.dk/api/campaign/adjustValue HTTP/1.1 

token: <company token>
firmaid: <company id>
Content-Type: application/x-www-form-urlencoded

CardNo=1
&CardID=2
&CampaignID=3
&value=25
Adjust campaign points on multiple cards
POST /campaign/adjustValues

Adjust campaign points on multiple cards at the same time. Points can be adjusted throught the koncern the customer belongs to(if any), but koncern-feature needs to be enabled on the customer to adjust points throughout the koncern.

Request headers

hash
Hash required

HMAC SHA256 hash of the request body json Read more

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Request body

Object
firmaid
integer

Firmaid at OnlinePOS. Must match the one sent in the header.

updateCards
Array
Object
cardNumber
string required

The number of the card to update

Example:
1212423434
campaignId
integer required

The id of the campaign to update

Example:
27
value
integer

The value to adjust with. Can be negative.

Example:
-5

Responses

200 OK
Body
Object
updatedCards
Array
Object
cardNumber
string required

The number of the card that was to be updated

Example:
1212423434
campaignId
integer required

The id of the campaign that was to be updated

Example:
27
value
integer required

The value that was to be adjusted with. Can be negative

Example:
-5
firmaid
integer nullable

The firmaid the card belongs to. Only given when a card is in a koncern.

status
Array
Object
code
integer

A number that representat an info/error message.

Enumeration:
200

Card was updated

201

Card was deleted

301

Card was already updated

401

Card was not found.

411

No updates was given for this card

412

Information was missing on whether to update or deleted the card

421

Birthday is not formatted correctly

422

Birthday is not a valid date in the calendar

423

RFID is not unique

424

Debtor number is not unique

425

A group with this id doesn’t exist

426

Failed validation of input for update.

501

Other. See a more specific error code in ‘message’.

502

The value of a field wasn’t updated.

message
string

An info/error message.

Card info
POST /campaign/cardInfo

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

JSON
integer optional

Response in JSON

Example:
1

Request body

application/x-www-form-urlencoded
Object
hash
string required

HMAC hash of the request values Read more

CardNo
string

The cardnumber of the card to look up

CardID
string

The rfid of the car do look up

Responses

200 OK

JSON Success

Body
One of
Object
Card
Object
name
string
Example:
John Doe
phone
string
cardstatus
string
Example:
Active
cardnumber
string
Example:
090000100000463
RFID
string
campaignGroup
string
Example:
Voucher
Examples
{
    "Card": {
        "name": "John Doe",
        "phone": "",
        "cardstatus": "Active",
        "cardnumber": "090000100000463",
        "RFID": "",
        "campaignGroup": "Voucher"
    }
}
<?xml version="1.0" encoding="ISO-8859-1"?>
<card>
    <name>John Doe</name>
    <phone>12345678</phone>
    <cardstatus>Active</cardstatus>
    <cardnumber>090000100000463</cardnumber>
    <RFID></RFID>
    <campaignGroup>Voucher</campaignGroup>
    <campaignInfo>
    </campaignInfo>
</card>
200 ERROR

JSON Error

Body
Object
ERROR
string
Example:
Unknown Card - CardInfo
Example 1
POST https://api.onlinepos.dk/api/campaign/cardInfo HTTP/1.1 

token: <company token>
firmaid: <company id>
Content-Type: application/x-www-form-urlencoded

hash=
&CardNo=
&CardID=
Card For List

Schema for card list

Array
Object
id
integer

Card id

name
string

Card holders name

phone
integer

Card holders phone

email
string

The cardholders email

birthday
integer

The cardholders birthday. Format YYYYMMDD

Example:
19950101
debtor
string
discount
string

The discount on the card, as a percentage.

Example:
20
cardgroup
string

The card group

RFID
string

The RAID for the card, if the card have one

cardnumber
string

The card number

cardtype
string

The type of the card

balance
string

The balance on the card, if the card has one

deleted
string

Return yes if the card is close else return no

External order
POST /external/makeorder
Make order
POST /external/makeorder

Call to make an order.

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Request body

Object
name
string required

The name of the person who order

Example:
Python Test
phone
string required

The phone number of the person who order

Example:
88888885
email
string required

The email of the person who order

Example:
sn@onlinepos.dk
pickupTime
string required

The time the order is ready for pickup. format hh:mm 24h (23:59)

Example:
10:00
priceChecksum
string required

The total sum of the cart. Used to verify the price is as expected.

Example:
50
amountChecksum
integer required

The total amount of lines in the cart. Used to verify the amount is as expected.

Example:
1
forDelivery
integer

0 = not a delivery order, 1 = an delivery order. if not set defaults to 0

Example:
0
address
string

The address for delivery. Is required if forDelivery = 1

Example:
testvej 1
zipCode
integer

The zip code for delivery. Is required if forDelivery = 1

Example:
8920
city
string

The city for delivery. Is required if forDelivery = 1

Example:
Randers
deliveryTime
string

This is the time the order is at the customer. format hh:mm 24h (23:59). Is required if forDelivery = 1

Example:
10:00
pax
integer

Number of people on the order

Example:
1
pickupDate
integer

The date for the order. format yyyymmdd

Example:
20200224
paid
integer

If the ordre is already paid = 1, if the order is not paid = 0. if not set default to 0

Example:
1
type
integer

The type of the order, taw = 1, kiosk = 2, app = 3. if not set default to 1

Example:
1
cart
Array required

The cart

Object
productId
integer

The product id

Example:
235931
indentation
integer

The indentation of the line

Example:
0
amount
integer

The amount on the line

Example:
1
price
number

The total price of the line

lineOption
integer
Enumeration:
0

Normal

1

Writes “uden” in front of the product.

2

Writes “med” in front of the product.

3

Doesn’t print the product on the kitchen receipt.

Default:
0
vatRate
number

The vat rate of the order(in percent per thousands)

Example:
0.025
shopId
integer

Shop id, is used to send an order to another company then the firmaid from the header

Example:
9000
displayOrderNo
string

Use this to set another customer ordernumber on the kds screen

Example:
5000
note
string

Note from person that made the order

Example:
No peanuts
kdsTime
string

The time when the order should be sent to the kitchen. Format: hh:mm

Example:
10:00
table
integer

Table number for the order (if relevant)

Example:
25
tips
number

Value of tips paid on the order

Example:
5.5
lineSeparation
integer

Optional toggle. If present and not set to 0, then all lines in the cart will be treated as separate elements regardless of their indentation

Example:
0
paymentType
string

Payment type of the order. Options are Online or App. Default is Online

Example:
App
Examples

json

{
    "name": "Python Test",
    "phone": "88888885",
    "email": "sn@onlinepos.dk",
    "pickupTime": "10:00",
    "priceChecksum": "50",
    "amountChecksum": 1,
    "forDelivery": 1,
    "address": "testvej 1",
    "zipCode": 8920,
    "city": "Randers",
    "deliveryTime": "10:00",
    "pax": 1,
    "pickupDate": 20200224,
    "paid": 1,
    "type": 1,
    "cart": [
        {
            "productId": 235931,
            "indentation": 1,
            "amount": 1,
            "price": 50,
            "lineOption": 1,
            "vatRate" : 0.025
        }
    ],
    "shopId": 9000,
    "displayOrderNo": "5000",
    "note": "No peanuts",
    "kdsTime": "10:00"
}

Responses

200 OK
Body
Object
status
string

The status of the order if succes = OK on error = ERROR

Example:
OK
ordernumber
string

The number the order have be given. Only here if make order is success

Example:
1000
error
string

The error msg. Only here if make order failed

Example:
The cart field is required
Examples

json

{
    "status": "OK",
    "ordernumber": "1000",
    "error": "The cart field is required"
}
200 _
application/xml
Example 1
POST https://api.onlinepos.dk/api/external/makeorder HTTP/1.1 

token: <company token>
firmaid: <company id>
Content-Type: application/json

{
    "name": "Python Test",
    "phone": "88888885",
    "email": "sn@onlinepos.dk",
    "pickupTime": "10:00",
    "priceChecksum": "50",
    "amountChecksum": 1,
    "forDelivery": 1,
    "address": "testvej 1",
    "zipCode": 8920,
    "city": "Randers",
    "deliveryTime": "10:00",
    "pax": 1,
    "pickupDate": 20200224,
    "paid": 1,
    "type": 1,
    "cart": [
        {
            "productId": 235931,
            "indentation": 1,
            "amount": 1,
            "price": 50,
            "lineOption": 1
        }
    ],
    "shopId": 9000,
    "displayOrderNo": "5000",
    "note": "No peanuts",
    "kdsTime": "10:00"
}
Taw

Taw api

GET /taw/products
GET /taw/shops
GET /taw/timeslots/(date)
POST /taw/makeOrdre
Products
GET /taw/products

Api call to get taw products

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Responses

200 OK
Body
application/json
Object
groups
Array
Object
id
integer

Group id

Example:
1
name
string

Group name

Example:
beers
description
string

Group description

Example:
cold
products
Array of TAW Product

Array of products in group

Examples

json

{
    "groups": [
        {
            "id": 1,
            "name": "beers",
            "description": "cold",
            "products": [
                {
                    "id": 123456,
                    "name": "Beer",
                    "price": "100",
                    "soldout": 1,
                    "multi": 1,
                    "description": "Cold beer",
                    "type": "product",
                    "max": 1,
                    "min": 1,
                    "options": [
                        {
                            "id": 578234,
                            "name": "Thousand Island Dressing",
                            "soldout": 1,
                            "price": "0",
                            "multi": 1,
                            "default": 1,
                            "max": 1,
                            "min": 1,
                            "type": "product",
                            "description": "",
                            "options": [
                                {}
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}
Shops
GET /taw/shops

Api call to get shops

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Responses

200 OK
Body
Object
shops
Array

Array of shops

Object
id
integer

shop id

Example:
1
name
string

shop name

Example:
OnlinePOS
address
string

The address of the shop

postcode
string

The postcode for the shop

Example:
8920
city
string

The city the shop is in

Example:
Randers
Examples

json

{
    "shops": [
        {
            "id": 1,
            "name": "OnlinePOS",
            "address": "",
            "postcode": "8920",
            "city": "Randers"
        }
    ]
}
Timeslots
GET /taw/timeslots/(date)

Api call to get timeslots

Request parameters

date
integer optional

if date is not in the url it will use the current date. format yyyymmdd

Example:
20190911

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Responses

200 OK
Body
application/json
Object
date
string

The date for the timeslots. format yyyymmdd

Example:
20190910
timeslots
Array of string

Array of timeslots

Example:
["00:00", ...]
Examples

json

{
    "date": "20190910",
    "timeslots": [
        ""
    ]
}
Make Ordre
POST /taw/makeOrdre

Api call to make an ordre, If new use External order make order

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Request body

multipart/form-data
Object
name
string required

name of the customer

Example:
Simon
phone
string required

phone number of the customer

Example:
88888888
email
string required

email of the customer

Example:
info@onlinepos.dk
cart
Object

the cart of product for the order (price is total for line)

productId
integer

The product id

Example:
235931
amount
integer

The amount on the line

Example:
1
price
number

The total price of the line

indent
integer

The indentation of the line

Example:
0
vatRate
number

The vat rate of the order(in percent per thousands)

Example:
0.025
lineOption
integer
Enumeration:
0

Normal

1

Writes “uden” in front of the product.

2

Writes “med” in front of the product.

3

Doesn’t print the product on the kitchen receipt.

Default:
0
pickup_time
string required

Time for the ordre. format hh:mm

Example:
10:00
pickup_date
string

Date for the ordre. format yyyymmdd. if not set use current day

Example:
20190910
note
string

Note for the kitchen

Example:
no nuts
pax
integer

Number of people on the ordre

Example:
0
kds_time
string

The time when the order should be sent to the kitchen. Format: hh:mm

Example:
10:00
shopId
integer

If the ordre is for another company the the firmaid from the header set shopId

Example:
1
forDelivery
string

if 1 the ordre is mark as an delivery ordre else 0. not set = 0

Example:
0
delivery_time
string

Time for when ordre is at customer. format hh:mm

Example:
10:00
address
string

Address for delivery Required if forDelivery = 1

Example:
Denmark st
postcode
integer

Zipcode for delivery Required if forDelivery = 1

Example:
8920
city
string

City for delivery Required if forDelivery = 1

Example:
Randers
paid
integer

Set 1 if order is paid. if property is not set it equal 0 (not paid)

Example:
1
paymentType
string

Payment type of the order. Options are Online or App. Default is Online

Responses

201 Created
Body
Object
status
string

OK

Example:
OK
ordernumber
string

The number of the ordre

Example:
123
Examples

JSON

{
    "status": "OK",
    "ordernumber": "123"
}
200 OK
Body
application/json
Object
error
string

Error message

Example:
Email empty
Examples

JSON

{
    "error": "Email empty"
}
Example 1
POST https://api.onlinepos.dk/api/taw/makeOrdre HTTP/1.1 

token: <company token>
firmaid: <company id>
Content-Type: multipart/form-data

name=Simon
&phone=88888888
&email=info@onlinepos.dk
&cart={"cart":[{ "productId":"74631", "amount":"1", "price":"50", "indent":"0" }]}
&pickup_time=10:00
&pickup_date=20190910
&note=no nuts
&pax=1
&kds_time=10:00
&shopId=1
&forDelivery=0
&delivery_time=10:00
&address=Denmark st
&postcode=8920
&city=Randers
&paid=1
Koncern

API calls for Koncern functionality

POST /exportKoncern
GET /getByUnixTimeKoncern/{form}/{to}
GET /koncern/koncernInfo
GET /koncern/clerkInfo
GET /koncern/getKoncernRevenue/{from}/{to}
Get list of sales
POST /exportKoncern

Get list of transaction lines across a whole koncern. The response has a limit of 10000 lines.

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Request body

application/x-www-form-urlencoded

Unix time

Unix time represents the seconds passed since Jan 01 1997.


Using unix time

Most programming languages have built in functions for converting a date to unix time.

You can also use an online tool like unixtimestamp.com.

Object
from
string required

Start of the period in unix time

Example:
1597141149
to
string required

End of the period in unix time

Example:
1597100000
cardnumber
string

Get all sales from a specific cardnumber

Example:
1234567890
offset
integer

And offset for sales, where the 1000 lines start from.

Default:
0
lokation
string

The id of a specific location in the koncern

department
string

Get all sales from a specific terminal or group of terminals. Department is the name of the terminal(s)

Example:
kasse 1

Responses

200 OK

Success

Body
application/json
Object
sales
Array
Object
line
Object
id
string
firma_id
integer
chk
string

Orderno.

date
string
time
string
unix_timestamp
number

unix timestamp

Example:
1458057600
product_id
integer
product
string
product_group_id
integer
product_group
string
amount
integer
price
string
payment_type
string

The method of payment for the sale.

clerk
string
pax
string

Number of guests involved with the sale.

department
string

The terminal or group of terminals a sale was made from.

ean_1
string

Product id

ean_2
string

Manufacturer product id

ean_3
string
ean_4
string
MasterID
integer

ID of the Master of this product. (0 means no master)

Example:
12345678
debtor
string
tags
Array of string

If the sale has any tags, this list will display their name and value

Examples

Successfull response returns an array of lines representing individual sales

{
    "sales": [
        {
            "line": {
                "id": 1,
                "chk": 1,
                "date": "15.03.2016",
                "time": "17:00",
                "unix_timestamp": 1458057600,
                "product_id": 1,
                "product": "",
                "product_group_id": 1,
                "product_group": "",
                "MasterID" : 0,
                "amount": 1,
                "price": "10,00",
                "payment_type": "",
                "clerk": "",
                "pax": 1,
                "department": "",
                "ean_1": "",
                "ean_2": "",
                "ean_3": "",
                "ean_4": ""
            }
        }
    ]
}
200 OK

Error

application/xml
Example 1
POST https://api.onlinepos.dk/api/exportKoncern HTTP/1.1 

token: <company token>
firmaid: <company id>
Content-Type: application/x-www-form-urlencoded

from=1597141149
&to=1597100000
&cardnumber=1234567890
&offset=1
&location=
&department=kasse 1
Get list of sales by unix time
GET /getByUnixTimeKoncern/{form}/{to}

Get list of transaction lines across a whole koncern filtered by time. The response has a limit of 10000 lines.

Path variables

form
string required

Start of the period in unix time

to
string required

End of the period in unix time

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Responses

200 OK
Body
application/xml
Object
XML
Object
period
string
location
Object
userId
integer
amount
integer
pax
string
Examples

Xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<XML>
	<period>string</period>
	<location>
		<customerId>0</customerId>
		<amount>0</amount>
		<pax>string</pax>
	</location>
</XML>
List Koncern Locations
GET /koncern/koncernInfo

List all locations and departments within a koncern. In OnlinePOS, locations are firmaID’s and departments are terminal logins

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Responses

200 OK
Body
Object
lokations
Array
Object
firmaid
integer
Example:
2
name
string
Example:
OnlinePOS Café
address
string
Example:
Brødregade 1
city
string
Example:
Randers C
postnumber
string
Example:
8900
active
integer
Example:
1
country
string
Example:
Danmark
departments
Array
Object
departmentID
integer
Example:
3
departmentName
string
Example:
Bar 1
departmentActive
integer
Example:
1
lastJournal
integer
Example:
6
parent_firmaid
integer
Example:
2
Examples

JSON Response

{
    "lokations": [
        {
            "firmaid": 2,
            "name": "OnlinePOS Café",
            "address": "Brødregade 1",
            "city": "Randers C",
            "postnumber": "8900",
            "active": 1,
            "country": "Danmark",
            "departments": [
                {
                    "departmentID": 3,
                    "departmentName": "Bar 1",
                    "departmentActive": 1,
                    "lastJournal": 6,
                    "parent_firmaid": 2
                }
            ]
        }
    ]
}

XML Response

<?xml version="1.0" encoding="ISO-8859-1"?>
<lokations>
    <lokation>
        <firmaid>2</firmaid>
        <name>OnlinePOS Café</name>
        <address>Brødregade 1</address>
        <city>Randers C</city>
        <postnumber>8900</postnumber>
        <country>Danmark</country>
        <active>1</active>
        <departments>
            <department>
                <departmentID>3</departmentID>
                <departmentName>Bar 1</departmentName>
                <departmentActive>1</departmentActive>
                <lastJournal>6</lastJournal>
                <parent_firmaid>2</parent_firmaid>
            </department>
    </lokation>
</locations>
List koncern clerks
GET /koncern/clerkInfo

Lists all clerks within a koncern.

Get Koncern Revenue
GET /koncern/getKoncernRevenue/{from}/{to}

Fetches all revenue journals from all venues in the koncern within a given time period. The period may not be longer that 48 hours.

Path variables

from
integer required

from time as unix timestamp

to
integer required

to time as unix timestamp

Responses

200 OK
Body
Object
entries
Array
Object
entry
Object
firmaid
integer
Example:
9000
departmentid
integer
Example:
481
booknumber
integer
Example:
1831
clerk
string
Example:
1234
revenue
string
Example:
14764.2
count
number
Example:
14764.2
startdate
integer
Example:
1659234798
enddate
integer
Example:
1659312568
diff
integer
btypes
Object
Stock
GET /stock/getStockComposition
GET /stock/getConsumption/{Customerno}/{from}/{to}
GET /stock/getStockLocations/{firmaid}
GET /stock/getStockValues
GET /stock/getStockLocationValue/{firmaid}
Get Stock Composition
GET /stock/getStockComposition

This call is used for getting the relation between products and stock products

Request parameters

page
integer optional

pagination page

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Responses

200 OK
Body
Object
data
Array

Data for relation between products and stock products

Object
product_id
integer

Id of the product

Example:
143529
stock_ids
Array

The list of stock products related to the product

Object
stock_id
integer

Id of the stock product

Example:
75613
amount
integer

Amount of stock products used with one product

Example:
1
from
integer

First number of product shown

Example:
1
next_page_url
unknown nullable

URL for next page if there is one

per_page
integer

Number of products per page (MAX 5000)

Example:
5000
prev_page_url
unknown nullable

URL for previous page if there is one

to
integer

Last number of product shown

Example:
47
current_page
integer

Current page

Example:
1
status
string

Status of call (OK on success else error)

Example:
OK
Examples
{
    "data": [
        {
            "product_id": 143529,
            "stock_ids": [
                {
                    "stock_id": 75613,
                    "amount": 1
                }
            ]
        }
    ],
    "from": 1,
    "next_page_url": null,
    "per_page": 5000,
    "prev_page_url": null,
    "to": 47,
    "current_page": 1,
    "status": "OK"
}
Get Goods Consumption
GET /stock/getConsumption/{Customerno}/{from}/{to}

Path variables

Customerno
string required

Customer ID of venue in the group

from
integer required

Start of period (Unix timestamp)

to
integer required

End of period (Unix timestamp)

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Responses

200 OK
Body
Array
Object
Product_ID
integer

ID of the stock product

Example:
1234
Product_Group
string

Name of the stock product’s group

Example:
Bottles
Product_Name
string

Name of the stock product

Example:
Beer
Consumption_in units
string

Amount of stock product consumed in the given period (in units)

Example:
15
Product_Unit
string

Name of the unit consumed

Example:
Fl
Consumption_value
string

Value of the consumed amount in the currency used by the venue.

Example:
5.12
Examples
[
    {
        "Product_ID": 1234,
        "Product_Group": "Bottles",
        "Product_Name": "Beer",
        "Consumption_in units": "15",
        "Product_Unit": "Fl",
        "Consumption_value": "5"
    }
]
Get Stock Locations
GET /stock/getStockLocations/{firmaid}

Get a list of all stock locations that are created on a given customer.

Path variables

firmaid
integer required

Firmaid at OnlinePOS

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Responses

200 OK
Body
Object
stockLocations
Object
main
Object
id
integer

ID of the stock location

Example:
520
name
string

Name of the stock location

Example:
Hovedlager
main
boolean

Indicates if this is the main stock location

Example:
true
all
Array
Object
id
integer

ID of the stock location

Example:
521
name
string

Name of the stock location

Example:
Bar
main
boolean

Indicates if this is the main stock location

Examples
{
    "stockLocations": {
        "main": {
            "id": 520,
            "name": "Hovedlager",
            "main": true
        },
        "all": [
            {
                "id": 521,
                "name": "Bar",
                "main": false
            },
            {
                "id": 520,
                "name": "Hovedlager",
                "main": true
            }
        ]
    }
}
Get Stock Values
GET /stock/getStockValues

Lists the value of all stock products on a given customer. Stock location can be used as parameter to filter stock product values. Date can be used to provide the stock value on a given date.

Request parameters

location
integer optional

location id

date
number optional

unix timestramp

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Responses

200 OK
Body
Object
product_id
integer
amount
string
value
string

cost price multipled with amount

Examples
{
    "product_id": 1,
    "amount": "0.000",
    "value": "0.000"
}
Get Stock Location Value
GET /stock/getStockLocationValue/{firmaid}

Lists the value of all stock products on a given customer grouped by stock locations. Stock location can be used as parameter to filter stock product values. Date can be used to provide the stock value on a given date.

Path variables

firmaid
integer required

Firmaid at OnlinePOS

Request parameters

Location
integer optional

location id

date
integer optional

Unix timestramp

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Responses

200 OK
Body
Object
stockLocations
Array

An array of Stock locations

Object
id
integer

Stock location id

stockValues
Array

An array of Stock values based on the location

Object
product_id
integer
amount
string
value
string
Examples
{
    "stockLocations": [
        {
            "id": 1,
            "stockValues": [
                {
                    "product_id": 1,
                    "amount": "0.000",
                    "value": "0.000"
                }
            ]
        },
        {
            "id": 2,
            "stockValues": [
                {
                    "product_id": 1,
                    "amount": "0.000",
                    "value": "0.000"
                }
            ]
        }
    ]
}
Offer
GET /offer
POST /offer
PUT /offer/{offer_id}
POST /offer/{offer_id}/add
DELETE /offer/{offer_id}/remove
Get Offers
GET /offer

Get a list of offers. Offers are reffered to as “Discount families” in OnlinePOS.

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Responses

200 OK
Body
Object
ID
integer
Example:
1700
days
string

Which weekdays the offer is active on

Example:
1,1,1,1,1,1,1
pricegroup
integer
prio
integer
name
string
Example:
0
dayfrom
string
Example:
0001-01-01
dayto
string
Example:
0001-01-01
timefrom
integer
Example:
-10000
timeto
integer
Example:
-10000
content
Array
Object
pid
integer
gid
integer
amount
integer
pris
number
Example:
12.5
Create Offer
POST /offer

Create an offer. Offers are reffered to as “Discount families” in OnlinePOS.

Request body

Object
name
string required
Example:
Pricegroup Zero
dayfrom
string

The date the offer is valid from, exclude if unlimited

Example:
2021-07-06
dayto
string

The date the offer is valid until, exclude if unlimited

Example:
2021-08-06
days
string

Which days the offer is active on. Comma seperated days from mon-sun

Default:
1,1,1,1,1,1,1
Examples:
1,1,1,1,1,_,_ (weekdays)_,_,_,_,_,1,1 (weekend)
prio
integer

The priority (order) the offer applies, lower numbers are applied first

Example:
3
content
Array
Object
pid
integer

Product ID - Required if gid not specified

Example:
1234
gid
integer

Product Group ID - Required if pid not specified

Example:
5678
price
number

The applied offer price of the product(s)

Example:
12.5
percent
integer

The applied percentage discount of the product(s)

Example:
25
amount
integer

The amount of products to buy, for the offer to activate

Example:
2

Responses

200 OK

Offer created

401 Unauthorized

Credentials incorrect, lacking permissions

Edit Offer
PUT /offer/{offer_id}

Edit an existing offer. Offers are reffered to as “Discount families” in OnlinePOS.

Path variables

offer_id
integer required

The id of the offer you’re editing

Request body

Object
name
string required
Example:
Pricegroup Zero
dayfrom
string

The date the offer is valid from, exclude if unlimited

Example:
2021-07-06
dayto
string

The date the offer is valid until, exclude if unlimited

Example:
2021-08-06
days
string

Which days the offer is active on. Comma seperated days from mon-sun

Default:
1,1,1,1,1,1,1
Examples:
1,1,1,1,1,_,_ (weekdays)_,_,_,_,_,1,1 (weekend)
prio
integer

The priority (order) the offer applies, lower numbers are applied first

Example:
3

Responses

200 OK

Updated

404 OfferNotFoundResponse

The offer you’re trying to edit does not exist

401 Unauthorized

Credentials incorrect, lacking permissions

Add Offer Line
POST /offer/{offer_id}/add

Add a new sales product to an existing offer. Offers are reffered to as “Discount families” in OnlinePOS.

Path variables

offer_id
string required

Request body

Object
pid
integer

Product ID - Required if gid not specified

Example:
1234
gid
integer

Product Group ID - Required if pid not specified

Example:
5678
price
number

The applied offer price of the product(s)

Example:
12.5
percent
integer

The applied percentage discount of the product(s)

Example:
25
amount
integer

The amount of products to buy, for the offer to activate

Example:
2

Responses

201 Created
401 Unauthorized

Credentials incorrect, lacking permissions

404 OfferNotFoundResponse

The offer you’re trying to edit does not exist

Remove Offer Line
DELETE /offer/{offer_id}/remove

Delete a sales product from an existing offer. Offers are reffered to as “Discount families” in OnlinePOS.

Path variables

offer_id
string required

Request body

Object
pid
integer
Example:
1234
gid
integer
Example:
5678

Responses

200 OK

Deleted

404 OfferNotFoundResponse

The offer you’re trying to edit does not exist

401 Unauthorized

Credentials incorrect, lacking permissions

Webshop

API calls for Webshop functionality

Get list of stock products info
GET /stock

Returns an array of info about stock products

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Responses

200 OK

Ok

Body
application/json
application/xml
Object
info
Array
Object
info
Object
ean
string
stock
string
ean_2
string
ean_3
string
ean_4
string
Examples

Json

{
    "info": [
        {
            "info": {
                "ean": "",
                "stock": "",
                "ean_2": "",
                "ean_3": "",
                "ean_4": ""
            }
        }
    ]
}

Xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<info>
	<info>
		<ean>string</ean>
		<stock>0</stock>
		<ean_2>string</ean_2>
		<ean_3>string</ean_3>
		<ean_4>string</ean_4>
	</info>
</info>
200 OK

Error

Body
application/xml
Object
info
Object
type
string
num
integer
text
string
Examples

Xml

<?xml version="1.0" encoding="utf-8"?>
<info>
    <info>
        <type>1</type>
        <num>5</num>
        <text>No location</text>
    </info>
</info>

Json

{
    "info": {
        "type": "",
        "num": 1,
        "text": ""
    }
}
Get stock amount from ean
POST /stockFromEan

This call can be used to see how many of a product is in stock, by it’s ean number.

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Request body

application/x-www-form-urlencoded
Object
ean
string required

The ean as comma separated string or a single ean.

Example:
52929,589954,84957

Responses

200 OK

Response in JSON

Body
application/json
application/xml
Object
info
Array
Object
info
Object
ean
string
stock
string
Examples

Successfull response returns an array of ean/stocks pairs for each ean number given

{
    "info": [
        {
            "info": {
                "ean": "",
                "stock": ""
            }
        }
    ]
}
Example
POST https://api.onlinepos.dk/api/stockFromEan HTTP/1.1 

token: <company token>
firmaid: <company id>
Content-Type: application/x-www-form-urlencoded
Accept: application/json

ean=52929,589954,84957
Update stock products amount
POST /updateStock

Update the stock of a product. This could be in the event of selling a product, a product being returned, etc.

Request headers

token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json

Request body

application/x-www-form-urlencoded
Object
hash
string required

The hash of the data

ean
string required

The ean of the product to update the stock on.

Example:
0001234567890
amount
string required

The amount to alter the stock by. Should always be positive. Use the type to control if the stock should be descreased or increased.

Example:
3
type
string required

The type of the operation, such as a Sale or a Return.

Enumeration:
2

Sale (decrease stock)

3

Return (increase stock)

Example:
2
orderno
string required

The orderno of the order which caused this stock update.

Example:
123456

Responses

200 OK

Successfull update

Body
application/xml
Object
info
Object
reply
string

OK

Examples

Xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<info>
	<info>
		<reply>OK</reply>
	</info>
</info>

Json

{
    "info": {
        "reply": "OK"
    }
}
200 NOT OK

Error

Body
application/xml
application/json
Object
info
Object
type
string
num
integer

Error code

Enumeration:
1

The product (ean) does not exsist.

2

Incorrect update type. Must be 1 (Sale) or 2 (Return).

3

No amount specified.

4

No orderno specified.

5

No webshop stock location availible.

text
string

Description of the error.

Examples

Json

{
    "info": {
        "type": "",
        "num": 1,
        "text": ""
    }
}

Xml

<?xml version="1.0" encoding="UTF-8"?>
<info>
	<info>
		<type>0</type>
		<num>0</num>
		<text>string</text>
	</info>
</info>
Example 1
POST https://api.onlinepos.dk/api/updateStock HTTP/1.1 

token: <company token>
firmaid: <company id>
Content-Type: application/x-www-form-urlencoded

hash=
&ean=0001234567890
&amount=3
&type=2
&orderno=123456
token
string required

Unique token from OnlinePOS

firmaid
integer required

Firmaid at OnlinePOS

Accept
string optional

For json response use application/json

Example:
application/json
TAW Product

Product schema

Object
id
integer

Product id

Example:
123456
name
string

Product name

Example:
Beer
price
string

Product price

Example:
100
soldout
integer

1 if product is soldout else 0

Example:
0
multi
integer

1 if product is a multi product else 0

description
string

Product description

Example:
Cold beer
type
string

item type

Example:
product
max
integer

if msg product, maximum pick

Example:
0
min
integer

if msg product, minmum pick

options
Array

if product is msg or multi, the options on the product

Object
id
integer

Product id

Example:
578234
name
string

Product name

Example:
Thousand Island Dressing
soldout
integer

1 if product is soldout else 0

price
string

Product price

Example:
0
multi
integer

1 if product is a multi product else 0

default
integer

Default product

max
integer

if msg product, maximum pick

min
integer

if msg product, minmum pick

type
string

item type

Example:
product
description
string

Product description

options
Array

keep going down array of this object

Object
Hash

Some api calls require a hash. The hash is all the data in the request body hashed using the hmac hash function together with a key. Contact support to get a key.

Object
Journal
POST /end_of_day_journal
end_of_day_journal
POST /end_of_day_journal

This is the endpoint where you will send a POST request to retrieve the end of day journal entries from within the given time interval.

Request parameters

time_from
string required

The starting timestamp for the journal entries. It is in ISO 8601 format (“YYYY-MM-DDTHH:mm:ss”).

Example:
2023-8-20T08:00:00
time_to
string required

The ending timestamp for the journal entries. It is in ISO 8601 format (“YYYY-MM-DDTHH:mm:ss”)

Example:
2023-8-21T08:00:00
cash_register_id
integer optional

The unique identifier for the cash register

Responses

200 OK
Body
Object
journal_entries
Array

Contains a list of end of day journal entries

Object
journal_number
integer

The unique identifier for the journal entry.

Example:
789
clerk_id
integer

The unique identifier for the clerk associated with the journal entry.

Example:
101
cash_register_id
integer

The unique identifier for the cash register.

Example:
456
cash_register_name
string

The name of the cash register.

Example:
Register A
department_code
string

The department code associated with the journal entry.

Example:
DPT001
venue_id
integer

The unique identifier for the venue where the transactions took place.

Example:
123
venue_name
string

The name of the venue.

Example:
Venue XYZ
time
string

The timestamp when the journal entry was recorded.

Example:
2023-10-12T15:30:00
journal_lines
Array

Contains a list of journal lines for the entry.

Object
journal_line_text
string

A description or text associated with the journal line

Example:
Sale of Product A
journal_line_account_number
string

The account number associated with the journal line.

Example:
ACCT001
journal_line_amount
number

The amount associated with the journal line.

journal_line_type
string

Indicates whether the journal line is a debit or credit entry.

Example:
debit
extended_data
Object

Contains additional extended data related to the journal entry.

debtor_sales
Array

Contains a list of debtor sales information.

Object
debtor_name
string

The name of the debtor.

Example:
John Doe
debtor_number
string

The unique identifier for the debtor.

Example:
12345
card_number
string

The card number used of the debtor.

Example:
1234
amount
number

The amount associated with the debtor sale

ean
string

The EAN (European Article Number) associated with the debtor sale.

Example:
1234567890123