Skip to main content

Customers

The customers model manages saved addresses for authenticated users. Customer addresses can be used during checkout (via shippingAddressId / billingAddressId) instead of entering inline addresses each time.

Authentication Required

All CustomerService methods require authentication. Guest users must provide addresses inline during checkout.

Customer Service​

The CustomerService provides methods to manage customer addresses.

getAddresses​

Retrieves all saved addresses for the authenticated customer.

getAddresses(authorization?: string): Observable<Customers.Model.CustomerAddresses>

Returns​

Paginated list of CustomerAddress.

getAddress​

Retrieves a specific address by ID.

getAddress(
params: GetAddressParams,
authorization?: string
): Observable<Customers.Model.CustomerAddress | undefined>

Parameters​

ParameterTypeDescription
params.idstringAddress ID (required)

createAddress​

Creates a new saved address.

createAddress(
data: CreateAddressBody,
authorization?: string
): Observable<Customers.Model.CustomerAddress>

Body Parameters​

ParameterTypeDescription
labelstringLabel e.g. "Home", "Work" (optional)
isDefaultbooleanSet as default address (optional)
addressAddressAddress data (required)

updateAddress​

Updates an existing address.

updateAddress(
params: UpdateAddressParams,
data: UpdateAddressBody,
authorization?: string
): Observable<Customers.Model.CustomerAddress>

deleteAddress​

Deletes a saved address.

deleteAddress(
params: DeleteAddressParams,
authorization?: string
): Observable<void>

setDefaultAddress​

Sets an address as the default for the customer.

setDefaultAddress(
params: SetDefaultAddressParams,
authorization?: string
): Observable<Customers.Model.CustomerAddress>

Data Model Structure​

Saved addresses are used during checkout when the customer selects a previously saved address instead of entering a new one.

Types​

CustomerAddress​

FieldTypeDescription
idstringUnique identifier
customerIdstringCustomer ID
labelstringLabel e.g. "Home", "Work" (optional)
isDefaultbooleanIs default address (optional)
addressAddressAddress data
createdAtstringISO 8601 timestamp
updatedAtstringISO 8601 timestamp

Address​

Shared address type used in carts, checkout, orders, and customer addresses.

FieldTypeDescription
firstNamestringFirst name (optional)
lastNamestringLast name (optional)
countrystringCountry code (required)
districtstringDistrict (optional)
regionstringRegion (optional)
streetNamestringStreet name (required)
streetNumberstringStreet number (optional)
apartmentstringApartment (optional)
citystringCity (required)
postalCodestringPostal code (required)
emailstringEmail (optional)
phonestringPhone (optional)

CustomerAddresses​

Paginated list of customer addresses.

type CustomerAddresses = Pagination.Paginated<CustomerAddress>;