How to get Bill Address.

Description :
To get the billing address of the order we can use the following code.

Code :

var cart = container.getComponent("Cart");
cart.getBillAddress().then(function(billaddress) {
    if (billaddress.isresidential == "T") {
        // Do work related to Sunday shipments for residential addresses.
        // ...
    }
});

Returns
Deferred
:

Returns a Deferred object. If the promise is resolved, it returns an Address. If the promise is rejected, it returns an error.

Address : Represents an address record in NetSuite.

NameTypeDescription
internalidStringThe internal ID of the address record in NetSuite.
zipStringThe postal code of the address.
countryStringThe two-letter country code of the address, for example, “CA”, “IE”, or “US”.
addr1StringThe first line of the address.
addr2StringThe second line of the address.
addr3StringThe third line of the address.
cityStringThe city name.
companyStringThe company name.
defaultbillingBooleanIndicates whether the address is the default billing address (T) or a secondary address (F).
defaultshippingBooleanIndicates whether the address is the default shipping address (T) or a secondary address (F).
fullnameStringThe customer’s full name.
isresidentialBooleanIndicates whether the address is a residential address (T) or a business address (F).
isvalidBooleanIndicates whether the address is currently valid (T) or invalid (F).
phoneStringThe phone number associated with the address.
stateStringThe state or province.

Leave a comment

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