> ## 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.

# 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.
</Tip>

## 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**.
</Note>

## Next

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

[1]: ./add-alternative

[2]: ./add-quote-line

[3]: ../../../../sale/dev/index#currency


## Related topics

- [Create a quote document](/en/sale/learn/quote/create-quote-document.md)
- [Create Quote Alternative](/en/api/reference/restful/agent/quote_agent/create-quote-alternative.md)
- [Create Quote Line](/en/api/reference/restful/agent/quote_agent/create-quote-line.md)
- [Create alternatives](/en/automation/crmscript/howto/quote/add-alternative.md)
- [Create Quote Line From Product](/en/api/reference/restful/agent/quote_agent/create-quote-line-from-product.md)
- [NSQuoteAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteAgent.md)
