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/menuMethod
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 |
posPublic | boolean | No | Set to |
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: |
articles | array | Product list — see fields below. |
articles[].id | integer | The Article id. This is the |
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 |
articles[].categories | array |
|
articles[].photo | object |
|
articles[].vat | object |
|
articles[].productParameters | array | Configurable options (e.g. size/variant dropdowns). With |
currency | object |
|
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/buyMethod
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 |
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. |
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/basket3. Create Web Order (internal API, used by the redirect page)
Endpoint URL
https://{domain}.smarton.app/api/public/pos/web_orderMethod
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 |
items[].parameters | array | Required if the article needs it | Array of |
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 |
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. |
English