Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Available tools

What Optimizely Opal tools are available for Optimizely Commerce Connect.

You can use the following Optimizely Opal tools with Optimizely Commerce Connect.

Campaign tools

campaign_types_list

Lists all available campaign types in the system.

This tool requires no parameters.

Response

{
  "StatusCode": 200,
  "Message": "Found 3 campaign types",
  "Types": [
    {
      "Name": "SalesCampaign",
      "FullName": "EPiServer.Commerce.Marketing.SalesCampaign",
      "AssemblyQualifiedName": "..."
    }
  ]
}

campaign_filter

Search and filter campaigns using various criteria.

PropertyTypeRequiredDescription
IsActivebooleanNoFilter by active status
MarketsstringNoFilter by target market IDs
ValidFromstringNoCampaign start date (ISO 8601)
ValidUntilstringNoCampaign end date (ISO 8601)

Example request

{
  "IsActive": true,
  "Markets": ["US", "EU"],
  "ValidFrom": "2024-01-01T00:00:00Z"
}

campaign_detail

Retrieve detailed information about a specific campaign.

PropertyTypeRequiredDescription
IdentifierstringYesCampaign name or ContentReference ID
IncludeAdditionalDetailsbooleanNoAudit info and promotions list

Example request

{
  "Identifier": "Summer Sale 2024",
  "IncludeAdditionalDetails": true
}

Response

{
  "StatusCode": 200,
  "Message": "Campaign found",
  "Campaign": {
    "Id": "123",
    "Name": "Summer Sale 2024",
    "Description": "Annual summer promotion",
    "ValidFrom": "2024-06-01T00:00:00Z",
    "ValidUntil": "2024-08-31T23:59:59Z",
    "IsActive": true,
    "TargetMarkets": ["US", "EU"],
    "EditLinkUrl": "/episerver/cms/...",
    "Promotions": [
      { "Id": "456", "Name": "20% Off All Items" }
    ]
  }
}

campaign_create

Create a marketing campaign.

PropertyTypeRequiredDescription
NamestringYesCampaign name
DescriptionstringNoCampaign description
ValidFromstringYesStart date (ISO 8601)
ValidUntilstringYesEnd date (must be after ValidFrom)

Example request

{
  "Name": "Black Friday 2024",
  "Description": "Annual Black Friday sale event",
  "ValidFrom": "2024-11-29T00:00:00Z",
  "ValidUntil": "2024-12-02T23:59:59Z"
}
📘

Note

This tool returns a confirmation dialog. The campaign is created after your confirmation.


campaign_update

Update an existing campaign.

PropertyTypeRequiredDescription
IdstringYesCampaign ContentReference ID
NamestringNoNew campaign name
DescriptionstringNoNew campaign description

Example request

{
  "Id": "123",
  "Name": "Black Friday 2024 - Extended",
  "Description": "Extended Black Friday sale"
}

Promotion tools

promotion_types_list

Lists all available promotion types with clickable suggestions.

This tool requires no input parameters.

Response

{
  "Text": "Please select a promotion type:",
  "Suggestions": [
    {
      "Title": "BuyQuantityGetFreeItems",
      "Value": "EPiServer.Commerce.Marketing.Promotions.BuyQuantityGetFreeItems"
    },
    {
      "Title": "BuyQuantityGetItemDiscount",
      "Value": "EPiServer.Commerce.Marketing.Promotions.BuyQuantityGetItemDiscount"
    },
    {
      "Title": "SpendAmountGetOrderDiscount",
      "Value": "EPiServer.Commerce.Marketing.Promotions.SpendAmountGetOrderDiscount"
    }
  ]
}

promotion_filter

Search and filter promotions using various criteria.

PropertyTypeRequiredDescription
NamestringNoPartial name match
IsActivebooleanNoActive status filter
ContentTypestringNoContent type (defaults to "PromotionData")
MarketsstringNoTarget market IDs
ValidFromstringNoStart date filter (ISO 8601)
ValidUntilstringNoEnd date filter (ISO 8601)

