Customer Methods

A customer object holds data for the logged in customer. This object is different from a NetSuite customer record, because it holds information for the given shopping session only.

The following Customer methods are available:

addAddress(address)

Adds an address for current customer.

Parameters
Returns

String - key of added address.

Supported Domains

Checkout

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

addCreditCard(creditcard)

Adds a credit card for current customer.

Note:

This method is not compatible with SuiteCommerce 2019.1 if the Payments Instruments feature is enabled. SuiteScript methods should be used instead.

Parameters
Returns

String - key of added credit card.

Supported Domains

Checkout

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

emailCustomer(subject, body)

Sends email to current customer with given subject and body.

Parameters
Returns

No value returned.

Supported Domains

Checkout

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

getAddress(addressid, fields)

Gets address with given ID for current customer.

Parameters
Returns

Object of type address.

Supported Domains

Checkout

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

getAddressBook(fields)

Gets all addresses for current customer

Parameters
Returns

Array of objects of type address.

Supported Domains

Checkout

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

getCampaignSubscriptions(fields)

Gets subscription information for the current customer

Parameters
Returns

Array of objects of type subscriptions.

Supported Domains

Checkout, Shopping

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

getCampaignSubscriptions(subscriptionId,fields)

Gets data for a single campaign subscription with passed id.

Parameters
Returns

Array of objects of type subscriptions

Supported Domains

Checkout, Shopping

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

getCreditCard(creditcardid, fields)

Gets credit card with given ID for current customer.

Note:

This method is not compatible with SuiteCommerce 2019.1 if the Payments Instruments feature is enabled. SuiteScript methods should be used instead.

Parameters
Returns

Object of type creditcard.

Supported Domains

Checkout

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

getCreditCards(fields)

Gets all credit cards for current customer.

Note:

This method is not compatible with SuiteCommerce 2019.1 if the Payments Instruments feature is enabled. SuiteScript methods should be used instead.

Parameters
Returns

Array of objects of type creditcard.

Supported Domains

Checkout

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

getCustomerSegments()

Gets all customer segments to which the current customer belongs.

Parameters

No parameters to set.

Returns

Array of objects with the field:

Supported Domains

Shopping, Checkout

Login Required?

No

Back to Customer Methods | Back to Shopping Objects

getCustomFields()

Gets custom fields on customer record for current customer.

Parameters

No parameters to set.

Returns

Object with custom field names.

Supported Domains

Checkout, Shopping

Login Required?

No

Back to Customer Methods | Back to Shopping Objects

getCustomFieldValues()

Gets custom field values on customer record for current customer.

Parameters

No parameters to set.

Returns

Object with custom field values. Multiple field values are separated by the Unicode character 'ENQUIRY' ("\u0005").

Supported Domains

Checkout, Shopping

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

getFieldValues(fields)

Gets standard field values on customer record for current customer.

Parameters
Returns

Object of type customer.

Supported Domains

Checkout

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

isGuest()

Checks whether the shopper is logged in as a guest. Returns False when the shopper is not logged in or is logged in as a customer.

Parameters

No parameters to set.

Returns

Boolean

Supported Domains

Checkout, Shopping

Login Required?

No

Back to Customer Methods | Back to Shopping Objects

removeAddress(addressid)

Removes address with given ID from current customer's list of addresses.

Parameters
Returns

No value returned.

Supported Domains

Checkout

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

removeCreditCard(creditcardid)

Removes given credit card from current customer.

Note:

This method is not compatible with SuiteCommerce 2019.1 if the Payments Instruments feature is enabled. SuiteScript methods should be used instead.

Parameters
Note:

Websites on SuiteCommerce versions earlier than 2019.1 must have a patch applied to be compatible with the Payments Instruments feature. See <link to patch documentation>. If the correct patch has been applied, the Payment Instruments feature is enabled, and the credit card has been tokenized, the creditcardid parameter should contain the numerical ID of the payment token.

Returns

No value returned.

Supported Domains

Checkout

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

setLoginCredentials(customer)

Sets login credentials for current guest customer.

Parameters
Returns

No value returned.

Supported Domains

Checkout

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

updateAddress(address)

Updates a specified address.

Parameters
Returns

No value returned.

Supported Domains

Checkout

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

updateCampaignSubscriptions(subscriptions)

Updates a specified campaign subscription.

Parameters
Returns

No value returned.

Supported Domains

Checkout, Shopping

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

updateCreditCard(creditcard)

Updates given credit card for current customer.

Note:

This method is not compatible with SuiteCommerce 2019.1 if the Payments Instruments feature is enabled.

Parameters
Note:

If given ccnumber does not match an existing record, internalid is ignored and a new credit card record is added for customer.

Returns

String - key of added or updated credit card.

Supported Domains

Checkout

Login Required?

Yes

Back to Customer Methods | Back to Shopping Objects

updateProfile(customer)

Updates profile of current customer.

Parameters
Returns

No value returned.

Supported Domains

Checkout

Login Required?

Yes

Related Topics:

Customer Methods
Input Parameters/Return Values for Shopping Object Methods
Order Methods
PageGenerator Methods
StandardTagLibrary Methods
Shopping Objects

General Notices