Set address to a customer / contact from webstore

The customer method “addAddress(address)” can be used to set an address to a customer or contact from webstore in the suitescript file

addAddress(address)

Adds an address for current customer.

Parameters
  • address [required] {Object with values for fields}
    • addressee [required]
    • addr1 [required]
    • addr2 [optional]
    • addr3 [optional]
    • city [required]
    • state [required]
    • country [required]
    • zip [required]
    • phone [optional]
    • isresidential [optional]
    • defaultshipping [optional]
    • defaultbilling [optional]
Returns

String – key of added address.

Supported Domains

Checkout

Login Required?

Yes

Eg code:

customer.addAddress({
internalid: user_data.customerid,
addressee : user_data.firstname,
addr1 : user_data.Address_1,
city : user_data.city,
state : user_data.state,
zip : user_data.zip,
country : user_data.country,
phone : user_data.phone,
defaultshipping : ‘T’,
defaultbilling : ‘T’
});

Here, ‘user_data’ is the object containing all the address details of the customer.

Leave a comment

Your email address will not be published. Required fields are marked *