Magento – Magento 2 – How to call REST API to register a new customer

apicustomermagento2

In Magento2, How to call REST API to register a new customer (What APIs need to call step by step). Thanks!

Best Answer

Refer below link for Magento 2.x version. http://devdocs.magento.com/swagger/index_20.html#/

I have used below body for creating customers through Rest Api and it worked properly.

Url : http://www.xxxxxxxx.com/rest/V1/customers

Type: POST

Content-Type : application/json

payload Data:

  {
     "customer": {
         "email": "abc@gmail.com",
         "firstname": "Abc",
         "lastname": "Xyz"   

     },
     "password": "Abc@123456"
  }

Response:

 {
    "id": 4,
    "group_id": 1,
    "created_at": "2017-01-27 18:35:48",
    "updated_at": "2017-01-27 18:35:48",
    "created_in": "Default Store View",
    "email": "abc@gmail.com",
    "firstname": "Abc",
    "lastname": "Xyz",
    "store_id": 1,
    "website_id": 1,
    "addresses": [],
    "disable_auto_group_change": 0
}

Call through postman see example in attachment:

Register customer using Magento2 rest api