sidemenu_home

sidemenu_noom

sidemenu_noom_station

sidemenu_cloudics_station

sidemenu_cloudics_merchant

sidemenu_cloudics_station_eng-test-new

Version: 1.33

 Table of Contents

Introducing NoomService API

NoomService API can be used to perform a wide array of tasks. You can use NoomServices as backend for your other business applications. For example:

Overall Capabilities

NoomService API allows managing a number of features, namely:

Getting started

PREREQUISITE - In order to use NoomService API, you should have needed agreements with NoomService API service provider - Astro Baltics OÜ


This specification helps you to implement the NoomService API.  The API is stateless – all requests are validated against an access token. The access token can be obtained fetching the Authorations request "USERACCESS"

Every API call is a HTTP POST request in traditional parameter1=value1&parameter2=value2 format. Server responds by sending an JSON document containing status information and data records.

host: https://URL

port:: PORT

user: USERNAME

pass: PASSWORD

Access token

For retrieving the access token you need to use the following request:

Request

https://URL:PORT/api/?act=USERACCESS&user=USERNAME&pass=PASSWORD

where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and defines action type
USERACCESS
YesAction type for receiveing access token
user
YesAPI username
pass
YesAPI password

Response

Access token response - success
{
 status: 1,
 msg: "",
 time: 0.281,
 data: {
  accesstoken: "xxxxxxxxxxxxxxxx" }
}
Access token response - error
{
 status: 0,
 msg: "Invalid user or password!",
 time: 1.006,
 data: null
}

where:

FieldNameTypeDescription
status 
1=success 0=error
msgSTRINGFilled incase of error or warning - description
time
Response time
data
Access token for the next queries. Access token must be provided as part of the query string for all requests, using the 'accesstoken' variable

List of NoomService API resources

With following requests you can INSERT documents with document types (e.g. LS,LV, LI...) and statuses (e.g. 0,1,2,3...) according to business requirements.

PREREQUISITE - NOOM document managent with API resources is adjusted with access permissions set up by API service provider.

Response

Not enough userrights to excute the request
{
"status": 0,
"msg": "NEW LS.2T You do not have privileges to do this operation!",
"time": 0.269,
"data": null
}

Create new open document in memory - ODOC_NEW

Creating new open document into NOOM - responding with NOOM internal document unique ID for further transactions.

Request

https://URL:PORT/api/?act=ODOC_NEW&doctype=LS&docst=2T&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and defines action type
doctypeCHAR(3)YesDocument type in NOOM (e.g. LS,LV, LI...)
docstCHAR(3)YesDocument type status in NOOM (e.g. 0,1,2,3...) 
related.dhidNUMERIC(10)NoUsed to set relation for another document by document id
realated.docuidVARCHAR(20)NoUsed to set relation for another document by document unique_id

where:

FieldNameTypeDescription
docuidCHAR(20)NOOM internal document unique ID.

Response

ODOC_NEW response - success
{
"status": 1,
"msg": "",
"time": 0.031,
"data": {
"docuid": "0001077484" }
}


Open an existing document for editing - ODOC_MODIFY

Request

https://URL:PORT/api/?act=ODOC_MODIFY&DOCUID=0001234567&local=0&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
localINTEGERNo Values larger than 0 indicate a local base
docuidCHAR(20)YesNOOM internal document unique ID

Response

ODOC_MODIFY response - success
{
"status": 1,
"msg": "",
"time": 0.047,
"data": {
"docuid": "0003443324" }
}
ODOC_MODIFY response - failure
{
"status": 0,
"msg": "Document does not exist 0003443324x",
"time": 0.062,
"data": null
}


Add/modify data in an open document - ODOC_SETDATA

Requires the document to be in edit mode first through either ODOC_NEW or ODOC_MODIFY

Request

https://URL:PORT/api/?act=ODOC_SETDATA&docuid=0001077484&objname=document&objdata={"header":{"customer_id":1,"datetime":"25.06.2018 10:33:59"}}&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and action type
docuid
YesDocument unique ID
objname
Yes

document - whole document JSON

header - document header

rows - array of rows

row - singular row, determined by the "rowno" attribute

getdocINTEGERNoif 1 saved document data is returned in response 'data/getdocdata'

Header attributes (including, not limited to)

