Skip to content

Connector (API Access)

The Connector gives you programmatic access to Dynasort through a REST-style API. You can use it to connect AI assistants like Claude or ChatGPT, build custom integrations, or automate merchandising workflows — all without touching the Dynasort dashboard.

Open Connector from the left sidebar in the Dynasort app.

Connector page showing API Key management and System Prompt sections

The page has three sections: API Key management, a System Prompt for AI assistants, and an API Reference card.

Click Generate API Key to create a new key. The full key is displayed exactly once — copy it immediately and store it somewhere safe. Dynasort only stores a hash of the key, so it cannot be retrieved later.

Your key starts with dyn_sk_ followed by a long hex string. Only one active key is allowed at a time. If you need a new one, revoke the current key first, then generate a fresh one.

The fastest way to use the Connector is to paste the System Prompt into an AI assistant. The prompt contains your store URL, the API endpoint, authentication instructions, and a complete reference for every available action — everything the assistant needs to manage your Dynasort setup through conversation.

To set up an AI assistant:

  1. Click Copy Prompt on the Connector page.
  2. Open your AI assistant (Claude, ChatGPT, or similar).
  3. Paste the prompt as a system message or at the start of a new conversation.
  4. When the assistant asks for your API key, provide the dyn_sk_... key you generated earlier.

From there, you can ask the assistant to do things like “list my collections,” “enable sorting on the Summer Sale collection,” or “boost product X by 50 points” — and it will make the API calls for you.

If you’re building a custom integration, you can call the API directly.

Endpoint: https://dynasort.immersiveecommerce.com/api/v1/

All requests are POST with a JSON body. Authenticate with a Bearer token:

Terminal window
curl -X POST https://dynasort.immersiveecommerce.com/api/v1/ \
-H "Authorization: Bearer dyn_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{"action": "list_collections"}'

The API allows 60 requests per minute per store. Every response includes rate limit headers:

HeaderDescription
X-RateLimit-LimitMaximum requests per minute (60)
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the window resets

If you exceed the limit, the API returns HTTP 429 with a Retry-After header.

Success:

{
"success": true,
"data": { ... }
}

Error:

{
"error": true,
"message": "Human-readable description",
"code": "error_code"
}
Error codeMeaning
unauthorizedInvalid or missing API key
rate_limitedToo many requests — retry after the reset time
permission_deniedStore plan does not include API access
invalid_actionUnknown action name
invalid_paramsMissing or invalid required parameters
not_foundRequested resource not found
server_errorInternal error

API Reference card showing all 16 available actions

The API exposes 16 actions organized into three categories.

ActionDescription
list_collectionsList all collections with their sorting status, recipe assignment, and product count
get_collectionGet detailed info about a single collection including its products
enable_collectionEnable Dynasort sorting on a collection
disable_collectionDisable sorting on a collection (reverts to configured sort order if set)
update_collectionAssign a recipe and/or set the revert sort order for a collection
bulk_toggle_collectionsEnable or disable multiple collections at once
bulk_assign_recipeAssign a recipe to multiple collections at once
sort_collectionTrigger an immediate sort using the assigned recipe
revert_collectionRevert a collection to its configured revert sort order
ActionDescription
list_recipesList all sorting recipes configured for your store
ActionDescription
list_productsList products with their Dynasort data, boost values, and option sorting status
get_productGet detailed info about a single product including its options
set_product_boostSet a boost value on a product (positive = boost up, negative = push down)
enable_productEnable option sorting on a product and configure sort rules for each option
disable_productDisable option sorting on a product
sort_productTrigger an immediate re-sort of a product’s options

Every action is sent as a JSON body with an "action" field. Below are the parameters for each.

{ "action": "list_collections" }

No required parameters. Returns an array of collections with ID, title, enabled status, current recipe, product count, and last sort time.

