Skip to content

ERP Quirks & Integration Notes

Order tiers: P21 has a 3-tier order fallback chain for order retrieval. See apps/dagster/erp_pipeline/sources/prophet21/order_service.py and the tier-hierarchy README in the P21 docs directory.

Custom source migration: There’s a get_p21_custom_source_enabled() flag in config.py that controls whether to use the new custom source path. This was added as part of a migration β€” don’t remove the flag gate until the migration is complete for all customers.

Inventory routing: The PDF extraction workflow runs a P21-specific enrichment step (enrich_order_with_inventory_routing) that annotates each order item with the best source location. This is P21-only β€” a no-op for other ERPs.

Auth: Prophet21AuthHandler handles session management. P21 sessions expire and need to be refreshed β€” the handler manages this transparently.

Hybrid scraping: WhereFour doesn’t have a real API. We use Playwright for login only (to handle their auth flow), then httpx for all actual API calls once we have a session cookie. Don’t try to use Playwright for the full scrape β€” it’s too slow.

ERP credentials are encrypted with AES-256-GCM. TypeScript (webapp) encrypts them, Python (Dagster/temporal-worker) decrypts them. The encryption key is shared via env var. Do not store plaintext credentials anywhere.