Skip to content

Step 12. Register customer for the storeview associated with additional website [Web API Tutorial]

Ievgen Shakhsuvarov edited this page Jul 16, 2019 · 3 revisions

In this step, we assume that you started our tutorial with fresh Magento installation, otherwise you should check whether you have the same store_id and website_idas we have or replace with your values in the payload. Endpoint
POST http://<host>/rest/test/V1/customers

Headers
Content-Type application/json
Authorization: Bearer <admin_token>

Payload

{
   "customer" : {
      "store_id" : 2,
      "website_id" : 2,
      "lastname" : "Doe",
      "firstname" : "Jane",
      "email" : "jdoe@example.com",
      "addresses" : [
         {
            "defaultBilling" : true,
            "defaultShipping" : true,
            "firstname" : "Jane",
            "lastname" : "Doe",
            "region" : {
               "regionCode" : "NY",
               "regionId" : 43,
               "region" : "New York"
            },
            "countryId" : "US",
            "postcode" : "10755",
            "city" : "Purchase",
            "street" : [
               "123 Oak Ave"
            ],
            "telephone" : "512-555-1111"
         }
      ]
   },
   "password" : "Password1"
}

Response
Magento assigned this user id value of 1.

Complete cURL request

store_id=2 && website_id=2 && store_view_code="test" && curl -X POST $endpoint/$store_view_code/V1/customers \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer $admin_token" \
 -d '{"customer":{"store_id":2,"website_id":2,"lastname":"Doe","firstname":"Jane","email":"jdoe@example.com","addresses":[{"defaultBilling":true,"defaultShipping":true,"firstname":"Jane","lastname":"Doe","region":{"regionCode":"NY","regionId":43,"region":"New York"},"countryId":"US","postcode":"10755","city":"Purchase","street":["123 Oak Ave"],"telephone":"512-555-1111"}]},"password":"Password1"}' | json_pp

◀️ Previous Step 📖 Table of Contents Next Step ▶️

MSI Documentation:

  1. Technical Vision. Catalog Inventory
  2. Installation Guide
  3. List of Inventory APIs and their legacy analogs
  4. MSI Roadmap
  5. Known Issues in Order Lifecycle
  6. MSI User Guide
  7. DevDocs Documentation
  8. User Stories
  9. User Scenarios:
  10. Technical Designs:
  11. Admin UI
  12. MFTF Extension Tests
  13. Weekly MSI Demos
  14. Tutorials
Clone this wiki locally