0

Folks, Is there a commerce cloud end point to retrieve a list of sites? I can't find anything in their documentation. There is a list of channels when you retrieve client ids but is that even best practice? https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth-admin/v1/tenants/{tenantId}/clients

{
  "data": [
    {
      "clientId": "a462b606-317c-4a3c-90a7-4b0b938f3807",
      "secret": "",
      "name": "Shop Mart",
      "scopes": [
        "sfcc.products sfcc.catalogs sfcc.products.ro"
      ],
      "redirectUri": "http://localhost:9010/callback",
      "callbackUri": "http://localhost:9010/pwd/reset/callback",
      "channels": [
        "SiteGenesis",
        "OtherSite"
      ],
      "isPrivateClient": true
    },....

1 Answer 1

0

This is only available via the OCAPI Sites resource:

GET https://hostname:port/dw/data/v23_2/sites?start={Integer}&count={Integer}&select={String}

Which responds in the following manner:

{
  "_v" : "23.2",
  "count" : 2,
  "data" : [ 
    {
        "_v" : "23.2",
        "_type" : "site",
        "customer_list_link" : {
            "_type" : "customer_list_link",
            "customer_list_id" : "SiteGenesis",
            "link" : "https://example.com/s/-/dw/data/v23_2/customer_lists/SiteGenesis"
        },
        "description" : {
            "default": "Prototypical site used for starting point",
        }
        "display_name" : {
            "default": "Site Genesis",
        }
        "id" : "SiteGenesis",
        "in_deletion": false,
        "link" : "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis",
        "storefront_status": "online"
    },
    {
        "_v" : "23.2",
        "_type" : "site",
        "customer_list_link" : {
            "_type" : "customer_list_link",
            "customer_list_id" : "MyCustomerList",
            "link" : "https://example.com/s/-/dw/data/v23_2/customer_lists/MyCustomerList"
        },
        "description" : {
            "default": "A site that sells products",
        }
        "display_name" : {
            "default": "My Site",
        }
        "id" : "MySite",
        "in_deletion": false,
        "link" : "https://example.com/s/-/dw/data/v23_2/sites/MySite",
        "storefront_status": "online"
    }
  ],
  "select": "**",
  "start" : 0,
  "total" : 2
}
1
  • thank you, didn't know open commerce api existed. i guess i should read the documentation till the very end.
    – SavvyGoat
    Jun 28, 2023 at 17:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .