This guide walks you through how to work directly with APIs to set up an ODS with your code and data using sfcc-ci. Use a third-party IDE if preferred, for example: Prophet Debugger.
To quickly get started using a PWA Kit demo site and demo data, see Create an On-Demand Sandbox for PWA Kit.
tip: Only existing customers can access some of the links on this page. Visit Salesforce Commerce Cloud GitHub Repositories and Access for information about how to get access to the repositories.
- Create your ODS and log in:
- If needed, install sfcc-ci.
- Create an API client to use with sfcc-ci. See Authorization for Admin APIs.
- Authenticate using either of the following sfcc-ci commands:
sfcc-ci auth:login {client_id}sfcc-ci client:auth {client_id} {client_secret}
- Create your ODS.
- Specify a sandbox on the
abcdrealm with an unlimited time to live. sfcc-ci ensures the WebDAV and OCAPI permissions are pre-configured using theclient_idfrom authentication. sfcc-ci sandbox:create -r abcd --ttl 0
- Specify a sandbox on the
- Validate your sandbox is started:
sfcc-ci sandbox:get -s [sandbox_id]
- Zip up your cartridges:
- Use your preferred tool to create a zip file of your cartridges. The zip should contain a top level folder with the code version name. In this folder should contain the cartridge folders.
- Your .zip file name must exactly match the top level folder name inside the .zip file, for example if your code version is
version1the zip should be calledversion1.zip
- Upload and activate your code version. For the .zip file, use the same name that you used for the code version.
sfcc-ci code:deploy code_version.zipsfcc-ci code:activate code_version
- Upload and import your site data:
sfcc-ci instance:upload archive.zip -i abcd-001.dx.commercecloud.salesforce.comsfcc-ci instance:import archive.zip -i abcd-001.dx.commercecloud.salesforce.com
- Run a job to refresh your indexes:
- Choose a job, for example, Full Product Index Update.
- Specify the job you selected and a site scope. For example, if you selected the
Full Product index updatejob:sfcc-ci job:run sfcc-search-index-product-full-update SiteScope='{"named_sites": ["RefArch"]}' -i abcd-001.dx.commercecloud.salesforce.com
Troubleshooting
- If you receive errors:
- Make sure the code version information used in your .zip file name exactly matches the name of the top level folder inside of the .zip file.
- When importing your data, make sure your .zip file archive, also known as the “site import archive”, has the required folder structure.
- If SLAS hybrid authentication fails with the error
Cannot construct SLAS session-bridge URL: no ACTIVE SCAPI short code found for this organization, generate a dedicated SCAPI short code for your sandbox realm in Business Manager. See Base URL and Request Formation and Generate a Short Code and Create an API Client ID.
Next Steps
If you are using SCAPI: see
- Quick Start for details on how to set up a demo using the SDK.
- Authorization for Shopper APIs for information about how to set up a client.