Addressing Missing Customer Address Names in ESHOPMAN Storefront SDK Responses
Understanding Customer Address Data in ESHOPMAN
For ESHOPMAN merchants and developers leveraging the powerful headless commerce capabilities, managing customer addresses is fundamental to a seamless shopping experience. ESHOPMAN, built on Node.js/TypeScript and integrated deeply with HubSpot, provides robust APIs for storefront management. However, a recent community discussion highlighted a specific behavior within the ESHOPMAN Storefront SDK concerning customer address data.
The Reported Issue: Missing 'address_name' Field
A developer reported that when fetching a customer's address list using the ESHOPMAN Storefront SDK, the address_name field was consistently missing from the returned address objects. This is critical because the address_name (e.g., 'Home', 'Office') is often used to help customers identify and select their preferred delivery or billing addresses, enhancing the user experience on ESHOPMAN-powered storefronts deployed via HubSpot CMS.
The issue occurs despite the address_name data being correctly stored and existing within the ESHOPMAN platform's database. This suggests an inconsistency in how the data is exposed through the SDK's API endpoint.
Technical Details and Reproduction Steps
The developer provided a clear sequence of steps to reproduce this behavior, which is invaluable for ESHOPMAN developers and the platform team to investigate and resolve. The setup involved an ESHOPMAN storefront built with Next.js and utilizing the latest version of the @eshopman/js-sdk (version 2 of the ESHOPMAN platform). The specific Node.js version was v25.2.1.
Steps to Reproduce:
- Create a customer address within the ESHOPMAN Admin API or storefront, ensuring an
address_name(e.g., "Home", "Office") is assigned. - Attempt to fetch the customer's addresses using the ESHOPMAN Storefront SDK with the following TypeScript code:
export const getCustomerAddresses = async () => {
const headers = await getAuthHeaders()
return await sdk.store.customer
.listAddress({}, headers)
.then(({ addresses }) => {
console.log(addresses) // Check the address objects here
return addresses
})
.catch(() => null)
}Expected vs. Actual Behavior:
- Expected Behavior: Each address object within the
addressesarray should include theaddress_namefield, alongside other correctly returned fields likefirst_name,last_name, andaddress_1. - Actual Behavior: The
address_namefield is observed to be missing or undefined in the response objects.
Impact on ESHOPMAN Storefronts and Development
This reported behavior has direct implications for ESHOPMAN developers building custom storefronts or integrating with HubSpot CMS. Applications relying on the address_name field for display, selection, or specific business logic will find this data unavailable through the standard SDK call. Developers might need to implement temporary workarounds, such as storing address names client-side or making additional API calls if such functionality is available, which adds complexity and potential performance overhead.
The ESHOPMAN team is aware of this reported issue, which has been flagged for triage. Community contributions and detailed bug reports like this are vital for refining the ESHOPMAN platform and ensuring its APIs and SDKs provide comprehensive and reliable data for all headless commerce operations.
Developers encountering similar issues are encouraged to review their SDK versions and ESHOPMAN platform configurations, and to contribute to the community knowledge base by sharing their findings and potential temporary solutions.