# POST /api/v1/orders/preview

> Preview (price) an order without creating it

- Group: products
- Tier: W
- Required scope: read:orders
- Docs: https://api.inleed.com/reference/products/preview-order

## Description

Returns `{currency, taxRate, lineItems[], totalGross, totalTax, totalNet, toPay, firstInvoiceDate, provisions[], createsOrder:false}`. `toPay` is the amount charged (VAT included); `totalGross` is before VAT. It buys nothing — call `create_order` to hand the human a payment link once the price looks right.

## Body

- `items` — object[] (required). The cart: one entry per plan you want to price. At least one, at most 50.
  - `service_plan_id` — integer (required). The catalogue plan id to buy — a plan's servicePlanId from list_products or get_product. It fixes the product and billing period.
  - `quantity` — integer. How many of this plan (1–99). Defaults to 1.
  - `domain` — string. The domain this line is for, where the product needs one (e.g. a hosting plan), like example.com.
  - `addons` — object[]. Addon services ordered together with this line (e.g. an extra IP, DirectAdmin on a VPS). Get valid options from get_addon_suggestions first.
    - `service_plan_id` — integer (required). The addon plan id — an options[].servicePlanId from get_addon_suggestions for this line's plan.
    - `quantity` — integer. How many of this addon (bounds come from get_addon_suggestions). Defaults to 1.
  - `config` — object. Per-product provisioning options. Only the keys valid for the line's product category are accepted — a wrong key is refused, never dropped.
    - `php_version` — string. Hosting lines only: the PHP version to provision with, e.g. 8.3.
    - `preinstall` — string. Hosting lines only: preinstall an application, e.g. wordpress.
    - `hostname` — string. VPS/dedicated lines only: the server hostname, e.g. vps1.example.com.
    - `operative_system` — string. VPS/dedicated lines only: the OS template name from list_vps_templates.
- `billing_address_id` — integer. Which billing profile to price against (currency and VAT come from it). Omit to use the account default.

## Request

```bash
curl -X POST "https://mcp.inleed.com/api/v1/orders/preview" \
  -H "Authorization: Bearer inl_live_…" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"service_plan_id":1,"quantity":1,"domain":"example.se","addons":[{"service_plan_id":1,"quantity":1}],"config":{"php_version":"8.3","preinstall":"example.se","hostname":"example.se","operative_system":"example.se"}}],"billing_address_id":1}'
```

## Errors

- **400**  — codes: invalid_request
- **401** No token was presented, or the token is revoked, expired or unknown. — codes: unauthorized, token_expired, token_revoked
- **403** The token lacks a required scope, or this account does not own the resource. — codes: insufficient_scope, not_owned
- **404** No such resource for this account. — codes: not_found
- **422** Validation error — codes: validation_failed
- **429** The rate limit for this token is exhausted. See `Retry-After`. — codes: rate_limited
- **500** Something went wrong on our side. The failure is logged against `requestId`. — codes: internal_error

## Related

- GET /api/v1/orders/{order} — https://api.inleed.com/reference/products/get-order
- GET /api/v1/orders — https://api.inleed.com/reference/products/list-orders
- POST /api/v1/orders — https://api.inleed.com/reference/products/create-order

