Skip to content

Adding billing information via mine API expects costumer id #17485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wittyvishwas opened this issue Aug 10, 2018 · 7 comments
Closed

Adding billing information via mine API expects costumer id #17485

wittyvishwas opened this issue Aug 10, 2018 · 7 comments
Assignees
Labels
Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release up for grabs

Comments

@wittyvishwas
Copy link

wittyvishwas commented Aug 10, 2018

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

@magento-engcom-team
Copy link
Contributor

Hi @wittyvishwas. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me {$VERSION} instance

where {$VERSION} is version tags (starting from 2.2.0+) or develop branches (2.2-develop +).
For more details, please, review the Magento Contributor Assistant documentation.

@wittyvishwas do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Aug 10, 2018
@ghost ghost self-assigned this Aug 10, 2018
@ghost
Copy link

ghost commented Aug 10, 2018

@wittyvishwas, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. Please provide more detailed steps to reproduce or try to reproduce this issue on a clean installation or latest release.
default

@ghost ghost assigned ghost and unassigned ghost Aug 10, 2018
@wittyvishwas
Copy link
Author

wittyvishwas commented Aug 10, 2018

@engcom-backlog-pb Thank you for the prompt response , So the catch is if you have put in a random id that doesn't not exists it works , i am assuming that customerAddressId that you passed '65' is just copy pasted from my report does not actually exists . As mentioned in prerequisite you must have a saved address for the customer and pass that address id in above response

And if you add a node "customerId":"2", like below it works

{
"address": {
      "customerAddressId":"65",
       "customerId":"2",
      "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"
   }
}

Replace the above response with your customer_address_id and customerId of the user that you are using

@ghost ghost removed the Progress: needs update label Aug 10, 2018
@ghost
Copy link

ghost commented Aug 10, 2018

@wittyvishwas, thank you for your report.
We've acknowledged the issue and added to our backlog.

@ghost ghost added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Aug 10, 2018
@ghost ghost removed their assignment Aug 10, 2018
@pmclain pmclain self-assigned this Oct 19, 2018
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Oct 19, 2018

Hi @pmclain. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@sidolov
Copy link
Contributor

sidolov commented Oct 27, 2018

Hi @wittyvishwas. Thank you for your report.
The issue has been fixed in #18704 by @pmclain in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.1 release.

@sidolov sidolov added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Oct 27, 2018
gelanivishal pushed a commit to gelanivishal/magento2 that referenced this issue Oct 27, 2018
@magento-engcom-team
Copy link
Contributor

Hi @wittyvishwas. Thank you for your report.
The issue has been fixed in #18872 by @gelanivishal in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.8 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release up for grabs
Projects
None yet
Development

No branches or pull requests

4 participants