تخطَّ إلى المحتوى

ERP mode

هذا المحتوى غير متوفر بلغتك بعد.

Each company runs in an ERP mode. It decides whether SLFLO waits for your ERP before an order counts as booked.

Mode What it means for orders
None (DISABLED) No ERP is connected. The office confirms orders itself; nothing waits on an ERP.
API (API) Your ERP pulls through this API. Orders released for fulfilment wait as ERP_PENDING until your ERP acks them: ERP_CONFIRMED when accepted, ERP_FAILED when rejected (the office can send it again).
Push to Dynamics 365 (DYNAMICS365) SLFLO sends orders to D365 itself. Not offered yet; the API mode is the supported route.
Demo (FAKE) A stand-in ERP inside SLFLO, for demos and tests. You won’t meet it on a real company.
  • Only pre-sale orders wait. A van sale is delivered and invoiced on the spot and never waits for your ERP; invoices are always issued by SLFLO, and you read them from the invoice feed.
  • Order acks need mode API. Against a company in another mode, an order ack answers 409 ERP_MODE_NOT_API.
  • Invoices, payments and returns take acks in any mode, so you can read them into your books even while orders are still run in SLFLO alone.
  • Pushing master data and lookups work in any mode.

What can still happen to an order once it waits for you, in mode API:

The order is What can happen next in SLFLO
ERP_PENDING Only your answer. The office can’t cancel or change it while it waits.
ERP_CONFIRMED (you accepted) Nothing: it is final. SLFLO never cancels or changes an order you booked.
ERP_FAILED (you refused) The office sends it again — ERP_PENDING at a higher version, the same lines — or cancels it: CANCELLED at a higher version.

Every change raises the order’s version, so add CANCELLED to your pull — filter[status]=ERP_PENDING,CANCELLED&filter[version_after]=… — to learn that a refused order was given up. An ack carries no version: SLFLO answers the order as it is now. An answer to an order that is no longer waiting is 409 ORDER_NOT_AWAITING_ACK, or 409 ALREADY_ACKNOWLEDGED when it differs from the answer you gave; so drop answers you haven’t sent for an order that was sent again, and answer the new version.

The company’s administrator switches between DISABLED and API with Orders wait for your ERP in Settings › Integrations (the help page); the go-live checklist says when.

  • On (API) needs an active integration client with orders:write (your ack), or the console refuses it with ERP_MODE_NEEDS_CLIENT. Orders released from then on wait for you; orders already with the office stay there.
  • Off (DISABLED) is refused with ERP_ORDERS_WAITING while any order is still ERP_PENDING: you may already have booked it, so ack every order you were sent first. Once off, an ack answers 409 ERP_MODE_NOT_API.
  • Each change is audited and published as settings.erp-capabilities-changed. Your connector learns the mode from GET /me (data.company.erp_mode); check it before acking.

Separately from the mode, an administrator can turn on Stock is managed in your ERP in Settings › Integrations (it needs an active integration with stock:write). GET /me answers it as data.company.stock_managed_by_erp. While it is true:

  • SLFLO makes no stock moves of its own: loads, unloads, moves, goods received (and the opening-stock import), write-offs and counts are refused in the console with MANAGED_BY_ERP.
  • A rep only accepts or refuses a load, never counts it (LOAD_COUNT_NOT_ALLOWED), and sells from the van only after accepting the waiting load — whatever version of the phone app.
  • Credit limits and prices you push stay locked on their own rows, as before (ERP_MASTERED).
  • Your ERP loads the vans: PUT /stock/loads/{ref} for each transfer journal, and the reps’ answers come back on GET /stock/loads. See Stock from your ERP.

While it is false, SLFLO keeps the company’s stock itself, and every /stock/… write is refused with 409 ERP_STOCK_NOT_ENABLED.

Terminal window
curl -s "$SLFLO_BASE/me" -H "Authorization: Bearer $SLFLO_TOKEN" | jq .data.company.stock_managed_by_erp
# true

GET /me answers the mode as data.company.erp_mode, so a connector can check it before it starts acking orders:

Terminal window
curl -s "$SLFLO_BASE/me" -H "Authorization: Bearer $SLFLO_TOKEN" | jq -r .data.company.erp_mode
# API

The sandbox answers API. When it answers anything else, don’t ack orders — they answer 409 ERP_MODE_NOT_API — but keep pulling and acking invoices, payments and returns.