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}