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 Card functionality
{debtor}
/{type}
/{offset}
{offset}
{cardnumber}
{cardnumber}
{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": ""
}
]
{offset}
Return a 1000 cards, start from offset, offset default = 0
Path variables
if not set default = 0
Request headers
Request body
Sending a body is optional.
When using filters make sure to set the correct content-type (application/json).
Find only cards with this given phone/mobile number
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>
<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>
<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": ""
}
]
{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>
<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,
"debtor": "",
"cardgroup": "",
"RFID": "",
"cardnumber": "",
"cardtype": "",
"balance": "",
"deleted": ""
}
]
{cardnumber}
Get info for a card on koncern level
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": ""
}
Create a new staffcard, pre-pay 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
Add multiable cards at onec. Max 1000 at a 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
Deposit to a 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.
Api call to create voucher from a 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"
}
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
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
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"
}
}
}
]
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>
</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
API calls for Sales functionality
{from}
/{to}
{from}
/{to}
{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
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
API calls for Koncern functionality
{form}
/{to}
Get list of sales for koncern. The response will return 1000 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.
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": ""
}
}
]
}
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}
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
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 under a koncern
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>
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
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)
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)
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
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
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
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
}
],
"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"
}
{campaignid}
{campaign_id}
{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
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
}
]
}
{offer_id}
{offer_id}
/add{offer_id}
/removeRequest headers
Responses
Body
Which weekdays the offer is active on
Request body
Responses
Offer created
Credentials incorrect, lacking permissions
{offer_id}
Path variables
The id of the offer you’re editing
Request body
Responses
Updated
The offer you’re trying to edit does not exist
Credentials incorrect, lacking permissions
{offer_id}
/addPath variables
Request body
Responses
Credentials incorrect, lacking permissions
The offer you’re trying to edit does not exist
{offer_id}
/removePath variables
Request body
Responses
Deleted
The offer you’re trying to edit does not exist
Credentials incorrect, lacking permissions
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
Offer lines, products or product groups, included in this offer
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
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
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"
}