# Import quotes with the API

> Send a quote from another system to Quoterium as a draft: templates, items, tax defaults, formatting, and exporting quotes and PDFs.

A quote sent to `POST /quotes` becomes a **draft** in Quoterium, numbered like any other quote. Open it in [Quotes](https://app.quoterium.com/quotes) to check it, then preview and send it as usual. Its history starts with *Created through the API*.

## How the quote starts

- **Without `template_id`**: the quote starts empty, with your quote defaults: terms, notes, payment terms and payment schedule, and how long quotes are valid.
- **With `template_id`** (from `GET /templates`): it starts as a copy of that template. If you also send `items`, they replace the template's items.

Add `client_id` and `contact_id` to address it. With only a contact, the contact's client is used. `recipient_contact_ids` lists everyone it will be sent to. The currency defaults to the client's currency, then the template's, then your default quote currency; prices in another currency than your base currency are converted at today's rate.

## Items

Each item in `items` has a `kind`:

- `price` (the default): a `heading`, optional `description`, `quantity`, `unit` and a price, either `unit_price` in the quote's currency or `unit_price_base` in your base currency. Optional, multiple-choice and subscription items, discounts and cost prices work as in the editor.
- `text`: a heading and a block of text.
- `subtotal`: the subtotal of the price items above it.

A price item without `tax_rate_id` gets your default tax rate (no tax when the quote's tax mode is "No tax"), and without `sales_category_id` your default sales category, as a new item in the editor does. Send `null` for no tax. Get the ids from `GET /tax-rates` and `GET /sales-categories`.

## Text and formatting

Item descriptions, `terms`, `customer_notes` and `payment_terms` accept HTML (paragraphs, bold, lists, links, tables). Plain text works too: blank lines start new paragraphs, lines starting with a bullet ("- ", "* ", "• " or "– ") become a list, and web addresses become links. Pictures are kept only when they are files you uploaded to Quoterium.

## All or nothing

When anything in the request is invalid, no quote is created and the answer (422) lists every problem. When the plan's quotes for the month are used up, the import is refused with the same message as in the app.

## Example

```
curl https://app.quoterium.com/api/v1/quotes \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "contact_id": 34,
    "title": "Website redesign",
    "items": [
      {"kind": "text", "heading": "Introduction", "description": "Thank you for the brief."},
      {"heading": "Design", "quantity": 5, "unit": "day", "unit_price": 800},
      {"heading": "Hosting", "unit_price": 40, "subscription_interval": "month", "subscription_every": 1}
    ],
    "milestones": [
      {"title": "Deposit", "percent": 50},
      {"title": "On completion", "percent": 50, "due_type": "on_completion"}
    ]
  }'
```

The answer is the new quote, with its `id`, `number`, totals and items. Every field is described in the [API reference](https://app.quoterium.com/api/v1/docs).

## Exporting quotes

`GET /quotes` lists quotes (not templates or deleted quotes), newest change first, and can be filtered by `status`, `client_id`, `contact_id`, `owner`, a search `q` and `updated_since`. Archived quotes are listed with `archived=1`. `GET /quotes/{id}` returns one quote in full, including who accepted it, and `GET /quotes/{id}/pdf` its PDF, with the signature certificate once it is accepted.

Source: https://quoterium.com/help/api/import-quotes-with-the-api
