Description
Preconditions
- Magento 2.2.5 installed with sample data , PHP 7.1 and MYSQL 5.6 With Ngnix
- Create Customer token and a quote with items that would be used to add shipping and billing information
- A saved customer address .
Steps to reproduce
Hit the products REST api rest/V1/carts/mine/billing-address with generated customer token in above state with a similar body as below
{
"address": {
"customerAddressId":"{{ saved customer address id }}",
"countryId":"MY",
"regionId":"572",
"regionCode":"MLK",
"region":"Melaka",
"street":[
"My home Any Floor, any Tower ,",
"Unknown Road"
],
"telephone":"",
"postcode":"12345",
"city":"Melaka",
"firstname":"Vishwas",
"lastname":"Bhatnagar"
}
}
Check the response of the Call
Expected result
Success and Returns quote address id
Actual result
"message": "Unable to save address. Please check input data.",
"trace": "#0 [internal function]: Magento\Quote\Model\BillingAddressManagement->assign(26, Object(Magento\Quote\Model\Quote\Address\Interceptor), false)\n#1 /vagrant/digi-magento/vendor/magento/module-webapi/Controller/Rest.php(330): call_user_func_array(Array, Array)\n#2 /vagrant/digi-magento/vendor/magento/module-webapi/Controller/Rest.php(239): Magento\Webapi\Controller\Rest->processApiRequest()\n#3 /vagrant/digi-magento/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))\n#4 /vagrant/digi-magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent('dispatch', Array)\n#5 /vagrant/digi-magento/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#6 /vagrant/digi-magento/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(26): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch', Array, Array)\n#7 /magento2/vendor/magento/framework/App/Http.php(135)
and a exception is generated
[2018-08-10 07:32:12] report.CRITICAL: No such entity with customerId = {"exception":"[object] (Magento\Framework\Exception\NoSuchEntityException(code: 0): No such entity with customerId = at vendor/magento/framework/Exception/NoSuchEntityException.php:50)"} []
Same stands for
- /V1/carts/mine/shipping-information
As it is a mine api the customer id should be populated from customer token