Multi User - Adding Sub-Accounts (Soap v2 API)


Adding Sub User accounts using the Soap v2 API

It is possible for developers to use the Soap v2 API to allow the creation, editing and deletion of sub accounts from external sources without the need to have log in credentials as either a User or as a site Administrator on the site.

To do this the developer will need session tokens for authentication. The documentation for the initial setup of the Soap API can be found by following this link.

When the API has been Configured the following three methods may be used along with the included parameters.


Create a new Sub Account profile

$result = $soap->subaccountCreate($session_id, array(
                ‘website_id’ => ‘3’,
                ‘store_id’ => ‘3’,
                ‘firstname’ => ‘cminds’,
                ‘lastname’ => ‘team’,
                ‘email’ => ‘team+1@cminds.com’,
                ‘password’ => ‘demo123’,
                ‘parent_customer_id’ =>‘159’,
                ‘permission’ => ‘4’,
                ‘view_all_orders’ => ‘1’,
                ‘can_see_cart’ => ‘1’,
                ‘have_access_checkout’ => ‘1’,
                ‘get_order_email’ => ‘1’,
                ‘get_order_invoice’ => ‘1’,
                ‘get_order_shipment’ => ‘1’,
            ));

Parameters details and options

  • website_id - This is the ID of the website. To obtain this go to System Manage Stores. Then hover over 'Main Store'.
  • store_id - The ID of the store. To obtain this go to System → Manage Stores. Then hover over the name of the store.
  • firstname - The first name of the user of the sub account being created.
  • lastname - The last name of the user of the sub account being created.
  • email - The email address of the user of the sub account being created.
  • password - The initial password to be assigned to the sub account being created.
  • parent_customer_id - The Customer ID of the Parent customer to be assigned to the sub user account.
  • permission - The permission level to be given to the sub account user.
    • 1 = Read Only
    • 2 = Modify Account
    • 3 = Order Creation
    • 4 = Order Creation and Modify Account
    • 5 = Read Only / Approval needed
    • Read more about the different Permission settings by clicking here.
  • view_all_orders - Determines whether the sub user can view all the orders of the parent user or just their own.
    • 1 = They can see all orders
    • 0 = They can only see their own
  • can_see_cart - Determines whether or not the sub account user can view the items they have added to their cart.
    • 1 = They can view items in their cart
    • 0 = They cannot view their cart
  • have_access_checkout - Sets whether or not the sub account user can proceed to the checkout page.
    • 1 = They can proceed to checkout
    • 0 = They cannot proceed to the checkout page
  • get_order_email - Defines whether or not the sub account user receives a confirmation email when they've placed the order
    • 1 = They do receive the confirmation email
    • 0 = They don't receive the confirmation email
  • get_order_invoice - Defines whether or not the sub account user receives an email with the invoice for the order
    • 1 = They do receive the order invoice
    • 0 = They do not receive the order invoice
  • get_order_shipment - Defines whether or not the sub account user receives a notification email when their order has been shipped.
    • 1 = They receive a shipment status notification email.
    • 0 = They do not receive a shipment status notification email.

Edit an existing Sub Account profile

$result = $soap->subaccountEdit($session_id, array(
                ‘firstname’ => ‘cminds222’,
                ‘lastname’ => ‘team444’,
                ‘email’ => ‘team+2@cminds.com’,
                ‘password’ => ‘demo123’,
                ‘permission’ => ‘4’,
                ‘view_all_orders’ => ‘1’,
                ‘can_see_cart’ => ‘0’,
                ‘have_access_checkout’ => ‘0’,
                ‘get_order_email’ => ‘1’,
                ‘get_order_invoice’ => ‘1’,
                ‘get_order_shipment’ => ‘1’,
                ‘customer_id’ => 141
            ));

Using the subaccountEdit method is almost identical to the subaccountCreate method with a few slight differences:

  • customer_id - This is the customer ID of the sub account to be edited. It is used as the identifier for the account. The rest of the parameters can be modified.
  • website_id  and  store_id  are not needed when editing a sub account profile.

Deleting a Sub Account profile

$result = $soap->subaccountDelete($session_id, array(
                ‘customer_id’ => 143
            ));

Finally the simplest of the three methods is the subaccountDelete method for removing Sub Account profiles.

This method only requires the customer_id of the sub account user.


Get more information about the Multi User Account Magento Extension

Find other Magento products at the CreativeMinds Magento Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center