Orders API

For access, paging, filters and getting only changes, see API basics.

Order Search Endpoint

Endpoint URL

https://{domain}.smarton.app/api/order/search

Method

GET


Description

This endpoint retrieves a list of all orders in the system. It supports pagination, sorting, and extensive joining with related entities such as customers, managers, tags, and shipments. Partial joins can be used to optimize response performance by limiting the returned fields.

Every request needs authentication: a login token or an API key. See API basics → Access.


Request Parameters

Parameter

Type

Required

Description

limit

integer

No

Maximum number of orders to return per request. Default is 50.

offset

integer

No

Starting index for pagination. Default is 0.

paginate

boolean

No

Enables or disables pagination. Default is true.

join[]

array

No

Fully include related entities such as tags, shipments.

partialJoin[customer][]

array

No

Include specific fields of the customer, e.g. alias.

partialJoin[manager][]

array

No

Include specific fields of the manager, e.g. name.

partialJoin[shipments][]

array

No

Include shipment details such as date.

sort[createdAt]

string

No

Sort by order creation date (asc or desc).

sort[shipments.date]

string

No

Sort by shipment date.

internal

boolean

No

When true, includes internal orders. Default is false.

translate

boolean

No

When true, translates data fields. Default is true.


Example Curl Request

curl --location 'https://{domain}.smarton.app/api/order/search?limit=50&offset=0&paginate=true&join[]=tags&partialJoin[customer][]=alias&partialJoin[manager][]=name&partialJoin[shipments][]=date&sort[createdAt]=desc&sort[shipments.date]=asc&internal=false&translate=true' \
--header 'accept: application/json, text/plain, */*' \
--header 'authorization: <Your Authorization Token>' \
--header 'content-type: application/x-www-form-urlencoded; charset=UTF-8'

Response

The response is a JSON object containing pagination data (length, total) and an array of order objects.


Response Structure

Field

Type

Description

length

integer

Number of orders returned in this request.

total

integer

Total number of orders available.

data

array

List of order objects.

data[].id

integer

Unique order identifier.

data[].number

string

Order reference number.

data[].uuid

string

Unique UUID for the order.

data[].status

string

Order status (e.g., complete, open).

data[].customer

object

Customer details (e.g., id, alias).

data[].manager

object

Assigned manager details.

data[].customerPrice

object

Order price excluding VAT.

data[].customerPriceWithVat

object

Order price including VAT.

data[].discountSum

object

Total discount amount.

data[].createdAt, data[].updatedAt

string

ISO 8601 timestamps for creation and last update.


Example Response

{
  "length": 50,
  "total": 16474,
  "data": [
    {
      "id": 32079,
      "number": "EKAS-ORD32079",
      "uuid": "16b06dcf-3f17-440b-8b7d-7316de2ef7b1",
      "status": "complete",
      "isPaid": true,
      "createdAt": "2025-11-06T15:56:01Z",
      "customer": { "id": 4835, "alias": "Customer" },
      "manager": { "id": 184, "name": "Proman Administrator" },
      "customerPrice": { "amount": 25.4, "currency": "EUR" },
      "customerPriceWithVat": { "amount": 26.74, "currency": "EUR" },
      "discountSum": { "amount": 3.99, "currency": "EUR" }
    }
  ]
}

Status Codes

Code

Message

Description

200 OK

—

Successfully retrieved the list of orders.

400 Bad Request

—

The request parameters were invalid or missing.

401 Unauthorized

—

The request did not include a valid authorization token.

500 Internal Server Error

—

An unexpected error occurred on the server.


Order Details Endpoint

Endpoint URL

https://{domain}.smarton.app/api/order/get

Method

GET


Description

This endpoint retrieves complete details about a single order, including its related customer, consumer, manager, and operational data. It supports both full joins (join[]) and partial joins (partialJoin[]) for optimizing response content.


Request Parameters

Parameter

Type

Required

Description

id

integer

✅ Yes

The ID of the order to retrieve.

join[]

array

No

Include related entities such as customer, consumer, operations, and tags.

partialJoin[entity][]

array

No

Select specific fields from related entities, such as partialJoin[manager][]=name.


Example Curl Request

curl --location 'https://{domain}.smarton.app/api/order/get?id=32079&join[]=customer&join[]=consumer&join[]=operations&partialJoin[manager][]=name' \
--header 'accept: application/json, text/plain, */*' \
--header 'authorization: <Your Authorization Token>' \
--header 'content-type: application/x-www-form-urlencoded; charset=UTF-8'

Response

The response is a single JSON object containing full order details.


Response Structure

Field

Type

Description

id

integer

Order ID.

number

string

Order reference number.

uuid

string

Unique UUID for the order.

status