{ "action": "get_collection", "collection_id": 123456789 }
ParameterRequiredDescription
collection_idYesShopify collection ID
{ "action": "enable_collection", "collection_id": 123456789 }
ParameterRequiredDescription
collection_idYesShopify collection ID
{
"action": "update_collection",
"collection_id": 123456789,
"metrics_id": 1,
"revert_sorting": "best-selling"
}
ParameterRequiredDescription
collection_idYesShopify collection ID
metrics_idYesRecipe ID to assign (use list_recipes to find IDs)
revert_sortingNoSort order to revert to when disabled. Options: manual, best-selling, alpha-asc, alpha-desc, price-asc, price-desc, created-desc, created-asc
{
"action": "bulk_toggle_collections",
"collection_ids": [123456789, 987654321],
"status": 1
}
ParameterRequiredDescription
collection_idsYesArray of Shopify collection IDs
statusYes1 to enable, 0 to disable
{
"action": "bulk_assign_recipe",
"collection_ids": [123456789, 987654321],
"metrics_id": 1,
"revert_sorting": "best-selling"
}
ParameterRequiredDescription
collection_idsYesArray of Shopify collection IDs
metrics_idYesRecipe ID to assign
revert_sortingNoRevert sort order
{ "action": "sort_collection", "collection_id": 123456789 }

Triggers an immediate sort. The collection must be enabled with a recipe assigned.

{ "action": "revert_collection", "collection_id": 123456789 }

Reverts the collection to its configured revert sort order.

{ "action": "list_recipes" }

Returns all recipes with their ID, name, attribute weights, and the number of collections using them.

{ "action": "list_products" }

Returns products with boost values, enabled status, options, and current sort settings.

{ "action": "get_product", "product_id": 123456789 }

Returns detailed info about a single product including all its options and their sorting configuration.

{
"action": "set_product_boost",
"product_id": 123456789,
"boost": 50
}
ParameterRequiredDescription
product_idYesShopify product ID
boostYesInteger added to the product’s ranking score. Positive = boost up, negative = push down, 0 = no boost

Enables option sorting on a product. Option sorting reorders the variant options (like Color or Size) within a single product based on performance data.

{
"action": "enable_product",
"product_id": 123456789,
"options": [
{
"option_id": 111,
"option_name": "Color",
"sort_type": "sales",
"sold_out": "bottom",
"direction": "desc",
"days": "30"
}
]
}
ParameterRequiredDescription
product_idYesShopify product ID
optionsNoArray of option sorting configurations (see below)

Option configuration fields:

FieldRequiredDescription
option_idYesThe option ID from the product (use get_product to find these)
option_nameYesThe option name (e.g. “Color”, “Size”)
sort_typeYesSort method — see table below
sold_outNoWhere to place sold-out variants: bottom (default), top, or ignore
directionNoSort direction: desc (default) or asc
daysNoTime window for sales/revenue sorts: 7, 30 (default), 60, 90, 365, or all
csv_patternNoCustom order for comma_separated sort type (e.g. "Red,Blue,Green")
common_sizeNoSize system for common_sizes sort type (e.g. "us_apparel", "us_shoes")

Available sort types:

Sort typeWhat it sorts by
offNo sorting for this option
alphabeticalAlphabetical order
salesUnits sold (within the time window)
revenuesRevenue generated
pricesVariant price
compare_at_pricesCompare-at price
costsCost per item
inventoriesAvailable inventory
marginsProfit margin
discount_amountsDiscount amount
discount_percentagesDiscount percentage
numericNumeric value in the option name
variant_agesHow recently the variant was added
variants_in_stockIn-stock status
comma_separatedCustom order defined by csv_pattern
common_sizesStandard size ordering (S, M, L, XL, etc.)
{ "action": "disable_product", "product_id": 123456789 }

Disables option sorting on the product.

{ "action": "sort_product", "product_id": 123456789 }

Triggers an immediate re-sort of the product’s options using its saved configuration. The product must be enabled with option sorting configured.

  • One active key at a time. If you need to rotate your key, revoke the current one first, then generate a new one.
  • Revoking a key is immediate. Any requests using the old key will fail with a 401 unauthorized error as soon as the key is revoked.
  • Keys don’t expire. An active key stays valid until you revoke it manually.
  • Key history is preserved. Revoked keys remain visible in the Connector page with a “Revoked” badge so you have an audit trail.