> The index of all pages is at [llms.txt](https://developers.qliro.com/llms.txt). Add `.md` to any page URL for its Markdown.

# Load checkout (/qliro-checkout/get-started/load-checkout)

## Overview

When the customer is ready to pay, load the checkout:

1. Send a create order request. Qliro responds with an order ID.
2. Use the order ID in a get order request. The response contains an HTML snippet.
3. Use the HTML snippet to render the checkout iframe.

![Load Checkout](<https://developers.qliro.com/assets/load-checkout_uid_66a00657e75c3-J4PTTqCx.webp>)

## Create order

Create order defines the checkout for the customer. It sets the order items, customer information, available shipping methods and merchant-provided metadata.

The CreateOrder response contains the key to the customer order, the `OrderID`.

For request and response parameters and error codes, see the [API Reference](https://developers.qliro.com/api-reference/merchant/orders/create-order).

### How-to

1. Generate your authentication token.
2. Send a POST request to `checkout/merchantapi/orders`.
3. Read the OrderID from the response.

**Request**

This example contains only the required parameters.

```json
{
  "MerchantReference": "MerchantUniqueReference",
  "MerchantApiKey": "MerchantApiKey",
  "Country": "SE",
  "Currency": "SEK",
  "Language": "sv-se",
  "MerchantConfirmationUrl": "https://merchant.com/confirmation/",
  "MerchantTermsUrl": "https://merchant.com/terms/",
  "OrderItems": [
    {
      "MerchantReference": "RedHat",
      "Description": "Red hat original product",
      "Type": "Product",
      "Quantity": 1,
      "PricePerItemIncVat": 375.55,
      "PricePerItemExVat": 300.35
    }
  ]
}
```

**Response**

```json
{
  "OrderId": 12345
}
```

### Good to know

* Add any customer information you already have to the CreateOrder request. Qliro adjusts its customer authentication flow to it. If more information is needed, the checkout prompts the customer after it renders.
* For integrated shipping, see [Integrated shipping](https://developers.qliro.com/qliro-checkout/checkout-features/integrated-shipping).

## Get order

Get order returns the order information: customer information, shipping methods, merchant-provided metadata and payment methods. The response contains the HTML snippet that renders the checkout.

Until the customer completes the order, the checkout status is inProcess and the list of order items is empty.

For request and response parameters and error codes, see the [API Reference](https://developers.qliro.com/api-reference/merchant/orders/get-order).

### How-to

1. Use the `OrderID` or your `MerchantReference`.
2. Send a GET request to `checkout/merchantapi/orders/{OrderId}` or `checkout/merchantapi/orders/?merchantReference={MerchantReference}`.
3. Read the checkout data from the response.

## Render checkout snippet

### How-to

1. Read the HTML snippet from the get order response.
2. Paste the snippet into the DOM where you want the Qliro Checkout iframe.
3. Render the page.

**Response**

```json
{
  "OrderHtmlSnippet": "Qlirocheckoutsnippet",
  "OrderId": 12345,
  "MerchantReference": "MerchantUniqueReference",
  "TotalPrice": 0,
  "Currency": "SEK",
  "Country": "SE",
  "Language": "sv-se",
  "CustomerCheckoutStatus": "InProcess",
  "OrderItems": [],
  "IdentityVerification": {},
  "MerchantProvidedMetadata": []
}
```

![Load Checkout](<https://developers.qliro.com/assets/load-checkout_uid_66a0069ce5c18-C77_YIuc.webp>)

### Good to know

* To know when the checkout has rendered, use the optional `onCheckoutLoaded` listener. See [Listeners](https://developers.qliro.com/qliro-checkout/frontend-features/listeners).
* Consider the following when you decide the padding:
  * The iframe has no maximum or minimum width.
  * The iframe content has a maximum width of 500px + 2px (padding-left = padding-right = 1px).
  * The iframe content is always centered. The left and right margins adapt to the total size of the iframe.
  * The iframe content has no minimum width. You can set a minimum width on the parent container of the iframe. The components then do not shrink below that width.

<Cards>
<Card title="Render thank you page" href="/qliro-checkout/get-started/render-thank-you-page">
Continue to Render thank you page
</Card>
</Cards>