Skip to main content

Function: loadBundleData()

loadBundleData(id, options?): Promise<PublicBundleData>

Load bundle data from the specified source

Parameters

ParameterTypeDescription
idstringThe external product ID (Shopify product ID)
options?OptionsConfiguration for data source and parameters

Returns

Promise<PublicBundleData>

Promise resolving to bundle data result with success/error handling

Example

// Load from online store
const result = await loadBundleData({
source: 'online_store',
external_product_id: '123456789',
country_code: 'US'
});

if (result.success) {
console.log('Bundle data:', result.data);
} else {
console.error('Error:', result.error.message);
}

// Load from Shopify Storefront API
const result2 = await loadBundleData({
source: 'shopify_storefront',
external_product_id: '123456789',
country_code: 'US',
shopify_storefront_access_token: 'your-token-here'
});