Memberid property seems to be missing?

The memberid property seems to be missing. Where is it?

using wixPaidPlans_onPlanPurchased(event) and according to the documentation:
onPlanPurchased - Velo API Reference - Wix.com event.order.memberid should be available, but doesn’t show up

created a events.jsw in the back end of the editor.

Product:
Wix Editor, velo code

What are you trying to achieve:
When someone buys a plan:

  1. create a group
  2. assign the user who bought the plan as the admin/owner of that group
import wixData from 'wix-data';
import wixPricingPlansBackend from 'wix-pricing-plans-backend';
import wixGroupsBackend from 'wix-groups-backend';
import { groups } from 'wix-groups-backend';
//import wixPricingPlansBackend from 'wix-pricing-plans-backend';

// when a content creator buys a creator plan, 
//1. create a group,
// 2. assign the creator account as the admin for that group
export function wixPaidPlans_onPlanPurchased(event)
 {
    const orderId = event.data.order._id;
    const eventId = event.metadata.id;
    const eventTime = event.metadata.eventTime;
    const planId = event.data.planId;
    const planName = event.data.planName;
    const order = event.order ;
    
    const groupInfo = {name:'My Group1'}; 

    if (planId == "f261519e-4c31-46b6-a621-1f4026686431" )
    {  
        groups.createGroup(groupInfo); 
    }
 }

The code above does not contain a reference to memberId. Can you share the code that isn’t working?

oh, sorry.

import wixData from 'wix-data';
import wixPricingPlansBackend from 'wix-pricing-plans-backend';
import wixGroupsBackend from 'wix-groups-backend';
import { groups } from 'wix-groups-backend';
//import wixPricingPlansBackend from 'wix-pricing-plans-backend';


// when a content creator buys a creator plan, 
//1. create a group,
// 2. assign the creator account as the admin for that group
export function wixPricingPlans_onPlanPurchased(event)
 {
    const orderId = event.data.order._id;
    const eventId = event.metadata.id;
    const eventTime = event.metadata.eventTime;
    const planId = event.data.planId;
    const planName = event.data.planName;
    //const order = event.order ;
    const groupInfo = {name:'My Anouncer', owner: event.order.memberid }; 

    console.log("Entered onPlanPurchased");
    console.log("Name: " + groupInfo.name.toString() );
    console.log("ownerID: " + groupInfo.owner.toString() );

    if (planId == "f261519e-4c31-46b6-a621-1f4026686431" )
    { 
        groups.createGroup(groupInfo); 
    }
 }

The parameter you are looking for is memberId, the i is capitalized.

When you use the above method, you will get undefined, as the parameter memberid doesn’t exist.

instead use

const groupInfo = {name:'My Anouncer', owner: event.order.memberId };

Hope this helps… Cheers!