---
title: "Create a quote"
url: "https://docs.unified.to/accounting/quote/Create_a_quote"
description: "Create a quote with Unified's Quote API (POST /accounting/{connection_id}/quote). Filter by fields and raw. Supported by 8 Quote integrations."
---
# Create a quote

 POST/accounting/{connection\_id}/quote

## Parameters

**fields**string array 

id

created\_at

updated\_at

quote\_number

reference

title

summary

payment\_terms

customer\_message

memo

contact\_id

contacts

issued\_at

expires\_at

sent\_at

accepted\_at

declined\_at

status

currency

currency\_rate

sub\_total\_amount

tax\_amount

discount\_amount

total\_amount

tax\_mode

lineitems

invoice\_id

project\_id

group\_id

category\_ids

url

organization\_id

metadata

raw

Fields to return

**raw**string 

Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar

**connection\_id**string  required 

ID of the connection

## Payload

**id**string 

**created\_at**date-time 

(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)

**updated\_at**date-time 

(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)

**quote\_number**string 

External identifier for this quote (Xero QuoteNumber, QBO DocNumber, NetSuite tranId)

**reference**string 

customer-side reference / PO number

**title**string 

short title (Xero Title, max 100)

**summary**string 

longer summary (Xero Summary, max 3000)

**payment\_terms** enum

Valid values:

 "ON\_RECEIPT" 

 "NET\_7" 

 "NET\_10" 

 "NET\_15" 

 "NET\_20" 

 "NET\_25" 

 "NET\_30" 

 "NET\_45" 

 "NET\_60" 

 "NET\_90" 

 "OTHER" 

unified payment terms enum, as on accounting\_invoice / accounting\_bill

**customer\_message**string 

customer-visible message

**memo**string 

internal note, not customer-visible

**contact\_id**string 

(reference to AccountingContact)

**contacts** array 

denormalized parties, reusing the transaction contact shape

**issued\_at**date-time 

Xero Date, QBO TxnDate (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)

**expires\_at**date-time 

Xero ExpiryDate, QBO ExpirationDate (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)

**sent\_at**date-time 

(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)

**accepted\_at**date-time 

(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)

**declined\_at**date-time 

(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)

**status** enum

Valid values:

 "DRAFT" 

 "SENT" 

 "ACCEPTED" 

 "DECLINED" 

 "INVOICED" 

 "EXPIRED" 

 "VOIDED" 

 "DELETED" 

where EXPIRED is derived (expires\_at < now), the source status is preserved in raw

**currency**string 

**currency\_rate**number 

exchange rate to the organization's base currency

**sub\_total\_amount**number 

**tax\_amount**number 

**discount\_amount**number 

**total\_amount**number 

**tax\_mode** enum

Valid values:

 "INCLUSIVE" 

 "EXCLUSIVE" 

 "NONE" 

INCLUSIVE / EXCLUSIVE / NONE; maps Xero LineAmountTypes (a boolean cannot represent NoTax)

**lineitems** array 

**invoice\_id**string 

populated once the quote is converted to an invoice; left null when the source cannot supply it (reference to AccountingInvoice)

**project\_id**string 

points to an AccountingProject (accounting costing project) (reference to TaskProject)

**group\_id**string 

points to a HRIS Group (reference to HrisGroup)

**category\_ids**string array 

tracking categories / classes (AccountingCategory dimensions)

**url**string 

public online-quote link where exposed

**organization\_id**string 

**metadata** array 

**raw** 

## Returns

