Repricer Articles Endpoints¶
Base path: /api/v1/multi + router prefix /articles → full base: /api/v1/multi/articles
Summary: Core CRUD and orchestration endpoints for repricer Article objects. Provides listing, filtering, per-channel details (Shopify, FBM, Kaufland, Otto, FBA), UVP management (set/remove), and triggers to recalculate/export across channels.
Auth: Bearer JWT required for all endpoints.
Rate limiting: Subject to global rate limiter (250 requests / 60s).
Listing & querying¶
- GET / — List articles with optional JSON
filtersandordersquery params - Path:
GET /api/v1/multi/articles/ - Query params:
filters(JSON array of filter objects),orders(JSON array of order objects),limit(int, default 100),offset(int) detailsquery param (enum) controls inclusion of channel-specific details:shopify,fbm,kaufland,otto,fba,pricing_history,all.- Response:
List[RepricerArticleWithDetailsResponse] -
Notes: Filters are applied by
apply_filters_to_query; orders useapply_order_to_query. -
GET /stats/summary — Returns aggregated counts and stock/value sums (catalog inventory, not sales/profit).
-
GET /stats/sales — Batch sales/profit KPIs
- Path:
GET /api/v1/multi/articles/stats/sales - Query:
skus(comma-separated, required, max 200),days(1–365, default 7),channel(all|otto|kaufland|shopify|fbm|fba|other) - Response:
{ days, channel, items: [ArticleSalesStatsResponse, ...] } -
See article_sales_stats.md for computation.
-
GET /{sku}/stats/sales — Same KPIs for one SKU (used by the Multi Repricer statistics dialog).
- Query:
days,channel(same as batch). - Response fields:
| Field | Type | Meaning |
|---|---|---|
sku |
string | Article SKU |
days / channel |
int / string | Request echo |
sales_qty / retour_qty |
float | Units sold / returned |
retour_rate |
float | retour_qty / sales_qty (0 if no sales) |
avg_sell_price / avg_buy_price |
float | null | Weighted averages |
avg_profit_per_sale |
float | null | period_profit / sales_qty after returns |
period_profit |
float | Σ sale profits − Σ return profits − return_cost_total |
gross_revenue / retour_gross |
float | Sell × qty (sales / returns) |
return_cost_total |
float | Always 0 (stub for future handling costs) |
by_channel |
object | null | Per-channel KPI map when channel=all |
Article CRUD¶
- GET /{sku} — Get an article (optionally with
details) - POST / — Create an article (
RepricerArticleCreate) - PUT /{sku} — Update an article (
RepricerArticleUpdate) — triggers channel-specific recalculations for changed fields (stock, buy price, weight, package) - DELETE /{sku} — Remove an article
Notes: PUT may call channel recalculation helpers for Shopify, Kaufland, Otto, FBA, FBM depending on changed fields.
Channel details endpoints (per-SKU)¶
These endpoints allow managing per-channel detail objects. Each channel exposes GET, POST (create), PUT (update) and DELETE endpoints where applicable.
- Shopify:
/api/v1/multi/articles/{sku}/shopify—ShopifyDetailsCRUD; creating/updating triggersshopify_recalculate_articles. - FBM:
/api/v1/multi/articles/{sku}/fbm—FBMDetailsCRUD; creating/updating triggersfbm_recalculate_articles. - Kaufland:
/api/v1/multi/articles/{sku}/kaufland—KauflandDetailsCRUD; creating/updating triggerskaufland_recalculate_articles. - Otto:
/api/v1/multi/articles/{sku}/otto—OttoDetailsCRUD; creating/updating triggersotto_recalculate_articles. - FBA:
/api/v1/multi/articles/{sku}/fba—FBADetailsCRUD; creating/updating triggersfba_recalculate_articles.
Additionally, FBM details can be updated by ID (PUT /fbm/{fbm_id}) to support multi-FBM variants per base article.
UVP (manufacturer suggested price) endpoints¶
- POST /{sku}/uvp — Apply UVP updates (
UVPUpdate) to one or more channels and optionally push values into channel-specific price fields. Also copies min/max UVP to 1:1 bundle peers (parentchild_skus↔ aliasbundle_packageswith quantity 1). Multi-component gift sets, value packs, and name-onlySKU(n)variants are not updated. Triggers downstream recalculations and exports for the SKU and those 1:1 peers. See Patch 1.11.2. - DELETE /{sku}/uvp — Remove UVP settings (
UVPRemove) and optionally revert channel pricing behavior (setuse_min_max_rules=True). Does not clear UVP on peer SKUs.
Other utilities¶
- Attach/detach pricing history:
pricing_historydetail source can be requested viadetails. - Package mapping helpers are used internally on
PUTwhen weight/package changes to reassignpackage_typeandpackage_cost.
Filtering & ordering examples¶
- Example: Get active Shopify articles with stock > 0, ordered by
shopify.pricedescending
curl "http://localhost:8000/api/v1/multi/articles/?filters=[{\"field\":\"stock\",\"op\":\"gt\",\"value\":0},{\"field\":\"shopify.price\",\"op\":\"is_not_null\"}]&orders=[{\"field\":\"shopify.price\",\"direction\":\"desc\"}]" \
-H "Authorization: Bearer <TOKEN>"
Base cron recalculation (nightly)¶
The base Articles cron (after sync / buy-price sync) recalculates channels in order: Shopify → Kaufland → Otto → FBM → FBA.
| Channel | Nightly main pass | Buy-price / package force pass |
|---|---|---|
| Shopify / Kaufland / Otto | Profit refresh by default; min/max on force or missing-bounds bootstrap | force_min_max=True (Otto may push max as sale) |
| FBM / FBA | Rules-on → full SP-API; wave / UVP → profit-only (force_min_max=False) |
force_min_max=True rewrites wave bounds via SP-API; UVP skipped entirely; FBA OOS included |
Buy-price force SKUs include penner/renner (clears article_type); UVP only is excluded.
Walkthrough examples¶
Penner + new buy price today¶
- Sync (Plenty / channels / bundles).
- Buy-price sync writes new EK → SKU changed.
- Force pick includes penner → clears
article_type. - Main recalc (
force_min_max=False): wave channels profit-only; rules-on FBM/FBA full SP-API. - Force pass (
force_min_max=True): Shopify / Kaufland / Otto rewrite bounds; FBM / FBA full SP-API (rewrites wave). - Export if “Update prices” is on.
Penner + unchanged EK¶
Force list empty for that SKU → main pass profit-only only → wave min/max kept.
Rules-on FBM/FBA + unchanged EK¶
Main pass full SP-API every night; no force pass.
UVP + new buy price¶
EK updates; force pick skips UVP; main pass pins UVP bounds (profit-only); no force rewrite.
Full tables: user guide — Cron walkthrough examples.
Implementation notes¶
- Implementation:
backend/service_multi-repricer/app/api/v1/endpoints/repricer_articles.py - This module delegates heavy work to per-channel modules and to
services.cron_servicefor scheduled workflows. It ensures normalized Pydantic responses and provides compatibility fallbacks when channel detail JSONs don't strictly match expected schemas.
Links¶
- Source:
backend/service_multi-repricer/app/api/v1/endpoints/repricer_articles.py - Related:
backend/service_multi-repricer/app/crud/repricer_article.py(data access helpers)
Generated: reference for core repricer endpoints and orchestration.