Websites
Describes the Websites API handler in Optimizely Configured Commerce.
HTTP Verb – GET
URL – /api/v1/websites/current/countries
Description – Returns country collection
Base – HandlerBase<GetCountryCollectionParameter, GetCountryCollectionResult>
Handlers –
Order | Handler | Description |
---|---|---|
500 | GetCountryQuery | Creates the initial country query that returns all countries. The query is stored in the CountryQuery property on the result object. |
600 | ApplyFiltering | Applies filtering to theCountryQuery property on the result object. The query will be filtered to return active countries assigned to the current website. If theCountryId property on the parameter object has a value, the query will be filtered to return only countries with that id. |
700 | ApplySort | Applies sorting to theCountryQuery property on the result object. If theSort property on the parameter object has a value, the query will be sorted with that value. If theSort property on the parameter object DOES NOT have a value, the query will be sorted by theCountry.Name property. |
800 | ExecuteQuery | Executes theCountryQuery after the query has been filtered and sorted. The result is stored in theCountryCollection property on the result object. |
900 | CreateGetCountryResults | TheCountryCollection property on the result object is transformed into a collection ofGetCountryResult objects. The result is stored in theGetCountryResults property on the result object. |
1000 | GetStates | If theGetStates property on the parameter object is true, the states will be retrieved for every country in theGetCountryResults property on the result object. The states are retrieved using theGetStateCollectionHandler handler chain. The results are stored in each of theGetCountryResults.GetStatesCollectionResult properties. |
HTTP Verb – GET
URL – /api/v1/websites/current/countries/{countryid}
Description – Returns a single country
Base – HandlerBase<GetCountryParameter, GetCountryResult>
Handlers –
Order | Handler | Description |
---|---|---|
500 | GetCountry | Retrieves a country using theGetCountryCollectionHandler handler chain. TheCountryId property on the parameter object is used to find the country. If a country is not found or more than one country is found, an error is returned. |
HTTP Verb – GET
URL – /api/v1/websites/current/currencies
Description – Returns currency collection
Base – HandlerBase<GetCurrencyCollectionParameter, GetCurrencyCollectionResult>
Handlers –
Order | Handler | Description |
---|---|---|
500 | GetCurrencyCollection | Retrieves currencies for the current website using the currency repository. If the current user is not a content reviewer, the query returns only currencies that are live.The query is filtered to return only currencies that have at least one currency rate with an effective date prior to the current date and time.If the CurrencyId property on the parameter object has a value, the query will be filtered to return only currencies with that id.The query is sorted by the WebsiteCurrency.IsDefault property then by the Currency.Description property. |
HTTP Verb – GET
URL – /api/v1/websites/current/currencies/{currencyid}
Description – Returns a single currency
Base – HandlerBase<GetCurrencyParameter, GetCurrencyResult>
Handlers –
Order | Handler | Description |
---|---|---|
500 | GetCurrency | Retrieves a currency using theGetCurrencyCollectionHandler handler chain. TheCurrencyId property on the parameter object is used to find the currency. If a currency is not found or more than one currency is found, an error is returned. |
HTTP Verb – GET
URL – /api/v1/websites/current/languages
Description – Returns language collection
Base – HandlerBase<GetLanguageCollectionParameter, GetLanguageCollectionResult>
Handlers –
Order | Handler | Description |
---|---|---|
500 | GetLanguageCollection | Retrieves languages for the current website using the language repository.
|
HTTP Verb – GET
URL – /api/v1/websites/current/languages/{languageid}
Description – Returns a single language
Base – HandlerBase<GetLanguageParameter, GetLanguageResult>
Handlers –
Order | Handler | Description |
---|---|---|
500 | GetLanguage | Retrieves a language using the GetLanguageCollectionHandler handler chain. The LanguageId property on the parameter object is used to find the language. If a language is not found or more than one language is found, an error is returned. |
HTTP Verb – GET
URL – /api/v1/websites/current/states
Description – Returns state collection
Base – HandlerBase<GetStateCollectionParameter, GetStateCollectionResult>
Handlers –
Order | Handler | Description |
---|---|---|
900 | CreateGetStateResults | TheStateCollection property on the result object is transformed into a collection ofGetStateResult objects. The result is stored in theGetStateResults property on the result object. |
800 | ExecuteQuery | Executes theStateQuery after the query has been filtered and sorted. The result is stored in theStateCollection property on the result object. |
700 | ApplySort | Applies sorting to theStateQuery property on the result object. If theSort property on the parameter object has a value, the query will be sorted with that value. If theSort property on the parameter object DOES NOT have a value, the query will be sorted by theState.Name property. |
600 | ApplyFiltering | Applies filtering to theStateQuery property on the result object. The query will be filtered to return only active states assigned to the current website. If theStateId property on the parameter object has a value, the query will be filtered to return only states with that id. If theCountryId property on the parameter object has a value, the query will be filtered to return only states that have a country with that id. |
500 | GetStateQuery | Creates the initial state query that returns all states. The query is stored in theStateQuery property on the result object. |
HTTP Verb – GET
URL – /api/v1/websites/current/states/{stateid}
Description – Returns a single state
Base – HandlerBase<GetStateParameter, GetStateResult>
Handlers –
Order | Handler | Description |
---|---|---|
500 | GetState | Retrieves a state using the GetStateCollectionHandler handler chain. The StateId property on the parameter object is used to find the state. If a state is not found or more than one state is found, an error is returned. |
HTTP Verb – GET
URL – /api/v1/websites
Description – Returns the current website
Base – HandlerBase<GetWebsiteParameter, GetWebsiteResult>
Handlers –
Order | Handler | Description |
---|---|---|
500 | GetWebsite | Retrieves the current website and stores the result to theWebsite property on the result object. |
600 | GetCountries | If theGetCountries property on the parameter object is true, the countries for the website will be retrieved. The countries are retrieved using theGetCountryCollectionHandler handler chain and the result is stored in theGetCountryCollectionResult property on the result object. |
700 | GetStates | If the GetStates property on the parameter object is true, the states for the website will be retrieved. The states are retrieved using the GetStateCollectionHandler handler chain and the result is stored in the GetStateCollectionResult property on the result object. |
800 | GetLanguages | If theGetLanguages property on the parameter object is true, the languages for the website will be retrieved. The languages are retrieved using theGetLanguageCollectionHandler handler chain and the result is stored in theGetLanguageCollectionResult property on the result object. |
900 | GetCurrencies | If theGetCurrencies property on the parameter object is true, the currencies for the website will be retrieved. The currencies are retrieved using theGetCurrencyCollectionHandler handler chain and the result is stored in theGetCurrencyCollectionResult property on the result object. |
1000 | CopyCustomPropertiesToResult | Copies custom properties configured for the website entity to the website object stored in the Website property on the result object. |
[4.4][4.5]HTTP Verb – GET
URL – /api/v1/websites/current/states
Description – Gets the States for the specified Website identifier.
Base – HandlerBase<GetStatesParameter, GetStatesResult>
Handlers –
Order | Handler | Description |
---|---|---|
500 | GetStateQuery | Creates the initial state query that returns all states. The query is stored in theStateQuery property on the result object. |
600 | ApplyFiltering | Applies filtering to theStateQuery property on the result object. The query will be filtered to return only active states assigned to the current website. If theStateId property on the parameter object has a value, the query will be filtered to return only states with that id. If theCountryId property on the parameter object has a value, the query will be filtered to return only states that have a country with that id. |
700 | ApplySort | Applies sorting to theStateQuery property on the result object. If theSort property on the parameter object has a value, the query will be sorted with that value. If theSort property on the parameter object DOES NOT have a value, the query will be sorted by theState.Name property. |
800 | ExecuteQuery | Executes theStateQuery after the query has been filtered and sorted. The result is stored in theStateCollection property on the result object. |
900 | CreateGetStateResults | TheStateCollection property on the result object is transformed into a collection ofGetStateResult objects. The result is stored in theGetStateResults property on the result object. |
[4.4][4.5]HTTP Verb – GET
URL – /api/v1/websites/current/addressfields
Description – Returns the fields for the address page and whether they are visible.
Base – HandlerBase<GetAddressFieldsParameter, GetAddressFieldsResult>
Order | Handler | Description |
---|---|---|
500 | GetBillToAddressFields | Retrieves the bill-to address fields for the current website. The values are stored in the BillToAddressField property on the result object. |
600 | GetShipToAddressFields | Retrieves the ship-to address fields for the current website. The values are stored in the ShipToAddressFields property on the result object. |
HTTP Verb – GET
URL – /api/v1/websites/current/crosssells
Description – Return a collection of global website cross sell products
Base – HandlerBase<GetCrossSellCollectionParameter, GetCrossSellCollectionResult>
Handlers –
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Uses the GetProductSettingsHandler handler chain to retrieve product search settings and stores them in the GetProductSettingsResult property on the result object. If the CanSeeProducts property on the settings object equals "false", an error is returned (the current user cannot search for or see products). |
600 | GetWebsiteCrossSellQuery | Creates the initial cross sells query that returns active cross sells for the current website. If the WebCrossSell property on the parameter object equals "false", this handler is skipped. The cross sells query is stored in the CrossSellQuery property on the result object. |
700 | GetProductCrossSellQuery | Creates the initial cross sells query that returns active cross sells for a specific product. If the WebCrossSell property on the parameter object equals "true", this handler is skipped. If a product cannot be found using the ProductId property on the parameter object, an error is returned. The cross sells query is stored in the CrossSellQuery property on the result object. |
800 | CreateCrossSellProductDtos | Executes the CrossSellQuery. The result is stored in the CrossSells property on the result object. Also, uses the CreateProductDtos catalog pipeline to transform the cross sells into a collection of ProductDtos. The transformed products are stored in the CrossSellProductDtos property on the result object. |
Updated over 1 year ago