> ## Documentation Index
> Fetch the complete documentation index at: https://superofficeas-worktree-351-fix-webapi-escaped-anchors.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Place order

> Create order based on quote version

Once the customer has accepted the quote, you can place the order.

## Create order based on quote version

To create an order, you have to select which alternative to use.

```crmscript! theme={null}
NSQuoteAgent qa;
Integer quoteAlternativeId = 9;
NSPluginUrlResponse order = qa.PlaceOrder(quoteAlternativeId, true, "256", "fall campaign", "ENG");

if (order.GetIsOk()) {
  printLine("Order placed successfully! " + order.GetUrl());
}
```

### Parameters

* ID of the alternative to place the order on
* Should the sale be set to sold? (bool)
* Purchase order number
* Comment
* Culture (for culture-sensitive data, such as dates or multi-language texts)

<Tip>
  To place an order for an **archived** version of the quote, call `CreateAndSaveQuoteVersion()` passing the ID of the old version. Then get the quote alternative ID from the newly created copy (which is now the active version).
</Tip>

## Get the order confirmation document

### String GetOrderConfirmation(Integer quoteVersionId, Integer confirmationTemplateId)

Generates a base64-encoded stream (PDF). No permanent document is created or stored anywhere!

```crmscript! theme={null}
NSQuoteAgent qa;
String orderConfirmation = qa.GetOrderConfirmation(1,1);

printLine(orderConfirmation.subString(0,20));
```

This example prints the 1st 20 characters of the stream.

<Tip>
  Learn more about [strings][1] and [documents][2].
</Tip>

[1]: ../../datatypes/string-type

[2]: ../document/index
