Technology API
For access, paging, filters and getting only changes, see API basics.
1. Article Search Endpoint
Endpoint
GET /api/article/search
Description
This endpoint retrieves a paginated list of articles. In addition to the main article fields, the response includes related data based on the specified partial join parameters.
Headers
- Accept:
application/json, text/plain, */* - Content-Type:
application/x-www-form-urlencoded; charset=UTF-8 - Authorization:
<token>
The token obtained from the login endpoint must be sent in this header. - Referer:
https://{{domain}}.smarton.app/articles
Additional headers such as accept-language, cache-control, and user-agent may also be included.
Query Parameters
limit: integer
The maximum number of articles to return (for example,50).offset: integer
The starting index for the articles list (for example,0).paginate: boolean
Whether the results should be paginated (for example,true).partialJoin[...] parameters:
A series of parameters to include related data. Examples include:partialJoin[createdBy][]=firstNamepartialJoin[articleMaterials][]=idpartialJoin[categories][]=name- ... and additional parameters as needed.
Example Query String
?limit=50&offset=0&paginate=true&
partialJoin[createdBy][]=firstName&
partialJoin[articleMaterials][]=id&
partialJoin[categories][]=name&
partialJoin[photo][]=newId&
partialJoin[video][]=newId&
partialJoin[type][]=name&
partialJoin[vat][]=name&
partialJoin[vat][]=percentage&
partialJoin[vat][]=discountApplies&
partialJoin[featureOptions][]=name&
partialJoin[featureOptions][]=feature&
partialJoin[featureOptions.feature][]=name&
partialJoin[devices][]=configuration&
partialJoin[articleChildes][]=id&
partialJoin[articleChildes.child][]=id&
partialJoin[articleChildes.child][]=name&
partialJoin[articleChildes.child.articleMaterials][]=id&
partialJoin[articleChildes.child.articleMaterials.material][]=id&
partialJoin[articleChildes.child.articleMaterials.material][]=name&
partialJoin[articleChildes.child.articleMaterials.material][]=deleted
Response Structure
The response is a JSON object with the following top-level keys:
length: integer
The number of articles returned in this request.total: integer
The total number of articles available in the database that match the query.data: array
An array of article objects. Each article object contains a comprehensive set of fields such as:- Basic Article Fields:
id,name,altName,description,technicalDescription, etc.- Pricing details:
cost,price,price1,price2, etc. - Flags:
confirmed,popular,public, etc.
- Timestamps:
createdAt,updatedAt
- Relations:
- createdBy: Contains basic details about the creator (e.g.,
id,firstName,type). - articleMaterials: An array of objects with material IDs.
- categories: An array of category objects (e.g.,
id,name). - photo: Object or null, representing the article’s image.
- video: Object with video details.
- type: Object describing the article type.
- vat: Object containing VAT details.
- devices: An array of objects with device configurations.
- articleChildes: An array that contains child articles with nested details (e.g., each child has its own
id,name, and optionally its ownarticleMaterials).
- createdBy: Contains basic details about the creator (e.g.,
- Basic Article Fields:
Example Response
{
"length": 2,
"total": 181,
"data": [
{
"productExpireAfter": 0,
"id": 13,
"name": "Juodoji kava",
"altName": "COFFEE",
"cost": 4,
"productYield": 50,
"confirmed": true,
"popular": false,
"compulsory": false,
"showInReports": true,
"compulsoryQuantity": 2,
"public": true,
"proposal": false,
"separateEachProduct": false,
"description": "<p><span style=\"color: rgb(184, 49, 47);\">Skani juoda kavytė <span class=\"fr-emoticon\" style=\"background: url(https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/1f600.svg);\"> </span></span></p>",
"technicalDescription": "<p><br></p>",
"internal": false,
"primeCostExpression": "orderProposalProduct.getProduct().getArticle().getPrice() * 0.5",
"packagingSizeExpression": "20x20x20",
"strictExpireControl": false,
"price": 5,
"price1": 0,
"price2": 1.6529,
"autoOrderFinish": false,
"usesProductions": true,
"aggregateProductions": true,
"autoProductionCreation": true,
"autoProductionStart": true,
"saleOnlyFromStock": false,
"isPackaged": false,
"barcode": "‘,‘,‘,‘,",
"featured": false,
"printable": true,
"position": 24,
"deleted": false,
"deletable": true,
"createdAt": "2020-04-20T10:31:09Z",
"updatedAt": "2025-02-10T13:01:52Z",
"createdBy": {
"id": 1,
"firstName": "Admin",
"type": "employee"
},
"articleMaterials": [
{ "id": 16 },
{ "id": 45 },
{ "id": 48 }
],
"categories": [
{ "id": 10, "name": "Drinks" }
],
"photo": null,
"video": {
"id": 71,
"newId": null
},
"type": {
"id": 4,
"name": "Gėrimai (nealkoholiniai)"
},
"vat": {
"id": "2",
"name": "B",
"percentage": 21,
"discountApplies": true
},
"featureOptions": [],
"devices": [
{
"id": 21,
"configuration": {
}
}
],
"articleChildes": [
{
"id": 672,
"child": {
"id": 6834,
"name": "cesnaki",
"articleMaterials": []
}
}
]
},
{
"productExpireAfter": null,
"id": 14,
"name": "Žalioji arbata",
"altName": "TEA",
"cost": 50,
"productYield": 3,
"confirmed": true,
"popular": false,
"compulsory": false,
"showInReports": false,
"compulsoryQuantity": 1,
"public": true,
"proposal": true,
"separateEachProduct": false,
"description": null,
"technicalDescription": "<p>aSasaSZ</p>",
"internal": false,
"primeCostExpression": "",
"strictExpireControl": false,
"price": 2,
"autoOrderFinish": false,
"usesProductions": true,
"aggregateProductions": true,
"autoProductionCreation": true,
"autoProductionStart": true,
"usesShipments": false,
"autoShipmentCreation": false,
"autoProductionCopy": false,
"productionOperationsCopy": false,
"saleOnlyFromStock": false,
"isPackaged": false,
"barcode": "123456",
"featured": false,
"printable": true,
"position": 0,
"deleted": false,
"deletable": true,
"createdAt": "2020-04-20T10:31:31Z",
"updatedAt": "2025-02-11T10:35:00Z",
"createdBy": {
"id": 1,
"firstName": "Admin",
"type": "employee"
},
"articleMaterials": [
{ "id": 50 },
{ "id": 68 }
],
"categories": [
{ "id": 10, "name": "Drinks" },
{ "id": 11, "name": "Karšti gėrimai" },
{ "id": 32, "name": "(EKAS) pakategoris Nr. 1.1" }
],
"photo": {
"id": 929,
"newId": "kasa/jpg/8/e/1d88ea1f9c7df7de80017fb7b50fb1f8d8b39f"
},
"video": null,
"type": {
"id": 4,
"name": "Gėrimai (nealkoholiniai)"
},
"vat": {
"id": "2",
"name": "B",
"percentage": 21,
"discountApplies": true
},
"featureOptions": [],
"devices": [
{
"id": 21,
"configuration": {
}
}
],
"articleChildes": [
{
"id": 540,
"child": {
"id": 6877,
"name": "Kiaulienos pusgamini",
"articleMaterials": [
{
"id": 51,
"material": {
"id": 269,
"name": "fig Jam",
"deleted": false
}
},
{
"id": 52,
"material": {
"id": 251,
"name": "Lemon limonade",
"deleted": false
}
}
]
}
}
]
}
]
}
Errors
- 401 Unauthorized: If the
Authorizationheader is missing or the token is invalid. - 400 Bad Request: If required query parameters are missing or malformed.
- 500 Internal Server Error: For any unexpected server errors.
2. Article Type Search Endpoint
Endpoint
GET /api/article_type/search
Description
This endpoint retrieves a list of article types. It supports pagination and allows you to optionally join related data (for example, device information) using the join[] query parameter.
Headers
- Accept:
application/json, text/plain, */* - Content-Type:
application/x-www-form-urlencoded; charset=UTF-8 - Authorization:
<token>
The token obtained from the login endpoint must be included here. - Referer:
https://{{domain}}.smarton.app/articles/types
Additional headers (e.g., accept-language, cache-control, user-agent) can also be sent as needed.
Query Parameters
limit: integer
The maximum number of article types to return (e.g.,50).offset: integer
The starting index (e.g.,0).paginate: boolean
Whether the results should be paginated (e.g.,true).join[]: string
Use this parameter to include related data. For example,join[]=devicesit will include device details associated with the article types.
Example Query String
?limit=50&offset=0&paginate=true&join[]=devices
Request Example (cURL)
curl 'https://{{domain}}.smarton.app/api/article_type/search?limit=50&offset=0&paginate=true&join[]=devices' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: en-US,en;q=0.9,lt;q=0.8,ru;q=0.7' \
-H 'authorization: <token>' \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' \
-b '_ga=GA1.1.741069282.1737226579; _gcl_au=1.1.1950062906.1737226579; session=1c7005e68e6c45f8185e77d5c896e79ebeff2be4; _ga_HJM9D3H47P=GS1.1.1740211314.10.0.1740211314.0.0.0; authorization=<token>' \
-H 'pragma: no-cache' \
-H 'priority: u=1, i' \
-H 'referer: https://{{domain}}.smarton.app/articles/types' \
-H 'sec-ch-ua: "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-origin' \
-H 'session;' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36' \
-H 'x-requested-with: XMLHttpRequest'
Response
A successful request returns a JSON array of article type objects. Each object includes fields such as:
- id: integer – The unique identifier of the article type.
- productExpireAfter: integer | null – Expiration period for products, if applicable.
- name: string – The name of the article type.
- alias: string – An alternative name (alias) for the article type.
- public: boolean – Indicates if the type is public.
- createdAt: string (ISO 8601) – Timestamp of creation.
- updatedAt: string (ISO 8601) – Timestamp of the last update.
- deletable: boolean – Whether the type can be deleted.
- color, icon: string | null – Optional visual properties.
Example Response
[
{
"id": 4,
"productExpireAfter": null,
"name": "Gėrimai (nealkoholiniai)",
"alias": "Gėrimas",
"categoryTypePurchase": null,
"categoryTypeInvoice": null,
"packagingQuantityExpression": null,
"productNameExpression": null,
"productionNameExpression": null,
"productionQuantityExpression": null,
"orderQuantityExpression": null,
"storedQuantityExpression": null,
"primeCostExpression": null,
"packagingLotExpression": null,
"productBarcodeExpression": null,
"weightExpression": null,
"public": false,
"weightUnit": null,
"autoShipmentCreationPeriod": null,
"createdAt": "2020-04-20T11:40:28Z",
"updatedAt": "2021-06-18T07:33:00Z",
"deletable": true,
"color": null,
"icon": null
}
]
Errors
- 401 Unauthorized: If the
Authorizationheader is missing or the token is invalid. - 400 Bad Request: If required query parameters are missing or malformed.
- 500 Internal Server Error: For any unexpected server errors.
3. Create Article Endpoint
Endpoint
POST /api/article/create
Description
This endpoint creates a new article in the system. After a successful creation, it returns a response indicating success along with the newly created article's ID.
Headers
- Accept:
application/json, text/plain, */* - Content-Type:
application/x-www-form-urlencoded; charset=UTF-8 - Authorization:
<token>
Use the token obtained from the login endpoint. - Origin:
https://{{domain}}.smarton.app - Referer:
https://{{domain}}.smarton.app/articles
Other headers (e.g., accept-language, cache-control, user-agent) can be included as needed.
Request Payload
The request body should be sent as URL-encoded form data with the following parameters:
name: string
The name of the article.type: integer
The article type ID to associate with the new article.
Example Payload
name=testas&type=4
Request Example (cURL)
curl 'https://{{domain}}.smarton.app/api/article/create' \ -H 'accept: application/json, text/plain, */*' \
-H 'accept-language: en-US,en;q=0.9,lt;q=0.8,ru;q=0.7' \
-H 'authorization: <token>' \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' \
-b '_ga=GA1.1.741069282.1737226579; _gcl_au=1.1.1950062906.1737226579; session=1c7005e68e6c45f8185e77d5c896e79ebeff2be4; _ga_HJM9D3H47P=GS1.1.1740211314.10.0.1740211314.0.0.0; authorization=<token>' \
-H 'origin: https://{{domain}}.smarton.app' \
-H 'pragma: no-cache' \
-H 'priority: u=1, i' \
-H 'referer: https://{{domain}}.smarton.app/articles' \
-H 'sec-ch-ua: "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-origin' \
-H 'session;' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36' \
-H 'x-requested-with: XMLHttpRequest' \
--data-raw 'name=testas&type=4'
Response
A successful creation returns a JSON object with the following keys:
- status: integer – A status code (e.g.,
1indicates success). - message: string – A message, such as
"info.created", indicating the result. - data: integer – The ID of the newly created article.
- total, length: May be present but typically set to
nullfor creation endpoints.
Example Response
{ "status": 1,
"message": "info.created",
"data": 9999,
"total": null,
"length": null
}
Errors
- 401 Unauthorized: Returned if the
Authorizationheader is missing or invalid. - 400 Bad Request: If required parameters (e.g.,
nameortype) are missing or invalid. - 500 Internal Server Error: For any unexpected server-side issues.
4. Update Article Endpoint
Endpoint
POST /api/article/update
Description
This endpoint updates an existing article. You must provide the article's unique ID and the fields requiring updating. Upon success, the API returns a response confirming the update and the article's ID.
Headers
- Accept:
application/json, text/plain, */* - Content-Type:
application/x-www-form-urlencoded; charset=UTF-8 - Authorization:
<token>
Use the token obtained from the login endpoint. - Origin:
https://{{domain}}.smarton.app - Referer:
https://{{domain}}.smarton.app/articles/<article-id>
Additional headers (such as accept-language, cache-control, and user-agent) may also be provided.
Request Payload
The request body should be sent as URL-encoded form data and must include the following parameters:
id: integer
The unique identifier of the article to be updated.name: string
The new name for the article (or any other fields you want to update).
Example Payload
id=9999&name=testas123
Request Example (cURL)
curl 'https://{{domain}}.smarton.app/api/article/update' \ -H 'accept: application/json, text/plain, */*' \
-H 'accept-language: en-US,en;q=0.9,lt;q=0.8,ru;q=0.7' \
-H 'authorization: <token>' \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' \
-b '_ga=GA1.1.741069282.1737226579; _gcl_au=1.1.1950062906.1737226579; session=1c7005e68e6c45f8185e77d5c896e79ebeff2be4; _ga_HJM9D3H47P=GS1.1.1740211314.10.0.1740211314.0.0.0; authorization=<token>' \
-H 'origin: https://{{domain}}.smarton.app' \
-H 'pragma: no-cache' \
-H 'priority: u=1, i' \
-H 'referer: https://{{domain}}.smarton.app/articles/9999' \
-H 'sec-ch-ua: "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-origin' \
-H 'session;' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36' \
-H 'x-requested-with: XMLHttpRequest' \
--data-raw 'id=9999&name=testas123'
Response
A successful update returns a JSON object with the following keys:
- status: integer – A status code (e.g.,
1indicates success). - message: string – A message indicating the result, such as
"info.updated". - data: integer – The ID of the updated article.
- total, length: These fields are typically set to
nullfor update operations.
Example Response
{ "status": 1,
"message": "info.updated",
"data": 9999,
"total": null,
"length": null
}
Errors
- 401 Unauthorized: Returned if the
Authorizationthe header is missing or invalid. - 400 Bad Request: If required parameters such as
idare missing or malformed. - 500 Internal Server Error: For any unexpected server-side issues.
Articles for reporting
Articles are the menu items and products you sell. Sales lines point to them through product.article (see Orders API). For access, paging and filters, see API basics.
GET /api/article/search
Example request
curl -g -G 'https://{company}.smarton.app/api/article/search' \
-H 'Authorization: <token>' \
--data-urlencode 'paginate=true' \
--data-urlencode 'limit=500' \
--data-urlencode 'offset=0' \
--data-urlencode 'select[]=name' \
--data-urlencode 'select[]=altName' \
--data-urlencode 'select[]=barcode' \
--data-urlencode 'select[]=price' \
--data-urlencode 'select[]=cost' \
--data-urlencode 'select[]=confirmed' \
--data-urlencode 'select[]=updatedAt' \
--data-urlencode 'partialJoin[categories][]=name' \
--data-urlencode 'partialJoin[type][]=name' \
--data-urlencode 'partialJoin[vat][]=percentage' \
--data-urlencode 'sort[id]=asc'
Fields
| Field | Meaning |
|---|---|
id, name | ID and name. |
altName | Code (shown as Code in Smarton). Not guaranteed to be unique. |
barcode | Barcode. |
categories | Article categories; an article can be in several. |
type | Article type. |
price, price1 … price4 | The five sale prices, without VAT. They come as text, for example "1.652893". |
vat | VAT rate. |
cost | Current cost (prime cost) of one item, calculated from the recipe and material prices. For the cost at the time of a sale, use the order line's productCost. |
weightUnit | Weight unit, if the article is sold by weight. |
confirmed | Confirmed article. Articles are not deactivated; a deleted article is returned with _deleted=1. |
Article categories
GET /api/article_category/search?partialJoin[parent][]=name&paginate=true&limit=500
Fields: id, name, parent (upper category), active.
Recipes
GET /api/article_material/search?article.id=123&partialJoin[material][]=name&partialJoin[material.materialType][]=unit
The materials (ingredients) of an article. Fields: material, standardQuantity (quantity of the material for one item, in the material's unit) and quantityExpression, if the quantity is calculated. Materials and their prices are described in Materials API.
English