articles

type: table

Methods

GET

List documents

List of documents matching search, pagination and order clauses returned

GET /<yourcompany>/articles/

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>/articles/?_pageNo=0&_pageLength=50

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

One document contents

GET /<yourcompany>/articles/<id>

Returns document data with all subdocuments (rows etc).

POST

Insert document

POST /<yourcompany>/articles/

Update existing document

POST /<yourcompany>/articles/<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>/articles/<id>

Deletes document with given id


Fields

Field Type Default Etc
idintPK
codevarchar(50)SK
namevarchar(200)
unitIdintunits
articleGroupIdintarticlegroups
BAASHINDdouble
BHKPVdate
memovarchar(255)
statusint
vatIdintvats
accountIdintaccounts
purchaseAccountIdintaccounts
purchaseVatIdintvats
typeIdint
trademarkIdint0trademarks
picturevarchar(100)''
colorvarchar(50)''
supplierIdint0companies
supplierCodevarchar(50)''
purchasePricedouble0
purchaseCurrencyIdint0currencies
markupdouble0
barcodevarchar(50)''
cnCodeIdint0cncodes
countryIdint0countries
name2varchar(200)''
vatGroupIdint0vatgroups
webshopint0
KULUKONTOIDint0accounts
MPRINTint1
MYYGIMAKSint0
gtinvarchar(50)''
TAARAIDint0articles
additionalNamevarchar(200)''
masterGoodIdint0articles
variationvarchar''

Subdocuments

articleunits

Field Type Default Etc
articleIdintPK
unitIdintPK units
coefdouble

minwarehousestate

Field Type Default Etc
articleIdintPK
warehouseIdintPK warehouses
warehouseStatedouble0

purchaseprices

Field Type Default Etc
articleIdintPK
companyIdintPK
nrint0
supplierCodevarchar(50)''
purchasePricedouble0
currencyIdint0currencies
markupdouble0

salesprices

Field Type Default Etc
articleIdintPK
pricelistIdintPK
pricedouble
discountdouble0

articlecomponents

Field Type Default Etc
articleIdintPK
nrintPK
compIdintarticles
quantitydouble
sourceWarehouseIdintwarehouses
printint1

articleanalogs

Field Type Default Etc
K1IDint0PK articles
K2IDint0PK articles
memovarchar(255)''

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