HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

Example models

public class MarketModel
{
    public string MarketId { get; set; }

    public bool IsEnabled { get; set; }

    public string MarketName { get; set; }

    public string MarketDescription { get; set; }

    public string DefaultLanguage { get; set; }

    public string DefaultCurrency { get; set; }
    
    public IEnumerable<string> Languages { get; set; } = Enumerable.Empty<string>();

    public IEnumerable<string> Currencies { get; set; } = Enumerable.Empty<string>();

    public IEnumerable<string> Countries { get; set; } = Enumerable.Empty<string>();

    public bool PricesIncludeTax { get; set; }
}

Get all markets

GETepiserverapi/commerce/marketsGet all markets

Response

[
  {
    "MarketId": "DEFAULT",
    "IsEnabled": true,
    "MarketName": "Default Market",
    "MarketDescription": "Default Market",
    "DefaultLanguage": "en",
    "DefaultCurrency": "USD",
    "Languages": [
      "en"
    ],
    "Currencies": [
      "USD"
    ],
    "Countries": [
      "USA"
    ],
    "PricesIncludeTax": false
  },
  {
    "MarketId": "EU",
    "IsEnabled": false,
    "MarketName": "European Union",
    "MarketDescription": "",
    "DefaultLanguage": "en",
    "DefaultCurrency": "EUR",
    "Languages": [
      "en"
    ],
    "Currencies": [
      "EUR"
    ],
    "Countries": [],
    "PricesIncludeTax": false
  },
  {
    "MarketId": "InteTest",
    "IsEnabled": true,
    "MarketName": "Test Market",
    "MarketDescription": "",
    "DefaultLanguage": "en",
    "DefaultCurrency": "USD",
    "Languages": [
      "en"
    ],
    "Currencies": [
      "USD"
    ],
    "Countries": [],
    "PricesIncludeTax": false
  },
  {
    "MarketId": "US",
    "IsEnabled": false,
    "MarketName": "United States",
    "MarketDescription": "",
    "DefaultLanguage": "en",
    "DefaultCurrency": "USD",
    "Languages": [
      "en"
    ],
    "Currencies": [
      "USD"
    ],
    "Countries": [],
    "PricesIncludeTax": false
  }
]

Get a specific market

GETepiserverapi/commerce/markets/{marketId}Get a specific market

Response

{
    "MarketId": "US",
    "IsEnabled": false,
    "MarketName": "United States",
    "MarketDescription": "",
    "DefaultLanguage": "en",
    "DefaultCurrency": "USD",
    "Languages": [
      "en"
    ],
    "Currencies": [
      "USD"
    ],
    "Countries": [],
    "PricesIncludeTax": false
}

Create market

POSTepiserverapi/commerce/marketsCreate market

Body

{
    "MarketId": "US",
    "IsEnabled": false,
    "MarketName": "United States",
    "MarketDescription": "",
    "DefaultLanguage": "en",
    "DefaultCurrency": "USD",
    "Languages": [
      "en"
    ],
    "Currencies": [
      "USD"
    ],
    "Countries": [],
    "PricesIncludeTax": false
}

Response

{
    "MarketId": "US",
    "IsEnabled": false,
    "MarketName": "United States",
    "MarketDescription": "",
    "DefaultLanguage": "en",
    "DefaultCurrency": "USD",
    "Languages": [
      "en"
    ],
    "Currencies": [
      "USD"
    ],
    "Countries": [],
    "PricesIncludeTax": false
}

Update market

PUTepiserverapi/commerce/markets/{marketId}Update market

Body

{
    "MarketId": "US",
    "IsEnabled": false,
    "MarketName": "United States",
    "MarketDescription": "",
    "DefaultLanguage": "en",
    "DefaultCurrency": "USD",
    "Languages": [
      "en"
    ],
    "Currencies": [
      "USD"
    ],
    "Countries": [],
    "PricesIncludeTax": false
}

Response

200 No Content

Delete market

DELETEepiserverapi/commerce/markets/{marketId}Delete market

Response

{
    "MarketId": "US",
    "IsEnabled": false,
    "MarketName": "United States",
    "MarketDescription": "",
    "DefaultLanguage": "en",
    "DefaultCurrency": "USD",
    "Languages": [
      "en"
    ],
    "Currencies": [
      "USD"
    ],
    "Countries": [],
    "PricesIncludeTax": false
}