Use the DraftOrder and Checkout resources to create a checkout from a draft order

From the draft order:
const lineItems = draftOrder.line_items;
const newCartItems = lineItems.map((item) => ({
id: item.variant_id,
quantity: item.quantity,
}));

return fetch(‘/cart/add.js’, {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’,
},
body: JSON.stringify({
items: newCartItems,
}),
});