Skip to main content

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.

Markup rules control how supplier cost prices are transformed into customer-facing storefront prices. Each rule is scoped to a customer and can target all products ("all"), a specific category ("category:{name}"), or a specific product ("product:{supplier_sku}"). The push payload endpoints combine markup rules with storefront overrides to produce the exact input n8n needs for OPS GraphQL mutations.

Markup rule endpoints

List rules for a customer

GET /api/markup-rules/{customer_id}
Returns all markup rules for the customer, ordered by priority descending (highest priority applied first). Example:
curl -b "auth_token=<token>" \
  http://localhost:8000/api/markup-rules/a1b2c3d4-5678-...
Response fields:
id
string
Rule UUID
customer_id
string
Customer UUID
scope
string
Rule scope: "all" (customer-wide), "category:{name}" (e.g. "category:T-Shirts"), or "product:{supplier_sku}"
markup_pct
number
Markup percentage (e.g. 40 = 40% above cost)
min_margin
number
Minimum margin floor in dollars, or null
rounding
string
none | nearest_99 | nearest_dollar
priority
integer
Higher number = applied first when multiple rules match

Create a rule

POST /api/markup-rules
{
  "customer_id": "a1b2c3d4-5678-...",
  "scope": "all",
  "markup_pct": 40,
  "min_margin": 2.00,
  "rounding": "nearest_99",
  "priority": 10
}
Returns 201 with the created rule.

Delete a rule

DELETE /api/markup-rules/{rule_id}
Returns {"deleted": true}. 404 if the rule does not exist.

Push payload endpoints

These endpoints require the X-Ingest-Secret header — they are intended for n8n workflows, not the admin UI.
Never expose these endpoints to end users or public traffic. They return markup percentages, cost prices, and business pricing rules.

OPS-ready push payload

GET /api/push/{customer_id}/product/{product_id}/payload
Applies the customer’s markup rules to the product and returns an OPS-ready payload for the setProduct mutation. Headers: X-Ingest-Secret: <INGEST_SHARED_SECRET>

OPS variants bundle

GET /api/push/{customer_id}/product/{product_id}/ops-variants
Returns sizes and prices aligned by index for the n8n OPS push loop. Accepts an optional ops_products_id query param (default 0) to set the OPS product ID on each size/price entry. Response:
{
  "sizes": [
    { "products_id": 0, "size_name": "L", "color_name": "Red", "products_sku": "PC61-RED-L" }
  ],
  "prices": [
    { "products_id": 0, "price": 12.99, "vendor_price": 8.50 }
  ]
}

OPS product options

GET /api/push/{customer_id}/product/{product_id}/ops-options
Returns product-scoped options in the shape OPS expects for per-product push. Only returns options where enabled = true. The master_option_id and ops_attribute_id are included as source_* fields for traceback into push mappings. Headers: X-Ingest-Secret: <INGEST_SHARED_SECRET>

Build docs developers (and LLMs) love