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.

Creating a supplier in API-HUB is a database operation — you configure a row with an adapter_class, protocol, and encrypted credentials, and the adapter framework handles all communication with that vendor. No code changes are required to add a new supplier. The create endpoint is idempotent on slug: if a supplier with the given slug already exists, it updates the existing record’s credentials and marks it is_active = true instead of returning an error. This supports the “re-activate” flow in the admin UI.

Create a supplier

curl -X POST https://your-hub.example.com/api/suppliers \
  -H "Content-Type: application/json" \
  -d '{
    "name": "SanMar",
    "slug": "sanmar",
    "protocol": "promostandards",
    "promostandards_code": "SANMAR",
    "adapter_class": "SanMarAdapter",
    "auth_config": {
      "id": "your-sanmar-id",
      "password": "your-sanmar-password"
    },
    "is_active": true
  }'
Request body
name
string
required
Human-readable supplier name shown in the admin UI and sync job records.
slug
string
required
URL-safe, lowercase, hyphen-separated identifier. Must be unique across all suppliers. Used as an alternative lookup key throughout the API (e.g., /api/suppliers/sanmar).
protocol
string
required
Transport protocol. One of:
  • promostandards — SOAP via PromoStandards Directory endpoint resolution
  • soap — Direct SOAP (non-PS-directory)
  • rest — Plain REST
  • hmac — REST with HMAC signing (e.g., 4Over)
  • ops_graphql — OnPrintShop GraphQL inbound
promostandards_code
string
PromoStandards directory company code. Required when protocol is promostandards. Used to resolve WSDL endpoints from the PS Directory.
base_url
string
Override base URL. Required for REST/HMAC suppliers that do not use the PS directory.
adapter_class
string
Python adapter class registered in the adapter registry. Must be set before triggering an import job. Valid values:
ValueSupplier type
PromoStandardsAdapterGeneric PromoStandards SOAP
SanMarAdapterSanMar (PromoStandards subclass with SanMar-specific SOAP quirks)
FourOverAdapter4Over REST + HMAC
OPSAdapterOnPrintShop GraphQL inbound
SSAdapterS&S Activewear REST
AlphabroderAdapterAlphabroder PromoStandards
auth_config
object
Credential map. Encrypted at rest via Fernet (AES-128) before being written to the database. The exact keys depend on the adapter:
  • PromoStandards/SanMar: { "id": "...", "password": "..." }
  • 4Over HMAC: { "api_key": "...", "api_secret": "..." }
  • REST: { "id": "...", "password": "..." }
is_active
boolean
default:"false"
Whether the supplier is enabled for sync operations.
protocol_config
object
Protocol-specific JSONB configuration. Shape is adapter-defined. Not required for most suppliers.
Response — 201 Created Returns the full SupplierRead object with product_count: 0.
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "SanMar",
  "slug": "sanmar",
  "protocol": "promostandards",
  "promostandards_code": "SANMAR",
  "base_url": null,
  "adapter_class": "SanMarAdapter",
  "auth_config": {
    "id": "your-sanmar-id",
    "password": "your-sanmar-password"
  },
  "field_mappings": null,
  "is_active": true,
  "created_at": "2026-04-14T18:00:00Z",
  "product_count": 0
}
Idempotent update on duplicate slug If a supplier with the same slug already exists, the endpoint updates all fields on the existing record (including credentials) and sets is_active = true. The response is 201 either way. No error is returned. Error responses
StatusDetail
409 ConflictUnique constraint race condition — slug already exists despite the idempotent check
422 Unprocessable EntityMissing required fields or invalid protocol value

Test a connection

Validate supplier credentials before saving them. For PromoStandards suppliers, this checks the PS Directory for the given company code. For REST suppliers, it validates that auth_config contains the expected credential keys.
Call this endpoint from your onboarding flow before POST /api/suppliers to give users early feedback on misconfigured credentials.
curl -X POST https://your-hub.example.com/api/suppliers/test \
  -H "Content-Type: application/json" \
  -d '{
    "protocol": "promostandards",
    "promostandards_code": "SANMAR"
  }'
Request body
protocol
string
required
Protocol type. Determines which validation path to run.
promostandards_code
string
Required when protocol is promostandards. Checked against the live PS Directory.
auth_config
object
Required when protocol is rest or hmac. Must contain non-empty id and password keys.
Response — 200 OK
ok
boolean
true if the connection test passed.
message
string
Success message. Present when ok is true.
error
string
Error description. Present when ok is false.
{
  "ok": true,
  "message": "Supplier SANMAR found in PromoStandards directory"
}
The test endpoint returns 200 OK even when the test fails — check the ok field in the body rather than the HTTP status code.

Build docs developers (and LLMs) love