# Warranty, quantity and plan rules (/ai/reference/catalog/product-policies)

Toolset `product_policies`, 11 tools.

## Records [#records]

### `platform_restriction` [#platform_restriction]

What the plan has locked for one limit, such as products over the plan allowance. meter names the limit.

- Permission: `products.read`
- Tools: `platform_restriction_list`

Filters on the list:

| Filter | Type | Required | Description |
| --- | --- | --- | --- |
| `meter` | string | yes | The limit, such as products |

### `variant_quantity_rule` [#variant_quantity_rule]

The least, most and step a shopper may buy of a variant, set by a wholesale quantity rule. List all variants of one product with product_id; get takes &lt;product id>/&lt;variant id> and answers null rule fields when the variant has none.

- Permission: `products.read`
- Tools: `variant_quantity_rule_list`, `variant_quantity_rule_get`

Filters on the list:

| Filter | Type | Required | Description |
| --- | --- | --- | --- |
| `product_id` | string | yes | The product whose variants to read |

### `warranty_policy` [#warranty_policy]

A warranty a product can carry: activation, support and replacement windows in days. One policy is the store default for products without their own; product_warranty_set assigns one.

- Permission: `products.read`
- Tools: `warranty_policy_list`, `warranty_policy_get`

## Actions [#actions]

### `product_tier_visibility_set` [#product_tier_visibility_set]

Choose the wholesale tiers that see and the tiers that can buy a product.

Tiers are customer group ids of wholesale tiers. An empty list means everyone. Read the current setting with product_get include tier_visibility.

- Action key: `product_tier_visibility.set`
- Permission: `products.write`
- Approval: Waits for approval when the store requires it for this action.
- Effect: Changes the live store.
- Retries: safe to repeat with the same input.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `product_id` | string | yes |  |
| `visible_to_tiers` | list of string | yes | at most 50 items |
| `purchasable_by_tiers` | list of string | yes | at most 50 items |

Example input:

```json
{
  "product_id": "019bb58e-0ec1-79c1-9f40-d39d8d07674b",
  "visible_to_tiers": [
    "019bb264-41f3-7e69-8ba9-63ad646130e7"
  ],
  "purchasable_by_tiers": []
}
```

### `variant_quantity_rule_set` [#variant_quantity_rule_set]

Set the least, most and step a shopper may buy of one variant.

null clears a limit. The step must fit the limits: with a maximum, the maximum has to be reachable in steps from the minimum.

- Action key: `variant_quantity_rule.set`
- Permission: `products.write`
- Approval: Waits for approval when the store requires it for this action.
- Effect: Changes the live store.
- Retries: safe to repeat with the same input.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `product_id` | string | yes |  |
| `variant_id` | string | yes |  |
| `min_quantity` | integer or null | yes | at least 1 |
| `max_quantity` | integer or null | yes | at least 1 |
| `quantity_step` | integer or null | yes | at least 1 |

Example input:

```json
{
  "product_id": "019bb58e-0ec1-79c1-9f40-d39d8d07674b",
  "variant_id": "019bb7f3-10ac-7f8b-b47e-f5cd71dff2e1",
  "min_quantity": 6,
  "max_quantity": 60,
  "quantity_step": 6
}
```

### `warranty_policy_create` [#warranty_policy_create]

Add a warranty policy products can be given.

- Action key: `warranty_policy.create`
- Permission: `products.write`
- Approval: Waits for approval when the store requires it for this action.
- Effect: Changes the live store.
- Retries: runs at most once; a repeat with the same idempotency key returns the first result.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | string | yes | at least 1 characters |
| `name` | string | yes | at least 1 characters |
| `template_key` | string |  | one of "digital_license_standard", "standard_warranty" |
| `activation_window_days` | integer | yes | Days after delivery to activate. above 0 |
| `support_window_days` | integer or null | yes | Null for no support window. above 0 |
| `replacement_window_days` | integer | yes | above 0 |
| `replacement_after_window_guaranteed` | boolean |  |  |
| `is_active` | boolean |  |  |
| `is_default` | boolean |  |  |

Example input:

```json
{
  "code": "std-12",
  "name": "Standard 12 months",
  "activation_window_days": 30,
  "support_window_days": null,
  "replacement_window_days": 365
}
```

### `warranty_policy_delete` [#warranty_policy_delete]

Delete a warranty policy; products that carried it fall back to the store default.

- Action key: `warranty_policy.delete`
- Permission: `products.write`
- Approval: Always waits for a person to approve it.
- Effect: Changes the live store.
- Destructive: in compact mode it runs with `run_destructive_action`.
- Retries: safe to repeat with the same input.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `policy_id` | string | yes | Warranty policy ID from warranty_policy_list |

Example input:

```json
{
  "policy_id": "019bb819-4494-70f4-a487-4e536b0d042e"
}
```

### `warranty_policy_set_default` [#warranty_policy_set_default]

Choose the warranty policy products without their own use.

Pass null for no default.

- Action key: `warranty_policy.set_default`
- Permission: `products.write`
- Approval: Waits for approval when the store requires it for this action.
- Effect: Changes the live store.
- Retries: safe to repeat with the same input.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `policy_id` | string or null | yes |  |

Example input:

```json
{
  "policy_id": "019bb819-4494-70f4-a487-4e536b0d042e"
}
```

### `warranty_policy_update` [#warranty_policy_update]

Change the windows, name or state of a warranty policy.

Only the fields passed change; at least one is needed.

- Action key: `warranty_policy.update`
- Permission: `products.write`
- Approval: Waits for approval when the store requires it for this action.
- Effect: Changes the live store.
- Retries: safe to repeat with the same input.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `policy_id` | string | yes | Warranty policy ID from warranty_policy_list |
| `code` | string |  | at least 1 characters |
| `name` | string |  | at least 1 characters |
| `template_key` | string |  | one of "digital_license_standard", "standard_warranty" |
| `activation_window_days` | integer |  | Days after delivery to activate. above 0 |
| `support_window_days` | integer or null |  | Null for no support window. above 0 |
| `replacement_window_days` | integer |  | above 0 |
| `replacement_after_window_guaranteed` | boolean |  |  |
| `is_active` | boolean |  |  |

Example input:

```json
{
  "policy_id": "019bb819-4494-70f4-a487-4e536b0d042e",
  "replacement_window_days": 730
}
```
