Create a site

You can use the createSite endpoint to create a new site, using the default site as a template.

This section applies to both OSF and Storefront Classic. This section applies to Open Storefront Framework (OSF) and Storefront Classic.

For example:

POST /ccadmin/v1/sites  HTTP/1.1
Authorization: Bearer <access_token>
x-ccasset-language: en

{
"properties":
  {
    "productionURL": "www.example2.com"
  }
}

The response is similar to the following:

{
   "longDescription": null,
   "priceListGroupList": [
      {
         "deleted": false,
         "repositoryId": "defaultPriceGroup",
         "active": true,
         "id": "defaultPriceGroup"
      }
   ],
   "productionURL": "www.example2.com",
   "timezone": "etc_utc",
   "description": null,
   "secondaryCurrency": null,
   "defaultCatalog": {
      "displayName": "Product Catalog",
      "repositoryId": "cloudCatalog",
      "id": "cloudCatalog"
   },
   "requireGDPRP13nConsent": false,
   "type": "siteConfiguration",
   "defaultBillingCountryId": null,
   "defaultShippingCountryId": null,
   "enabled": false,
   "requireGDPRCookieConsent": false,
   "payTaxInSecondaryCurrency": false,
   "timeToLive": null,
   "defaultLocaleId": "1",
   "activeTheme": null,
   "loyaltyPrograms": [

   ],
   "paymentOption": "0",
   "additionalProductionURLs": [

   ],
   "links": [
      {
         "rel": "self",
         "href": "http://myserver.example.com:7002/ccadmin/v1/sites"
      }
   ],
   "id": "100002",
   "defaultSite": false,
   "additionalLocaleIds": [

   ],
   "recommendationsHost": "pt-recs-app1.us.example.com",
   "favicon": null,
   "allowedOriginMethods": {

   },
   "noimage": null,
   "defaultPriceListGroup": {
      "deleted": false,
      "repositoryId": "defaultPriceGroup",
      "active": true,
      "id": "defaultPriceGroup"
   },
   "payShippingInSecondaryCurrency": false,
   "siteTypes": [
      "commerce"
   ],
   "recommendationsPort": "8080",
   "shipFromAddress": {

   },
   "repositoryId": "100002",
   "name": "100002"
}

Note: If you want to implement wish lists on a new site that you create using the Admin API, you must also create a new wish list environment and associate it with the site. To do this, use the PUT /swm/rs/v1/sites/cc/{ccSiteId} endpoint in the Social Wish Lists API. If you subsequently modify the site using the Admin API, you should use this endpoint to make the equivalent changes to the associated wish list environment. If you delete the site, you should also delete the associated wish list environment, using the DELETE /swm/rs/v1/sites/cc/{ccSiteId} endpoint.

For more information about these endpoints, see the REST API documentation that is available through the Oracle Help Center:

http://docs.oracle.com/cloud/latest/commercecs_gs/CXOCC/

createSiteFromForm endpoint

In addition to the createSite endpoint, which creates a site based on the default site, Commerce includes a createSiteFromForm endpoint that creates a site based on a site you specify. For example, to create a new site using site 100002 as a template:

POST /ccadmin/v1/sites/100002  HTTP/1.1
Authorization: Bearer <access_token>
x-ccasset-language: en

{
"properties":
  {
    "productionURL": "www.example3.com"
  }
}