External Api v2
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.
API calls for Product functionality
Get products
Request headers
Responses
OK
Body
The product id
The product name
The product group id
The product group name
Price 1
Price 2
Price 3
Price 4
Price 5
The cost price
The standard price
list of categories the product appears in
the id of the category
the name of the category
array of pricegroups indexed by their group number
individual group number for each pricegroup
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>
Create a new product
Request headers
Request body
HMAC hash of the request values Read more
The produkt name
The name of the product group the product should belong to. A new group will be created if the name does not exsist.
The price of the produkt
The cost price of the product
Responses
Body
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>
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 products
Request headers
Responses
OK
Body
List of active product groups
ID of product group
Name of product group
Description of product group
List of products in product group
ID of product
Name of Product
Price of product
Description of product
Cost price of product
Product Categories of product
ID of category
Name of category
Custom PLU 1
Custom PLU 2
ID of the Master of this product. (0 means no master)
Other registered prices (if any exists)
Pricegroup number
Name of pricegroup
Price of product when pricegroup is active
If the product is a split product (it contains sub products), then this list shows its content.
ID of sub product
Amount of sub product added
Total sales price of sub products (line price, not a unit price)
If the product is a MSG product, then this contains the ID of the MSG page connected to the product
List of all MSG pages
ID of MSG Page
Name of MSG page
Minimum number of selections required
Maximum number of selections allowed
If this field is present, then the total price of all selections should be this value
If field is present, contains the Product ID(s) of default selections.
List of Product ID’s available for selection
Examples
JSON Response
API calls for Sales functionality
{from}
/{to}
{from}
/{to}
{date}
{orderid}
{from}
/{to}
Get list of debtor sales
Path variables
Start of the period in unix time
End of the period in unix time
Request headers
Responses
{from}
/{to}
There can be multiple locations
Path variables
Start of the period in unix time
End of the period in unix time
Request headers
Responses
Body
2016.01.01 00:00:00 - 2018.07.24 00:00:00
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"
}
]
}
Get list of sales for a specific department or cardnumber
Request headers
Request body
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
Start of the period in unix time
End of the period in unix time
Get all sales from a specific terminal or group of terminals. Department is the name of the terminal(s)
Get all sales from a specific cardnumber
Whether to map product- and group-ids to the koncern ids
Responses
Response in JSON
Body
dd.mm.yyyy
hh:mm
If map_to_koncern is enabled this will show the id from the koncern
If map_to_koncern is enabled this will show the id from the koncern
The method of payment for the sale.
Number of guests involved with the sale.
The terminal or group of terminals a sale was made from.
Product id
Manufacturer product id
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!"
}
Response in XML (Default)
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
Get extended list of sales grouped by order lines
Request headers
Responses
Body
Timestamp for payment of the order line
Timestamp for when order is created
The ID of the order line
The ID of the order that the order line is related to
OnlinePOS check number
The ID of the product on the order line
The name of the product on the order line
Account
ID of the Master of this product. (0 means no master)
Account number
The ID of the product group that the product is related to
The name of the product group that the product is related to
EAN 1
EAN 2
EAN 3
EAN 4
The amount of product sold on the order line
The price/value of the order line
The price/value of the order line excl. VAT
The cost price of the product
The VAT rate related to the order line
The discount given on the order line
The payment type for the order line
The payment type ID for the order line
The clerk who received payment for the order line
The order number that the order line is related to
The number of guests registred on the order
The table number that the order line is related to
The terminal that the order line is sold on
The OnlinePOS customer number that the order line is registred on
The name of the company
Card number
The country that the card is related to
OnlinePOS pnumber (employee number)
The debtor number
The name of the debtor
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
}
{date}
Get extended list of sales grouped by order lines and date
Path variables
Get data from date and forward. type UNIX Timestamp
Request headers
Responses
Body
Timestamp for payment of the order line
Timestamp for when order is created
The ID of the order line
The ID of the order that the order line is related to
OnlinePOS check number
The ID of the product on the order line
The name of the product on the order line
Account
ID of the Master of this product. (0 means no master)
Account number
The ID of the product group that the product is related to
The name of the product group that the product is related to
EAN 1
EAN 2
EAN 3
EAN 4
The amount of product sold on the order line
The price/value of the order line
The price/value of the order line excl. VAT
The cost price of the product
The VAT rate related to the order line
The discount given on the order line
The payment type for the order line
The payment type ID for the order line
The clerk who received payment for the order line
The order number that the order line is related to
The number of guests registred on the order
The table number that the order line is related to
The terminal that the order line is sold on
The OnlinePOS customer number that the order line is registred on
The name of the company
Card number
The country that the card is related to
OnlinePOS pnumber (employee number)
The debtor number
The name of the debtor
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
}
{orderid}
Get extended list of sales grouped by order lines and starting order ID
Path variables
Get data from order id and forward
Request headers
Responses
Body
Timestamp for payment of the order line
Timestamp for when order is created
The ID of the order line
The ID of the order that the order line is related to
OnlinePOS check number
The ID of the product on the order line
The name of the product on the order line
Account
ID of the Master of this product. (0 means no master)
Account number
The ID of the product group that the product is related to
The name of the product group that the product is related to
EAN 1
EAN 2
EAN 3
EAN 4
The amount of product sold on the order line
The price/value of the order line
The price/value of the order line excl. VAT
The cost price of the product
The VAT rate related to the order line
The discount given on the order line
The payment type for the order line
The payment type ID for the order line
The clerk who received payment for the order line
The order number that the order line is related to
The number of guests registred on the order
The table number that the order line is related to
The terminal that the order line is sold on
The OnlinePOS customer number that the order line is registred on
The name of the company
Card number
The country that the card is related to
OnlinePOS pnumber (employee number)
The debtor number
The name of the debtor
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
}
API calls for Card functionality
{cardnumber}
{debtor}
/{type}
/{offset}
{cardnumber}
{offset}
{firmaid}
/{from}
/{to}
{cardnumber}
{cardnumber}
Get card info from card number
Path variables
The card number
Request headers
Responses
OK
Body
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": ""
}
]
{debtor}
/{type}
/{offset}
Get card list by debtor and type, return 1000 cards start from offset
Path variables
Customer’s debtor number
The type must be between 1-3
Staff card
Prepaid card
Giftcard
if not set default = 0
Request headers
Responses
OK
Body
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": ""
}
]
{cardnumber}
Get card info for a card within the koncern.
Path variables
The card number
Request headers
Responses
OK
Body
The card id
The card name
The card holders phone
The card pin code
The card group
The cards RFID if it has one
The card number
The type of card
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": ""
}
{offset}
Returns 1000 cards, starting from the defined offset. Offset default is 0.
Path variables
if not set default = 0
Request parameters
Filter results to only show cards with this registered email
Filter results to only show cards with this registered phone number
Request headers
Responses
OK
Body
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 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
Only list cards with a card number existing in this comma separated list.
012341234123413,012341234123414
Only list cards with card numbers equal to or higher than this card number.
Only list cards with card numbers equal to or lower than this card number.
Only list cards with a card group name existing in this comma separated list.
VIP,Special guest
If closed cards should be included in the list or not.
The current page in a paginated results.
Request headers
Responses
A non-paginated result was returned.
Body
The card’s database id
The card’s number
The name of the card’s owner
The phone number of the card’s owner
The card’s debtor
The card’s pincode
The card’s RFID
The name of the card’s card group
The card’s price group
The card’s discount in pct
The firmaid the card belongs to. Only given when a card is in a koncern.
The id of the waiter
The card’s balance
The card’s type. Se values in examples.
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.
No cards were found with the filters used!
A paginated result was returned. Page size = 50.
Body
The total number of pages in the paged result
The number of cards in every page of the paged result
The current page returned in the page result
The last page in the paged result
The cards of the current page in the paged result
The card’s database id
The card’s number
The name of the card’s owner
The phone number of the card’s owner
The card’s debtor
The card’s pincode
The card’s RFID
The name of the card’s card group
The card’s price group
The card’s discount in pct
The firmaid the card belongs to. Only given when a card is in a koncern.
The id of the waiter
The card’s balance
The card’s type. Se values in examples.
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.
Bad input was set in one of the parameters.
Hash Not Matching! or You don’t have access to this call! or User not found!
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 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
Only list cards with a card number existing in this comma separated list.
012341234123413,012341234123414
Only list cards with card numbers equal to or higher than this card number.
Only list cards with card numbers equal to or lower than this card number.
Only list cards with a card group name existing in this comma separated list.
VIP,Special guest
If closed cards should be included in the list or not.
The current page in a paginated results.
Request headers
Responses
A non-paginated result was returned.
Body
The card number
The name on the card
The card’s RFID no
The phone number on the card
The status of the card. “Active” or “Closed”
The firmaid the card belongs to. Only given when a card is in a koncern.
The card group the card belongs to - if any
Points listed by campaign
The name of the campaign
The unique id of the campaign
The current number of points for this campaign
No cards were found with the filters used!
A paginated result was returned. Page size = 50.
Body
The total number of pages in the paged result
The number of cards in every page of the paged result
The current page returned in the page result
The last page in the paged result
The cards of the current page in the paged result
The card number
The name on the card
The card’s RFID no
The phone number on the card
The status of the card. “Active” or “Closed”
The firmaid the card belongs to. Only given when a card is in a koncern.
The card group the card belongs to - if any
Points listed by campaign
The name of the campaign
The unique id of the campaign
The current number of points for this campaign
Bad input was set in one of the parameters.
Hash Not Matching! or You don’t have access to this call! or User not found!
Create a new staffcard, prepaid card or giftcard.
Request headers
Request body
HMAC hash of the request values Read more
The card type, 1 = standard card, 2 = prepaid card, 3 = giftcard
The new card name
The new card phone number
The new card debtor number. (Must be unique)
RFID for the card
Ekspedient number. (Must be unique)
0 or 1, if 1 use cardnumber as pnr
0 or 1, if 1 use debtor as pnr
The name of the group the card should belong to. A new group will be created if the name does not exist.
Only relevant if Staff Card. (Must be 6 digits or less)
The id of the price group the card will order products from
The discount of the card in percentage.
The cardholders email address
The cardholders birthdate (formatted as yyyymmdd)
Block the card for being use for payment. 1 to block card and 0 to not block. Default is 0
Responses
OK
Body
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>
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 multible cards at the same time. The limit is creating 1000 cards at the same time.
Request headers
Request body
List of card to make
HMAC hash of the request values Read more
The card type, 1 = standard card, 2 = prepaid card, 3 = giftcard
The new card name
The new card phone number
The new card debtor number. (Must be unique)
RFID for the card, if set it will be the cardnumber of the card to
Only relevant if standard card(type 1). Ekspedient number. (Must be unique)
0 or 1, if 1 use cardnumber as pnr
0 or 1, if 1 use debtor as pnr
The name of the group the card should belong to. A new group will be created if the name does not exist.
Only relevant if standard card (type 1). (Must be 6 digits or less)
The id of the price group the card will order products from
The discount of the card in percentage.
The cardholders email address
The cardholders birthdate (formatted as yyyymmdd)
Block the card for being use for payment. 1 to block card and 0 to not block. Default is 0
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
Body
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 an existing card
Request headers
Request body
HMAC hash of the request values Read more
The carnumber of desired card you want to modify
The new name for card
The new phone number for card
The new debtor number for card
The new RFID for card
The id of the group the card should be moved to.
Set true if you want to delete card
The cardholders email address
The cardholders birthdate (formatted as yyyymmdd)
The discount of the card in percentage.
Examples
Responses
Body
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>
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 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
Request body
Firmaid at OnlinePOS. Must match the one sent in the header.
The updates per card that is to be made.
The number of the card to update
The updates that is to be made on a card
Update the card’s RFID no
Update the owner of the card’s name
Update the owner of the card’s phone number
Update the owner of the card’s email
Update the owner of the card’s birthday
Update the id of the card’s card group
Update the card’s discount(in pct)
Update the no of the card’s price group
Update the card’s balance
If the card needs to be deleted. 0 = No, 1 = Yes.
Responses
Body
The updates per card that was to be made. Incl. status.
A number that representat an info/error message.
Card was updated
Card was deleted
Card was already updated
Card was not found.
No updates was given for this card
Information was missing on whether to update or deleted the card
Birthday is not formatted correctly
Birthday is not a valid date in the calendar
RFID is not unique
Debtor number is not unique
A group with this id doesn’t exist
Failed validation of input for update.
Other. See a more specific error code in ‘message’.
The value of a field wasn’t updated.
An info/error message.
The firmaid the card belongs to. Only given when a card is in a koncern.
Deposit a value to a specific card
Request headers
Request body
HMAC hash of the request values Read more
The card number
The amount you want to deposit
Use this parameter to set the cards balance to amount. Default behaviour the balance is modified by amount.
Responses
OK
Body
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>
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 a new voucher
Request headers
Request body
Hash of the data
Name of the new voucher
Voucher number, must be unique
Id of the campaign the voucher is associated with
Date the voucher is valid from. Following the format YYYYMMDD
Date the voucher is valid to. Following the format YYYYMMDD
Responses
When using JSON response
Body
Examples
Successful operation
{
"status": "Voucher created",
"cardnumber": "1000000007"
}
Failed operation
{
"ERROR": "voucherno is not unique!"
}
Body
Examples
Successfull operation
Failed operation
Incorrect credentials, privledges or hash.
Create multipe vouchers from an interval of card numbers
Request headers
Request body
Hash of the data. Data order: token, firmaid, voucherNoFrom, voucherNoTo, name, campaignid, points, startDate and endDate. Read more
Start card number for voucher
End card number for voucher
Amount of points on voucher/card
Id of campaign the voucher/card is part of
Name of the voucher/card. Default is Gavekort
Start date for voucher/card to be active if the is one. Format is YYYYMMDD
End date for voucher/card to be active if the is one. Format is YYYYMMDD
Examples
Example of json body
{
"hash": "Test",
"voucherNoFrom": "10000",
"voucherNoTo": "15000",
"points": 10,
"campaignid": 26,
"name": "Test",
"startDate": 20210304,
"endDate": 20210304
}
Responses
Body
Status of call can be Vouchers created or ERROR
Error message, error is only the if status is ERROR
Examples
On Error
{
"status": "ERROR",
"error": "Hash Not Matching!"
}
On Succes
{
"status": "Vouchers created"
}
{firmaid}
/{from}
/{to}
Get a list of deposits and withdrawals per card in the given time period.
Path variables
Customer number
From time as unix timestamp
to time as unix timestamp
Request headers
Responses
OK
Body
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"
}
]
{cardnumber}
Get historic data for all balance changes on the given card.
Path variables
Card number
Request headers
Responses
OK
Body
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_id}
{campaignid}
Request parameters
Whether or not to show inactive campaigns
Request headers
Responses
Body
List of campaigns
Id of campaign
Name of campaign
whether the campaign is active or not
The type of the campaign (amount, price, points)
List of company ids the campaing works on.
[1,2]
Examples
{
"Campaigns": [
{
"campaign": {
"campaignID": 1,
"campaignName": "",
"active": 1,
"type": "points",
"free_split": 1,
"free_msg": 1,
"auto_add": 1,
"info_view": 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
}
}
]
}
{campaign_id}
Path variables
The campaign id you wish to look up products for
Request headers
Responses
Body
List of reward products
The cost to activate the campaign deal
The price of the product after activation
list of collection products
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
}
]
}
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
}
]
}
{campaignid}
Path variables
id of the campaign to edit
Request headers
Request body
HMAC hash of the request values Read more
New name of the campaign
valid id of the new cardgroup for the campaign
Whether the campaign is active or not
List of company id the campaign can be use on, if no company id is set it runs on all in the concern
[1, 2]
List of company id to remove from whitelist
[1, 2]
Responses
JSON Success
Body
JSON Error
Body
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
Request headers
Request body
The cardnumber of the card to adjust the value of
The rfid of the card to adjust the value of
The campaign to adjust the value of the card on
What value to adjust the card with (positive or negative)
Responses
JSON
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 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
Request body
Firmaid at OnlinePOS. Must match the one sent in the header.
The number of the card to update
The id of the campaign to update
The value to adjust with. Can be negative.
Responses
Body
The number of the card that was to be updated
The id of the campaign that was to be updated
The value that was to be adjusted with. Can be negative
The firmaid the card belongs to. Only given when a card is in a koncern.
A number that representat an info/error message.
Card was updated
Card was deleted
Card was already updated
Card was not found.
No updates was given for this card
Information was missing on whether to update or deleted the card
Birthday is not formatted correctly
Birthday is not a valid date in the calendar
RFID is not unique
Debtor number is not unique
A group with this id doesn’t exist
Failed validation of input for update.
Other. See a more specific error code in ‘message’.
The value of a field wasn’t updated.
An info/error message.
Request headers
Request body
HMAC hash of the request values Read more
The cardnumber of the card to look up
The rfid of the car do look up
Responses
JSON Success
Body
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>
JSON Error
Body
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=
Schema for card list
Card id
Card holders name
Card holders phone
The cardholders email
The cardholders birthday. Format YYYYMMDD
The discount on the card, as a percentage.
The card group
The RAID for the card, if the card have one
The card number
The type of the card
The balance on the card, if the card has one
Return yes if the card is close else return no
Call to make an order.
Request headers
Request body
The name of the person who order
The phone number of the person who order
The email of the person who order
The time the order is ready for pickup. format hh:mm 24h (23:59)
The total sum of the cart. Used to verify the price is as expected.
The total amount of lines in the cart. Used to verify the amount is as expected.
0 = not a delivery order, 1 = an delivery order. if not set defaults to 0
The address for delivery. Is required if forDelivery = 1
The zip code for delivery. Is required if forDelivery = 1
The city for delivery. Is required if forDelivery = 1
This is the time the order is at the customer. format hh:mm 24h (23:59). Is required if forDelivery = 1
Number of people on the order
The date for the order. format yyyymmdd
If the ordre is already paid = 1, if the order is not paid = 0. if not set default to 0
The type of the order, taw = 1, kiosk = 2, app = 3. if not set default to 1
The cart
The product id
The indentation of the line
The amount on the line
The total price of the line
Normal
Writes “uden” in front of the product.
Writes “med” in front of the product.
Doesn’t print the product on the kitchen receipt.
The vat rate of the order(in percent per thousands)
Shop id, is used to send an order to another company then the firmaid from the header
Use this to set another customer ordernumber on the kds screen
Note from person that made the order
The time when the order should be sent to the kitchen. Format: hh:mm
Table number for the order (if relevant)
Floor ID for the order (if relevant)
Determines whether the order must be parked on the given table in the POS-system. Park on table requires that the customer has sat up a table plan and optionally a floor plan in OnlinePOS backend. Park on table will only be accepted if sent ‘table’ and optionally floor is valid for the customer. Park on table cannot be true, if the order is marked with ‘paid’ = 1.
Value of tips paid on the order
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
Payment type of the order. Options are Online or App. Default is Online
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
Body
The status of the order if succes = OK on error = ERROR
The number the order have be given. Only here if make order is success
The error msg. Only here if make order failed
Examples
json
{
"status": "OK",
"ordernumber": "1000",
"error": "The cart field is required"
}
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 api
Api call to get taw products
Request headers
Responses
Body
Group id
Group name
Group description
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": [
{}
]
}
]
}
]
}
]
}
Api call to get shops
Request headers
Responses
Body
Array of shops
shop id
shop name
The address of the shop
The postcode for the shop
The city the shop is in
Examples
json
{
"shops": [
{
"id": 1,
"name": "OnlinePOS",
"address": "",
"postcode": "8920",
"city": "Randers"
}
]
}
Api call to get timeslots
Request parameters
if date is not in the url it will use the current date. format yyyymmdd
Request headers
Responses
Body
The date for the timeslots. format yyyymmdd
Array of timeslots
["00:00", ...]
Examples
json
{
"date": "20190910",
"timeslots": [
""
]
}
Api call to make an ordre, If new use External order make order
Request headers
Request body
name of the customer
phone number of the customer
email of the customer
the cart of product for the order (price is total for line)
The product id
The amount on the line
The total price of the line
The indentation of the line
The vat rate of the order(in percent per thousands)
Normal
Writes “uden” in front of the product.
Writes “med” in front of the product.
Doesn’t print the product on the kitchen receipt.
Time for the ordre. format hh:mm
Date for the ordre. format yyyymmdd. if not set use current day
Note for the kitchen
Number of people on the ordre
The time when the order should be sent to the kitchen. Format: hh:mm
If the ordre is for another company the the firmaid from the header set shopId
if 1 the ordre is mark as an delivery ordre else 0. not set = 0
Time for when ordre is at customer. format hh:mm
Address for delivery Required if forDelivery = 1
Zipcode for delivery Required if forDelivery = 1
City for delivery Required if forDelivery = 1
Set 1 if order is paid. if property is not set it equal 0 (not paid)
Payment type of the order. Options are Online or App. Default is Online
Responses
Body
OK
The number of the ordre
Examples
JSON
{
"status": "OK",
"ordernumber": "123"
}
Body
Error message
Examples
JSON
{
"error": "Email empty"
}
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
¬e=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
API calls for Koncern functionality
{form}
/{to}
{from}
/{to}
Get list of transaction lines across a whole koncern. The response has a limit of 10000 lines.
Request headers
Request body
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.
Start of the period in unix time
End of the period in unix time
Get all sales from a specific cardnumber
And offset for sales, where the 1000 lines start from.
The id of a specific location in the koncern
Get all sales from a specific terminal or group of terminals. Department is the name of the terminal(s)
Responses
Success
Body
Orderno.
unix timestamp
The method of payment for the sale.
Number of guests involved with the sale.
The terminal or group of terminals a sale was made from.
Product id
Manufacturer product id
Sales account of the product or productgroup
Total value of discount given on this sale
ID of the Master of this product. (0 means no master)
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": "",
"account": "1234",
"discount": "0,00"
}
}
]
}
Error
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
{form}
/{to}
Get list of transaction lines across a whole koncern filtered by time. The response has a limit of 10000 lines.
Path variables
Start of the period in unix time
End of the period in unix time
Request headers
Responses
Body
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 all locations and departments within a koncern. In OnlinePOS, locations are firmaID’s and departments are terminal logins
Request headers
Responses
Body
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>
{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 time as unix timestamp
to time as unix timestamp
Responses
Body
{Customerno}
/{from}
/{to}
{firmaid}
{firmaid}
This call is used for getting the relation between products and stock products
Request parameters
pagination page
Request headers
Responses
Body
Data for relation between products and stock products
Id of the product
The list of stock products related to the product
Id of the stock product
Amount of stock products used with one product
First number of product shown
URL for next page if there is one
Number of products per page (MAX 5000)
URL for previous page if there is one
Last number of product shown
Current page
Status of call (OK on success else error)
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"
}
{Customerno}
/{from}
/{to}
Path variables
Customer ID of venue in the group
Start of period (Unix timestamp)
End of period (Unix timestamp)
Request headers
Responses
Body
ID of the stock product
Name of the stock product’s group
Name of the stock product
Amount of stock product consumed in the given period (in units)
Name of the unit consumed
Value of the consumed amount in the currency used by the venue.
Examples
[
{
"Product_ID": 1234,
"Product_Group": "Bottles",
"Product_Name": "Beer",
"Consumption_in units": "15",
"Product_Unit": "Fl",
"Consumption_value": "5"
}
]
{firmaid}
Get a list of all stock locations that are created on a given customer.
Path variables
Firmaid at OnlinePOS
Request headers
Responses
Body
ID of the stock location
Name of the stock location
Indicates if this is the main stock location
ID of the stock location
Name of the stock location
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
}
]
}
}
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 id
unix timestramp
Request headers
Responses
Body
cost price multipled with amount
Examples
{
"product_id": 1,
"amount": "0.000",
"value": "0.000"
}
{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 at OnlinePOS
Request parameters
location id
Unix timestramp
Request headers
Responses
Body
An array of Stock locations
Stock location id
An array of Stock values based on the location
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_id}
{offer_id}
/add{offer_id}
/removeGet a list of offers. Offers are reffered to as “Discount families” in OnlinePOS.
Request headers
Responses
Body
Which weekdays the offer is active on
Create an offer. Offers are reffered to as “Discount families” in OnlinePOS.
Request body
The date the offer is valid from, exclude if unlimited
The date the offer is valid until, exclude if unlimited
Which days the offer is active on. Comma seperated days from mon-sun
The priority (order) the offer applies, lower numbers are applied first
Product ID - Required if gid not specified
Product Group ID - Required if pid not specified
The applied offer price of the product(s)
The applied percentage discount of the product(s)
The amount of products to buy, for the offer to activate
Responses
Offer created
Credentials incorrect, lacking permissions
{offer_id}
Edit an existing offer. Offers are reffered to as “Discount families” in OnlinePOS.
Path variables
The id of the offer you’re editing
Request body
The date the offer is valid from, exclude if unlimited
The date the offer is valid until, exclude if unlimited
Which days the offer is active on. Comma seperated days from mon-sun
The priority (order) the offer applies, lower numbers are applied first
Responses
Updated
The offer you’re trying to edit does not exist
Credentials incorrect, lacking permissions
{offer_id}
/addAdd a new sales product to an existing offer. Offers are reffered to as “Discount families” in OnlinePOS.
Path variables
Request body
Product ID - Required if gid not specified
Product Group ID - Required if pid not specified
The applied offer price of the product(s)
The applied percentage discount of the product(s)
The amount of products to buy, for the offer to activate
Responses
Credentials incorrect, lacking permissions
The offer you’re trying to edit does not exist
{offer_id}
/removeDelete a sales product from an existing offer. Offers are reffered to as “Discount families” in OnlinePOS.
Path variables
Request body
Responses
Deleted
The offer you’re trying to edit does not exist
Credentials incorrect, lacking permissions
API calls for Webshop functionality
Returns an array of info about stock products
Request headers
Responses
Ok
Body
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>
Error
Body
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": ""
}
}
This call can be used to see how many of a product is in stock, by it’s ean number.
Request headers
Request body
The ean as comma separated string or a single ean.
Responses
Response in JSON
Body
Examples
Successfull response returns an array of ean/stocks pairs for each ean number given
{
"info": [
{
"info": {
"ean": "",
"stock": ""
}
}
]
}
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 the stock of a product. This could be in the event of selling a product, a product being returned, etc.
Request headers
Request body
The hash of the data
The ean of the product to update the stock on.
The amount to alter the stock by. Should always be positive. Use the type to control if the stock should be descreased or increased.
The type of the operation, such as a Sale or a Return.
Sale (decrease stock)
Return (increase stock)
The orderno of the order which caused this stock update.
Responses
Successfull update
Body
OK
Examples
Xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<info>
<info>
<reply>OK</reply>
</info>
</info>
Json
{
"info": {
"reply": "OK"
}
}
Error
Body
Error code
The product (ean) does not exsist.
Incorrect update type. Must be 1 (Sale) or 2 (Return).
No amount specified.
No orderno specified.
No webshop stock location availible.
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>
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
Unique token from OnlinePOS
Firmaid at OnlinePOS
For json response use application/json
Product schema
Product id
Product name
Product price
1 if product is soldout else 0
1 if product is a multi product else 0
Product description
item type
if msg product, maximum pick
if msg product, minmum pick
if product is msg or multi, the options on the product
Product id
Product name
1 if product is soldout else 0
Product price
1 if product is a multi product else 0
Default product
if msg product, maximum pick
if msg product, minmum pick
item type
Product description
keep going down array of this object
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
The starting timestamp for the journal entries. It is in ISO 8601 format (“YYYY-MM-DDTHH:mm:ss”).
The ending timestamp for the journal entries. It is in ISO 8601 format (“YYYY-MM-DDTHH:mm:ss”)
The unique identifier for the cash register
Responses
Body
Contains a list of end of day journal entries
The unique identifier for the journal entry.
The unique identifier for the clerk associated with the journal entry.
The unique identifier for the cash register.
The name of the cash register.
The department code associated with the journal entry.
The unique identifier for the venue where the transactions took place.
The name of the venue.
The timestamp when the journal entry was recorded.
Contains a list of journal lines for the entry.
A description or text associated with the journal line
The account number associated with the journal line.
The amount associated with the journal line.
Indicates whether the journal line is a debit or credit entry.
Contains additional extended data related to the journal entry.
Contains a list of debtor sales information.
The name of the debtor.
The unique identifier for the debtor.
The card number used of the debtor.
The amount associated with the debtor sale
The EAN (European Article Number) associated with the debtor sale.