@plentymarkets/shop-api / userAddressGetters
Variable: userAddressGetters ​
constuserAddressGetters:object
Defined in: getters/userAddressGetters.ts:247
Type Declaration ​
getAddresses ​
getAddresses: (
addresses,criteria?) =>Address[]
Returns the list of addresses, optionally filtered by the given criteria.
Parameters ​
addresses ​
Address[]
The array of address objects.
criteria? ​
unknown
Optional search criteria (currently unused in filtering logic).
Returns ​
Address[]
The original addresses array, or an empty array if not provided.
getAddressWithoutId ​
getAddressWithoutId: (
address) =>Address
Removes the id field from the address and returns the modified address.
Parameters ​
address ​
The address object.
Returns ​
The address object with the id property deleted.
getApartmentNumber ​
getApartmentNumber: (
address) =>string|number
Returns the apartment/house number of the address.
Parameters ​
address ​
The address object.
Returns ​
string | number
The apartment value, or 0 if not set.
getBirthday ​
getBirthday: (
address) =>string
Returns the birthday of the address holder.
Parameters ​
address ​
The address object.
Returns ​
string
The birthday string, or an empty string if not set.
getCity ​
getCity: (
address) =>string
Returns the city of the address.
Parameters ​
address ​
The address object.
Returns ​
string
The city string, or an empty string if not set.
getCompanyName ​
getCompanyName: (
address) =>string
Returns the company name of the address holder.
Parameters ​
address ​
The address object.
Returns ​
string
The company name string, or an empty string if not set.
getCountryId ​
getCountryId: (
address) =>string
Returns the country ID of the address as a string.
Parameters ​
address ​
The address object.
Returns ​
string
The country ID string, or "0" if not set.
getCountryName ​
getCountryName: (
address,countries) =>string
Returns the country name for the address by looking it up in the given country list.
Parameters ​
address ​
The address object.
countries ​
Country[]
The array of available countries.
Returns ​
string
The country name, or an empty string if the country is not found.
getDefault ​
getDefault: (
addresses) =>Address|null
Returns the primary (default) address from a list of addresses.
Parameters ​
addresses ​
Address[]
The array of address objects.
Returns ​
Address | null
The first address marked as primary, or null if none is found.
getEmail ​
getEmail: (
address) =>string
Returns the email address of the address holder.
Parameters ​
address ​
The address object.
Returns ​
string
The email string, or an empty string if not set.
getFirstName ​
getFirstName: (
address) =>string
Returns the first name of the address holder.
Parameters ​
address ​
The address object.
Returns ​
string
The first name string, or an empty string if not set.
getId ​
getId: (
address) =>string
Returns the unique ID of the address as a string.
Parameters ​
address ​
The address object.
Returns ​
string
The address ID string, or an empty string if not set.
getLastName ​
getLastName: (
address) =>string
Returns the last name of the address holder.
Parameters ​
address ​
The address object.
Returns ​
string
The last name string, or an empty string if not set.
getPhone ​
getPhone: (
address) =>string
Returns the phone number of the address holder.
Parameters ​
address ​
The address object.
Returns ​
string
The phone number string, or an empty string if not set.
getPostCode ​
getPostCode: (
address) =>string
Returns the postal code of the address.
Parameters ​
address ​
The address object.
Returns ​
string
The zip code string, or an empty string if not set.
getPostNumber ​
getPostNumber: (
address) =>string
Returns the post number (Packstation identifier) of the address.
Parameters ​
address ​
The address object.
Returns ​
string
The post number string, or an empty string if not set.
getProvince ​
getProvince: (
address) =>string
Returns the province or state of the address.
Parameters ​
address ​
The address object.
Returns ​
string
The state string, or an empty string if not set.
getStateId ​
getStateId: (
address) =>string
Returns the state ID of the address as a string.
Parameters ​
address ​
The address object.
Returns ​
string
The state ID string, or "0" if not set.
getStateName ​
getStateName: (
address,countries) =>string
Returns the state name for the address, formatted with a trailing comma and space. Looks up the state in the country's state list using the address's country and state IDs.
Parameters ​
address ​
The address object.
countries ​
Country[]
The array of available countries.
Returns ​
string
The formatted state name string (e.g. "Bavaria, "), or an empty string if not found.
getStreetName ​
getStreetName: (
address) =>string
Returns the street name of the address.
Parameters ​
address ​
The address object.
Returns ​
string
The street name string, or an empty string if not set.
getStreetNumber ​
getStreetNumber: (
address) =>string|number
Returns the street/house number (apartment field) of the address.
Parameters ​
address ​
The address object.
Returns ​
string | number
The apartment/house number, or an empty string if not set.
getTotal ​
getTotal: (
addresses) =>number
Returns the total number of addresses in the list.
Parameters ​
addresses ​
Address[]
The array of address objects.
Returns ​
number
The number of addresses, or 0 if the array is empty.
getVatNumber ​
getVatNumber: (
address) =>string
Returns the VAT number of the address holder.
Parameters ​
address ​
The address object.
Returns ​
string
The VAT number string, or an empty string if not set.
isDefault ​
isDefault: (
address) =>boolean
Returns whether the address is marked as the primary (default) address.
Parameters ​
address ​
The address object.
Returns ​
boolean
true if the primary flag is a positive number, otherwise false.