Understand site objects

Each site is represented in Commerce by an object whose properties store configuration data for the site.

To set up a new site, you create a site object and set the values of the properties. You can also update an existing site by modifying the values of the site object properties, or delete a site by deleting its site object. Note that you must log into the Admin API on the administration server using a profile that has the Administrator role in order to create, modify, or delete sites.

To simplify site creation, Commerce designates one site as the default site. When you create a new site, the values for properties that you do not explicitly supply are copied to the new site from the default site, with the following exceptions:

  • productionURL and additionalProductionURLs are left null if you do not supply values.
  • requireGDPRCookieConsent and requireGDPRP13nConsent default to false.
  • priceListGroupList defaults to a single JSON object containing the value of defaultPriceListGroup.
  • id and name values are supplied automatically by Commerce.

In addition to serving as a template for site creation, the default site is used as the destination for requests to your Commerce instance when the site cannot be otherwise resolved (for example, a request whose URL does not match any of the URLs specified in the productionURL or additionalProductionURLs properties described below).

There is always a single default site in an individual instance of Commerce. Initially, this is the site whose id is siteUS (the site included with each Commerce instance). Once you have created other sites, you can change which site is the default. However, there are several things you should be aware of when setting the default site:

  • The enabled property of the default site must be true. If you want to make a currently disabled site the default, first set enabled to true.
  • You cannot set the enabled property to false on the default site. If you want to disable the site that is currently the default, first make a different site the default.
  • If you set the defaultSite property to true on a site that is not currently the default, the defaultSite property is automatically set to false on the site that was previously the default.
  • If you attempt to set the defaultSite property to false on the site that is currently the default, the call is ignored. To set the defaultSite property to false on a site, you must set it to true on a different site.
  • You cannot delete the default site. If you want to delete the site that is currently the default, first make a different site the default.
  • You cannot set the value of a site’s id property to defaultSite.
  • You can use GET /ccadmin/v1/site/defaultSite to return the current default site.

Most of the properties of site objects are site-specific – their values can be different for each site. A few properties are global – their values must be identical for all sites. When you set a site-specific property on a site object, the value you supply is applied only to that site object. When you set a global property on a site object, the value you supply is applied to all of the site objects in your Commerce instance.

The following site properties are global:

Property Description
recommendationsHost The hostname of the server for product recommendations. For example, pt-recs-app1.us.example.com.
recommendationsPort The port number for accessing the server for product recommendations.

The remaining site properties are site-specific, including the following:

Property Description
productionURL The primary URL for accessing the site, without the protocol. If you have multiple sites running on your Commerce instance, their URLs can be differentiated by domain, subdomain, or context root.
additionalProductionURLs Alternate URLs that can be used to access the site. Use this property to indicate other versions of the production URL, such as adding www.example.com to the productionURL entry of example.com. Note that you must also configure additional domain names using the neverAuthenticateTargetHostNames property in the Merchant Basic Auth endpoint. For additional information on this endpoint, refer to the REST API documentation.
allowedOriginMethods An array that specifies external domains that are allowed to use CORS to make requests to the site. See CORS Support for more information.
priceListGroupList An array of JSON objects that specify all of the price list groups associated with the site. Must include the price list group specified in defaultPriceListGroup.
defaultPriceListGroup A JSON object that specifies the default price list group associated with the site.
name Name of the site (maximum 254 characters).
description Text describing the site.
longDescription Text describing the site in greater detail.
defaultCatalog The product catalog used for the site. Each site is associated with a single catalog.
defaultBillingCountryId The country code of the default billing country for the site.
defaultShippingCountryId The country code of the default shipping country for the site.
defaultLocaleId A string containing an integer that identifies the default locale for the site. You can view the mapping of IDs to locales using the listLocales endpoint.enabled.
additionalLocaleIds An array of IDs that specify other locales the site supports.
useDefaultSiteLocale A Boolean specifying whether the locale specified by defaultLocaleId is displayed, even if it is not the browser's default locale.
enabled A Boolean specifying whether the site is currently enabled.
defaultSite A Boolean specifying whether the site is currently the default site.
siteTypes An array listing the site types this site supports. For sites running consumer-based commerce, set this property to ["commerce"]. If you have sites running account-based commerce or sites running both account-based and consumer-based commerce, this setting must be configured for you by Oracle.
timeToLive Amount of time (in milliseconds) that an approved order or a partially paid order can remain available before payment is completed. If payment is not completed after this amount of time, the order is marked for cancellation.
secondaryCurrency For sites that support loyalty points, the monetary currency that points can be converted to for calculating taxes and shipping costs. See Work with Loyalty Programs for more information.
requireGDPRCookieConsent A Boolean specifying whether a shopper on the site must give consent before any cookies containing personal data are created on the shopper’s machine. See Manage the Use of Personal Data for more information.
requireGDPRP13nConsent A Boolean specifying whether a shopper on the site must give consent to be considered a member of any audience that uses shopper profile data. See Manage the Use of Personal Data for more information.