datetimeTIMESTAMPHEADER: Document datetime, Undefined, NOOM will set currentdate
documentnoCHAR(20)HEADER: Document numer can be set externally. Undefined, NOOM will set doc.no from sequence
location_idCHAR(10)HEADER: Document is connected with location. Undefined, NOOM will set default location_id
object_idCHAR(6)HEADER: Document is connected with object/stack. Undefined, NOOM will set default object_id
customer_idNUMERIC(10)HEADER: Document customer ID
customerlocation_idNUMERIC(10)HEADER: Document customer location ID. In some cases customer have branches, locations
textVAR(250)HEADER: External comments/notes
text2VAR(250)HEADER: Internal comments/notes

Row attributes (including, not limited to)

rownoNUMERIC(4)Row number, used for row identification during creation
bach_idNUMERIC(10)Batch ID
product_idNUMERIC(10)Product ID
object_idCHAR(6)Object ID
quantityNUMERIC(15,5)Row quantity
priceNUMERIC(15,4)Price


Data from ODOC_GETDOC can be used as an example for formatting.

Examples

ODOC_SETDATA examples
https://URL:PORT/api/?act=ODOC_SETDATA&docuid=0003443386&objname=document&objdata={"rows":[{"object_id":"PSTM"},{"object_id":"TRTH"}]}&accesstoken=ACCESSTOKENhttps://URL:PORT/api/?act=ODOC_SETDATA&docuid=0003443386&objname=header&objdata={"customer_id":2}&accesstoken=ACCESSTOKENhttps://URL:PORT/api/?act=ODOC_SETDATA&docuid=0003443385&objname=rows&objdata=[{"object_id":"PSTM"},{"object_id":"TRTH"}]&accesstoken=ACCESSTOKENhttps://URL:PORT/api/?act=ODOC_SETDATA&docuid=0003443386&objname=row&objdata={"rowno":2,"object_id":"PSTM"}&accesstoken=ACCESSTOKEN

Response

ODOC_SETDATA response
{
"status": 1,
"msg": "",
"time": 0.012,
"data": null
}


Check if document is open - ODOC_CHECK

Request

https://URL:PORT/api/?act=ODOC_CHECK&docuid=0001234567&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and action type
docuid
YesDocument unique ID
checklevel
No=1 when running check scripts instead

Response

ODOC_CHECK response - success
{
"status": 1,
"msg": "",
"time": 0.046,
"data": null
}
ODOC_CHECK response - failure
 {
"status": 0,
"msg": "Invalid UID: 000344332",
"time": 0.046,
"data": null
}


List all open documents - ODOC_LIST

Request

https://URL:PORT/api/?act=ODOC_LIST&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and action type
docuid
YesDocument unique ID

Response

ODOC_LIST response - success
{
"status": 1,
"msg": "",
"time": 0.257,
"data": [ {
"docuid": "0001077482" },
{
"docuid": "0001077552" } ]
}


Get data from an open document - ODOC_GETDOC

Requires the document to be in edit mode first through either ODOC_NEW or ODOC_MODIFY

NB! some empty or null data can be omitted from the result

Request

https://URL:PORT/api/?act=ODOC_GETDOC&docuid=0001234567&what=3&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act
YesNOOM API endpoint and action type
docuidCHAR(20)YesNOOM internal document unique ID
whatIntegerNo

1 - row information only
2 - minimal row information only
3 - full document

Response

