• Eesti

Version: 1.32

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

actionscript3Midnight1Access token response - successtruetrue


actionscript3MidnightAccess token response - errortruetrue

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

actionscript3Midnight1Not enough userrights to excute the requesttruetrue

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...) 

where:

FieldNameTypeDescription
docuidCHAR(20)NOOM internal document unique ID.

Response

actionscript3Midnight1ODOC_NEW response - successtruetrue


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

actionscript3Midnight1ODOC_MODIFY response - successtruetrue


actionscript3Midnight1ODOC_MODIFY response - failuretruetrue


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

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

actionscript3Midnight1ODOC_SETDATA examplestruetrue

Response

actionscript3Midnight1ODOC_SETDATA responsetruetrue


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

Response

actionscript3Midnight1ODOC_CHECK response - successtruetrue


actionscript3Midnight1ODOC_CHECK response - failuretruetrue


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

actionscript3Midnight1ODOC_LIST response - successtruetrue


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

actionscript3Midnight1ODOC_GETDOC response - successtruetrue


actionscript3Midnight1ODOC_GETDOC response - failuretruetrue


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

Examples

actionscript3Midnight1ODOC_SETDATA examplestruetrue

Response

actionscript3Midnight1ODOC_ITEMSALE response - successtruetrue


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

Response

actionscript3Midnight1ODOC_BARCODESALE response - successtruetrue


actionscript3Midnight1ODOC_BARCODESALE response - failuretruetrue


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

Response

actionscript3Midnight1ODOC_ITEMSETQTY response - successtruetrue


actionscript3Midnight1ODOC_ITEMSETQTY response - failuretruetrue


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

Response

actionscript3Midnight1ODOC_ROWDEL response - successtruetrue


actionscript3Midnight1ODOC_ROWDEL response - failuretruetrue


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

Response

actionscript3Midnight1ODOC_GETPAYMODES response - successtruetrue


actionscript3Midnight1ODOC_GETPAYMODES response - failuretruetrue


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

Response

actionscript3Midnight1ODOC_SETPAYMENT response - successtruetrue


actionscript3Midnight1ODOC_SETPAYMENT response - failuretruetrue


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

actionscript3Midnight1ODOC_ADDEVENT response - successtruetrue


actionscript3Midnight1ODOC_ADDEVENT response - failuretruetrue


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

actionscript3Midnight1ODOC_CANCEL response - successtruetrue


actionscript3Midnight1ODOC_CANCEL response - exceptiontruetrue

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.

Response

actionscript3Midnight1ODOC_COMPLETE response - successtruetrue


actionscript3Midnight1ODOC_COMPLETE response - exceptiontruetrue

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

actionscript3Midnight1ODOC_SETDATA examplestruetrue

Response

actionscript3Midnight1DOCCHANGESTATE response - successtruetrue


actionscript3Midnight1DOCCHANGESTATE response - exceptiontruetrue

Logic scheme

trueODOC logic schemefalseautotoptrue14462