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. It covers collection sorting, option sorting, search re-ranking, product recommendations, and post-purchase offers.

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 available actions

The API exposes 25 actions organized into six 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 the recipes of one type: collection (default), recommendation, or search
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
ActionDescription
get_search_servingGet search serving status: recipes, the active recipe, storefront connection, display settings
set_search_recipeSet the active search recipe (0 turns search re-ranking off)
update_search_settingsUpdate the search results display settings (partial update)
connect_search_storefrontProvision the Storefront API token search serving needs
ActionDescription
list_placementsList all recommendation placements with their bound recipe, enabled flag, and settings
update_placementUpdate one placement’s recipe, enabled flag, label, or settings (partial update)
ActionDescription
get_serving_statusOne-call overview: search, placements, post-purchase, and quota state
get_serve_statsDaily serves, clicks, adds, and checkouts for one search or recommendation recipe
get_serve_usageMonthly serve usage against your plan quota

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", "recipe_type": "collection" }
ParameterRequiredDescription
recipe_typeNocollection (default), recommendation, or search

Returns the recipes of that type with their ID, name, attribute weights, and usage. Collection recipes report the number of collections using them; search recipes include is_active marking the one currently re-ranking search results.

{ "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.

{ "action": "get_search_serving" }

Returns your search recipes, the active recipe ID, whether the storefront is connected, and the current display settings.

Search re-ranking needs three things to serve: an active search recipe, a storefront connection, and the Dynasort search blocks added to your theme in the theme editor. The API manages the first two; the theme step happens in the Shopify admin. See the search re-ranking guide for the theme setup.

{ "action": "set_search_recipe", "metrics_id": 42 }
ParameterRequiredDescription
metrics_idYesA search recipe ID from list_recipes with recipe_type "search". Use 0 to turn search re-ranking off

Search uses exactly one active recipe; setting a new one deactivates the previous one. IDs that are not search recipes are rejected without changing anything.

{
"action": "update_search_settings",
"settings": {
"layout": { "columns": { "mobile": 2, "tablet": 3, "desktop": 4 }, "per_page": 24 },
"fields": { "swatches": true, "badges": true, "rating": true, "inline_add": true }
}
}

This is a partial update: only the keys you send change, everything else keeps its current value. Limits: columns mobile 1 to 3, tablet 2 to 4, desktop 2 to 6; per_page 8 to 48.

{ "action": "connect_search_storefront" }

Provisions (or reuses) the Storefront API access token that search serving uses to read which products match a query. Idempotent; safe to call again.

{ "action": "list_placements" }

Returns every recommendation placement with its bound recipe, enabled flag, label, and full presentation settings. Placement keys: product-page, cart, collection, home, post-purchase, and custom-1 through custom-5.

{
"action": "update_placement",
"placement_key": "product-page",
"recipe_id": 42,
"enabled": 1,
"settings": {
"layout": { "columns": { "desktop": 4 } },
"fields": { "badges": { "sale": true } }
}
}
ParameterRequiredDescription
placement_keyYesOne of the keys from list_placements
recipe_idNoA recommendation recipe ID from list_recipes with recipe_type "recommendation". Use 0 to unbind
enabledNo1 or 0
labelNoDisplay label, mainly for custom placements
settingsNoPartial presentation settings object, merged over the placement’s current settings. See list_placements output for the full schema

A newly bound recipe starts serving within a few minutes. For the post-purchase placement only a subset of settings applies: layout.columns.desktop (products shown), layout.min_to_render, and the sale badge toggle; checkout styles the cards itself.

{ "action": "get_serving_status" }

A cheap one-call overview: the active search recipe and storefront connection, how many recommendation placements are enabled, whether post-purchase is bound, and a quota_over notice when the monthly serve quota is exhausted.

{ "action": "get_serve_stats", "recipe_id": 42, "days": 30 }
ParameterRequiredDescription
recipe_idYesA search or recommendation recipe ID
daysNoReporting window, default 30. Clamped to your plan’s analytics depth; the response reports both window_days and plan_days

Returns per-day serves, clicks, inline adds, attributed cart adds, and checkouts, plus window totals. Today’s numbers are live; past days come from the nightly rollup.

{ "action": "get_serve_usage" }

Returns used, quota (with unlimited: true when your plan has no cap), the current month, and resets_on.

  • 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.