Example request

{
  "Name": "discount",
  "IsActive": true,
  "Markets": ["US"]
}

promotion_detail

Get comprehensive details about a specific promotion.

PropertyTypeRequiredDescription
IdentifierstringYesPromotion name or ContentReference ID
IncludeAdditionalDetailsbooleanNoAll properties and audit info

Example request

{
  "Identifier": "20% Off Electronics",
  "IncludeAdditionalDetails": true
}

Response

{
  "StatusCode": 200,
  "Message": "Promotion found",
  "Promotion": {
    "Id": "456",
    "Name": "20% Off Electronics",
    "Description": "20% discount on all electronics",
    "IsActive": true,
    "PromotionType": "BuyQuantityGetItemDiscount",
    "FullTypeName": "EPiServer.Commerce.Marketing.Promotions.BuyQuantityGetItemDiscount",
    "CampaignId": "123",
    "Priority": 10,
    "CouponCode": "ELEC20",
    "DiscountType": "Percentage",
    "ValidFrom": "2024-06-01T00:00:00Z",
    "ValidUntil": "2024-08-31T23:59:59Z",
    "EditLinkUrl": "/episerver/cms/...",
    "Properties": [
      {
        "Name": "Condition_RequiredQuantity",
        "Value": 1,
        "PropertyType": "Int32"
      },
      {
        "Name": "Discount_Percentage",
        "Value": 20.0,
        "PropertyType": "Decimal"
      }
    ]
  }
}

promotion_create

Create a promotion within a campaign.

PropertyTypeRequiredDescription
NamestringYesPromotion name
CampaignstringYesCampaign ID or name
PromotionTypestringYesFull type name (from promotion_types_list)
DescriptionstringNoPromotion description

Example request

{
  "Name": "Buy 2 Get 1 Free",
  "Campaign": "Summer Sale 2024",
  "PromotionType": "EPiServer.Commerce.Marketing.Promotions.BuyQuantityGetFreeItems",
  "Description": "Buy any 2 items, get 1 free"
}
📘

Note

This tool returns a confirmation dialog. The promotion is created after your confirmation.


promotion_update

Update basic promotion properties.

PropertyTypeRequiredDescription
IdstringYesPromotion ContentReference ID
NamestringNoNew promotion name
DescriptionstringNoNew description
IsActivebooleanNoActive status
PriorityintegerNoPriority (lower number = higher priority)

Example request

{
  "Id": "456",
  "Name": "Buy 2 Get 1 Free - Extended",
  "IsActive": true,
  "Priority": 5
}

promotion_dynamic_update

Update promotion properties using property paths. Supports nested properties.

PropertyTypeRequiredDescription
IdstringYesPromotion ContentReference ID
PropertiesobjectNoDictionary of property paths to values

Property path format – Use underscore notation for nested properties.

  • Condition_RequiredQuantity - RequiredQuantity property of Condition.
  • Discount_Percentage - Percentage property of Discount.
  • Reward_AmountOff - AmountOff property of Reward.

Example request (Get editable properties)

{
  "Id": "456"
}

Example request (Update properties)

{
  "Id": "456",
  "Properties": {
    "Condition_RequiredQuantity": 3,
    "Discount_Percentage": 25.0,
    "IsActive": true
  }
}

promotion_clone

Clone an existing promotion to the same or different campaign.

PropertyTypeRequiredDescription
PromotionIdstringYesSource promotion ContentReference ID
CampaignIdstringNoTarget campaign ID (optional, defaults to same campaign)

Example request

{
  "PromotionId": "456",
  "CampaignId": "789"
}
📘

Note

This tool returns a confirmation dialog. The promotion is created after your confirmation.


promotion_properties

Get all available properties for a promotion type, including metadata.

PropertyTypeRequiredDescription
PromotionTypestringYesType name or full type name

Example request

{
  "PromotionType": "BuyQuantityGetItemDiscount"
}

Response

