Skip to content

Adding billing information via mine API expects costumer id #17485

Closed
@wittyvishwas

Description

@wittyvishwas

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

Metadata

Metadata

Assignees

Labels

Component: Framework/WebapiUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just CatalogFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseup for grabs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions