API-HUB is a middleware platform that connects 994+ PromoStandards wholesale suppliers to OnPrintShop (OPS) storefronts. Instead of paying a $3,000-per-year per-customer API integration fee or writing bespoke connector code for every vendor, you register a supplier as a single database row and let the adapter pipeline handle SOAP calls, REST requests, pricing markup, and storefront push automatically.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/VisualGraphxLLC/API-HUB/llms.txt
Use this file to discover all available pages before exploring further.
The problem it solves
Most print distributors face the same dilemma: each supplier exposes a different protocol (SOAP, REST, GraphQL), ships data in a different schema, and charges for API access separately. Connecting a new storefront customer means repeating that entire integration cycle — often at significant cost and with weeks of development time. API-HUB collapses that complexity into a single, configurable layer. Suppliers are not hardcoded into the application. They are rows in the database with anadapter_class field and an encrypted auth_config blob. Adding a new supplier means filling in a form, not deploying code.
The PromoStandards Directory integration auto-discovers all registered suppliers. You don’t maintain a vendor list — the directory does.
Key concepts
Before diving into setup or architecture, it helps to understand how API-HUB thinks about its core entities.Suppliers
Suppliers
A supplier is a database record, not a code module. Each row stores the supplier’s name, protocol,
adapter_class, and an encrypted auth_config JSON blob that holds credentials. The adapter registry reads this record at runtime and instantiates the correct adapter — no restart required when you add or update a supplier.Adapters
Adapters
An adapter is a Python class that implements the
BaseAdapter abstract base class. Every adapter exposes four methods: discover() fetches the full product catalog, hydrate_product() retrieves detail for a single SKU, discover_changed() fetches only products changed since a given timestamp, and discover_closeouts() retrieves discontinued items. The four built-in adapters cover PromoStandards SOAP, SanMar, FourOver REST, and the OPS GraphQL inbound path.Catalog products
Catalog products
The catalog is polymorphic. Every product has a
product_type field that is either apparel or print. Apparel products use tiered variant pricing keyed by size and quantity breaks. Print products use a formula: base × area × area_factor + setup. Both types share the same catalog API surface.Markup rules
Markup rules
Markup rules are per-customer pricing overlays. You define a percentage markup, minimum margin, rounding strategy, and optional storefront overrides. The pricing engine applies these rules when generating a quote via
POST /api/pricing/quote, so the same underlying cost can produce different customer-facing prices across storefronts.Credentials and encryption
Credentials and encryption
All supplier and customer credentials — API keys, passwords, HMAC secrets — are stored encrypted at rest using Fernet AES-128 via the
EncryptedJSON field type. The encryption key is the SECRET_KEY environment variable. Credentials are managed entirely through the admin UI; no plaintext ever enters the database.The four systems
API-HUB is structured as a modular monolith with four distinct components that work together.FastAPI backend
The Python backend that exposes all REST endpoints, owns the PostgreSQL schema, runs the adapter registry, and applies pricing markup. It runs on port 8000 and is the only process that writes to the database.
Next.js 15 frontend
The admin UI running on port 3000. Built with the Blueprint design system (Outfit + Fira Code fonts, paper palette
#f2f0ed, blueprint blue #1e4d92). Operators use this to manage suppliers, customers, markup rules, and monitor sync health.n8n automation engine
An n8n instance in Docker (port 5678) that owns all outbound API calls to suppliers and OPS storefronts. FastAPI prepares and enriches data; n8n triggers imports, syncs, and pushes on schedule. This separation keeps external API calls auditable and retryable without touching backend code.
n8n-nodes-onprintshop
A TypeScript custom n8n node that speaks GraphQL to OnPrintShop storefronts. It handles product creation, variant mapping, and inventory updates on the OPS side of the pipeline. Installed into the n8n container at startup.
How the systems interact
The data flow is unidirectional and predictable: The frontend never talks to suppliers directly. n8n never writes to the database directly. FastAPI is the single source of truth for catalog state.What API-HUB is not
API-HUB is not a general-purpose e-commerce platform or an OMS. It does not handle order processing, shipping, or invoicing. Its scope is narrowly defined: get normalized supplier product data into OnPrintShop storefronts with correct pricing, and keep it in sync automatically.Quickstart
Get API-HUB running locally in under 15 minutes.
Architecture
Deep dive into the system design, API routes, and data flow.