listCurrentMemberOrders Error: Failed to fetch

I am trying to get current members subscription status so I can redirect to members area or subscribe window. Login and currentMember.getMembers work fine. What’s missing?

import { orders } from 'wix-pricing-plans'; 

$w('#myListOrdersButton').onClick((event) => {
	orders.listCurrentMemberOrders()
	.then((ordersList) => {
	  const firstOrder = ordersList[0];
	  const firstOrderStatus = ordersList[0].status;

	  console.log('Your orders:', ordersList);
	  return ordersList;
	})
	.catch((error) => {
		console.error(error);
	})
});
Error: Ambassador client request failed: HTTP STATUS: -1 RESPONSE: "Failed to fetch" See the httpStatus and response fields for more information.
1 Like

I’m gonna bump this way up. Did you attempt to test in preview mode or was this on your live site? If I’m not mistaken listCurrentMemberOrders() won’t work properly in preview mode