NFusion Tenants
A tenant in the middleware represents one nFusion Solutions account and its associated configuration for fetching precious-metals pricing data.
Managing Tenants
Tenants are managed in the Filament admin panel under nFusion → Tenants.
Tenant Fields
| Field | Type | Description |
|---|---|---|
name | string | Human-readable label (e.g., "Retail", "Dealers") |
alias | string | nFusion subdomain — builds the base URL {alias}.nfusioncatalog.com |
api_token_catalog | string | Name of the .env variable containing the nFusion Catalog API token (used for product price syncs) |
api_token | string (nullable) | Name of the .env variable containing the nFusion General API token (used for spot prices and other general API calls) |
sales_channel | string | nFusion sales channel identifier (configured in the nFusion portal) |
currency | string | ISO currency code, e.g. USD |
tier_pricing_source | enum | retail_tiers or wholesale_tiers — which price tiers to include in the API request |
supports_markup_sale_prices | boolean | When true, sale-price overlays from the local products table are applied |
healthcheck_url | string (nullable) | URL to ping (GET) after each successful sync |
last_synced_at | timestamp (nullable) | Updated after every successful sync run |
status | enum | active or inactive — inactive tenants are skipped by the scheduler |
API Tokens
nFusion uses two separate API tokens for different parts of their platform:
| Token field | Env variable convention | Used for |
|---|---|---|
api_token_catalog | NFUSION_API_KEY_RETAIL | Product price sync via {alias}.nfusioncatalog.com |
api_token | NFUSION_MARKET_API_KEY_RETAIL | General / Spot API via api.nfusionsolutions.biz |
Neither column stores the raw token value. Each stores the name of the .env variable that holds the actual token. At runtime, NFusionService resolves the real value via env():
// Catalog API (getPrices)
$this->catalogToken = env($this->catalogToken);
// General/Spot API (getMetalSpotPrices)
$this->apiToken = env($this->apiToken);
This ensures tokens are never exposed in the database and can be rotated by updating .env without any database changes.
Both API tokens are required for the WooCommerce Sync logic to work. If you are seeing sync failures, confirm both API keys exist.
nFusion API Endpoints
Catalog API (Product Prices)
The base URL is constructed from the tenant alias:
https://{alias}.nfusioncatalog.com/service/
The pricing endpoint called during each sync:
GET /service/Price/PricesByChannel
?currency={currency}
&channel={salesChannel}
&withCost=true
&withRetailTiers={true|false}
&withWholesaleTiers={true|false}
&token={api_token_catalog}
General API (Spot Prices)
Metal spot prices are fetched from the nFusion general API:
GET https://api.nfusionsolutions.biz/api/v1/Metals/spot/summary
?metals=gold,silver,platinum
&token={api_token}
The response is an array of objects, one per requested metal. The middleware normalises this into a keyed snapshot stored in the sync log and written to wp_options on WooCommerce targets:
{
"gold": { "ask": 4550.93, "bid": 4548.93 },
"silver": { "ask": 72.054, "bid": 71.204 },
"platinum": { "ask": 1893.20, "bid": 1883.20 }
}
Triggering a Manual Sync
From the Filament admin:
- Navigate to nFusion → Tenants.
- Click the Sync Prices action button next to the desired tenant.
This dispatches NFusionSyncTenantPricesJob immediately on the nfusion queue.
Healthcheck Integration
If a healthcheck_url is configured (e.g., a Healthchecks.io ping URL), the PriceSyncService issues a GET request to that URL after every successful sync. This allows external monitoring tools to alert when syncs stop running on schedule.