I want to load a previous generated quote in magento 2 using REST API. Directly on frontend using custom URL like "/myurl/cart/index" that should redirect to "/checkout/cart" with the products loaded. That I'm doing in API is the following:
1) POST /rest/V1/guest-carts
Return something like: bca5b94b97710599026d73h358e058f7
2) POST rest/V1/guest-carts/bca5b94b97710599026d73h358e058f7/items
{
"cartId": "bca5b94b97710599026d73h358e058f7",
"cart_item": {
"quote_id": "bca5b94b97710599026d73h358e058f7",
"sku": "mysku",
"qty": 1
}
}
the above return the item added. Then:
3) GET /rest/V1/guest-carts/bca5b94b97710599026d73h358e058f7
That return cart object:
{
"id": 21,
"created_at": "2018-07-30 18:07:14",
"updated_at": "2018-07-30 18:32:21",
"is_active": true,
"is_virtual": false,
"items": [
{
"item_id": 2,
"sku": "mysku",
"qty": 1,
"name": "Test",
"price": 150,
"product_type": "simple",
"quote_id": "5"
}
]
}
4) Then I've managed to load the quote in my controller with route "/myurl/cart/index" and I can see my quote loaded, something like:
Array
(
[entity_id] => 21
[store_id] => 1
[created_at] => 2018-07-30 18:07:14
[updated_at] => 2018-07-30 18:32:21
[converted_at] =>
[is_active] => 1
[is_virtual] => 0
[is_multi_shipping] => 0
[items_count] => 1
[items_qty] => 1.0000
[orig_order_id] => 0
[store_to_base_rate] => 0.0000
[store_to_quote_rate] => 0.0000
[base_currency_code] => USD
[store_currency_code] => USD
[quote_currency_code] => USD
[grand_total] => 150.0000
[base_grand_total] => 150.0000
[checkout_method] =>
[customer_id] =>
[customer_tax_class_id] => 3
[customer_group_id] => 0
[customer_email] =>
[customer_prefix] =>
[customer_firstname] =>
[customer_middlename] =>
[customer_lastname] =>
[customer_suffix] =>
[customer_dob] =>
[customer_note] =>
[customer_note_notify] => 1
[customer_is_guest] => 0
[remote_ip] =>
[applied_rule_ids] =>
[reserved_order_id] =>
[password_hash] =>
[coupon_code] =>
[global_currency_code] => USD
[base_to_global_rate] => 1.0000
[base_to_quote_rate] => 1.0000
[customer_taxvat] =>
[customer_gender] =>
[subtotal] => 150.0000
[base_subtotal] => 150.0000
[subtotal_with_discount] => 150.0000
[base_subtotal_with_discount] => 150.0000
[is_changed] => 1
[trigger_recollect] => 0
[ext_shipping_info] =>
[is_persistent] => 0
[gift_message_id] =>
)
Which is fine, but now I need to redirect to the cart/checkout in frontend with products loaded to display to the guest user/customer.. Is that possible without create an order?
Thanks,