Search code examples
phpmagentomagento-soap-api

magento customer.create, only one store allowed?


I am working on a soap plugin to connect my CRM to Magento. When I study the customer.create soap api call I see that I need to define a website and a store id. http://www.magentocommerce.com/api/soap/customer/customer.create.html

  1. Is a user limited to just that store?
  2. or can the same user be "re-used" for another store?

For example:

  • A user limited to just one store

User: john doe registers: Hellofa-footwear.com gets user id: 403

Same user registers on another site with same credentials(email adress, etc..) registers: Yoking-matters.com gets user id: 404

  • A user gets re-used

User: john doe registers: Hellofa-footwear.com gets user id: 403

Same user registers on another site with same credentials(email adress, etc..) registers: Yoking-matters.com Userid 403 gets updated that this customer also shops on joking matters

Since I can't find this anywhere in the magento documentation.... I was wondering if someone here knows about the internal workings of magento.

The questions:

  1. Which scenario is being used by the magento soap api?
  2. If scenario 1. Does the user need to be added over and over for each individual consequent website?
  3. If scenario 1. Does the user get permissions/reused over multiple storeviews or does it also need to be added for each storeview it accesses?

Solution

  • If you log in Magento Admin panel and go to System / Configuration / Customer Configuration / Account sharing options, you'll see "Share Customer Accounts" option here. You can chose two options:

    1. Globally - means that if a customer created an account on one of websites of this Magento installation then he'll be able to log in with the same email/password on a different website
    2. per Website - means that customer must be created for each website separetly

    The store_id param in SOAP call is used by Magento to:

    1. Select correct email translation
    2. To check if this store is configured to sent customer sign up confirmation emails
    3. To save this value, so you'll be able to it in your custom logic somewhere on the site

    You can omit this param (or pass empty string). In this case store_id will be automatically populated with ID of default store of a website.