string

Order status (open, complete, etc.).

isPaid

boolean

Indicates whether the order has been paid.

quantity

integer

Quantity in the order.

customer

object

Full customer data.

manager

object

Manager details (id, name, type).

consumer

object

Table or POS consumer info, including metadata (area, type, position).

customerPrice

object

Price excluding VAT.

customerPriceWithVat

object

Price including VAT.

discountSum

object

Total discount.

productionPrice

object

Internal production cost.

createdAt, updatedAt, finishedAt

string

ISO timestamps.


Example Response

{
  "id": 32079,
  "number": "EKAS-ORD32079",
  "status": "complete",
  "isPaid": true,
  "customer": {
    "id": 4835,
    "name": "Customer",
    "alias": "Customer",
    "totalInvoiced": 7.15
  },
  "consumer": {
    "id": 1293,
    "name": "6",
    "status": "open",
    "metadata": {
      "area": "5",
      "size": "50",
      "type": "round",
      "position": ["341.66", "181.66"]
    }
  },
  "manager": {
    "id": 184,
    "name": "Proman Administrator",
    "type": "employee"
  },
  "customerPrice": { "amount": 25.4, "currency": "EUR" },
  "customerPriceWithVat": { "amount": 26.74, "currency": "EUR" },
  "discountSum": { "amount": 3.99, "currency": "EUR" },
  "createdAt": "2025-11-06T15:56:01Z"
}

Status Codes

Code

Message

Description

200 OK

—

Successfully retrieved the order details.

400 Bad Request

—

Invalid or missing id parameter.

401 Unauthorized

—

Authentication failed.

404 Not Found

—

Order with specified ID not found.

500 Internal Server Error

—

Unexpected server error.


Order Products Endpoint

Endpoint URL

https://{domain}.smarton.app/api/order_product/search

Method

GET


Description

This endpoint retrieves all products associated with a specific order. It includes details about the product, VAT, article information, parameters, and files. It supports deep joins with related objects like product photos, parent products, and shipment details.


Request Parameters

Parameter

Type

Required

Description

order.id

integer

✅ Yes

ID of the order whose products should be retrieved.

limit

integer

No

Maximum number of products to return. Default is 50.

paginate

boolean

No

Enables pagination. Default is true.

join[]

array

No

Related entities to fully join, e.g. product.photo, product.parameters.

partialJoin[product][]

array

No

Include selected product fields (e.g. name, weight, vat).

translate

boolean

No

Enable translation of fields. Default is true.


Example Curl Request

curl --location 'https://{domain}.smarton.app/api/order_product/search?order.id=32079&limit=50&paginate=true&join[]=product.photo&join[]=product.parameters&partialJoin[product][]=name&partialJoin[product.vat][]=percentage&translate=true' \
--header 'accept: application/json, text/plain, */*' \
--header 'authorization: <Your Authorization Token>' \
--header 'content-type: application/x-www-form-urlencoded; charset=UTF-8'

Response

The response is a paginated JSON object containing all products associated with the specified order.


Response Structure

Field

Type

Description

length

integer

Number of order products in the response.

total

integer

Total number of products in the order.

data

array

Array of order product objects.

data[].id

integer

Unique identifier for the order product.

data[].quantity

integer

Quantity of the product in the order.

data[].status

string

Product status (e.g. confirmed).

data[].customerPrice

object

Product price excluding VAT.

data[].customerPriceWithVat

object

Product price including VAT.

data[].discountSum

object

Total discount applied.

data[].productionPrice

object

Internal production cost.

data[].product

object

Product metadata.

data[].product.photo

object

Image data related to the product.

data[].product.parameters

array

Product parameter definitions.

data[].product.vat

object

VAT details including rate and applicability.


Example Response

{
  "length": 1,
  "total": 1,
  "data": [
    {
      "id": 143807,
      "quantity": 1,
      "status": "confirmed",
      "customerPrice": { "amount": 25.4, "currency": "EUR" },
      "customerPriceWithVat": { "amount": 26.74, "currency": "EUR" },
      "discountSum": { "amount": 3.99, "currency": "EUR" },
      "productionPrice": { "amount": 13.462, "currency": "EUR" },
      "product": {
        "id": 139976,
        "name": "Užkandžių lekštė",
        "photo": {
          "id": 34,
          "name": "kahvalti_tabagi.pro173",
          "path": "Misc/2020-04-20/kahvalti_tabagi_pro173.pro34.jpeg"
        },
        "parameters": [
          { "parameter": { "name": "komentaras", "type": "string" }, "value": "wed" },
          { "parameter": { "name": "Puodelis", "type": "dropdown" }, "value": "1316" }
        ],
        "vat": { "name": "B", "percentage": 21, "discountApplies": true }
      }
    }
  ]
}

