Changes
Comparing empty → 160dc49.
| @@ -1,0 +1,63 @@ | ||
| 1 | +--- | |
| 2 | +title: Your first product | |
| 3 | +sort: 2 | |
| 4 | +--- | |
| 5 | + | |
| 6 | +# Your first product | |
| 7 | + | |
| 8 | +Two ways: CLI or API. Use whichever feels familiar. | |
| 9 | + | |
| 10 | +## CLI | |
| 11 | + | |
| 12 | +```bash | |
| 13 | +zephyr products create \ | |
| 14 | + --name "Filter coffee, 250g" \ | |
| 15 | + --sku coffee-250 \ | |
| 16 | + --price-cents 1490 \ | |
| 17 | + --currency EUR \ | |
| 18 | + --inventory 200 | |
| 19 | +``` | |
| 20 | + | |
| 21 | +Output: | |
| 22 | + | |
| 23 | +```json | |
| 24 | +{ | |
| 25 | + "id": "prod_01HXY4M9C0AVE0M1QGPS9XK7T2", | |
| 26 | + "name": "Filter coffee, 250g", | |
| 27 | + "sku": "coffee-250", | |
| 28 | + "default_price_cents": 1490, | |
| 29 | + "currency": "EUR", | |
| 30 | + "inventory": 200, | |
| 31 | + "status": "active", | |
| 32 | + "created_at": "2026-05-31T09:14:12Z" | |
| 33 | +} | |
| 34 | +``` | |
| 35 | + | |
| 36 | +## API | |
| 37 | + | |
| 38 | +The same call over HTTP: | |
| 39 | + | |
| 40 | +```bash | |
| 41 | +curl -sS https://api.zephyrcart.io/v1/products \ | |
| 42 | + -H "Authorization: Bearer $ZEPHYR_API_KEY" \ | |
| 43 | + -H "Idempotency-Key: $(uuidgen)" \ | |
| 44 | + -H "Content-Type: application/json" \ | |
| 45 | + -d '{ | |
| 46 | + "name": "Filter coffee, 250g", | |
| 47 | + "sku": "coffee-250", | |
| 48 | + "default_price_cents": 1490, | |
| 49 | + "currency": "EUR", | |
| 50 | + "inventory": 200 | |
| 51 | + }' | |
| 52 | +``` | |
| 53 | + | |
| 54 | +The `Idempotency-Key` is optional but recommended. Identical retries within 24 hours return the | |
| 55 | +same response without creating a duplicate product. See the | |
| 56 | +[Idempotency reference](../api-reference/index.md#idempotency). | |
| 57 | + | |
| 58 | +## Verify in the dashboard | |
| 59 | + | |
| 60 | +The product should appear in **Catalog → Products** within ~1 second. If it doesn't, you're | |
| 61 | +probably authenticated against a different tenant — check `zephyr config get tenant`. | |
| 62 | + | |
| 63 | +Next: [Run a checkout end to end](checkout-test.md). | |