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

# Create Products

> Turn a board design into a Hyperwisor IoT product — send a fixed-format component list, get back a product and a QR code.

Once you have an access token, call the Partner API on your user's behalf to
create (or update) a manufacturer product from their board.

## Create or update a product

```bash theme={null}
curl -X POST https://hyperwisor.nikolaindustry.workers.dev/functions/v1/partner-products \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "external_ref": "yourapp:project_123",
    "name": "GLYPH-S3 Audio Relay Controller",
    "board": "glyph-s3",
    "components": [
      { "type": "relay", "channels": 2, "pins": ["A6","A8"], "label": "2CH Relay" },
      { "type": "microphone", "interface": "i2s", "label": "1CH MIC" },
      { "type": "gpio_output", "pins": ["D13"], "label": "Status LED" }
    ],
    "metadata": { "category": "IoT", "sku": "GS3-AUDIO-01" }
  }'
```

Requires the `manufacturer:products` scope.

### Fields

| Field          | Required | Notes                                                                                                                                                  |
| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `external_ref` | ✓        | Your stable id for the project. Re-POSTing the same `external_ref` **updates** the product instead of creating a duplicate.                            |
| `name`         | ✓        | Product name shown in Hyperwisor.                                                                                                                      |
| `board`        | —        | Board family (e.g. `glyph-s3`) — selects the firmware to flash.                                                                                        |
| `components`   | —        | The board's components. Each has a `type` (see below) plus optional `pins`, `channels`, `interface`, `label`. Used to auto-build the device dashboard. |
| `metadata`     | —        | Optional passthrough: `category`, `description`, `firmware_version`, `sku`, …                                                                          |

### Response

```json theme={null}
{
  "product_id": "uuid",
  "dashboard_id": null,
  "qr": {
    "product_id": "uuid",
    "data": "hyperwisor://onboard?product=uuid",
    "onboard_url": "https://hyperwisor.com/onboard?product=uuid"
  },
  "firmware": { "board": "glyph-s3", "config_endpoint": "/partner-products-firmware?product=uuid" }
}
```

Render the QR from `qr.data` in your own UI. The end user scans it in the
Hyperwisor app to onboard the physical device.

## Component types

Common `type` values (extended over time):

| `type`        | Becomes                |
| ------------- | ---------------------- |
| `relay`       | one toggle per channel |
| `gpio_output` | toggle / button        |
| `gpio_input`  | status indicator       |
| `microphone`  | level / waveform       |
| `temperature` | gauge + chart          |
| `humidity`    | gauge                  |
| `unknown`     | generic value card     |

<Note>
  Unknown component types are accepted and stored — they simply map to a generic
  widget until first-class support is added.
</Note>

## Read a product's status

```bash theme={null}
curl "https://hyperwisor.nikolaindustry.workers.dev/functions/v1/partner-products?external_ref=yourapp:project_123" \
  -H "Authorization: Bearer ACCESS_TOKEN"
```

```json theme={null}
{ "product_id": "uuid", "dashboard_id": null, "qr": { "…": "…" } }
```

## Idempotency

Operations are keyed on `(your client, external_ref)`. Safe to retry — a repeat
call updates the same product rather than creating a new one.