ODOC_GETDOC response - success
 {
"status": 1,
"msg": "",
"time": 0.844,
"data": {
"amount": 15.00,
"amounttopay": 15.00,
"document": {
"documentname": "Test document",
"company": {
"searchcode": "27864",
"regno": "10000000",
"name": "TEST",
"address": "TEST 7",
"vatregno": "EE1000000",
"wwwaddr": "www.test.ee",
"address1": "Test 7",
"address2": "",
"city": "Tallinn",
"zip": "60000",
"county": "Harjumaa",
"country_id": "EST" },
"header": {
"id": "3443324",
"doctype_id": "LV",
"status_id": "12",
"location_id": "TST",
"datetime": "03.03.2020 15:32:22",
"documentno": "000002-0TST1",
"location": {
"searchcode": "TST",
"name": "Test äri",
"address": "TEST",
"address1": "Test",
"city": "Tallinn",
"zip": "60000",
"county": "Harjumaa",
"country_id": "EST" },
"locationcontact": {
"name": "Astro Test 2",
"phone": "55667788",
"email": "test@noom.ee",
"searchcode": "34694" },
"customer_id": 1,
"customer": {
"searchcode": "ASTRO",
"regno": "10386779",
"name": "Astro Baltics OÜ",
"address": "Raatuse tn 20, Tartu linn Tartu linn 51009 EST",
"vatregno": "EE100042395",
"wwwaddr": "www.noom.ee",
"address1": "Raatuse tn 20, Tartu linn",
"city": "Tartu linn",
"zip": "51009",
"county": "Tartu maakond",
"country_id": "EST" },
"object_id": "TESH",
"currency_id": "EUR",
"language_id": "ET",
"docstate_id": "K",
"additional13": "123",
"ref_testref": "123",
"unique_id": "0003443324",
"stockdirection": "O",
"stockentrytype": "O",
"creationdatetime": "03.03.2020 15:32:22",
"cardprocesstype": "0",
"ledgeroperation": "LV6",
"sent": "",
"workplace_id": "TEST",
"user_id": "APITEST",
"pos_id": "",
"table_id": "",
"disableledgerop": "",
"remotedocheader_id": "",
"opentable": "",
"shift_id": "",
"disablestockop": "",
"disableledgerop2": "",
"person_id": "" },
"rows": {
"row": {
"id": "22359320",
"batch_id": 34463,
"product_id": 15848,
"quantity": 5,
"price": 3,
"amount": 15,
"price1": 6.5,
"priceclassprice": 6.5,
"measurunit_id": "TK",
"searchcode": "601264",
"batchname": "T",
"text": "Test (Tst)",
"vat_id": "20",
"group_id": "Test",
"netprice": 2.5,
"pricefixed": "+",
"unique_id": "0022359320",
"service": "-",
"barcode": "60104410",
"netamount": 12.5,
"vatrate": 20,
"vatamount": 2.5,
"producerprodcode": "28.11",
"supplier_id": "40",
"recipe_id": "0",
"transactiontime": "03.03.2020 16:31:57" } },
"payments": {
"payment": {
"paymentdatetime": "03.03.2020",
"paymenttype": "P",
"paymenttypename": "Payment",
"paymentmode": "B",
"paymentmodename": "Bank Card",
"paymentmodeex": "",
"amount": "15,00",
"amountincurrency": "15,00",
"currency_id": "EUR",
"text": "",
"creationdatetime": "03.03.2020 16:48:38",
"unique_id": "0002164897",
"location_id": "TST",
"workplace_id": "Test",
"user_id": "APITEST" } } } }
}
ODOC_GETDOC response - failure
 {
"status": 0,
"msg": "Invalid UID: 0003443324",
"time": 0.047,
"data": null
}


Add new item sale to open document - ODOC_ITEMSALE

Requires the document to be in edit mode first through either ODOC_NEW or ODOC_MODIFY

Request

https://URL:PORT/api/?act=ODOC_ITEMSALE&docuid=0001077550&batch_id=5797&quantity=3,345&price=8,67&rowno=1&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and defines action type
docuid
YesDocument unique ID
rownoNUMERIC(4)NoROW: Row number. (default next available)
batch_idNUMERIC(10)Yes
(One of the 2)
ROW: Product batch ID
searchcodeCHAR(20)ROW: Product searchcode
quantityNUMERIC(15,5)NoROW: Product quantity
priceNUMERIC(15,4)YesROW: Product unit price, not mandatory
getdocINTEGERNoif 1 saved document data is returned in response 'data/getdocdata'

Examples

ODOC_SETDATA examples
https://URL:PORT/api/?act=ODOC_ITEMSALE&docuid=0001077484&searchcode=GA0004&accesstoken=ACCESSTOKENhttps://URL:PORT/api/?act=ODOC_ITEMSALE&docuid=0001077484&batch_id=58&accesstoken=ACCESSTOKENhttps://URL:PORT/api/?act=ODOC_ITEMSALE&docuid=0001077484&batch_id=58&quantity=2&accesstoken=ACCESSTOKENhttps://URL:PORT/api/?act=ODOC_ITEMSALE&docuid=0001077484&searchcode=GA0004&quantity=2&price=11.5&rowno=1&accesstoken=ACCESSTOKEN

Response

ODOC_ITEMSALE response - success
{
"status": 1,
"msg": "",
"time": 0.012,
"data": null
}


Add item to document via barcode - ODOC_BARCODESALE

Requires the document to be in edit mode first through either ODOC_NEW or ODOC_MODIFY

Request

https://URL:PORT/api/?act=ODOC_BARCODESALE&docuid=0001234567&barcode=60100000&doinsert=1&rowno=2&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and defines action type
docuidCHAR(20)YesNOOM internal document unique ID
barcodeCHAR(16)YesItem's barcode
doinsertINTEGERYes0 for row modifying, 1 for insertion
rownoINTEGERYesRow number where the item will be added
quantityINTEGERNoquantity, if not defined quantity 1 is used
getdocINTEGERNoif 1 saved document data is returned in response 'data/getdocdata'

