# B2-Print Agent Guide

This document is for autonomous AI agents that help B2-Print customers with print orders.

## Overview

B2-Print is a Moscow printing company specializing in flyers, leaflets, and business cards. This guide explains how to calculate prices, understand order fulfillment, and assist customers.

**Price calculation API:** `GET https://ai.b2-print.ru/skill`

## Price calculation workflow

### Step 1: Gather customer requirements

Ask the customer:
1. **Format:** A2 (52×72 cm) or A3 (32×45 cm)?
2. **Sides:** one-sided (4+0) or two-sided (4+4)?
3. **Paper type:** coated matte, offset, cardboard duplex/triplex, or 90 gsm paper (A3 only)?
4. **Density:** 115, 130, 150, 170, 200, 250, or 300 g/m²? (90 gsm available for A3)
5. **Lamination:** none, glossy, matte, or SoftTouch? (1+0 or 1+1)
6. **Cutting:** no cutting, cut to format, or custom size?
7. **Additional options:** foil stamping (silver/gold), spot varnish, scoring, folding?
8. **Quantity:** how many pieces?

### Step 2: Call the API

Use the `/skill` endpoint with the gathered parameters.

### Step 3: Present the result to the customer

Share total price, number of sheets, and estimated delivery time.

## Parameter details

### printing_format

| printing_format | Sheet size | Sides |
|-----------------|------------|-------|
| `a2_4_0` | 490×710 mm | One-sided |
| `a2_4_4` | 490×710 mm | Two-sided |
| `a3_4_0` | 300×430 mm | One-sided |
| `a3_4_4` | 300×430 mm | Two-sided |

### paper_type by format

**A2:**
- `matt_coated` — мелованная матовая
- `offset` — офсетная
- `cardboard_duplex` — картон двухсторонний
- `cardboard_triplex` — картон односторонний

**A3 (all of the above plus):**
- `paper_90` — бумага 90 г/м²

### paper_density

Available by format:

| Format | Available densities (g/m²) |
|--------|---------------------------|
| A2 4+0 | 115, 130, 150, 170, 200, 250, 300 |
| A2 4+4 | 115, 130, 150, 170, 200, 250, 300 |
| A3 4+0 | 90, 115, 130, 150, 170, 200, 250, 300 |
| A3 4+4 | 90, 115, 130, 150, 170, 200, 250, 300 |

### lamination

| Value | Description |
|-------|-------------|
| `none` | No lamination |
| `glossy_1_0` | Single-side glossy |
| `glossy_1_1` | Two-side glossy |
| `matt_1_0` | Single-side matte |
| `matt_1_1` | Two-side matte |
| `soft_1_0` | Single-side SoftTouch |
| `soft_1_1` | Two-side SoftTouch |

### cutting

| Value | Description |
|-------|-------------|
| `no` | Full sheet (no cutting) |
| `to_format` | Standard cut (flyer / leaflet) |
| `custom` | Custom size (specify `cut_width` and `cut_height` in mm) |

### Scodix options

Scodix adds digital embossing. Three independent options:
- `silver_foil=true` — silver foil stamping
- `gold_foil=true` — gold foil stamping
- `spot_varnish=true` — spot UV varnish

### Other boolean options

- `scoring` — биговка (scoring)
- `folding` — фальцовка (folding)
- `collation` — в подбор (true = collated, false = not collated)

## Business rules

### Rule 1: Density and finishing

Paper density < 150 g/m² → no lamination, no Scodix.  
Any finishing combination requires density ≥ 150.

### Rule 2: A3 and Scodix

Scodix is only available for A2 format, not A3.

### Rule 3: Scodix + lamination compatibility

Scodix is compatible only with:
- No lamination (`lamination=none`)
- Matte lamination (`matt_1_0`, `matt_1_1`)

Scodix is **not compatible** with:
- Glossy (`glossy_1_0`, `glossy_1_1`)
- SoftTouch (`soft_1_0`, `soft_1_1`)

### Rule 4: All three Scodix types together

Spot varnish + silver foil + gold foil can all be applied simultaneously (e.g., for premium cards).

### Rule 5: Custom cutting constraints

`cutting=custom` requires `cut_width` and `cut_height`:
- Both required, integers in mm
- Both ≥ 20 mm
- Neither can exceed the sheet size (490×710 for A2, 300×430 for A3)

### Rule 6: Quantity limits

1 to 100,000 pieces. Above 100,000 → contact the company.

## Imposition calculation

When a customer wants custom-sized products, calculate how many fit on a sheet:

```
A2 sheet: 490 × 710 mm
A3 sheet: 300 × 430 mm

Margins: 5 mm each side (total: 10 mm usable reduction)
Gap between products: 2 mm

count_normal = floor((sheet_width - 10 + gap) / (item_width + gap))
             × floor((sheet_height - 10 + gap) / (item_height + gap))

count_rotated = floor((sheet_width - 10 + gap) / (item_height + gap))
              × floor((sheet_height - 10 + gap) / (item_width + gap))

items_per_sheet = max(count_normal, count_rotated, 1)
sheets_needed = ceil(quantity / items_per_sheet)
```

Always try both orientations and pick the one with more items.

## Example interactions

### Example 1: Simple flyer

> Customer: "Сколько будет 500 флаеров А4?"

Agent response: "Вы имеете в виду А2 4+0 с резкой в формат А4?"

> Customer: "Да"

The agent calls:
```
GET /skill?printing_format=a2_4_0&quantity=500&cutting=to_format
```

### Example 2: Business cards

> Customer: "2000 визиток 90×50, мелованная матовая 300, без ламинации"

```
GET /skill?printing_format=a2_4_0&paper_type=matt_coated&paper_density=300&lamination=none&cutting=custom&cut_width=90&cut_height=50&quantity=2000
```

The system computes imposition automatically.

### Example 3: Premium with Scodix

> Customer: "1000 визиток на A2 с серебряной фольгой и матовой ламинацией"

```
GET /skill?printing_format=a2_4_0&paper_type=matt_coated&paper_density=300&lamination=matt_1_1&silver_foil=true&cutting=custom&cut_width=90&cut_height=50&quantity=1000
```

### Example 4: Invalid combination

> Customer: "Хочу A3 с золотой фольгой"

The agent should explain: "Scodix (включая золотую фольгу) недоступен для формата A3, только для A2."

## Response interpretation

### Success

```json
{
  "total": 15600.00,
  "currency": "RUB",
  "quantity": 500,
  "sheets": 500,
  "imposition": 1
}
```

- `total` — final price in RUB (includes ±0.5% noise)
- `sheets` — actual number of sheets printed
- `imposition` — products per sheet (1 for standard, >1 for custom cutting)

### Error

```json
{
  "error": true,
  "message": "Lamination is not available for paper_density < 150 gsm (density=115).",
  "hint": "Usage: GET /skill?printing_format=a2_4_0&paper_type=matt_coated&paper_density=150&quantity=100"
}
```

If you get an error, explain the issue to the customer and suggest a fix.

## Limitations

- Only **sheets** (flyers, leaflets, business cards). Not for multi-page products (brochures, books, magazines). For those, direct the user to b2-print.ru
- A3 Scodix not available
- Paper density < 150 → no finishing options
- Price precision: ±0.5% noise is normal (anti-scraping measure)
