PosPublic API

PosPublic Web Order — External Product Checkout

This feature lets an external site (a client's own webshop/ordering frontend) hand a customer off to our existing pospublic Stripe/SEB/Paynt checkout screen for one or more products, without going through our QR/table ordering flow. The client only ever sends product ids and quantities — the price is always recalculated server-side from the Article, so a client site can never under- or over-charge a customer.


Prerequisites

Configure the tenant's PosPublicOptions (same settings used by the QR ordering feature):

  • Public Manager
  • Public Customer Employee

The first web order automatically creates a dedicated virtual table named "Website Orders (Takeaway)" that all web orders are attached to, so staff see and close them exactly like any other POS order (kitchen display, payments, etc.). No extra setup is required for this table — it's created lazily on first use.


1. Get Menu / Products

Endpoint URL

https://{domain}.smarton.app/api/public/pos/menu

Method

GET


Description

Returns the tenant's product catalog. This is the same endpoint the pospublic menu screen itself calls, so it reflects exactly what's available to order. Use the returned article id values as the productId in the Checkout Redirect / Create Web Order requests below.


Query Parameters

Parameter

Type

Required

Description

pos

boolean

No

Set to true to get the POS-formatted menu (pricing/stock aware). Without it, a simpler generic menu is returned.

posPublic

boolean

No

Set to true together with pos=true to restrict results to articles marked public, and only their required parameters — matches what an anonymous customer is allowed to order.


Example Request

curl --location 'https://{domain}.smarton.app/api/public/pos/menu?pos=true&posPublic=true'

Response Structure

Field

Type

Description

articleCategories

array

Category tree: id, name, level, position, specialOffer, parent, photo.

articles

array

Product list — see fields below.

articles[].id

integer

The Article id. This is the productId used everywhere else in this integration.

articles[].name

string

Product display name.

articles[].description

string

Product description.

articles[].price

number

Base price (excluding VAT). Shown for reference only — the checkout flow always recalculates the real charge server-side.

articles[].inStock

number

Remaining stock, only meaningful when sellFromWarehouse is true.

articles[].categories

array

{ id, name, level } for each category the product belongs to.

articles[].photo

object

{ id, newId }, or null if no photo.

articles[].vat

object

{ id, percentage }, or null.

articles[].productParameters

array

Configurable options (e.g. size/variant dropdowns). With posPublic=true, only required parameters are included.

currency

object

{ name, shorthand } for the tenant's currency.

style

object

Tenant's pospublic theme colors.


Status Codes

Code

Message

Description

200 OK

—

Menu returned successfully.


2. Checkout Redirect (main integration point)

Endpoint URL

https://{domain}.smarton.app/pospublic/buy

Method

Browser navigation (GET) — this is a page in our Angular app, not a JSON API. Redirect the customer's browser here directly (full page navigation, not fetch/XHR/iframe).


Description

This is the actual integration contract external clients should use. The page creates the order, authenticates the browser for that order, and forwards to our existing /pospublic/checkout/:orderId screen (Stripe Elements / SEB / Paynt, whichever is configured for the tenant).

The raw /public/pos/web_order API below is not meant to be called directly from a client's own server — it must run inside the customer's browser so the resulting session cookie/token is set on the customer's browser, not the client's server.


Query Parameters

Parameter

Type

Required

Description

items

string

✅ Yes

Comma-separated productId:quantity pairs. Product id is an Article id. Quantity defaults to 1 if omitted. Example: 123:2,456:1

returnUrl

string (URL)

No

Where to send the customer immediately after a successful payment — the customer is redirected here automatically as soon as the payment is confirmed, before our own tips/feedback screen would otherwise show.

cancelUrl

string (URL)

No

Where to send the customer if they back out of checkout before paying.

lang

string

No

Two-letter language code for the checkout UI, e.g. en.


Example

https://{domain}.smarton.app/pospublic/buy?items=123:2,456:1&lang=en&returnUrl=https://www.yourwebsite.com/thank-you&cancelUrl=https://www.yourwebsite.com/basket

3. Create Web Order (internal API, used by the redirect page)

Endpoint URL

https://{domain}.smarton.app/api/public/pos/web_order

Method

POST


Description

Creates a new Order attached to the tenant's "Website Orders (Takeaway)" table, adds each requested product priced from its Article, and authenticates the current session as the tenant's public customer employee. No login/authorization header is required — this is a public endpoint, same trust level as the rest of /public/pos/*.


Request Body (JSON)

Field

Type

Required

Description

items

array

✅ Yes

Array of { productId, quantity, parameters }. productId is an Article id; price is always looked up server-side, never taken from the request.

items[].parameters

array

Required if the article needs it

Array of { parameter, value }. Required whenever the article's price depends on a selected option (e.g. size/variant) — some articles calculate price from a formula that reads a parameter's value (see the productParameters field on Get Menu above). If a required parameter is omitted, the price calculation will be wrong (often 0), not rejected with an error. parameter is the parameter id from the article's productParameters[].parameter.id; value is the selected value — for a dropdown parameter this is the chosen dropDownOptions[].id (or its label, depending on how the parameter is configured).

returnUrl

string

No

Stored on the order's metadata; read back by the checkout/success screens.

cancelUrl

string

No

Stored on the order's metadata; read back by the checkout screen's back button.


Example Request

curl --location 'https://{domain}.smarton.app/api/public/pos/web_order' \\\\\\\\
--header 'content-type: application/json' \\\\\\\\
--data '{
"items": [
{ "productId": 123, "quantity": 2, "parameters": [ { "parameter": 16, "value": "500ml" } ] },
{ "productId": 456, "quantity": 1 }
],
"returnUrl": "https://www.yourwebsite.com/thank-you",
"cancelUrl": "https://www.yourwebsite.com/basket"
}'

Response

Same shape as the QR ordering table-login response.


Response Structure

Field

Type

Description

orders

array

Array containing the single newly created order (id, number, products, customerPrice, customerPriceWithVat, etc.).

user

object

Login payload (includes token) for the public customer employee session — must be stored and sent like any other authenticated session.

deviceId

null

Always null for web orders (no physical POS device involved).


Example Response

{
"orders": [
{
"id": 88213,
"number": "WEB-88213",
"name": "Website Order #WEB-88213",
"status": "created",
"products": [
{ "id": 501, "name": "Fish and Chips", "quantity": 2, "customerPrice": { "amount": 8.5, "currency": "GBP" }, "customerPriceWithVat": { "amount": 10.2, "currency": "GBP" } }
],
"customerPrice": { "amount": 17.0, "currency": "GBP" },
"customerPriceWithVat": { "amount": 20.4, "currency": "GBP" }
}
],
"user": { "id": 42, "token": "<token>" },
"deviceId": null
}

Status Codes

Code

Message

Description

200 OK

—

Order created successfully.

400/500

Error

No items provided, invalid productId/quantity, product not found, or PosPublicOptions not configured (missing public manager/customer employee).


4. Get Web Order Status

Endpoint URL

https://{domain}.smarton.app/api/public/pos/web_order/{orderId}

Method

GET


Description

Used by the checkout screen to refresh a single web order's current price/status. Only returns orders that belong to the "Website Orders (Takeaway)" table — it will not return arbitrary orders from the tenant.


Response

Same shape as the Create Web Order response above (orders / user / deviceId), for the single requested order.


Status Codes

Code

Message

Description

200 OK

—

Order found and returned.

400/500

Error

Order not found, or the order does not belong to the web-orders table.