{
  "StatusCode": 200,
  "Message": "Found 15 properties",
  "PromotionType": "BuyQuantityGetItemDiscount",
  "Properties": [
    {
      "Name": "RequiredQuantity",
      "PropertyPath": "Condition_RequiredQuantity",
      "PropertyType": "Int32",
      "DisplayName": "Required Quantity",
      "Description": "Number of items required to trigger promotion",
      "IsRequired": true,
      "MinValue": 1,
      "DefaultValue": 1
    },
    {
      "Name": "Percentage",
      "PropertyPath": "Discount_Percentage",
      "PropertyType": "Decimal",
      "DisplayName": "Discount Percentage",
      "Description": "Percentage discount to apply",
      "IsRequired": true,
      "MinValue": 0,
      "MaxValue": 100
    }
  ]
}

promotion_list_by_sales

List promotions ordered by sales volume (orders placed).

PropertyTypeRequiredDescription
MarketIdstringNoFilter by specific market

Example request

{
  "MarketId": "US"
}

Response

{
  "items": [
    {
      "PromotionName": "20% Off Everything",
      "PromotionGuid": "abc123...",
      "OrderPlaced": 1250,
      "DiscountType": "Percentage",
      "CouponCode": "SAVE20"
    }
  ]
}

get_validator_properties

Get properties that have validation requirements for a specific type.

PropertyTypeRequiredDescription
PromotionTypestringYesCampaign or promotion type name

Example request

{
  "PromotionType": "BuyQuantityGetFreeItems"
}

Response

{
  "StatusCode": 200,
  "Message": "Found 3 properties with validators",
  "Properties": [
    "Condition_RequiredQuantity",
    "Reward_NumberOfFreeItems",
    "Discount_Items"
  ]
}

Catalog tools

catalog_query

Query catalog content using various filters.

PropertyTypeRequiredDescription
ContentTypestringNoCatalogContent, NodeContent, ProductContent, or VariationContent
NamestringNoPartial name match
CodestringNoPartial code match
ParentIdstringNoParent content ID
IsAvailablebooleanNoAvailability filter
LimitintegerNoResults limit (The default is 50)

Example request

{
  "ContentType": "ProductContent",
  "Name": "shirt",
  "IsAvailable": true,
  "Limit": 20
}

The response includes the following:

  • Name, ContentType, ContentLink, ParentLink
  • Type-specific fields (catalog, node, product, variation)
  • PricePerMarket data for variations
  • Created, Changed, Language info

Graph tools

com_graph_schema

Retrieve the full GraphQL schema from Optimizely Graph service.

This tool requires no input parameters.

Response – Full GraphQL introspection schema (cached for 4 hours).

Query operators

  • where – Filter results
  • match – Text search
  • eq – Exact match
  • like – Pattern match (use % wildcards)
  • gte, lte – Range comparisons
  • in – List membership
  • _fulltext – Full-text search across all fields
  • facets – Aggregated results
  • total(all:true) – Get total count

com_graph_query_executor

Execute custom GraphQL queries against Commerce Graph.

PropertyTypeRequiredDescription
GraphQLQuerystringYesThe GraphQL query to execute

Example request

{
  "GraphQLQuery": "query { ProductContent(where: { IsAvailable: { eq: true } }, limit: 10) { items { Name Code } } }"
}

Market tools

commerce_list_market

List all available markets with their configuration.

PropertyTypeRequiredDescription
IsEnabledOnlybooleanNoShow only enabled markets
CurrencystringNoFilter by currency code (USD, EUR, SEK, etc.)
LanguagestringNoFilter by language code
MarketIdstringNoFilter by specific market ID

Example request

{
  "IsEnabledOnly": true,
  "Currency": "USD"
}

Response

{
  "StatusCode": 200,
  "Message": "Found 3 markets",
  "Markets": [
    {
      "MarketId": "US",
      "MarketName": "United States",
      "MarketDescription": "US Market",
      "DefaultCurrency": "USD",
      "DefaultLanguage": "en",
      "IsEnabled": true,
      "Countries": ["US"],
      "Languages": ["en", "es"]
    }
  ]
}