Settings in ECommerce API

Several settings control different behaviors in the ECommerce API.

If you go to Feature Data and pick “ECommerce Settings”-feature your right-hand side will show you the current settings. They could like something like shown in Figure 1.

Figure 1: Some of the settings available in the ECommerce API

From top to bottom, the settings are all described in the following sub-sections.

If you wonder why all Channels are set to “*”, please check chapter on Channels.

FileServiceUrl-setting

In case you use OutputKind Attachment in some mapping, this Url will be used to retrieve the byte-representation of the attachments (or passed to the caller, dependent on the OutputKind-parameter). This setting should therefor point to a correctly configured Perfion File Service. Note: This is even used when images are output as attachments.

The Url-passed will point to the correct Id of the File/Image in play.

The Urls generated will all be on the form:

http://api.local/perfion/file.aspx?id=<SomeGuid>

using the settings shown in Figure 1.

Default value is blank, meaning that no attachments will be output from EC.

ImageHeight and ImageWidth

Here you specify the wanted Height and Width of all images passed to the recipient. These should generally be set to the highest resolution needed for the receiving system. Most ECommerce-system will create smaller variants when needed.

Default is 1024 pixels for both settings. Note: If ImageServiceUrlParameters-setting is set both ImageHeight and ImageWidth are ignored, and you will have to specify the “size”-parameter.

ImageServiceUrl-setting

In case you use OutputKind Image this Url will be used to retrieve the byte-representation of the images (or passed to the caller, dependent on the OutputKind-parameter). This setting should therefor point to a correctly configured Perfion File Service.

The Url-passed will be augmented, so that all images are output as jpg’s scaled to the height and width supplied in ImageHeight and ImageWidth-settings (preserving the image original aspect ratio).

The Urls generated will all be on the form:

http://api.local/perfion/image.aspx?id=<SomeGuid>&format=jpg&size=1024x1024

using the settings shown in Figure 1 (noticing that ImageServiceUrlParameters-setting is commented out. See more in section ImageServiceUrlParameters-setting).

Default value is blank, meaning that no images will be output from EC.

Languages

This setting specifies which Perfion Languages that are output by the EC API. At least one language must be specified. EC per default translates all Perfion Languages into their MS Culture equivalent (See msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx). In case you are not happy with that, or you maybe need one language to be output in two or more different cultures, please see chapter on language deviations.

Default value is EN, meaning the en-US culture.

From Perfion 4.5 2019 R1 the notion of the default language has been introduced. This is simply the first language in the list of languages. It does not have much influence, but it does have an impact when combining a Field coming from a non-localizable feature with an attribute coming from a localizable feature as described in Attribute.

OutputFolder

When outputting Attachment and Image-mappings using the File OutputKind-parameter, a byte representation of the requested Files and Images are stored on local storage. Here you specify the folder in which you want these files stored. The filenames used are the same as generated in “ConstructedFileName”. See section Image for details on how this filename is generated.

A subfolder-hierarchy is generated containing the files as seen on Figure 2.

Figure 2: A subfolder to OutputFolder is created per entity outputting images

In each of these, a subfolder for attachments and one for images are also created.
Here only Product- and Variant-entities are shown (missing Site- and Category-entities)

Default value for OutputFolder is blank, meaning that no binary files will be written.

VariantSupportEnabled

When VariantSupportEnabled is set to true, support for variants is enabled. This implies a lot of things and will be described in chapter Enabling Variant Support in ECommerce API.

Default value is false.

ImageServiceUrlParameters-setting

This setting was introduced in Perfion v. 4.5.36. The setting is in Figure 1 but commented out. When setting this it enabled and set to something not being blank, it will control the Url-parameters shipped to the Image Server. Commenting it in will product Image Urls on the following form:

http://api.local/perfion/image.aspx?id=<SomeGuid>&size=200x200&format=png&fit=exact

Notice in green bold-face that the value of this parameter is simply added to the Url fetching images.

The parameters used in the example make a 200x200 image using “exact”-fit and returns a png-file (instead of the default jpg). See more on which parameters the Perfion Image Server takes and what they do in the Perfion API Reference Manual.

Timezone

From version 4.7 of Perfion you can now supply a TimeZone-setting. This setting controls in which time zone all timestamps returned by the ECommerce API are returned in. ECommerce API supports the same time zones as the Perfion API, which are the ones support by Windows with the addition of “Client” and “Database” (See the Perfion API documentation for more details). If no TimeZone-setting is supplied, the ECommerce API assumes “Database”-time.

This setting can be overridden by the timezone-parameter that can be supplied in GetProducts, GetCategories and GetSites-methods.

Generally it is recommended to always use UTC-time, i.e. setting the TimeZone to “utc”.

IncludeTiming

Introduced in versions Perfion 4.6.26 and 4.7 2020 SR 2.

When added and set to true, all methods will return a result in which all parts of executing an ECommerce API method call has their duration measured and returned. This is the exact same as setting the includetiming-attribute to true in all ECommerce API-methods. See beginning of Chapter ECommerce API methods and their parameters for information on this attribute and the durations returned.

Having a setting is useful, if you do not control the methods that are called, for example when using the Sana Connector or other 3rd party integration using the ECommerce API.