companies

type: table

Methods

GET

List documents

List of documents matching search, pagination and order clauses returned

GET /<yourcompany>/companies/

Filtering is possible using _filter request.

Filter clauses presented by JSON array of records with next fields:

  • field - any document field could be used in filter.
  • operator - filter condition binary operator. Allowed operators are:
    • >
    • <
    • >=
    • <=
    • =
    • <>
    • like
  • value - searched value

Sample filter request
_filter=URLEncode([{"field": "date", "operator": ">", "value": "2017-11-15"}, {"field": "date", "operator": "<", "value": "2017-11-17"}, {"field": "summaryRows", "operator": "like", "value": "%Volvo%"}])

NB! Filter request should be URL encoded!

Pagination is possible using _pageNo and _pageLength:

GET /<yourcompany>/companies/?_pageNo=0&_pageLength=50

_pageNo starts with 0 (default value), Default _pageLength is 50.

One document contents

GET /<yourcompany>/companies/<id>

Returns document data with all subdocuments (rows etc).

POST

Insert document

POST /<yourcompany>/companies/

Update existing document

POST /<yourcompany>/companies/<id>

Document data should be in POST body variable data.

Returns inserted or updated document full data.

Id of inserted document could be found in returned inserted document data.

DELETE

Delete document

DELETE /<yourcompany>/companies/<id>

Deletes document with given id


Fields

Field Type Default Etc
idintPK
codevarchar(20)SK
namevarchar(100)
regCodevarchar(20)
vatCodevarchar(20)
addressvarchar(255)
phonevarchar(255)
faxvarchar(255)
emailvarchar(100)
contactvarchar(100)
paymentPeriodint
interestdouble
memovarchar(1000)
customerint
supplierint
clientAccountIdintaccounts
supplierAccountIdintaccounts
pricelistIdintpricelists
discountdouble0
KYKORTERint0
KYPINDALAdouble0
KYOMANIKvarchar(100)''
KYINIMARVint0
KYKORRUSint0
KYAADRESSvarchar(100)''
salesmanIdint0users
KREDLIMIITdouble0
JURAADRESSTANAVvarchar(100)''
JURAADRESSLINNvarchar(100)''
JURAADRESSINDEKSvarchar(20)''
JURAADRESSRIIKIDint0countries
POSTIAADRESSTANAVvarchar(100)''
POSTIAADRESSLINNvarchar(100)''
POSTIAADRESSINDEKSvarchar(20)''
POSTIAADRESSRIIKIDint0countries
groupIdint0companygroups
closedint0
LEPINGvarchar(50)''
KYMAJAIDint0KYMAJAD
KYKPINDALAdouble0
vatTypeIdint0vattypes
VIITENUMBERvarchar(20)''
MARVEVORMIDint0ARUANDED
currencyIdint0currencies
webshopint0
KYARVEEMAILIint0
OTSEKORRALDUSint0
EMKONTOIDint0accounts
MYYGIMAKSint0
shippingAreaIdint0VEOPIIRKONNAD
paymentTermIdint0paymentterms
GLNvarchar(50)''
invoiceMemovarchar(255)''
payerIdint0companies
TEHINGUPARTNERIDint0TEHINGUPARTNERID
KYTREPIKODAint0
D_TAGSvarchar(1000)''
eInvoiceChannelvarchar
KYMAKSJAvarchar
KMDINFint1

Subdocuments

FIRMAKONTAKTID

Field Type Default Etc
companyIdintPK
nrintPK
PREFIXvarchar(10)''
KONTAKTvarchar(100)''
phonevarchar(50)''
emailvarchar(50)''
memovarchar(255)''
EMAILKEELATUDint0
EPOODUIDvarchar(32)''
EPOODPWDvarchar(32)''

PANGAARVED

Field Type Default Etc
companyIdintPK
nrintPK
bankIdintbanks
invoiceNrvarchar(20)''
memovarchar(255)
IBANvarchar(100)''

KYFIRMAMOOTJAD

Field Type Default Etc
companyIdintPK
articleIdintPK articles
MOOTJAint1

KYFIRMASEERIAD

Field Type Default Etc
companyIdintPK
enumerationIdintPK KYSEERIAD
paymentDueint

Output format

Output formats are JSON (default) or PHP print_r output.

Output format could be changed using HTTP_X_OUTPUTFORMAT request header variable.
Possible values:

  • json
  • php


Authentication

Token based authentication, with token in X-ProfitToken request header variable.


Profit API v 0.1.4.2 beta, © Intellisoft OÜ 2017 - 2024