Response

ODOC_BARCODESALE response - success
 {
"status": 1,
"msg": "",
"time": 0.250,
"data": null
}
ODOC_BARCODESALE response - failure
 {
"status": 0,
"msg": "Invalid UID: 000344332",
"time": 0.047,
"data": null
}


Edit row quantity - ODOC_ITEMSETQTY

Requires the document to be in edit mode first through either ODOC_NEW or ODOC_MODIFY

Request

https://URL:PORT/api/?act=ODOC_ITEMSETQTY&docuid=0001234567&rowno=1&quantity=10&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and defines action type
docuidCHAR(20)YesNOOM internal document unique ID
rownoINTEGERYesRow number to edit
quantityNUMERIC(15,5)YesNew quantity
getdocINTEGERNoif 1 saved document data is returned in response 'data/getdocdata'

Response

ODOC_ITEMSETQTY response - success
 {
"status": 1,
"msg": "",
"time": 0.031,
"data": null
}
ODOC_ITEMSETQTY response - failure
 {
"status": 0,
"msg": "Request sent and answer received.",
"time": 0.031,
"data": null
}


Delete a row - ODOC_ROWDEL

Requires the document to be in edit mode first through either ODOC_NEW or ODOC_MODIFY

Request

https://URL:PORT/api/?act=ODOC_ROWDEL&docuid=0001234567&rowno=1&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and defines action type
docuidCHAR(20)YesNOOM internal document unique ID
rownoINTEGERYesRow number to delete
getdocINTEGERNoif 1 saved document data is returned in response 'data/getdocdata'

Response

ODOC_ROWDEL response - success
 {
"status": 1,
"msg": "",
"time": 0.204,
"data": null
}
ODOC_ROWDEL response - failure
{
"status": 0,
"msg": "Request sent and answer received.",
"time": 0.031,
"data": null
}


Query payment types for a document - ODOC_GETPAYMODES

Requires the document to be in edit mode first through either ODOC_NEW or ODOC_MODIFY

Request

https://URL:PORT/api/?act=ODOC_GETPAYMODES&docuid=0001234567&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and defines action type
docuidCHAR(20)YesNOOM internal document unique ID
getdocINTEGERNoif 1 saved document data is returned in response 'data/getdocdata'

Response

ODOC_GETPAYMODES response - success
 {
"status": 1,
"msg": "",
"time": 0.047,
"data": {
"paymodescondition": "C,B,G,U",
"partialpayment": 1,
"nopayment": 1,
"paymentmodes": [ {
"id": "C",
"name": "Cash",
"backcolor": "",
"older": "",
"allowoverpayment": "",
"privilegeslevel": "",
"syspaymentmode": "" },
{
"id": "B",
"name": "Bank Card",
"backcolor": "",
"older": "",
"allowoverpayment": "",
"privilegeslevel": "",
"syspaymentmode": "" },
{
"id": "U",
"name": "Customer Card",
"backcolor": "",
"older": "",
"allowoverpayment": "",
"privilegeslevel": "",
"syspaymentmode": "" },
{
"id": "G",
"name": "Gift certificate",
"backcolor": "",
"older": "",
"allowoverpayment": "",
"privilegeslevel": "",
"syspaymentmode": "" } ] }
}
ODOC_GETPAYMODES response - failure
 {
"status": 0,
"msg": "Invalid UID: 0003443324",
"time": 0.047,
"data": null
}


Add payment to a document - ODOC_SETPAYMENT

Requires the document to be in edit mode first through either ODOC_NEW or ODOC_MODIFY
Use a payment type from ODOC_SETPAYMENT

Request

https://URL:PORT/api/?act=ODOC_SETPAYMENT&docuid=0001234567&paymentmode=B&paymenttype=P&paymentmodeex=""&currency_id=EUR&additional_id=0&amount=10&replaceamount=0&needsreversal=-&paymentdatetime=01.01.2020&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and defines action type
docuidCHAR(20)YesNOOM internal document unique ID
paymentmodeCHAR(1)YesPre-determined via agreements

paymenttype

CHAR(1)YesChoose mode from ODOC_SETPAYMENT

paymentmodeex

CHAR(3)NoExtension for paymentmode
currency_idCHAR(3)No
additional_idCHAR(20)NoExtra information such as receipt number
amountNumeric(11,2)YesTransaction amount
paymentdatetimeTIMESTAMPNoCurrent time is assigned if it is left null or empty
getdocINTEGERNoif 1 saved document data is returned in response 'data/getdocdata'

