Question: On the `Checkout Page` after filling in the shipping address and checking the check box: my billing and shipping address are the same on the payment method

it returns the error:

> 
> Please check the billing address information. `firstname` is required.
> Enter and try again. `lastname` is required. Enter and try again.
> "street" is required. Enter and try again. "city" is required. Enter
> and try again. "telephone" is required. Enter and try again.
> "postcode" is required. Enter and try again. `regionId` is required.
> Enter and try again.
> 
> 
> 

It now requires that I uncheck the checkbox: my billing and shipping address are the same and enter a billing address there too for the order to be placed successfully.

I would prefer to just check the checkbox: my billing and shipping address are the same to place the order successfully.

[![Screenshot of the Error](https://i.stack.imgur.com/lPfym.png)](https://i.stack.imgur.com/lPfym.png)

Answer: 
Try to add below script in the `vendor\magento\module-checkout\view\frontend\templates\success.phtml`

```
<script>
     require([
         'Magento_Customer/js/customer-data'
     ], function (customerData) {
         var sections = ['cart'];
         customerData.invalidate(sections);
         customerData.reload(sections, true);
     });
 </script>

```
For anyone else who stumbles across this same problem. The issue seems to be that you need to invalidate the cart local storage on the success callback of the place order function in checkout. There are two ways to accomplish this. 

1. Manually with in your javascript success callback from a successful place order operation:

```
customerData.invalidate(['cart']);

```

2. Using the sections.xml like so:

```
<action name="rest/*/V1/guest-carts/*/payment-information">
    <section name="cart"/>
</action>

```

Basically, built in mage code (customer-data.js) monitors for post or put requests to the URL supplied in the name attribute and invalidates the cart or whatever customerData section key you supply here. See the core codebase for examples of how this gets used.
More information explaining the second method here:
<https://alanstorm.com/understanding-the-limitations-of-sectionsxml/>

Most built in methods seem to use the sections.xml. I noticed a bug in the built in amazon pay module that would result in a stale minicart after a successful checkcout. Attempting to resolve this, I was unable to get the sections.xml method to work properly because of the way that payment flow works. I used the first method invalidating the customerData storage on the place order success callback to resolve the issue.