
## Create a quote

`POST /v1/quotes`

Creates a new quote in CRM.

## Request fields (body)

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `title` | string | no | Quote name. If omitted, Bitrix24 assigns a name containing the quote number |
| `opportunity` | number | no | Amount. To prevent the amount from being recalculated from line items, pass it together with `isManualOpportunity: true`. The camelCase name `amount` is also accepted |
| `isManualOpportunity` | boolean | no | `true` — manual amount mode (required if you set `opportunity`/`amount` directly). Accepts a boolean or the string `"Y"` |
| `currencyId` | string | no | Currency. List: `GET /v1/currencies` |
| `stageId` | string | no | Status: `DRAFT`, `SENT`, `APPROVED`. List: `GET /v1/statuses?filter[entityId]=QUOTE_STATUS` |
| `dealId` | number | no | Deal ID. Lookup: `GET /v1/deals` |
| `contactId` | number | no | Contact ID. Lookup: `GET /v1/contacts` |
| `companyId` | number | no | Company ID. Lookup: `GET /v1/companies` |
| `assignedById` | number | no | Assignee ID. Employee list: `GET /v1/users` |
| `comments` | string | no | Comment |
| `begindate` | datetime | no | Start date |
| `closedate` | datetime | no | Close date |

No field is required, but the body must contain at least one field.

> **Field names.** In responses, fields are returned in camelCase: `amount`, `currency`, `beginDate`, `closeDate`. On write, both forms are accepted: these camelCase names and the Bitrix24-native `opportunity` / `currencyId` / `begindate` / `closedate`. The API layer maps them to the names Bitrix24 expects.

Full list of fields: [GET /v1/quotes/fields](/docs/entities/quotes/fields). User fields (`ufCrm_*`) are also accepted.

## Examples

### curl — personal key

```bash
curl -X POST https://vibecode.bitrix24.com/v1/quotes \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Quote for server hardware",
    "opportunity": 1500,
    "isManualOpportunity": true,
    "currencyId": "USD",
    "stageId": "DRAFT",
    "dealId": 741,
    "assignedById": 1
  }'
```

### curl — OAuth application

```bash
curl -X POST https://vibecode.bitrix24.com/v1/quotes \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Quote for server hardware",
    "opportunity": 1500,
    "isManualOpportunity": true,
    "currencyId": "USD",
    "stageId": "DRAFT",
    "dealId": 741,
    "assignedById": 1
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/quotes', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Quote for server hardware',
    opportunity: 1500,
    isManualOpportunity: true,
    currencyId: 'USD',
    stageId: 'DRAFT',
    dealId: 741,
    assignedById: 1,
  }),
})

const { success, data } = await res.json()
console.log('Quote ID:', data.id)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/quotes', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Quote for server hardware',
    opportunity: 1500,
    isManualOpportunity: true,
    currencyId: 'USD',
    stageId: 'DRAFT',
    dealId: 741,
    assignedById: 1,
  }),
})

const { success, data } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | `true` when the quote is created |
| `data` | object | The created quote. The main fields are listed in the rows below; all fields — [Quote fields](/docs/entities/quotes/fields) |
| `data.id` | number | ID of the created quote |
| `data.title` | string | Name |
| `data.amount` | number | Amount |
| `data.currency` | string | Currency |
| `data.stageId` | string | Status |
| `data.dealId` | number | Deal ID |
| `data.assignedById` | number | Assignee |
| `data.createdBy` | number | Creator |
| `data.createdTime` | datetime | Creation date |
| `data.updatedTime` | datetime | Modification date |

The response contains all quote fields, including user fields (`ufCrm_*`). The main ones are shown above.

The URL of the quote card in Bitrix24 is built from `id`:

```
https://<portal>.bitrix24.com/crm/type/7/details/<id>/
```

`7` — the `entityTypeId` of a quote in Bitrix24. `<portal>` — the Bitrix24 portal domain. Access is restricted by the employee's permissions in Bitrix24.

## Response example

```json
{
  "success": true,
  "data": {
    "id": 412,
    "title": "Quote for server hardware",
    "amount": 1500,
    "isManualOpportunity": true,
    "currency": "USD",
    "stageId": "DRAFT",
    "dealId": 741,
    "contactId": 0,
    "companyId": 0,
    "assignedById": 1,
    "createdBy": 1,
    "comments": "",
    "beginDate": "2026-04-15T00:00:00.000Z",
    "closeDate": "2026-05-15T00:00:00.000Z",
    "createdTime": "2026-04-15T10:30:00.000Z",
    "updatedTime": "2026-04-15T10:30:00.000Z"
  }
}
```

## Error response example

403 — no scope:

```json
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'crm' scope"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 403 | `SCOPE_DENIED` | The API key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 400 | `EMPTY_CREATE_BODY` | The request body is empty — pass at least one field |
| 400 | `INVALID_REQUEST` | Invalid fields |
| 400 | `READONLY_FIELD` | The request body contains a read-only field, such as `clientTitle`. Such fields are marked in the RO column of [Quote fields](/docs/entities/quotes/fields) |

Full list of common API errors — [Errors](/docs/errors).

## See also

- [Working with files in CRM fields](/docs/recipes/crm-files)
- [List quotes](/docs/entities/quotes/list)
- [Quote fields](/docs/entities/quotes/fields)
- [Entity API](/docs/entity-api)
- [Filtering syntax](/docs/filtering)
- [Batch](/docs/batch)
- [Limits and optimization](/docs/optimization)
