| description | Commands for creating, managing, starting, stopping, and deleting On-Demand Sandboxes (ODS) for development. |
|---|
Commands for managing On-Demand Sandboxes (ODS).
Commands that operate on a specific sandbox (get, start, stop, restart, delete) accept two ID formats:
| Format | Example | Description |
|---|---|---|
| UUID | abc12345-1234-1234-1234-abc123456789 |
Full sandbox UUID |
| Realm-instance | zzzv-123 or zzzv_123 |
Realm-instance format |
The realm-instance format uses the 4-character realm code followed by a dash (-) or underscore (_) and the instance identifier. When using the realm-instance format, the CLI automatically looks up the corresponding sandbox UUID.
# These are equivalent (assuming zzzv-123 resolves to the UUID)
b2c ods get abc12345-1234-1234-1234-abc123456789
b2c ods get zzzv-123These flags are available on all ODS commands:
| Flag | Environment Variable | Description |
|---|---|---|
--sandbox-api-host |
SFCC_SANDBOX_API_HOST |
ODS API hostname (default: admin.dx.commercecloud.salesforce.com) |
ODS commands require an Account Manager API Client.
| Auth Method | Role | Configured On |
|---|---|---|
| User Authentication | Sandbox API User |
Your user account |
| Client Credentials | Sandbox API User |
The API client |
User Authentication: Used when only --client-id is provided. Opens a browser for login. The Sandbox API User role must be assigned to your user account in Account Manager.
Client Credentials: Used when both --client-id and --client-secret are provided. The Sandbox API User role must be assigned to the API client.
The API client's roles must have a tenant filter configured for the realm(s) you wish to manage. In Account Manager, under each role (e.g., Sandbox API User), add the realm IDs you need to access to the Tenant Filter.
# User Authentication (opens browser)
b2c ods list --client-id xxx
# Client Credentials
export SFCC_CLIENT_ID=my-client
export SFCC_CLIENT_SECRET=my-secret
b2c ods listFor complete setup instructions, see the Authentication Guide.
List all on-demand sandboxes accessible to your account.
b2c ods list| Flag | Description | Default |
|---|---|---|
--realm, -r |
Filter by realm ID (four-letter ID) | |
--filter-params |
Raw filter parameters (e.g., "realm=abcd&state=started") | |
--show-deleted |
Include deleted sandboxes in the list | false |
--columns, -c |
Columns to display (comma-separated) | |
--extended, -x |
Show all columns including extended fields | false |
realm, instance, state, profile, created, eol, id, hostname, createdBy, autoScheduled
# List all sandboxes
b2c ods list
# Filter by realm
b2c ods list --realm abcd
# Filter by state and realm
b2c ods list --filter-params "realm=abcd&state=started"
# Show extended information
b2c ods list --extended
# Custom columns
b2c ods list --columns realm,instance,state,hostname
# Output as JSON
b2c ods list --jsonRealm Instance State Profile Created EOL
──────────────────────────────────────────────────────────────────────────
abcd 001 started medium 12/20/2024, 10:00 AM 12/21/2024, 10:00 AM
abcd 002 stopped large 12/19/2024, 2:30 PM 12/20/2024, 2:30 PM
Create a new on-demand sandbox.
b2c ods create --realm <REALM>| Flag | Description | Default |
|---|---|---|
--realm, -r |
(Required) Realm ID (four-letter ID) | |
--ttl |
Time to live in hours (0 for infinite) | 24 |
--profile |
Resource profile (medium, large, xlarge, xxlarge) | medium |
--auto-scheduled |
Enable automatic start/stop scheduling | false |
--wait, -w |
Wait for sandbox to reach started or failed state | false |
--poll-interval |
Polling interval in seconds when using --wait | 10 |
--timeout |
Maximum wait time in seconds (0 for no timeout) | 600 |
--set-permissions |
Automatically set OCAPI and WebDAV permissions |
# Create a sandbox with default settings
b2c ods create --realm abcd
# Create with extended TTL
b2c ods create --realm abcd --ttl 48
# Create with larger resources
b2c ods create --realm abcd --profile large
# Create and wait for it to be ready
b2c ods create --realm abcd --wait
# Create with auto-scheduling enabled
b2c ods create --realm abcd --auto-scheduled
# Create and automatically set permissions for the client
b2c ods create --realm abcd --set-permissions
# Output as JSON
b2c ods create --realm abcd --json- Sandbox creation can take several minutes
- Use
--waitto block until the sandbox is ready - The
--set-permissionsflag configures OCAPI and WebDAV access for the client ID used to create the sandbox
Get details of a specific sandbox.
b2c ods get <SANDBOXID>| Argument | Description | Required |
|---|---|---|
SANDBOXID |
Sandbox ID (UUID or realm-instance, e.g., zzzv-123) |
Yes |
# Get sandbox details using UUID
b2c ods get abc12345-1234-1234-1234-abc123456789
# Get sandbox details using realm-instance format
b2c ods get zzzv-123
# Output as JSON
b2c ods get zzzv_123 --jsonDisplays detailed information about the sandbox including:
- Sandbox ID and instance
- Realm and hostname
- State and resource profile
- Creation time and end-of-life
- Links to BM and storefront
Display ODS user and system information.
b2c ods info# Get ODS info
b2c ods info
# Output as JSON
b2c ods info --jsonDisplays information about:
- Authenticated user
- Available realms
- System status and limits
Start a stopped on-demand sandbox.
b2c ods start <SANDBOXID>| Argument | Description | Required |
|---|---|---|
SANDBOXID |
Sandbox ID (UUID or realm-instance, e.g., zzzv-123) |
Yes |
# Start a sandbox using UUID
b2c ods start abc12345-1234-1234-1234-abc123456789
# Start a sandbox using realm-instance format
b2c ods start zzzv-123
# Output as JSON
b2c ods start zzzv_123 --jsonStop a running on-demand sandbox.
b2c ods stop <SANDBOXID>| Argument | Description | Required |
|---|---|---|
SANDBOXID |
Sandbox ID (UUID or realm-instance, e.g., zzzv-123) |
Yes |
# Stop a sandbox using UUID
b2c ods stop abc12345-1234-1234-1234-abc123456789
# Stop a sandbox using realm-instance format
b2c ods stop zzzv-123
# Output as JSON
b2c ods stop zzzv_123 --jsonRestart an on-demand sandbox.
b2c ods restart <SANDBOXID>| Argument | Description | Required |
|---|---|---|
SANDBOXID |
Sandbox ID (UUID or realm-instance, e.g., zzzv-123) |
Yes |
# Restart a sandbox using UUID
b2c ods restart abc12345-1234-1234-1234-abc123456789
# Restart a sandbox using realm-instance format
b2c ods restart zzzv-123
# Output as JSON
b2c ods restart zzzv_123 --jsonDelete an on-demand sandbox.
b2c ods delete <SANDBOXID>| Argument | Description | Required |
|---|---|---|
SANDBOXID |
Sandbox ID (UUID or realm-instance, e.g., zzzv-123) |
Yes |
| Flag | Description | Default |
|---|---|---|
--force, -f |
Skip confirmation prompt | false |
# Delete a sandbox using UUID (with confirmation prompt)
b2c ods delete abc12345-1234-1234-1234-abc123456789
# Delete a sandbox using realm-instance format
b2c ods delete zzzv-123
# Delete without confirmation
b2c ods delete zzzv_123 --force- The command will prompt for confirmation unless
--forceis used - Deleted sandboxes cannot be recovered