[AccountingQuote](https://docs.unified.to/accounting/quote/model.md)

| Response field                        | Type                                                                                                                            | Required | Description                                                                                                                                                                         |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                                    | string                                                                                                                          | No       |                                                                                                                                                                                     |
| created\_at                           | string (date-time)                                                                                                              | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                                                                            |
| updated\_at                           | string (date-time)                                                                                                              | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                                                                            |
| quote\_number                         | string                                                                                                                          | No       | External identifier for this quote (Xero QuoteNumber, QBO DocNumber, NetSuite tranId)                                                                                               |
| reference                             | string                                                                                                                          | No       | customer-side reference / PO number                                                                                                                                                 |
| title                                 | string                                                                                                                          | No       | short title (Xero Title, max 100)                                                                                                                                                   |
| summary                               | string                                                                                                                          | No       | longer summary (Xero Summary, max 3000)                                                                                                                                             |
| payment\_terms                        | enum                                                                                                                            | No       | unified payment terms enum, as on accounting\_invoice / accounting\_bill Values: ON\_RECEIPT, NET\_7, NET\_10, NET\_15, NET\_20, NET\_25, NET\_30, NET\_45, NET\_60, NET\_90, OTHER |
| customer\_message                     | string                                                                                                                          | No       | customer-visible message                                                                                                                                                            |
| memo                                  | string                                                                                                                          | No       | internal note, not customer-visible                                                                                                                                                 |
| contact\_id                           | string                                                                                                                          | No       | (reference to AccountingContact)                                                                                                                                                    |
| contacts                              | [AccountingTransactionContact](https://docs.unified.to/accounting/quote/Create%5Fa%5Fquote.md#AccountingTransactionContact)\[\] | No       | denormalized parties, reusing the transaction contact shape                                                                                                                         |
| contacts\[\].id                       | string                                                                                                                          | Yes      |                                                                                                                                                                                     |
| contacts\[\].is\_customer             | boolean                                                                                                                         | No       |                                                                                                                                                                                     |
| contacts\[\].is\_supplier             | boolean                                                                                                                         | No       |                                                                                                                                                                                     |
| issued\_at                            | string (date-time)                                                                                                              | No       | Xero Date, QBO TxnDate (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                                                     |
| expires\_at                           | string (date-time)                                                                                                              | No       | Xero ExpiryDate, QBO ExpirationDate (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                                        |
| sent\_at                              | string (date-time)                                                                                                              | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                                                                            |
| accepted\_at                          | string (date-time)                                                                                                              | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                                                                            |
| declined\_at                          | string (date-time)                                                                                                              | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                                                                            |
| status                                | enum                                                                                                                            | No       | where EXPIRED is derived (expires\_at < now), the source status is preserved in raw Values: DRAFT, SENT, ACCEPTED, DECLINED, INVOICED, EXPIRED, VOIDED, DELETED                     |
| currency                              | string                                                                                                                          | No       |                                                                                                                                                                                     |
| currency\_rate                        | number                                                                                                                          | No       | exchange rate to the organization's base currency                                                                                                                                   |
| sub\_total\_amount                    | number                                                                                                                          | No       |                                                                                                                                                                                     |
| tax\_amount                           | number                                                                                                                          | No       |                                                                                                                                                                                     |
| discount\_amount                      | number                                                                                                                          | No       |                                                                                                                                                                                     |
| total\_amount                         | number                                                                                                                          | No       |                                                                                                                                                                                     |
| tax\_mode                             | enum                                                                                                                            | No       | INCLUSIVE / EXCLUSIVE / NONE; maps Xero LineAmountTypes (a boolean cannot represent NoTax) Values: INCLUSIVE, EXCLUSIVE, NONE                                                       |
| lineitems                             | [AccountingLineitem](https://docs.unified.to/accounting/quote/Create%5Fa%5Fquote.md#AccountingLineitem)\[\]                     | No       |                                                                                                                                                                                     |
| lineitems\[\].id                      | string                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].created\_at             | string (date-time)                                                                                                              | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                                                                            |
| lineitems\[\].updated\_at             | string (date-time)                                                                                                              | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                                                                            |
| lineitems\[\].refunded\_at            | string (date-time)                                                                                                              | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                                                                            |
| lineitems\[\].total\_amount           | number                                                                                                                          | No       | unit\_quantity \* unit\_amount + tax\_amount                                                                                                                                        |
| lineitems\[\].refund\_amount          | number                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].discount\_amount        | number                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].tax\_amount             | number                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].item\_id                | string                                                                                                                          | No       | (reference to CommerceItem)                                                                                                                                                         |
| lineitems\[\].unit\_amount            | number                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].unit\_quantity          | number                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].item\_sku               | string                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].item\_name              | string                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].item\_description       | string                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].notes                   | string                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].taxrate\_id             | string                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].account\_id             | string                                                                                                                          | No       | (reference to AccountingAccount)                                                                                                                                                    |
| lineitems\[\].category\_ids           | string\[\]                                                                                                                      | No       | (reference to AccountingCategory)                                                                                                                                                   |
| lineitems\[\].locations               | [AccountingReference](https://docs.unified.to/accounting/quote/Create%5Fa%5Fquote.md#AccountingReference)\[\]                   | No       |                                                                                                                                                                                     |
| lineitems\[\].locations\[\].id        | string                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].locations\[\].name      | string                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].item\_variants          | [AccountingReference](https://docs.unified.to/accounting/quote/Create%5Fa%5Fquote.md#AccountingReference)\[\]                   | No       |                                                                                                                                                                                     |
| lineitems\[\].item\_variants\[\].id   | string                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].item\_variants\[\].name | string                                                                                                                          | No       |                                                                                                                                                                                     |
| lineitems\[\].fees                    | [AccountingFee](https://docs.unified.to/accounting/quote/Create%5Fa%5Fquote.md#AccountingFee)\[\]                               | No       |                                                                                                                                                                                     |
| lineitems\[\].fees\[\].type           | enum                                                                                                                            | Yes      | Unified fee category Values: TAX, DISCOUNT, PROMOTION, SHIPPING, GIFT\_WRAP, COD, SURCHARGE, TIP, SERVICE\_CHARGE, OTHER                                                            |
| lineitems\[\].fees\[\].original\_type | string                                                                                                                          | No       | The provider's original fee label, e.g. "VAT" or a shipping carrier name                                                                                                            |
| lineitems\[\].fees\[\].amount         | number                                                                                                                          | Yes      |                                                                                                                                                                                     |
| lineitems\[\].fees\[\].currency       | string                                                                                                                          | No       | ISO 4217 currency code, e.g. USD                                                                                                                                                    |
| lineitems\[\].contact\_id             | string                                                                                                                          | No       | (reference to AccountingContact)                                                                                                                                                    |
| lineitems\[\].project\_id             | string                                                                                                                          | No       | ref -> AccountingProject; the project this line is coded to (reference to TaskProject)                                                                                              |
| lineitems\[\].exchange\_rate          | number                                                                                                                          | No       | The exchange rate applied to this line, for multi-currency documents                                                                                                                |
| lineitems\[\].is\_billable            | boolean                                                                                                                         | No       | True when the line is rebillable to a customer                                                                                                                                      |
| invoice\_id                           | string                                                                                                                          | No       | populated once the quote is converted to an invoice; left null when the source cannot supply it (reference to AccountingInvoice)                                                    |
| project\_id                           | string                                                                                                                          | No       | points to an AccountingProject (accounting costing project) (reference to TaskProject)                                                                                              |
| group\_id                             | string                                                                                                                          | No       | points to a HRIS Group (reference to HrisGroup)                                                                                                                                     |
| category\_ids                         | string\[\]                                                                                                                      | No       | tracking categories / classes (AccountingCategory dimensions)                                                                                                                       |
| url                                   | string                                                                                                                          | No       | public online-quote link where exposed                                                                                                                                              |
| organization\_id                      | string                                                                                                                          | No       |                                                                                                                                                                                     |
| metadata                              | [AccountingMetadata](https://docs.unified.to/accounting/quote/Create%5Fa%5Fquote.md#AccountingMetadata)\[\]                     | No       |                                                                                                                                                                                     |
| metadata\[\].id                       | string                                                                                                                          | No       |                                                                                                                                                                                     |
| metadata\[\].slug                     | string                                                                                                                          | No       |                                                                                                                                                                                     |
| metadata\[\].value                    | object                                                                                                                          | No       |                                                                                                                                                                                     |
| metadata\[\].namespace                | string                                                                                                                          | No       |                                                                                                                                                                                     |
| metadata\[\].format                   | enum                                                                                                                            | No       | Values: TEXT, NUMBER, DATE, BOOLEAN, FILE, TEXTAREA, SINGLE\_SELECT, MULTIPLE\_SELECT, MEASUREMENT, PRICE, YES\_NO, CURRENCY, URL                                                   |
| metadata\[\].extra\_data              | object                                                                                                                          | No       |                                                                                                                                                                                     |

## Errors

 Errors return the HTTP status code and a JSON body with `statusCode`, `error` (the short label) and `message` (a human-readable detail). 

```json
{
  "statusCode": 429,
  "error": "Too Many Requests",
  "message": "Too many requests to unified.to API; max requests per minute: N"
}
```

| Status | Error                 | Meaning                                           |
| ------ | --------------------- | ------------------------------------------------- |
| 400    | Bad Request           | The request was malformed or failed validation.   |
| 401    | Unauthorized          | The connection is likely broken; re-authorize it. |
| 403    | Forbidden             | The connection is missing permissions or scopes.  |
| 404    | Not Found             | The requested resource does not exist.            |
| 429    | Too Many Requests     | Rate limit exceeded (see the two sources below).  |
| 500    | Internal Server Error | An unexpected error occurred.                     |
| 501    | Not Implemented       | Not supported by this integration.                |

 Errors from the underlying integration pass through: the integration's status comes back as ours (429, 401, 403, 404 or 5xx), usually with its message. When the integration's error body is unclear, Unified extracts what it can and returns a clearer message. 

### 429 Too Many Requests

A 429 has two possible sources:

* The integration's own rate limit, passed through.
* Unified's workspace limit: a rolling 60 seconds, set by plan, with the message `Too many requests to unified.to API; max requests per minute: N`.

## Code Samples

### Node.js SDK

```javascript
import { UnifiedTo } from '@unified-api/typescript-sdk';

const sdk = new UnifiedTo({
    security: {
        jwt: '<YOUR_API_KEY_HERE>',
    },
});

const connectionId = '5de520f96e439b002043d8dc';

const results = await sdk.accounting.createAccountingQuote({ connectionId, accountingQuote: { }, 
    fields: '',
    raw: '',
 });
```

### Node.js (axios)

```javascript
const options = {
  method: 'POST',
  url: 'https://api.unified.to/accounting/5de520f96e439b002043d8dc/quote',
  headers: {
    authorization: 'bearer .....'
  },
  data: undefined,
  params: {
    fields: '',
    raw: '',
  }
};

const results = await axios.request(options);
```

### Java

```java
AsyncHttpClient client = new DefaultAsyncHttpClient();

client.prepare("POST", "https://api.unified.to/accounting/5de520f96e439b002043d8dc/quote?fields=&raw=")
  .setHeader("accept", "application/json")
  .setHeader("authorization", ".....")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
```

### Go

```go
import (
	"fmt"
	"net/http"
	"io/ioutil"
)

url := `https://api.unified.to/accounting/5de520f96e439b002043d8dc/quote?fields=&raw=

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("accept", "application/json")
req.Header.Add("authorization", ".....")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
```

### Python

```python
import requests

url = "https://api.unified.to/accounting/5de520f96e439b002043d8dc/quote?fields=&raw="

headers = {
    "accept": "application/json",
    "authorization": "....."
}

response = requests.post(url, headers=headers)
```

### PHP

```php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.unified.to/accounting/5de520f96e439b002043d8dc/quote?fields=&raw=",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "accept: application/json",
    "authorization: ....."
  ],
]);
```

### Ruby

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.unified.to/accounting/5de520f96e439b002043d8dc/quote?fields=&raw=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["authorization"] = '....'

response = http.request(request)
puts response.read_body
```

### cURL

```bash
curl --request POST \
  --url 'https://api.unified.to/accounting/5de520f96e439b002043d8dc/quote?fields=&raw=' \
  --header 'accept: application/json' \
  --header 'authorization: .....'
```
