Magento 2 API Add Shipping Information To Cart For Guest Customer


ENDPOINT : /rest/V1/guest-carts/{cartId}/shipping-information
e.g : http://localhost.magento.com/rest/V1/guest-carts/DnsT4UjkMPPdID4K53h4ToaXMSElc8pI/shipping-information
METHOD : POST
HEADERS : Content-Type application/json
Authorization : Bearer
PAYLOAD:
{ "addressInformation": {
"shipping_address": {
"region": "New York",
"region_id": 43,
"region_code": "NY",
"country_id": "US",
"street": [
"123 Oak Ave"
],
"postcode": "35004",
"city": "Purchase",
"firstname": "Jane",
"lastname": "Doe",
"email": "jdoe@example.com",
"telephone": "512-555-1111"
},
"billing_address": {
"region": "New York",
"region_id": 43,
"region_code": "NY",
"country_id": "US",
"street": [
"123 Oak Ave"
],
"postcode": "35004",
"city": "Purchase",
"firstname": "Jane",
"lastname": "Doe",
"email": "jdoe@example.com",
"telephone": "512-555-1111"
},
"shipping_carrier_code": "freeshipping",
"shipping_method_code": "freeshipping"
}
}
// We are passing shipping and billing address with shipping code. You can change the address as well as shipping method of your choice
Response :
{
"payment_methods": [
{
"code": "cashondelivery",
"title": "Cash On Delivery"
},
{
"code": "banktransfer",
"title": "Bank Transfer Payment"
},
{
"code": "checkmo",
"title": "Check / Money order"
}
],
"totals": {
"grand_total": 27,
"base_grand_total": 27,
"subtotal": 32,
"base_subtotal": 32,
"discount_amount": -5,
"base_discount_amount": -5,
"subtotal_with_discount": 27,
"base_subtotal_with_discount": 27,
"shipping_amount": 0,
"base_shipping_amount": 0,
"shipping_discount_amount": 0,
"base_shipping_discount_amount": 0,
"tax_amount": 0,
"base_tax_amount": 0,
"weee_tax_applied_amount": null,
"shipping_tax_amount": 0,
"base_shipping_tax_amount": 0,
"subtotal_incl_tax": 32,
"shipping_incl_tax": 0,
"base_shipping_incl_tax": 0,
"base_currency_code": "USD",
"quote_currency_code": "USD",
"items_qty": 1,
"items": [
{
"item_id": 26,
"price": 32,
"base_price": 32,
"qty": 1,
"row_total": 32,
"base_row_total": 32,
"row_total_with_discount": 0,
"tax_amount": 0,
"base_tax_amount": 0,
"tax_percent": 0,
"discount_amount": 0,
"base_discount_amount": 0,
"discount_percent": 0,
"price_incl_tax": 32,
"base_price_incl_tax": 32,
"row_total_incl_tax": 32,
"base_row_total_incl_tax": 32,
"options": "[]",
"weee_tax_applied_amount": null,
"weee_tax_applied": null,
"name": "Strive Shoulder Pack"
}
],
"total_segments": [
{
"code": "subtotal",
"title": "Subtotal",
"value": 32
},
{
"code": "discount",
"title": "Discount (You Save)",
"value": -5
},
{
"code": "shipping",
"title": "Shipping & Handling (Free Shipping - Free)",
"value": 0
},
{
"code": "tax",
"title": "Tax",
"value": 0,
"extension_attributes": {
"tax_grandtotal_details": []
}
},
{
"code": "testdiscount",
"title": "Discount (You Save)",
"value": -5
},
{
"code": "grand_total",
"title": "Grand Total",
"value": 27,
"area": "footer"
}
]
}
} // return all the available payment methods with cart information

I used to be suggested this blog through my cousin. I’m not sure whether this put up is written by him as no one else know such distinctive about my problem. You’re amazing! Thank you! 누누티비
I used to be able to find good advice from your blog posts. more info

Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also https://www.cashplan.link/

I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day! 아지툰

I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day! 아고다 할인코드
I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day! 호텔스닷컴 할인코드

Loving the information on this internet site , you have done great job on the blog posts. taegeuknews.com
Loving the information on this internet site , you have done great job on the blog posts. 나트랑카지노

The post is written in very a good manner and it contains many useful information for me. 옥상방수
The post is written in very a good manner and it contains many useful information for me. 토토사이트
The post is written in very a good manner and it contains many useful information for me. 롤대리
The post is written in very a good manner and it contains many useful information for me. 마사지

Im no expert, but I believe you just made an excellent point. You certainly fully understand what youre speaking about, and I can truly get behind that. interstic.io
Im no expert, but I believe you just made an excellent point. You certainly fully understand what youre speaking about, and I can truly get behind that. 스포츠중계

i read a lot of stuff and i found that the way of writing to clearifing that exactly want to say was very good so i am impressed and ilike to come again in future.. 롤대리

Thank you so much for the post you do. I like your post and all you share with us is up to date and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job. torus789

You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! 토토커뮤니티

I appreciate everything you have added to my knowledge base.Admiring the time and effort you put into your blog and detailed information you offer.Thanks. 카지노솔루션

I appreciate everything you have added to my knowledge base.Admiring the time and effort you put into your blog and detailed information you offer.Thanks. 아이피임대

I learn some new stuff from it too, thanks for sharing your information. 안전놀이터

I just found this blog and have high hopes for it to continue. Keep up the great work, its hard to find good ones. I have added to my favorites. Thank You. 먹튀검증사이트
Please rotate your device
We don't support landscape mode on your device. Please rotate to portrait mode for the best view of our site