# Load a product for a sales order line

```http
POST https://secure.yoprint.com/v1/api/store/{team_slug}/hydrate_product
```

- API version: v1
- Operation ID: `v1_public_hydrate_imported_product`
- Section: Products and catalog › [Products](https://developer.yoprint.com/reference/products.md)
- Web page: https://developer.yoprint.com/reference/products/v1-hydrate-imported-product/
- Authentication: `Authorization: Bearer YOUR_API_KEY`

Returns a product with every option you can sell, in the shape sales order line pickers use: `size_data`, `color_data` and `attr_data` (one row per size and color combination). It is also how you get a supplier catalog style's size and color ids. Read-only.

What `id` names depends on `type`. Your own simple product is `db_simple` here (and on stock levels), but `user_simple` on sales order lines.

| `type` | `id` | What comes back |
| --- | --- | --- |
| `db_simple` or `custom` | One of your products | A simple product (`type: simple`) with its `price`, or a variant product (`type: variant`) with its live variants in `attr_data`. |
| `db_variant` | One of your variants | Its whole parent product (`type: variant`). |
| `db_catalog` | A catalog product id: one size and color, such as `ssa-B00000001` | Its whole catalog style (`type: variant_catalog`). |
| `db_catalog_style` | A catalog style id, such as `ssa-5000` | The same style. |

**A supplier catalog product, step by step**

1. Start from a catalog id you have: the product id of an existing catalog sales order line (send it as `db_catalog`), or a style id (`db_catalog_style`). Catalog ids are the supplier code, a dash, then the supplier's own key. A style id ends in the supplier's style key: for SanMar (`smr`) that is the style number people see; other suppliers use their own key, which is not always the style number shown (S&S Activewear's is S&S's own style key; the style number people see comes back as `style_name`). The public API can't search the catalog by keyword.
2. Call this operation. In `attr_data`, pick the row by `size_label` and `color_label`. Its `id` is the catalog product id and its `provider` is the supplier code.
3. Get the supplier cost with Get live supplier pricing, sending that `id`.
4. Add the line with Add a line item: `product.properties.id` is the row's `id` and `pricing.catalog.provider` is the row's `provider`.

Supplier codes: `ssa` S&S Activewear, `ssaca` S&S Activewear Canada, `smr` SanMar, `sanmar_ca` SanMar Canada, `agst` Momentec (Augusta Sportswear), `agstca` Momentec Canada, `asc` AS Colour. Older catalogs with stored prices only: `alp` and `alpca` (AlphaBroder), `conde`, `tsf`, `deltapp` (Delta Apparel).

## Permission

Any member of the team.

## Business rules

- Deleted products and variants are not found (404).
- Catalog lookups read YoPrint's copy of the supplier catalogs; they make no call to the supplier.

## Path parameters

- `team_slug` (string, required): Your team slug, shown as Team ID next to your API key in Profile. Example `your-team`.

## Request body

Content type `application/json`, required.

Fields:

- `id` (string, required): A product or variant hash id, or a catalog id (catalog ids are plain strings such as `ssa-B00000001`).
- `type` (string, required): One of: `"db_simple"`, `"custom"`, `"db_variant"`, `"db_catalog"`, `"db_catalog_style"`.
- `context` (string | null, optional): `mockup_editor` also refuses catalog products the team can't use for mockups. One of: `"mockup_editor"`.

### Example request

```bash
curl -X POST 'https://secure.yoprint.com/v1/api/store/your-team/hydrate_product' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'X-Yoprint-Decimal-Format: exact-v1' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "ssa-B00000001",
    "type": "db_catalog"
  }'
```

Another example: One of your variant products:

```bash
curl -X POST 'https://secure.yoprint.com/v1/api/store/your-team/hydrate_product' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'X-Yoprint-Decimal-Format: exact-v1' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "Xe3wCbaZYrxJAI",
    "type": "db_simple"
  }'
```

## Response

`200` Successful response.

Fields:

- `data` (object, required)
  - One of, picked by `type`:
    - **A supplier catalog style** (`variant_catalog`): `type` is `variant_catalog`. `attr_data` lists every size and color of the style.
      - `type` (string, required): Always `"variant_catalog"`.
      - `trashed` (boolean, optional): Always `false`.
      - `attr_data` (array of objects, required): One row per size and color, most recently updated first.
        - Each item:
          - `available` (boolean, optional): Always `true`.
          - `dscnt` (boolean, required): Discontinued: true when the supplier discontinued the variant. For S&S Activewear, also true when the variant was not updated in the last 16 days.
          - `id` (string, required): The catalog product id, such as `ssa-B00000001`: the `db_catalog` line's product id and the id for live pricing.
          - `provider` (string, required): The supplier code, such as `ssa`: send it as the line's `pricing.catalog.provider`.
          - `color_hex` (string | null, optional)
          - `color_id` (string | null, optional)
          - `color_image` (string | null, optional)
          - `color_label` (string | null, optional)
          - `display_dscnt` (boolean, optional): Display discontinued status: true when YoPrint displays the discontinued badge for this variant.
          - `size_id` (string | null, optional)
          - `size_label` (string | null, optional)
          - `updated_at` (string (date-time), optional)
          - `weight` (number | string | null, optional)
      - `id` (string, required): The style id, such as `ssa-5000`.
      - `style_id` (string, required): The same as `id`.
      - `variant_type` (string, required): One of: `"size"`, `"color"`, `"size_color"`, `"none"`.
      - `brand` (string | null, optional)
      - `color_data` (array of objects, optional)
        - Each item:
          - `id` (string, required)
          - `label` (string, required)
          - `hex` (string, optional)
          - `image` (string, optional): A color swatch image URL, when the supplier has one.
      - `display_dscnt` (boolean, optional): Display discontinued status: true when YoPrint displays the discontinued badge for this style.
      - `dscnt` (boolean, optional): Discontinued: true when the supplier discontinued the style.
      - `product_type` (string | null, optional): The supplier, such as `SSActivewear` or `SanMar`.
      - `size_data` (array of objects, optional)
        - Each item:
          - `id` (string, required)
          - `label` (string | null, required)
      - `style_name` (string | null, optional): The style number people see.
      - `title` (string | null, optional)
    - **Your variant product** (`variant`): `type` is `variant`. `attr_data` lists its live variants.
      - `type` (string, required): Always `"variant"`.
      - `product_type` (string, optional): Always `"variant"`.
      - `attr_data` (array of objects, required): One row per live variant.
        - Each item:
          - `id` (string, required): The variant id: the `db_variant` line's product id.
          - `phased_out` (boolean, required): True: new sales order and quote lines refuse this variant.
          - `price` (integer | number | string, required): The variant's `default_price`. Never null. Thousandths, an older encoding: `12500` is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (`1234.5` is 1.2345), or as a string (`"1234.5"`) when you send `X-Yoprint-Decimal-Format: exact-v1`. See [Money and quantities](/concepts/money-and-quantities/).
          - `available` (boolean, optional): The variant's enabled flag. Nothing enforces it: use `phased_out`.
          - `color_hex` (string | null, optional)
          - `color_id` (string | null, optional)
          - `color_image` (string, optional): Always empty for your own products.
          - `color_label` (string | null, optional)
          - `size_id` (string | null, optional)
          - `size_label` (string | null, optional)
          - `supplier_id` (string | null, optional)
          - `variant_deleted` (boolean, optional): Always false here: deleted variants are left out.
          - `weight` (number | string | null, optional)
      - `color_data` (array of objects, required)
        - Each item:
          - `id` (string, required)
          - `label` (string | null, required)
          - `hex` (string | null, optional)
      - `id` (string, required): The product id.
      - `size_data` (array of objects, required)
        - Each item:
          - `id` (string, required)
          - `label` (string | null, required)
      - `variant_type` (string, required): One of: `"size"`, `"color"`, `"size_color"`.
      - `brand` (string | null, optional)
      - `description` (string | null, optional)
      - `style_id` (string, optional): The same as `id`.
      - `title` (string | null, optional)
      - `trashed` (boolean, optional)
    - **Your simple product** (`simple`): `type` is `simple`.
      - `type` (string, required): Always `"simple"`.
      - `product_type` (string, optional): Always `"simple"`.
      - `id` (string, required): The product id: the `user_simple` line's product id.
      - `phased_out` (boolean, required): True: new sales order and quote lines refuse it.
      - `price` (integer | number | string | null, required): The selling price before pricing rules: `default_price`. Null when not set. Thousandths, an older encoding: `12500` is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (`1234.5` is 1.2345), or as a string (`"1234.5"`) when you send `X-Yoprint-Decimal-Format: exact-v1`. See [Money and quantities](/concepts/money-and-quantities/).
      - `title` (string | null, required)
      - `trashed` (boolean, required)
      - `brand` (string | null, optional)
      - `description` (string | null, optional)
      - `phased_out_at` (string (date-time) | null, optional)
      - `supplier_id` (string | null, optional)
      - `weight` (number | string | null, optional)
- `status` (integer, required)
- `success` (boolean, required)

Example response:

```json
{
  "data": {
    "attr_data": [
      {
        "available": true,
        "color_hex": "#000000",
        "color_id": "black",
        "color_image": "https://example.com/swatches/black.jpg",
        "color_label": "Black",
        "display_dscnt": false,
        "dscnt": false,
        "id": "ssa-B00000001",
        "provider": "ssa",
        "size_id": "0300",
        "size_label": "M",
        "updated_at": "2026-11-01T06:00:00+00:00",
        "weight": 0.4
      },
      {
        "available": true,
        "color_hex": "#000000",
        "color_id": "black",
        "color_image": "https://example.com/swatches/black.jpg",
        "color_label": "Black",
        "display_dscnt": false,
        "dscnt": false,
        "id": "ssa-B00000002",
        "provider": "ssa",
        "size_id": "0400",
        "size_label": "L",
        "updated_at": "2026-11-01T06:00:00+00:00",
        "weight": 0.45
      }
    ],
    "brand": "Example Brand",
    "color_data": [
      {
        "hex": "#000000",
        "id": "black",
        "image": "https://example.com/swatches/black.jpg",
        "label": "Black"
      }
    ],
    "display_dscnt": false,
    "dscnt": false,
    "id": "ssa-5000",
    "product_type": "SSActivewear",
    "size_data": [
      {
        "id": "0300",
        "label": "M"
      },
      {
        "id": "0400",
        "label": "L"
      }
    ],
    "style_id": "ssa-5000",
    "style_name": "5000",
    "title": "Heavy Cotton T-Shirt",
    "trashed": false,
    "type": "variant_catalog",
    "variant_type": "size_color"
  },
  "status": 200,
  "success": true
}
```

## Errors

- `401` The API key is missing or wrong (`unauthenticated`).
- `403` You are not allowed to do this. `api_access_not_in_plan`: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only `{"message": "Insufficient Permission"}`. Other refusals use the error envelope, with `unauthorized` or `user_is_not_authorized`.
- `404` Not found. `page_not_found`: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's. `code: null`, with a message that starts "No query results for": there is no record with that id.
  - When: A catalog product without a style, a catalog style without products, a variant without its product, or, with `context: mockup_editor`, a catalog style the team can't use for mockups: `error.code` is the number `404` and `error.message` is `product_not_found`. Nothing with this id at all (or a deleted product): `error.code` null. Fix: Check `type` and `id`.
- `422` The request was refused and changed nothing. `validation_failed` lists what to fix in `error.fields`; other codes name a business rule, explained in `error.message`. A few checks answer with only `{"message": "..."}`. An operation that calls another service (a payment provider, a carrier, an accounting app) can answer `connect_timeout` ("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.
  - When: `type` is not one of the five, `id` is missing, or `context` is not `mockup_editor`. `error.code` is `validation_failed`. Fix: Send both.

## Related

- [Get live supplier pricing for catalog products](https://developer.yoprint.com/reference/supplier-catalog/v1-real-time-data-fetcher-pricing.md): `POST /v1/api/store/{team_slug}/real_time_data_fetcher/pricing`
- [Add a line item to a sales order or quote](https://developer.yoprint.com/reference/sales-order-line-items/v2-order-item-store.md): `POST /v2/api/store/{team_slug}/v2/sales_order/{order_unique_key}/order_item`
- [Get stock levels for products](https://developer.yoprint.com/reference/product-stock/v1-misc-product-stock.md): `POST /v1/api/store/{team_slug}/product_stock`
