header

Magento 1.x Software Support Notice

For Magento Commerce 1, Magento is providing software support through June 2020. Depending on your Magento Commerce 1 version, software support may include both quality fixes and security patches. Please review our Magento Software Lifecycle Policy to see how your version of Magento Commerce 1 is supported.

For Magento Open Source 1.5 to 1.9, Magento is providing software security patches through June 2020 to ensure those sites remain secure and compliant. Visit our information page for more details about our software maintenance policy and other considerations for your business.

Customer Set

Edit this page on GitHub

Mage_Checkout

Module: Shopping Cart API

Resource: cart_customer

Method:

Allows you to add information about the customer to a shopping cart (quote).

Arguments:

Type Name Description
string sessionId Session ID
int quoteId Shopping cart ID
array customerData Array of shoppingCartCustomerEntity
string store Store view ID or code (optional)

Return:

Type Name Description
boolean result True if information is added

The shoppingCartCustomerEntity content is as follows:

Type Name Description
string mode
Customer mode
int customer_id
Customer ID
string email
Customer email address
string
firstname
Customer first name
string
lastname
Customer last name
string
password
Customer password
string
confirmation
Confirmation flag
int website_id
Website ID
int store_id
Store ID
int group_id
Group ID

Faults:
No Faults.

Examples

Request Example SOAP V1
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');

$shoppingCartId = $proxy->call( $sessionId, 'cart.create', array( 'magento_store' ) );
$customerAsGuest = array(
	"firstname" => "testFirstname",
	"lastname" => "testLastName",
	"email" => "testEmail",
	"website_id" => "0",
	"store_id" => "0",
	"mode" => "guest"
);
$resultCustomerSet = $proxy->call($sessionId, 'cart_customer.set', array( $shoppingCartId, $customerAsGuest) );
Request Example SOAP V2
$client = new SoapClient('http://magentohost/api/v2_soap/?wsdl');
$session = $client->login('apiUser', 'apiKey');

$quoteId = $client->shoppingCartCreate($session);

$customerData = array(
    "firstname" => "testFirstname",
    "lastname" => "testLastName",
    "email" => "testEmail@mail.com",
    "mode" => "guest",
 "website_id" => "0"
      );

$resultCustomerSet = $client->shoppingCartCustomerSet($session, $quoteId, $customerData);