# Account Creation Quick Start

## Setup

```bash
# Install dependencies
pip install -r requirements.txt

# Create config file
cp config.shadow config.json

# Edit config.json with:
# - Bearer token in "bearer_token" section
# - Service tier UUIDs in "service_tier_map" section
```

## Usage

### QA Environment
```bash
python3 create_accounts.py \
  --csv input.csv \
  --config config.json \
  --success-csv results.csv
```

### Production
```bash
python3 create_accounts.py \
  --csv input.csv \
  --config config.json \
  --env prod \
  --success-csv results.csv
```

**API Endpoints:**
- `--env qa` (default): `https://ows-grass.theorchard.io/v2/vendors`
- `--env prod`: `https://ows-account.theorchard.io/v2/vendors`

**Output:**
- `results.csv` - Successful accounts with Account IDs
- `results_failures.csv` - Failed/skipped rows with error details

### Auto-Resume

The script automatically saves progress and resumes. If interrupted:
1. Update bearer token in config.json (if expired)
2. Rerun the same command

The script will skip already processed accounts and continue.

### Retry Failures

```bash
python3 create_accounts.py \
  --csv results_failures.csv \
  --config config.json \
  --env prod \
  --success-csv results.csv
```

### Test (Dry Run)

```bash
python3 create_accounts.py \
  --csv input.csv \
  --config config.json \
  --dry-run \
  --limit 5
```

## Options

- `--csv` - Input CSV file (required)
- `--config` - Config JSON file (required)
- `--env` - Environment: qa or prod (default: qa)
- `--success-csv` - Output CSV with Account IDs
- `--dry-run` - Test without making API calls
- `--limit N` - Process only N rows
- `--delay` - Seconds between API calls (default: 0.5)
