---
schema_version: "1"
id: 20267eb437837f48eac6100733657208cb7683305309d242e907288f71bb46cd
title: Develop With Your On-Demand Sandbox
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/b2c-commerce/guides/sandboxes/b2c-develop-with-on-demand-sandbox.md
canonical_url: https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/b2c-develop-with-on-demand-sandbox.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6883329fc01d50870f85191b2cedbc4c8433ca53d2c0ea9425cf813f234d5213
products:
  - Composable Storefront
  - Salesforce APIs
---
# Develop With Your On-Demand Sandbox

This guide walks you through how to work directly with APIs to set up an [ODS](https://commerce-clo-hargrave-o-sgrlli.herokuapp.com/docs/commerce/b2c-commerce/guide/b2c-developer-sandboxes.html) with your code and data using [sfcc-ci](https://github.com/SalesforceCommerceCloud/sfcc-ci). Use a third-party IDE if preferred, for example: [Prophet Debugger](https://marketplace.visualstudio.com/items?itemName=SqrTT.prophet).

To quickly get started using a PWA Kit demo site and demo data, see [Create an On-Demand Sandbox for PWA Kit](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/creating-an-on-demand-sandbox.html).

**tip:** Only existing customers can access some of the links on this page. Visit [Salesforce Commerce Cloud GitHub Repositories and Access](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-github-repo-access.html) for information about how to get access to the repositories.


1. Create your ODS and log in:
   1. If needed, install [sfcc-ci](https://github.com/SalesforceCommerceCloud/sfcc-ci).
   2. Create an API client to use with sfcc-ci. See [Authorization for Admin APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html).
   3. Authenticate using either of the following sfcc-ci commands:
      - `sfcc-ci auth:login {client_id}`
      - `sfcc-ci client:auth {client_id} {client_secret}`
   4. [Create your ODS](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-get-started-sandboxes.html#create-an-on-demand-sandbox).
      - Specify a sandbox on the `abcd` realm with an unlimited time to live. sfcc-ci ensures the WebDAV and OCAPI permissions are pre-configured using the `client_id` from authentication.
      - `sfcc-ci sandbox:create -r abcd --ttl 0`
   5. Validate your sandbox is started:
      - `sfcc-ci sandbox:get -s [sandbox_id]`
2. 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 `version1` the zip should be called `version1.zip`
3. 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.zip`
   - `sfcc-ci code:activate code_version`
4. Upload and import your site data:
   - `sfcc-ci instance:upload archive.zip -i abcd-001.dx.commercecloud.salesforce.com`
   - `sfcc-ci instance:import archive.zip -i abcd-001.dx.commercecloud.salesforce.com`
5. Run a job to refresh your indexes:
   1. [Choose a job](https://developer.salesforce.com/docs/commerce/b2c-commerce/references/b2c-commerce-ocapi/globaljobs.html), for example, **Full Product Index Update**.
   2. Specify the job you selected and a [site scope](https://sfcclearning.com/infocenter/OCAPI/current/data/Documents/SearchIndexUpdateConfiguration.php). For example, if you selected the `Full Product index update` job:
      - `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](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#short-code) and [Generate a Short Code and Create an API Client ID](https://help.salesforce.com/s/articleView?id=cc.b2c_generate_a_shortcode_and_api_client_id.htm&type=5).

## Next Steps

If you are using SCAPI: see

- [Quick Start](https://developer.salesforce.com/docs/commerce/commerce-api/guide/api-and-sdk-demo.html) for details on how to set up a demo using the SDK.
- [Authorization for Shopper APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-shopper-apis.html) for information about how to set up a client.
