const product = await openbridge.products
.get('subscription-box')
.select(['sellingPlanGroups'])
product?.sellingPlanGroups.forEach((group) => {
console.log('Group:', group.name)
group.sellingPlans.forEach((plan) => {
console.log(' Plan:', plan.name)
console.log(' ID:', plan.id)
// Checkout charge info (deposit amount)
if (plan.checkoutCharge.type === 'PERCENTAGE') {
console.log(' Deposit:', plan.checkoutCharge.value.percentage + '%')
} else {
console.log(' Deposit:', plan.checkoutCharge.value.amount?.amount)
}
})
})