Status Codes

Code

Message

Description

200 OK

—

Successfully retrieved the list of order products.

400 Bad Request

—

Missing or invalid parameters.

401 Unauthorized

—

Authentication credentials missing or invalid.

404 Not Found

—

Order or product not found.

500 Internal Server Error

—

Server encountered an unexpected error.

Sales data for reporting

The sections below are for reporting and analytics integrations: they describe how POS sales are stored and how to export them. For access, paging, filters and getting only changes, see API basics.

In the POS every receipt (check) is an order. Its items are order lines (order_product), and its payments and refunds are payment records (account_registry). Fetch the three with separate requests for the same period.

Receipts

GET /api/order/search

Example request

Receipts paid in October 2026, with their payment records, table and zone:

curl -g -G 'https://{company}.smarton.app/api/order/search' \
  -H 'Authorization: <token>' \
  --data-urlencode 'paginate=true' \
  --data-urlencode 'limit=200' \
  --data-urlencode 'offset=0' \
  --data-urlencode 'status==complete' \
  --data-urlencode 'finishedAt=>=2026-10-01T00:00:00Z&<2026-11-01T00:00:00Z' \
  --data-urlencode 'join[]=accountRegisters' \
  --data-urlencode 'partialJoin[consumer][]=name' \
  --data-urlencode 'partialJoin[consumer.area][]=name' \
  --data-urlencode 'partialJoin[manager][]=name' \
  --data-urlencode 'partialJoin[createdBy][]=name' \
  --data-urlencode 'partialJoin[customer][]=name' \
  --data-urlencode 'sort[finishedAt]=asc'

Fields

FieldMeaning
idUnique ID of the order.
numberOrder number shown to staff. Depending on the POS settings it can start again after a Z report, so use id as the key.
createdAtWhen the receipt was opened.
finishedAtWhen it was paid and closed.
statusMain values: created (open), confirmed_by_manager (sent to the kitchen or bar), complete (paid), canceled.
isPaidPaid in full.
customerPriceTotal without VAT, before discounts.
discountSumTotal discount without VAT.
customerPriceWithVatTotal with VAT, after discounts: what the guest pays.
productsCostCost of the items, the sum of the lines' productCost.
numberOfVisitorsNumber of guests.
managerThe employee who serves the order (waiter). See Staff API.
createdByThe user who created the order.
customerThe customer. Walk-in sales have the company's default customer.
consumer, consumer.areaThe table and its zone. See POS API.
namespaceThe unit (location) of the order, for companies with several locations.
createdFromWhere the order was created: posCreateWithResponse (POS), PosPublic (QR table ordering), WebOrder (web order), the name of a delivery platform, or orderControllerCreateOrder (Smarton web app). Empty for orders created before October 2023.
accountRegistersPayment records of the order, with the fiscal receipt number receiptNumber. See Payments and refunds.
cancelReason, deletedAtFor deleted orders. See Deleted orders and removed items.

Not stored on the order: the business day (convert the times from UTC and apply your own day boundary), a dine-in or takeaway flag, and the cash register (use the device of the payment record).

Order lines

GET /api/order_product/search

Example request

All lines of the receipts paid in October 2026:

curl -g -G 'https://{company}.smarton.app/api/order_product/search' \
  -H 'Authorization: <token>' \
  --data-urlencode 'paginate=true' \
  --data-urlencode 'limit=500' \
  --data-urlencode 'offset=0' \
  --data-urlencode 'order.status==complete' \
  --data-urlencode 'order.finishedAt=>=2026-10-01T00:00:00Z&<2026-11-01T00:00:00Z' \
  --data-urlencode 'partialJoin[order][]=number' \
  --data-urlencode 'join[]=product' \
  --data-urlencode 'join[]=product.article' \
  --data-urlencode 'join[]=product.vat' \
  --data-urlencode 'partialJoin[parentOrderProduct][]=id' \
  --data-urlencode 'sort[id]=asc'

Fields

