Magento 2 API Add Shipping Information To Cart For Guest Customer

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

0   0
Eecrets Magento
profile kop 16th May 2025

Whats up! I just would like to give a huge thumbs up for the nice data you have here on this post. I will probably be coming back to your blog for extra soon. 루피카지노

Write a comment ...
Post comment
Cancel
profile kop 16th May 2025

I’ll immediately grab your rss as I can’t find your e-mail subscription link or e-newsletter service. Do you’ve any? Please let me know in order that I could subscribe. Thanks. 텐텐벳

Write a comment ...
Post comment
Cancel
profile kop 16th May 2025

Excellent post however I was wanting to know if you could write a litte more on this topic? I’d be very thankful if you could elaborate a little bit more. Thank you! 지니카지노

Write a comment ...
Post comment
Cancel
profile kop 16th May 2025

Thanks  for another informative website. The place else may I am getting that type of info written in such an ideal means? I’ve a undertaking that I’m just now operating on, and I have been on the glance out for such info. 라바카지노

Write a comment ...
Post comment
Cancel
profile kop 16th May 2025

Of course, what a magnificent site and illuminating posts, I will bookmark your website.Have an awsome day! 짱구카지노

Write a comment ...
Post comment
Cancel
profile kop 9th May 2025

Hi there! I could have sworn I’ve been to this web site before butafter looking at a few of the posts I realized it’s new to me.Anyhow, I’m definitely pleased I found it and I’ll be book-marking it and checkingback often! 티비착

Write a comment ...
Post comment
Cancel
profile kop 9th May 2025

Hi there, after reading this remarkable pieceof writing i am also glad to share my knowledge here with friends. 여기여

Write a comment ...
Post comment
Cancel
profile kop 9th May 2025

Hey! This is my first comment here so I just wanted to give a quick shoutout and say I really enjoy reading your blog posts. Can you recommend any other blogs. 티비위키

Write a comment ...
Post comment
Cancel
profile kop 9th May 2025

It’s actually very complex in this full of activity life to listen news on Television, thus I simplyuse the web for that purpose, and take the most up-to-dateinformation. 주소모아

Write a comment ...
Post comment
Cancel
profile kop 9th May 2025

Excellent blog you’ve got here.. It?s digficult to find high qualitywriting like yours these days. I seriously appreciate individuals like you!Take care!! 링크사랑

Write a comment ...
Post comment
Cancel
profile kop 9th May 2025

Hey there,  You’ve done a fantastic job. I’ll definitely digg it and personally suggest to my friends.I’m confident they will be benefited from this site. 툰코

Write a comment ...
Post comment
Cancel
profile kop 9th May 2025

I every time used to read piece of writing in news papers but now as I ama user of net thus from now I am using net for articlesor reviews, thanks to web. 마나토끼

Write a comment ...
Post comment
Cancel
profile kop 8th May 2025

As soon as I found this internet site I went on reddit to share some of the love with them. 누누티비

Write a comment ...
Post comment
Cancel
profile kop 8th May 2025

These are actually impressive ideas in about blogging.You have touched some good factors here.Any way keep up wrinting. 온카123

Write a comment ...
Post comment
Cancel
profile kop 7th May 2025

Hello my loved one! I wish to say that this post is awesome, nice written and come with almost all important infos. I’d like to see more posts like this . 해시게임

Write a comment ...
Post comment
Cancel

Related Post

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