Response

ODOC_SETPAYMENT response - success
 {
"status": 1,
"msg": "",
"time": 0.047,
"data": null
}
ODOC_SETPAYMENT response - failure
{
"status": 0,
"msg": "Invalid UID: 000344332",
"time": 0.031,
"data": null
}


Add a document event to a document - ODOC_ADDEVENT

Requires the document to be in edit mode first through either ODOC_NEW or ODOC_MODIFY

Request

https://URL:PORT/api/?act=ODOC_ADDEVENT&docuid=0001234567&de_act=TEST&de_custevent=MY EVENT&de_comment=this is an event&de_data=event data&de_sourcetype=API&de_source_id=1&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and defines action type
docuidCHAR(20)YesNOOM internal document unique ID
de_actCHAR(10)YesEvent type
de_custeventCHAR(10)NoAdditional event type specification
de_commentVARCHAR(100)NoComments
de_dataVARCHAR(750)NoEvent data
de_sourcetype_idCHAR(3)NoSource type, can be 'API' for general API usage
de_source_idVARCHAR(10)NoSource identifier, such as source document ID

Response

ODOC_ADDEVENT response - success
 {
"status": 1,
"msg": "",
"time": 0.031,
"data": null
}
ODOC_ADDEVENT response - failure
 {
"status": 0,
"msg": "Invalid UID: 000344332",
"time": 0.047,
"data": null
}


Cancel open document - ODOC_CANCEL

Requires the document to be in edit mode first through either ODOC_NEW or ODOC_MODIFY

Request

https://URL:PORT/api/?act=ODOC_CANCEL&docuid=0001077484&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and defines action type
docuidCHAR(20)YesNOOM internal document unique ID.

Response

ODOC_CANCEL response - success
{
"status": 1,
"msg": "",
"time": 0.264,
"data": null
}
ODOC_CANCEL response - exception
{
"status": 0,
"msg": "Invalid UID: 0001077482",
"time": 0.031,
"data": null
}

Complete/Save open document - ODOC_COMPLETE

In order to publish document it is mandatory to confirm/save open document by excecuting ODOC_COMPLETE request

Request

https://URL:PORT/api/?act=ODOC_COMPLETE&docuid=0001077484&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and defines action type
docuidCHAR(20)YesNOOM internal document unique ID.
getdocINTEGERNoif 1 saved document data is returned in response 'data/getdocdata'

Response

ODOC_COMPLETE response - success
{
 "status": 1,
 "msg": "",
 "time": 0.254,
 "data": {
  "dhid": 1077484  }
}
ODOC_COMPLETE response - exception
{
"status": 0,
"msg": "Cannot save document! Document row 1: BACH_ID on NULL!",
"time": 0.25,
"data": null
}

Change document state - DOCCHANGESTATE

Newstate value has to be described in the NOOM Document state table.

Request

https://URL:PORT/api/?act=DOCCHANGESTATE&docuid=0001077484&newstate=1&accesstoken=ACCESSTOKEN

 where:

FieldNameTypeRequiredDescription
https://URL:PORT/api/?act 
YesNOOM API endpoint and defines action type
docuidCHAR(20)Yes
(One of the 3)
NOOM internal document unique ID.
dhidNUMERIC(10)NOOM internal document ID.
dochidNUMERIC(10)NOOM internal document ID.
newstateCHAR(3)YesNOOM internal document state.
local
NoIf >0 then using only localbase

Examples

DOCCHANGESTATE examples
https://URL:PORT/api/?act=DOCCHANGESTATE&docuid=0001077484&newstate=1&accesstoken=ACCESSTOKENhttps://URL:PORT/api/?act=DOCCHANGESTATE&dochid=3443386&newstate=1&accesstoken=ACCESSTOKENhttps://URL:PORT/api/?act=DOCCHANGESTATE&dhid=3443386&newstate=1&accesstoken=ACCESSTOKENhttps://URL:PORT/api/?act=DOCCHANGESTATE&dhid=3443386&newstate=1&local=1&accesstoken=ACCESSTOKEN

Response

DOCCHANGESTATE response - success
{
 "status": 1,
 "msg": "",
 "time": 0.047,
 "data": null
}
DOCCHANGESTATE response - exception
{
 "status": 0,
 "msg": "Invalid document state ID value: '2'",
 "time": 0.032,
 "data": null
}

Logic scheme