FieldMeaning
idUnique ID of the line.
orderThe order (receipt).
product.nameItem name as sold.
product.articleThe article (menu item) it was sold from. See Technology API.
quantityQuantity.
customerPriceUnit price without VAT, before discount.
discountDiscount in percent.
discountSumDiscount per unit, without VAT.
customerPriceWithVatUnit price with VAT, after discount.
product.vatVAT rate (percentage). If empty, the rate is on product.article.vat.
productCostCost of the whole line (quantity × the article's cost), saved when the order is paid or finished. Later cost changes do not change it. Empty for open orders.
statuscreated, confirmed (sent to the kitchen or bar), deleted, returned and others.
parentOrderProductFor modifiers and set-menu items: the line this line belongs to. Empty for normal lines.
hideInInvoicetrue for sub-lines with price 0 that are not printed on the receipt.
createdAt, updatedAt, createdByWhen the line was added and changed, and by whom.

Line totals are not stored; calculate them:

  • Sales without VAT = (customerPrice − discountSum) × quantity
  • Sales with VAT = customerPriceWithVat × quantity
  • Discount without VAT = discountSum × quantity

Payments and refunds

GET /api/account_registry/search

One payment record is one payment or one refund. An order can have several, and one record can have several payment rows (split payment, for example part cash and part card).

Example request

curl -g -G 'https://{company}.smarton.app/api/account_registry/search' \
  -H 'Authorization: <token>' \
  --data-urlencode 'paginate=true' \
  --data-urlencode 'limit=500' \
  --data-urlencode 'offset=0' \
  --data-urlencode 'createdAt=>=2026-10-01T00:00:00Z&<2026-11-01T00:00:00Z' \
  --data-urlencode 'join[]=payments' \
  --data-urlencode 'join[]=payments.paymentType' \
  --data-urlencode 'partialJoin[order][]=number' \
  --data-urlencode 'partialJoin[createdBy][]=name' \
  --data-urlencode 'partialJoin[device][]=id' \
  --data-urlencode 'sort[createdAt]=asc'

Fields

FieldMeaning
id, orderThe record and its order.
createdAt, createdByWhen the payment was taken, and the cashier.
deviceThe POS device (cash register) used.
orderAmountAmount due with VAT, after discounts.
paidAmountAmount paid, without the change given.
totalPaidAmountAmount handed over by the guest.
refundAmountNegative for a refund, otherwise 0.
receiptNumber, fiscalNoFiscal receipt number and fiscal device number, if a fiscal printer is used.
payments[].paymentTypePayment method (name): Cash, Card, gift voucher, delivery platforms and others. List: GET /api/payment_type/search.
payments[].amountAmount paid with this method.
payments[].cashBackChange given.
payments[].statusconfirmed, pending or canceled (online payments).
  • A refund is a record with a negative refundAmount and no payment rows. Whether it was refunded in cash or to a card is in the cash operations log; see POS API.
  • When a payment is corrected in Smarton, the old record is deleted and a new one is created. Sync deleted records too (_deleted=1). Joined payment rows can include deleted ones; skip rows with deleted: true.

Deleted orders and removed items

Deleted orders and items removed from orders are hidden from normal lists. Ask for them with _deleted=1:

GET /api/order/search?_deleted=1&deletedAt=>=2026-10-01T00:00:00Z%26<2026-11-01T00:00:00Z&paginate=true&limit=200
GET /api/order_product/search?_deleted=1&deletedAt=>=2026-10-01T00:00:00Z%26<2026-11-01T00:00:00Z&partialJoin[order][]=number&paginate=true&limit=500
FieldMeaning
deletedAtWhen it was deleted.
cancelReason (order)The reason entered when the order was deleted.
metadata.deletedBy (order)How and by whom it was deleted, for example posRemove Jane Smith.
reasonForRemoval (line)The reason entered when the item was removed.
updatedBy (line, join it)The user who last changed the line; for a removed item, normally the one who removed it.

The lines of a deleted order are returned as deleted lines too. To count only items removed from orders that were not deleted, leave out lines whose order is deleted.

Sales invoices

GET /api/invoice/search

Example request

curl -g -G 'https://{company}.smarton.app/api/invoice/search' \
  -H 'Authorization: <token>' \
  --data-urlencode 'paginate=true' \
  --data-urlencode 'limit=200' \
  --data-urlencode 'date=>=2026-10-01&<=2026-10-31' \
  --data-urlencode 'join[]=records' \
  --data-urlencode 'partialJoin[records.order][]=id' \
  --data-urlencode 'partialJoin[customer][]=name'

Main fields: number, date, customer, sum (without VAT), sumVat, sumWithVat, isCredit (credit note). records are the invoice lines; records.order links an invoice line to the order it was made from. Invoices can be deleted without a trace, so reload a period in full when you need to be sure.

Example: export one day of sales

  1. Work out the day's start and end in UTC. For example, 10 October 2026 in Lithuania (UTC+3) is 2026-10-09T21:00:00Z to 2026-10-10T21:00:00Z.
  2. Receipts: order/search with status==complete and finishedAt in that window.
  3. Lines: order_product/search with order.status==complete and order.finishedAt in the same window.
  4. Payments: account_registry/search with createdAt in the window, joined with payments.paymentType.
  5. Deletions: the same three requests with _deleted=1 and deletedAt in the window.

Page through each list with limit and offset until you have total rows.