> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# iCommerce Agent Sandbox Runbook

> Provision, execute, and clean up an iCommerce agent in Sandbox.

# iCommerce Agent Sandbox Runbook

This runbook provides an end-to-end flow for running the iCommerce agent inside a sandbox.

## 1) Provision a Sandbox

```bash theme={null}
curl -X POST https://api.sandbox.stateset.app/api/v1/sandbox/create \
  -H "Authorization: ApiKey YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"timeout_seconds": 600}'
```

Save the `sandbox_id` from the response.

## 2) Verify Connectivity

```bash theme={null}
curl -X POST https://api.sandbox.stateset.app/api/v1/sandbox/SANDBOX_ID/execute \
  -H "Authorization: ApiKey YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"command": "stateset \"show me pending orders\""}'
```

## 3) Execute Write Actions (Explicit)

```bash theme={null}
curl -X POST https://api.sandbox.stateset.app/api/v1/sandbox/SANDBOX_ID/execute \
  -H "Authorization: ApiKey YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"command": "stateset --apply \"ship order #12345 with tracking FEDEX123\""}'
```

## 4) Capture Outputs

* Stream output from the execution response
* Store logs and results for audit trails

## 5) Stop the Sandbox

```bash theme={null}
curl -X POST https://api.sandbox.stateset.app/api/v1/sandbox/SANDBOX_ID/stop \
  -H "Authorization: ApiKey YOUR_API_KEY"
```

## Related Documentation

* [Run the iCommerce Agent in Sandbox](/stateset-icommerce-agent-sandbox)
* [Sandbox API Flow](/stateset-sandbox-api-flow)
