---
title: "Initialize shopify sandbox with data"
method: POST
path: "/sandbox/shopify/{sandbox_id}/initialize"
tags: ["sandbox"]
---

# Initialize shopify sandbox with data

`POST /sandbox/shopify/{sandbox_id}/initialize`

Initialize the sandbox with shopify-specific data following the defined schema.

## Path parameters

- `sandbox_id` string, required — The unique sandbox identifier

## Query parameters

- `init_default_data` boolean — If true, use default test data for initialization

## Request body

- ShopifyDataInput — Complete Shopify sandbox data structure. Orders reference customers and products by their index in the respective lists. Products and customers are created first, then orders are created with proper references.
  - `products` ShopifyProduct[], nullable — List of products to create
    - `title` string, required — Product name
    - `description` string, nullable — Product description
    - `vendor` string, required — Brand or vendor name
    - `category` string, required — Product category/type
    - `price` string, required — Product price (e.g., '29.99')
    - `sku` string, required — Stock Keeping Unit identifier
    - `stock` integer — Available inventory count
    - `status` string — Product status (active, draft, archived)
  - `customers` ShopifyCustomer[], nullable — List of customers to create
    - `email` string, email, nullable — Customer email address
    - `name` string, nullable — Customer full name
    - `address` string, nullable — Street address
    - `city` string, nullable — City name
    - `state` string, nullable — State/province code
    - `zip` string, nullable — Postal/ZIP code
    - `country` string, nullable — Country code (e.g., 'US')
  - `orders` ShopifyOrder[], nullable — List of orders to create
    - `customer_index` integer, required — Index of the customer in the customers list (0-based)
    - `line_items` ShopifyOrderLineItem[], required — List of line items
      - `product_index` integer, required — Index of the product in the products list (0-based)
      - `quantity` integer — Quantity of the product to order
    - `financial_status` string — Order financial status (pending, paid, refunded, etc.)

## Response `200`

Successful Response

- InitializeSandboxResponse — Response model for sandbox initialization
  - `sandbox_id` string, required — Sandbox identifier
  - `status` 'idle' | 'occupied' | 'error', required — Status of a sandbox instance - matches database enum
  - `message` string, required — Initialization result message

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/klavis-ai/apis/klavis-ai-https-www-klavis-ai.md) · [All operations](https://skmtc.net/klavis-ai/apis/klavis-ai-https-www-klavis-ai/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/klavis-ai/klavis-ai-https-www-klavis-ai/versions/1f05ced7280f/schema)
