Saltar para o conteúdo

Help center · Integrators

Connect your ERP and other systems to Spero

For IT partners and ERP or BI teams. There are two ways: files (CSV or Excel, in the dashboard) or the API, with a company key. Everything is JSON over HTTPS.

1. Keys and rules

Base URL: https://sperosystems.pt/api/iot/v1

Company key (spk_…): the administrator creates it in the dashboard → Integrations and picks the permissions: «read data» and/or «create orders». The key is shown only once and can be revoked at any time.

Send the key in the «Authorization: Bearer spk_…» header. Limit: 120 requests per minute per key.

Equipment and terminals use the device's own key (spd_…), created when it is installed.

Errors: 401 invalid or revoked key · 403 missing permission · 413 request too large · 422 invalid data (the response says what) · 429 too many requests.

2. No code: files

Orders: export them from the ERP to CSV or Excel and upload the file in the dashboard → Shop Floor → ERP. The first time, choose which column holds each field (Spero suggests it from the header); it is saved.

Actual times: in the same place, download the Excel or CSV (with «;» and decimal comma) for a period, to import into the ERP.

Orders whose number is already on a production order are not imported again.

3. Customer orders → production orders

POST /fabrica/ordens («create orders» permission). Up to 300 orders per request. Orders are created and scheduled as in the dashboard.

Add ?verificar=1 to validate without saving. The same reference is never imported twice (it is returned in «ja_importadas»).

FieldTypeDescription
produtotextProduct code (or name), as in Spero. Required.
quantidadeinteger1 to 100000. Required.
referenciatextOrder number in the ERP (prevents duplicates).
linhatextLine name; required if the company has more than one.
data_pedidaYYYY-MM-DDPromised delivery date.
inicioYYYY-MM-DD HH:MMDesired start (empty = now).
clientetextEnd customer.
prioridade-9 to 9Higher = first.
notastextShown on the tablet.
lotetextBatch, for traceability.
Request
curl -X POST https://sperosystems.pt/api/iot/v1/fabrica/ordens \
  -H "Authorization: Bearer spk_…" -H "Content-Type: application/json" \
  -d '{"ordens":[{"produto":"CAD-1","quantidade":20,"referencia":"ENC 2026/123",
       "data_pedida":"2026-11-20","cliente":"Móveis Lda","lote":"L-2026-11"}]}'
Response
{ "gravado": true, "validas": 1, "criadas": [42], "ja_importadas": [], "erros": [] }

Products with mandatory options (colours, sizes…) are created in the dashboard.

4. Actual times → ERP

GET /fabrica/tempos?de=YYYY-MM-DD&ate=YYYY-MM-DD («read data» permission). By default the last 7 days; at most 93 days. Add &formato=csv for CSV.

One row per order and station, finished in the period or in progress. Times in ISO 8601 (UTC); minutes with one decimal.

Request
curl "https://sperosystems.pt/api/iot/v1/fabrica/tempos?de=2026-11-01&ate=2026-11-07" -H "Authorization: Bearer spk_…"
Response
{ "de": "2026-11-01T00:00:00.000Z", "ate": "2026-11-08T00:00:00.000Z", "fuso": "Europe/Lisbon",
  "tempos": [{ "ordem": 42, "referencia": "ENC 2026/123", "cliente": "Móveis Lda", "codigo": "CAD-1", "produto": "Cadeira",
    "quantidade": 20, "lote": "L-2026-11", "linha": "Linha 1", "estacao": "Montagem",
    "inicio": "2026-11-03T08:02:00.000Z", "fim": "2026-11-03T10:40:00.000Z", "minutosPrevistos": 150, "minutosReais": 158,
    "operarios": ["Ana Costa"], "pecas": 20, "estado": "concluída" }] }

5. Factory data (OEE, stops, alerts)

GET /dados lists the equipment and the available data sets: daily OEE, stops, orders, aggregated readings, andon, alerts and indicators.

GET /dados/{set}?p=hoje|semana|mes or ?de=…&ate=… (max. 93 days), optional &formato=csv.

Request
curl "https://sperosystems.pt/api/iot/v1/dados" -H "Authorization: Bearer spk_…"
curl "https://sperosystems.pt/api/iot/v1/dados/paragens?p=semana&formato=csv" -H "Authorization: Bearer spk_…"

6. Equipment readings

POST /leituras with the device key. Up to 500 readings per request and one request every 2 seconds.

Types: estado (1 running, 0 stopped, -1 off), pecas, refugo, temperatura, humidade, potencia, energia, porta. Optional «t»: time of the reading (ISO, seconds or milliseconds; up to 7 days back).

On a Shop Floor station linked to this machine, parts add up on the order in progress and a long stop opens the andon on its own.

Request
curl -X POST https://sperosystems.pt/api/iot/v1/leituras \
  -H "Authorization: Bearer spd_…" -H "Content-Type: application/json" \
  -d '{"leituras":[{"tipo":"estado","valor":1},{"tipo":"pecas","valor":3,"t":"2026-11-03T08:15:00Z"}]}'
Response
{ "ok": true, "recebidas": 2, "erros": [], "agora": "2026-11-03T08:15:02.120Z" }

7. Station terminal (no screen)

GET /estacao returns the station, who is present and the orders with their tasks.

POST /estacao with «acao»: presenca, iniciar, concluir, tarefa, material or alerta (e.g. a help button). The operator is identified by the card code or their number.

Request
curl https://sperosystems.pt/api/iot/v1/estacao -H "Authorization: Bearer spd_…"
curl -X POST https://sperosystems.pt/api/iot/v1/estacao -H "Authorization: Bearer spd_…" -H "Content-Type: application/json" \
  -d '{"cartao":"0A0B0C0D","acao":"iniciar","ordem":42}'

Need help with the connection?

Open a support request in the dashboard (Help → Support) with the name of the ERP and what you want to connect.

Back to top