iRetail PRO hub 1.0.0-m5
78 operations
← All documentation · Source: contracts openapi/hub-v1.yaml at 8000474.
REST API the node adds in the hub role (spec/SYNC.md): the organization, its stores, the store nodes registered with the hub, the stores' change requests, analytics over the chain (spec/ANALYTICS.md) and dashboards (spec/DASHBOARDS.md). The hub also serves the store API's operations on the records it owns (items, groups, tax rates, promotions, employees, roles, and from M9 suppliers, recipes, expiry rules, loyalty programs, customers, vouchers, gift cards, partners and bonus rules: openapi/store-v1.yaml), with prices, tax codes and deposits per store here, and the chain's transfers, goods in transit and its bonus and partner reports, and from M11 the releases it holds, rollouts in waves and its own update (spec/RELEASES.md). Conventions: spec/API.md; permissions: spec/RBAC.md. Every request from an app carries IRetail-App (components/parameters/IRetailApp, on every path), and the hub may refuse an app 426 app_update_required by it, by its office store's min_app_versions, except on an operation marked x-app-update-exempt (spec/RELEASES.md, Apps and the gateway).
organization 2 operations
The chain.
- GET
/v1/organizationThe chain this hub serves. - PATCH
/v1/organizationChange the chain's name or default language.
stores 19 operations
The chain's stores and their prices.
- GET
/v1/storesThe chain's stores with the state of their nodes. - POST
/v1/storesAdd a store; its node registers with a token made for it. - GET
/v1/stores/{id}One store with the state of its node. - PATCH
/v1/stores/{id}Change a store's settings; they reach its node as a record. - PUT
/v1/stores/{id}/register-shareGive a store its share of the license's registers; it reaches the store with its record. - GET
/v1/stores/{id}/tax-ratesA store's tax codes (spec/TAX.md). - PUT
/v1/stores/{id}/tax-rates/{code}Create or change one store's tax code; it reaches the store as a record. - DELETE
/v1/stores/{id}/tax-rates/{code}Delete a store's tax code that no item of the store uses. - GET
/v1/stores/{id}/tax-providerWhere a store's tax rates come from, and how the last sync went (spec/TAX.md). - PUT
/v1/stores/{id}/tax-providerSet the tax service that fills a store's rates; the key is only named. - POST
/v1/stores/{id}/tax-provider/syncAsk the tax service for a store's rates now; answers the status after the attempt. - GET
/v1/stores/{id}/depositsA store's container deposits (spec/TAX.md). - PUT
/v1/stores/{id}/deposits/{code}Create or change one store's container deposit; it reaches the store as a record. - DELETE
/v1/stores/{id}/deposits/{code}Delete a store's deposit that no item names. - GET
/v1/stores/{id}/pricesA store's prices by item. - PUT
/v1/stores/{id}/prices/{item_id}Set an item's price in one store; it reaches the store as a record. - GET
/v1/transfersThe chain's transfers with both documents (spec/STOCK.md, Transfers). - GET
/v1/transfers/{id}One transfer of the chain. - GET
/v1/stock/in-transitEvery line in transit between the chain's stores.
nodes 4 operations
Store nodes registered with the hub.
- POST
/v1/stores/{id}/registration-tokensA one-time token a store's node registers with (spec/SYNC.md, Registration); shown once. - GET
/v1/nodesRegistered store nodes and their sync state. - GET
/v1/nodes/{id}One node and its sync state. - POST
/v1/nodes/{id}/revokeRefuse the node's certificate from now on; the store keeps selling, cut off from the hub.
change-requests 3 operations
Stores' requests for hub-owned changes.
- GET
/v1/change-requestsStores' change requests, pending first. - POST
/v1/change-requests/{id}/approveMake the proposed record the hub's (same id); it reaches every store it concerns. - POST
/v1/change-requests/{id}/refuseRefuse a request with a reason the store sees.
analytics 8 operations
The chain's sales and stock (spec/ANALYTICS.md).
- GET
/v1/analytics/metricsThe metrics the analytics query offers (metrics/catalog.json). - POST
/v1/analytics/queryThe chain's sales and stock by the metrics and dimensions asked (spec/ANALYTICS.md). - GET
/v1/exchange-ratesThe organization's exchange rates by day, newest first (spec/ANALYTICS.md, Currencies). - PUT
/v1/exchange-rates/{date}/{from}/{to}Set the rate of a day for a pair. - DELETE
/v1/exchange-rates/{date}/{from}/{to}Remove the rate of a day for a pair. - POST
/v1/exchange-rates/importImport rates from CSV: a headerdate,from,to,rate, then one rate per line. - GET
/v1/reports/bonusesEmployee bonuses over the chain's stores, by store and employee. - GET
/v1/reports/partnersPartners over the chain's stores, by store and partner.
dashboards 4 operations
Pages of tiles over the analytics (spec/DASHBOARDS.md).
- GET
/v1/dashboardsThe organization's dashboards and the ready-made set (spec/DASHBOARDS.md). - GET
/v1/dashboards/{id}One dashboard. - PUT
/v1/dashboards/{id}Save a dashboard; under a ready-made id, the organization's copy takes its place. - DELETE
/v1/dashboards/{id}Delete the organization's dashboard (a ready-made one comes back in its place).
network 4 operations
The chain's private WireGuard network (spec/NETWORK.md).
- PUT
/v1/stores/{id}/networkThe store's own switch for the private network (spec/NETWORK.md); null follows the organization. It reaches the store with its record. - GET
/v1/networkThe organization's private network (spec/NETWORK.md). - PUT
/v1/networkTurn the private network on or off, set its subnet (only while off) and the endpoint stores reach the hub at. - GET
/v1/network/peersEvery registered node as a peer of the hub, with its latest handshake as the replicas recorded it.
releases 22 operations
Releases the hub holds, rollouts in waves and the hub's own update (spec/RELEASES.md).
- GET
/v1/releasesThe releases the hub holds, the latest version first (spec/RELEASES.md, The hub's releases). - GET
/v1/releases/availableWhat the source (IRETAIL_RELEASES_URL) offers as its latest release, and whether the hub holds it.409 release_source_missingwith downloading off,503 release_source_unreachablewhen version.json cannot be read. - POST
/v1/releases/downloadDownload a release from the source. The manifest is read and verified before answering (422 release_refused); the artifacts follow in the background, each verified as it is stored.200for a version already held. - POST
/v1/releases/importImport a release bundle sent as the raw body (a POSIX tar, manifest.json first, then every artifact). Verified as it streams;201verified,200for the same manifest again,409 release_conflictfor another manifest of a version held,422 release_refusedwith nothing kept. - GET
/v1/releases/{version}One release the hub holds, with its signed manifest. - DELETE
/v1/releases/{version}Remove a release and its files from storage;409 release_in_usewhile it is in use. - GET
/v1/rolloutsRollouts, newest first (spec/RELEASES.md, Rollouts). - POST
/v1/rolloutsStart a rollout of a verified release in waves.409 rollout_activewhile another is unfinished;422 invalid_rolloutwith a reason. - GET
/v1/rollouts/{id}One rollout with its waves. - GET
/v1/rollouts/{id}/storesEach store of a rollout with its wave, update state and gate status, in the waves' order. - POST
/v1/rollouts/{id}/pausePause a running rollout; the current wave's stores that have not begun applying lose their targets.409 rollout_stateotherwise. - POST
/v1/rollouts/{id}/resumeResume a paused rollout on its current wave, as a new attempt for the stores not done; the current wave's stores whose apps are held for the release have the hold cleared (apps_cleared_at).409 rollout_stateotherwise. - POST
/v1/rollouts/{id}/rollbackSend every store that took the release back to its previous version, at once.409 rollout_statefrom rolling_back or rolled_back,409 rollout_not_latestfor an older rollout,409 rollout_activewhile another is unfinished. - POST
/v1/rollouts/{id}/stores/{store_id}/skipTake a store out of a rollout; a target it has not finished is withdrawn and the gate passes it.409 rollout_statein completed or rolled_back. - POST
/v1/rollouts/{id}/stores/{store_id}/clear-appsClear a store's held apps for the rollout's release (spec/RELEASES.md, One device first) by writing its target again with apps_cleared_at.409 rollout_statein rolled_back;404for a store the rollout does not cover or whose target was withdrawn. - GET
/v1/app-updateWhat an app of the hub's office store, or the console on a desktop, should run, by the release the hub runs, one device first (spec/RELEASES.md, The apps); as a store's getAppUpdate. A hub that does not hold the release it runs offers no installer. - POST
/v1/app-update/reportAn app of the hub's office store, or the console, reports where its update stands (spec/RELEASES.md, Reporting); as a store's postAppUpdateReport. - POST
/v1/app-update/clearClear the hub's office store's hold of a release for an app and platform (spec/RELEASES.md, One device first). 404 when nothing is held. - GET
/v1/releases/{version}/manifestThe signed manifest of a release the hub holds verified, for its office store's devices, the console and its updater; the caller verifies it with its own embedded keys. 404 for a release not held or not verified. - GET
/v1/releases/{version}/artifacts/{name}A file of a release the hub holds verified;Rangeresumes a broken download. The caller checks its size and SHA-256 against the manifest. - GET
/v1/hub-updateThe hub's own update (spec/RELEASES.md, The hub's own update). - PUT
/v1/hub-updateSet the hub's own target, applied by its updater.404for a version not held,409 release_not_verified,409 stores_incompatibleunless forced,422 release_refused(downgrade) for an earlier version that is not the previous one.
brand 3 operations
Stores' banners over the organization's brand (spec/BRANDS.md); the brand itself is the store API's.
- GET
/v1/stores/{id}/bannerA store's banner over the brand, served whether or not the key holds white_label; 404 when the store has none (spec/BRANDS.md). - PUT
/v1/stores/{id}/bannerSet a store's banner, checked as a brand is (422 invalid_brand, 422 brand_contrast); 403 module_disabled without white_label. - DELETE
/v1/stores/{id}/bannerRemove a store's banner, bringing the brand back to it; 403 module_disabled without white_label.
alerts 4 operations
- GET
/v1/alertsThe chain's alerts, newest first (spec/HEALTH.md). - POST
/v1/alerts/{id}/acknowledgeAcknowledge an open alert; it stays open and sends no further notice.409 alert_resolvedfor one already resolved. - GET
/v1/alerts/settingsThe alert thresholds and the webhook's name. - PUT
/v1/alerts/settingsSet the alert thresholds and the webhook's name (its URL is read from IRETAIL_ALERT_WEBHOOK_<NAME>).
backups 5 operations
- GET
/v1/backup-policyThe organization's backup policy (spec/BACKUP.md). - PUT
/v1/backup-policySet the backup policy; it reaches every store with its record.409 backup_storage_missingto enable it without storage at the hub. - GET
/v1/backupsStored and failed archives, newest first. - POST
/v1/backupsAsk a store (or the hub) for an archive now.409 backup_disabledwithout an enabled policy. - GET
/v1/backups/{id}/downloadThe encrypted archive, with its file name; only the organization's age identities open it.