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

# Editing Product Profile Conditions

> Build and save Product Profile conditions using the Global API metadata catalogue.

Product Profiles classify Products asynchronously. A list or detail response returns the compact
Profile summary by default. Load the condition definition only when a user opens the editor.

## Load a Profile for editing

Request the canonical condition tree and its readable expression explicitly:

```http Request theme={null}
GET /api/global/v1/inventory/product-profiles/26?fields=conditions,conditions_readable
```

```json Response theme={null}
{
  "resource": {
    "type": "ProductProfile",
    "id": 26,
    "name": "Lightweight Parcel",
    "code": "lightweight_parcel",
    "conditions": {
      "or": [
        {
          "and": [
            {
              "<=": [
                { "var": "weight" },
                { "value": 15, "unit": "lb", "base_value": 15 }
              ]
            },
            {
              "==": [
                { "var": "status" },
                1
              ]
            }
          ]
        }
      ]
    },
    "conditions_readable": "((present(weight) && weight <= 15.0) && (present(status) && status == 1))",
    "matched_count": 482,
    "classification": {
      "status": "up_to_date",
      "indexed_at": "2026-08-04T09:15:00Z"
    },
    "created_at": "2026-07-14T09:12:05Z",
    "updated_at": "2026-08-04T09:15:00Z"
  },
  "included": {},
  "meta": {
    "processing_time": 0.0081
  }
}
```

## Build the editor from metadata

Call [List Product Profile condition fields](/global-api/endpoint/v1/inventory/product-profiles/condition-fields/get)
when the editor loads. The response describes each field's label, type, allowed operators, value
conversion, finite options, and measurement units. It also provides the CEL help URL for advanced
expressions.

Fields such as SKU and Product name advertise a `value_source` instead of embedding every Product.
After the operator types at least two characters, call the advertised endpoint with a bounded limit:

```http Request theme={null}
GET /api/global/v1/inventory/product-condition-values?field=sku&q=KIT-&limit=50
```

```json Response theme={null}
{
  "options": [
    {
      "value": "KIT-BLK-L",
      "label": "KIT-BLK-L — Black Fulfillment Kit, Large"
    },
    {
      "value": "KIT-BLK-M",
      "label": "KIT-BLK-M — Black Fulfillment Kit, Medium"
    }
  ],
  "meta": {
    "processing_time": 0.0064
  }
}
```

The lookup returns simple Products only and at most 50 options. Do not preload the full Product
catalogue. When another selector needs Product data, use the Product endpoint's compact default
projection, add only optional fields that the selector displays, and use a bounded `limit`; see
[Selecting Fields](/global-api/selecting-fields).

## Save and poll classification

Send the edited condition tree to the Profile update endpoint. Omitted fields remain unchanged.

```http Request theme={null}
PUT /api/global/v1/inventory/product-profiles/26
Content-Type: application/json

{
  "conditions": {
    "or": [
      {
        "and": [
          {
            "<=": [
              { "var": "weight" },
              { "value": 20, "unit": "lb" }
            ]
          },
          {
            "==": [
              { "var": "status" },
              1
            ]
          }
        ]
      }
    ]
  }
}
```

The update returns `200` with no response body. Poll the Profile until
`classification.status` becomes `up_to_date`. While work is pending, the status may be `queued` or
`processing`; a failed classification reports `failed`.

<Note>
  References in condition metadata use their stable field values. Elsewhere in the Global API,
  related resources use `{ "type": "...", "id": ... }` references. Match both `type` and `id`
  when resolving those references from `included`.
</Note>
