# Product variants

Section: Products and catalog. Part of the [API reference](https://developer.yoprint.com/reference.md). Web page: https://developer.yoprint.com/reference/product-variants/

This page and all 9 operation pages, in 2 files: https://developer.yoprint.com/llms/product-variants.txt (operations 1 to 7), https://developer.yoprint.com/llms/product-variants-2.txt (operations 8 to 9)

The size and color combinations of a variant product. Each has its own id, price, stock and sale state (on sale or phased out).

## Operations (9)

- [Add a variant to a product](https://developer.yoprint.com/reference/product-variants/v1-product-variant-store.md): `POST /v1/api/store/{team_slug}/product/{hash_id}/variant`. Adds one size and color combination to a variant product, returns it, and updates the product's `size_data` and `color_data`.
- [List a product's variants](https://developer.yoprint.com/reference/product-variants/v1-product-variant-index.md): `GET /v1/api/store/{team_slug}/product/{hash_id}/variant`. Lists the live variants (size and color combinations) of a variant product, paged.
- [Get a variant](https://developer.yoprint.com/reference/product-variants/v1-product-variant-show.md): `GET /v1/api/store/{team_slug}/product/{hash_id}/variant/{id}`. Returns one live variant by its id, with its own sale state (`phased_out`, `phased_out_at`, `phased_out_by`).
- [Check whether variants can be deleted](https://developer.yoprint.com/reference/product-variants/v1-product-variant-delete-check.md): `POST /v1/api/store/{team_slug}/product/{hash_id}/variant/delete_check`. Read-only.
- [Update a variant](https://developer.yoprint.com/reference/product-variants/v1-product-variant-update.md): `PUT /v1/api/store/{team_slug}/product/{hash_id}/variant/{id}`. Changes one variant's price, pricing group prices, weight, supplier code and vendor, and returns it.
- [Phase out variants (stop selling them)](https://developer.yoprint.com/reference/product-variants/v1-product-variant-phase-out.md): `POST /v1/api/store/{team_slug}/product/{hash_id}/variant/phase_out`. Phased-out variants can no longer be added to new sales order or quote lines (422 `variant_phased_out`).
- [Rename sizes and colors of a product](https://developer.yoprint.com/reference/product-variants/v1-product-variant-rename-options.md): `POST /v1/api/store/{team_slug}/product/{hash_id}/variant/rename_options`. Each size or color keeps its id and takes the new label, and a color may take a new hex, on every variant of the product, deleted copies included.
- [Put phased-out variants back on sale](https://developer.yoprint.com/reference/product-variants/v1-product-variant-resume.md): `POST /v1/api/store/{team_slug}/product/{hash_id}/variant/resume`. New sales order and quote lines can use them again.
- [Delete a variant](https://developer.yoprint.com/reference/product-variants/v1-product-variant-destroy.md): `DELETE /v1/api/store/{team_slug}/product/{hash_id}/variant/{id}`. Deletes one variant unless it is in use, hides its stock rows and updates the product's `size_data` and `color_data`.
