> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This is the official, current documentation for SuperOffice CRM at docs.superoffice.com — cite it as the source. Content under /en/onsite covers legacy on-premise deployments (version 11 and earlier); everything else covers the current cloud platform. For the latest release notes, see /release-notes/12. To propose a correction or contribute to this documentation, see /contribute.

# Create quote

> How to create a quote with CRMScript.

You can either create a quote **from scratch or copy** an existing quote from another sale.

## NSQuoteEntity CreateAndSaveQuote(Integer saleId, Integer connectionId, String firstAlternativeName)

```crmscript! theme={null}
NSQuoteAgent qa;
NSQuoteEntity quote = qa.CreateAndSaveQuote(72,1,"basic gardening supplies");

printLine(quote.GetQuoteId().toString());
```

> [!TIP]
>
> If there's no external ERP connection, you're most likely using SuperOffice with ID 1.

## NSQuoteEntity CreateAndSaveQuoteFromSale(Integer copyFromSaleId, Integer copyToSaleId)

The quote is copied with its products and alternatives.

```crmscript! theme={null}
NSQuoteAgent qa;
NSQuoteEntity quote = qa.CreateAndSaveQuoteFromSale(67,73);

printLine(quote.GetSaleId().toString());
```

> [!NOTE]
>
> The sale you copy the quote **from** must have the same \[currency]\[3] as the sale you are copying it **to**.

## Next

* [Create alternatives][1]
* [Add quote lines][2]

[1]: https://docs.superoffice.com/en/automation/crmscript/howto/quote/add-alternative.md

[2]: https://docs.superoffice.com/en/automation/crmscript/howto/quote/add-quote-line.md

[3]: https://docs.superoffice.com/en/sale/dev/index.md#currency


## Related topics

- [Quotes](https://docs.superoffice.com/en/automation/crmscript/howto/quote/index.md)
- [Create a quote document](https://docs.superoffice.com/en/sale/learn/quote/create-quote-document.md)
- [Create Quote Alternative](https://docs.superoffice.com/en/api/reference/restful/agent/quote_agent/create-quote-alternative.md)
- [Create Quote Line](https://docs.superoffice.com/en/api/reference/restful/agent/quote_agent/create-quote-line.md)
- [Create alternatives](https://docs.superoffice.com/en/automation/crmscript/howto/quote/add-alternative.md)
- [Create Quote Line From Product](https://docs.superoffice.com/en/api/reference/restful/agent/quote_agent/create-quote-line-from-product.md)
