Load checkout
Create an order, get the order and render the checkout iframe.
Overview
When the customer is ready to pay, load the checkout:
- Send a create order request. Qliro responds with an order ID.
- Use the order ID in a get order request. The response contains an HTML snippet.
- Use the HTML snippet to render the checkout iframe.

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.
How-to
- Generate your authentication token.
- Send a POST request to
checkout/merchantapi/orders. - Read the OrderID from the response.
Request
This example contains only the required parameters.
{
"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
{
"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.
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.
How-to
- Use the
OrderIDor yourMerchantReference. - Send a GET request to
checkout/merchantapi/orders/{OrderId}orcheckout/merchantapi/orders/?merchantReference={MerchantReference}. - Read the checkout data from the response.
Render checkout snippet
How-to
- Read the HTML snippet from the get order response.
- Paste the snippet into the DOM where you want the Qliro Checkout iframe.
- Render the page.
Response
{
"OrderHtmlSnippet": "Qlirocheckoutsnippet",
"OrderId": 12345,
"MerchantReference": "MerchantUniqueReference",
"TotalPrice": 0,
"Currency": "SEK",
"Country": "SE",
"Language": "sv-se",
"CustomerCheckoutStatus": "InProcess",
"OrderItems": [],
"IdentityVerification": {},
"MerchantProvidedMetadata": []
}
Good to know
- To know when the checkout has rendered, use the optional
onCheckoutLoadedlistener. See 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.