Skip to content
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

Creating a customer via rest api: /V1/customers/me does not work #3887

Closed
Bbbrinks opened this issue Mar 24, 2016 · 6 comments
Closed

Creating a customer via rest api: /V1/customers/me does not work #3887

Bbbrinks opened this issue Mar 24, 2016 · 6 comments
Assignees
Labels
Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog

Comments

@Bbbrinks
Copy link

Steps to reproduce

  1. Install Magento from develop branch.
  2. Call /V1/customers/me rest api with (valid auth token) and body:
    {
    "email": "[email protected]",
    "firstname": "dsfsdf",
    "lastname": "sdsdf",
    "addresses": [
    {
    "firstname": "string",
    "lastname": "string"
    }
    ]
    }

Expected result

  1. The customer gets created and 200 is returned

Actual result

  1. 400 bad request
    {
    "message": "One or more input exceptions have occurred.",
    "errors": [
    {
    "message": "%fieldName is a required field.",
    "parameters": {
    "fieldName": "firstname"
    }
    },
    {
    "message": "%fieldName is a required field.",
    "parameters": {
    "fieldName": "lastname"
    }
    },
    {
    "message": "Invalid value of "%value" provided for the %fieldName field.",
    "parameters": {
    "fieldName": "email",
    "value": null
    }
    }
    ]
    }
@adderall
Copy link

adderall commented Apr 7, 2016

Now it works with:

curl -X POST "http://v2.website.com/index.php/rest/V1/customers" -H "Content-Type:application/json" -H "Authorization: Bearer xhfyo8cfvknpyd5dwuupe34uosh6tuhj" -d '{"customer": { "email": "[email protected]", "firstname": "First", "lastname": "Last", "storeId": 1, "websiteId": 1 }}' | json_pp

However, can somebody help me add the default address information into this request?

@sevos1984
Copy link
Contributor

@mbrinton01
Copy link

@sterfpaul Were you able to answer your question about how to create customer address information from the documentation?

@maksek maksek added the Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog label May 13, 2016
@maksek maksek closed this as completed May 13, 2016
@singh190
Copy link

singh190 commented Jun 8, 2017

I need to register customer via REST API. I have 'Consumer Key','Consumer Secret','Access Token' and 'Access Token Secret', created from Magento admin.
Please tell me how I can generate valid token and register customer using this details?

@mbrinton01
Copy link

Hello @singh190. Please use GitHub for bug reports only. For your question about how to use the REST API, please post on the Magento 2 Forums.

@khatariya
Copy link

{
"customer": {
"email": "[email protected]",
"firstname": "Abc",
"lastname": "Xyz"

 },
 "password": "Abc@123456"

}

magento-engcom-team pushed a commit that referenced this issue Mar 13, 2019
[TSG] Upporting for 2.3 (pr43) (2.3-develop)
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
Projects
None yet
Development

No branches or pull requests

9 participants