Event created via Velo API is Not Visible in Wix Events Dashboard

I’m having trouble with
I am trying to create a Recurring Event with wix-events.v2 APIs, Even though I receive Success and it shows Event Created but the Wix Event Dashboard doesn’t shows the created event. For Time being and debugging instead of using the real data from the field, I have added mock data for recurrence timing.

Working in
Wix Studio Editor

What I’m trying to do
When I create a Single Event or Recurrence event it need to create new event in draft in Wix Event Dashboard. But when I try to create single event it was created and saved in draft which is expected result, But during creation of recurrence event, there is no evident where did the created event saved, I event checked in botht he Draft events and Published events

What I’ve tried so far
This is the Payload used to create Recurring Event:

{
  "title": "Yoga Saturdays",
  "location": {
    "type": "VENUE",
    "name": "Yoga Studio Denver",
    "address": {
      "country": "US",
      "subdivision": "CO",
      "city": "Denver",
      "postalCode": "80202",
      "streetAddress": {
        "name": "123 Main St",
        "number": "123"
      },
      "latitude": 39.7392,
      "longitude": -104.9903
    }
  },
  "dateAndTimeSettings": {
    "dateAndTimeTbd": false,
    "timeZoneId": "America/Denver",
    "showTimeZone": true,
    "startDate": "2026-01-10T10:00:00.000Z",
    "endDate": "2026-01-10T11:00:00.000Z",
    "recurringEvents": {
      "individualEventDates": [
        {
          "startDate": "2026-01-10T10:00:00.000Z",
          "endDate": "2026-01-10T11:00:00.000Z",
          "timeZoneId": "America/Denver",
          "showTimeZone": true
        },
        {
          "startDate": "2026-01-17T10:00:00.000Z",
          "endDate": "2026-01-17T11:00:00.000Z",
          "timeZoneId": "America/Denver",
          "showTimeZone": true
        },
        {
          "startDate": "2026-01-24T10:00:00.000Z",
          "endDate": "2026-01-24T11:00:00.000Z",
          "timeZoneId": "America/Denver",
          "showTimeZone": true
        },
        {
          "startDate": "2026-01-31T10:00:00.000Z",
          "endDate": "2026-01-31T11:00:00.000Z",
          "timeZoneId": "America/Denver",
          "showTimeZone": true
        }
      ]
    }
  },
  "registration": {
    "initialType": "TICKETING",
    "tickets": {
      "items": [
        {
          "name": "General Admission",
          "price": {
            "amount": "0",
            "currency": "USD"
          },
          "taxSettings": {
            "type": "INCLUDED_IN_PRICE"
          },
          "limitPerOrder": 10
        }
      ]
    }
  },
  "draft": true
}

This is the Response Payload:

{
  "success": true,
  "message": "Event created!",
  "data": {
    "location": {
      "name": "Yoga Studio Denver",
      "type": "VENUE",
      "locationTbd": true
    },
    "dateAndTimeSettings": {
      "dateAndTimeTbd": false,
      "startDate": "Sat Jan 10 2026 15:30:00 GMT+0530 (India Standard Time)",
      "endDate": "Sat Jan 10 2026 16:30:00 GMT+0530 (India Standard Time)",
      "timeZoneId": "America/Denver",
      "hideEndDate": false,
      "showTimeZone": true,
      "recurrenceStatus": "RECURRING",
      "recurringEvents": {
        "individualEventDates": [],
        "categoryId": "2a421470-7830-4dfe-8534-3e706ef5a493"
      },
      "formatted": {
        "dateAndTime": "January 10, 2026, 3:00 – 4:00 AM MST",
        "startDate": "January 10, 2026",
        "startTime": "3:00 AM",
        "endDate": "January 10, 2026",
        "endTime": "4:00 AM"
      }
    },
    "title": "Yoga Saturdays",
    "shortDescription": "",
    "detailedDescription": "",
    "slug": "yoga-saturdays-2026-01-10-03-00-6",
    "status": "UPCOMING",
    "registration": {
      "type": "TICKETING",
      "status": "CLOSED_AUTOMATICALLY",
      "rsvp": {
        "responseType": "YES_ONLY",
        "waitlistEnabled": false,
        "confirmationMessages": {
          "positiveConfirmation": {
            "title": "Thank you!",
            "message": "An email with all the event info was sent to you.",
            "addToCalendarActionLabel": "Add to Calendar",
            "shareActionLabel": "Share"
          },
          "waitlistMessages": {
            "title": "Thanks! You've been added to the waitlist.",
            "message": "We'll update you if additional spots become available.",
            "addToCalendarActionLabel": "Add to Calendar",
            "shareActionLabel": "Share"
          },
          "negativeMessages": {
            "title": "Sorry You Can't Make It",
            "shareActionLabel": "Share"
          }
        }
      },
      "tickets": {
        "guestsAssignedSeparately": false,
        "ticketLimitPerOrder": 50,
        "reservationDurationInMinutes": 20,
        "gracePeriodInMinutes": 120,
        "confirmationMessages": {
          "title": "Thank you, {Guest Name}",
          "message": "You’re all set for {Event Name}. A confirmation email was sent to {Guest Email}.",
          "downloadTicketsLabel": "Download Tickets",
          "addToCalendarActionLabel": "Add to Calendar",
          "shareActionLabel": "Share"
        },
        "checkoutType": "EVENTS_APP"
      },
      "allowedGuestTypes": "VISITOR_OR_MEMBER",
      "initialType": "TICKETING",
      "registrationPaused": false,
      "registrationDisabled": false
    },
    "calendarUrls": {
      "google": "http://calendar.google.com/calendar/render?action=TEMPLATE&text=Yoga+Saturdays&dates=20260110T100000Z%2F20260110T110000Z&location=&details=Yoga+Saturdays%0AJanuary+10%2C+2026%2C+3%3A00+%E2%80%93+4%3A00+AM+MST%0AYoga+Studio+Denver",
      "ics": "https://www.wixevents.com/media/v2/calendar?token=JWS.eyJraWQiOiJpb21iOUJ0eSIsImFsZyI6IkhTMjU2In0.eyJkYXRhIjoie1wiaW5zdGFuY2VJZFwiOlwiODY3ODljMmEtYjBhNS00OTRmLTlkZTktODc0ZGQ1MmIxNjliXCIsXCJldmVudElkXCI6e1widmFsdWVcIjpcImNkMTE1MWYxLWNjYzMtNDE4OC05MzU1LTg2MmJlYWNiNzk5NVwifSxcIm9jTGlua1wiOm51bGx9IiwiaWF0IjoxNzY0NjU3MzQwfQ.iWpq7kB-7QiPYvd8nSeoLWi4Fw4Feto-nrcVbnHSkRw"
    },
    "eventPageUrl": "https://www.ezdestinations.com/event-details/yoga-saturdays-2026-01-10-03-00-6",
    "form": {
      "controls": [
        {
          "type": "NAME",
          "system": true,
          "name": "name",
          "inputs": [
            "[Object]",
            "[Object]"
          ],
          "label": "First name, Last name",
          "orderIndex": 0,
          "deleted": false,
          "_id": "name"
        },
        {
          "type": "INPUT",
          "system": true,
          "name": "email",
          "inputs": [
            "[Object]"
          ],
          "label": "Email",
          "orderIndex": 1,
          "deleted": false,
          "_id": "email"
        }
      ],
      "messages": {
        "rsvp": {
          "rsvpYesOption": "I'm Going",
          "rsvpNoOption": "Not Going",
          "positiveMessages": {
            "title": "Add your details",
            "confirmation": "[Object]"
          },
          "waitlistMessages": {
            "title": "Looks like this event is full. Join the waitlist.",
            "confirmation": "[Object]"
          },
          "negativeMessages": {
            "title": "Add your details",
            "confirmation": "[Object]"
          },
          "submitActionLabel": "SUBMIT"
        },
        "checkout": {
          "title": "Add your details",
          "submitActionLabel": "Continue",
          "confirmation": {
            "title": "Thank you, {Guest Name}",
            "message": "You’re all set for {Event Name}. A confirmation email was sent to {Guest Email}.",
            "downloadTicketsLabel": "Download Tickets",
            "addToCalendarLabel": "Add to Calendar",
            "shareEventLabel": "Share"
          }
        },
        "registrationClosed": {
          "message": "Registration is closed",
          "exploreEventsActionLabel": "See other events"
        },
        "ticketsUnavailable": {
          "message": "Tickets are not on sale",
          "exploreEventsActionLabel": "See other events"
        }
      }
    },
    "summaries": {
      "rsvps": {
        "totalCount": 0,
        "yesCount": 0,
        "noCount": 0,
        "waitlistCount": 0
      },
      "tickets": {
        "ticketsSold": 0,
        "currencyLocked": false,
        "totalOrders": 0
      }
    },
    "instanceId": "86789c2a-b0a5-494f-9de9-874dd52b169b",
    "guestListSettings": {
      "displayedPublicly": true
    },
    "userId": "",
    "feed": {
      "token": "{\"authorizerAppDefId\":\"140603ad-af8d-84a5-2c80-a0f60cb47351\",\"claims\":[\"wix.feed.FeedAccess\",\"wix.comments.CommentsAccess\",\"wix.reactions.ReactionsAccess\"],\"contextId\":\"cd1151f1-ccc3-4188-9355-862beacb7995\",\"contextType\":\"events\"}"
    },
    "onlineConferencing": {
      "enabled": false,
      "providerName": "",
      "type": "UNKNOWN_CONFERENCE_TYPE",
      "session": {
        "hostLink": "https://www.wixevents.com/oc?start=JWS.eyJraWQiOiJpb21iOUJ0eSIsImFsZyI6IkhTMjU2In0.eyJkYXRhIjoie1wiYWN0aW9uXCI6XCJzdGFydFwiLFwiaW5zdGFuY2VJZFwiOlwiODY3ODljMmEtYjBhNS00OTRmLTlkZTktODc0ZGQ1MmIxNjliXCIsXCJldmVudElkXCI6XCJjZDExNTFmMS1jY2MzLTQxODgtOTM1NS04NjJiZWFjYjc5OTVcIn0iLCJpYXQiOjE3NjQ2NTczNDB9.8MdjdahKN-SktdMfjS6Euwy95mo3FEzZ3Ofl_x-JBvg",
        "guestLink": "https://www.wixevents.com/oc?join=JWS.eyJraWQiOiJpb21iOUJ0eSIsImFsZyI6IkhTMjU2In0.eyJkYXRhIjoie1wiYWN0aW9uXCI6XCJqb2luXCIsXCJpbnN0YW5jZUlkXCI6XCI4Njc4OWMyYS1iMGE1LTQ5NGYtOWRlOS04NzRkZDUyYjE2OWJcIixcImV2ZW50SWRcIjpcImNkMTE1MWYxLWNjYzMtNDE4OC05MzU1LTg2MmJlYWNiNzk5NVwifSIsImlhdCI6MTc2NDY1NzM0MH0.gr2wGw423AWuNwkW0PXg3au9q0t4IO98usBBlFJcYKU"
      }
    },
    "agendaSettings": {
      "enabled": false,
      "pageUrl": "https://www.ezdestinations.com/schedule/yoga-saturdays-2026-01-10-03-00-6"
    },
    "categories": {
      "categories": [
        {
          "name": "Yoga Saturdays",
          "hidden": true,
          "type": "RECURRING_EVENT",
          "_id": "2a421470-7830-4dfe-8534-3e706ef5a493",
          "_createdDate": "Tue Dec 02 2025 12:05:40 GMT+0530 (India Standard Time)"
        }
      ]
    },
    "eventDisplaySettings": {},
    "customizableTickets": true,
    "labellingSettings": {
      "assignedContactsLabelDeleted": false
    },
    "publishedDate": "2025-12-02T06:35:40.099Z",
    "_id": "cd1151f1-ccc3-4188-9355-862beacb7995",
    "_createdDate": "Tue Dec 02 2025 12:05:39 GMT+0530 (India Standard Time)",
    "_updatedDate": "Tue Dec 02 2025 12:05:40 GMT+0530 (India Standard Time)"
  }
}

This is the code I have used from my frontend:

import { eventCategories, createEvent, updateEventCategory } from "backend/events.web.js";
import wixLocation from 'wix-location';
import wixUsers from 'wix-users';
import { authentication, currentMember } from "wix-members-frontend";

$w.onReady(async function () {


    if (dropdownOptions.length > 0) {
        // $w('#category1').value = dropdownOptions[0].value;
        $w('#category1').value = "Select a Event Category 1";
        $w('#category2').value = "Select a Event Category 2";
        $w('#category3').value = "Select a Event Category 3";

    
    }

    const allCategoryOptions = [...dropdownOptions];

    function getRecurringSettings() {
    const radioValue = $w('#radioGroup3').value;
    if (radioValue !== 'Radio Button2') return null;

    const datesValue = $w('#datesdropdown').value;
    if (datesValue !== 'repeatingDates') return null;

    const startDate = $w('#startDatePicker').value;
    const endDate = $w('#endDatePicker').value;
    const startTime = $w('#startTimePicker').value;
    const endTime = $w('#endTimePicker').value;

    if (!startDate || !endDate || !startTime || !endTime) {
        throw new Error("Start/end date & time required");
    }

    // FIX: Declare the Date objects properly
    let startDateTime = new Date(startDate);
    let endDateTime = new Date(endDate);

    const startTP = parseTimeToObject(startTime);
    const endTP = parseTimeToObject(endTime);

    if (!startTP || !endTP) throw new Error("Invalid time");

    startDateTime.setHours(startTP.hours, startTP.minutes, 0, 0);
    endDateTime.setHours(endTP.hours, endTP.minutes, 0, 0);

    const rrule = {
        frequency: '',
        interval: 1,
        byDay: [],
        byMonthDay: null,
        until: null,
        count: null
    };


    if (endsValue === 'specificdate' && $w('#Endingdate').value) {
        const until = new Date($w('#Endingdate').value);
        until.setHours(23, 59, 59, 999);
        rrule.until = until.toISOString();
    } else if (endsValue === 'noofevents') {
        rrule.count = Number($w('#Num2').value) || null;
    }

    return {
        startDateTime: startDateTime.toISOString(),
        endDateTime: endDateTime.toISOString(),
        recurrence: rrule
    };
}

    function updateAllVisibility() {
        const radioValue = $w('#radioGroup3').value; // Radio Button1 or Radio Button2
        const datesValue = $w('#datesdropdown').value || ''; // specificDates or repeatingDates
        const frequencyValue = $w('#frequencydropdown').value || ''; // daily, weekly, monthly, custom
        const repeatEveryValue = $w('#repeatsevery').value || ''; // days, weeks, months
        const endsValue = $w('#endsdropdown').value || ''; // specificdate or noofevents

        // 1. Hide ALL possible recurring fields first (clean slate)
        const allRecurringElements = [
            '#datesdropdown', '#datesButton',
            '#Endingdate', '#checkboxGroup1', '#endsdropdown', '#Num1', '#Num2',
            '#frequencydropdown', '#repeatsevery', '#repeatson'
        ];
        allRecurringElements.forEach(id => $w(id).hide());

        // Also hide single event pickers when in recurring mode
        $w('#startDatePicker').hide();
        $w('#endDatePicker').hide();
        $w('#startTimePicker').hide();
        $w('#endTimePicker').hide();

        // ========================================================================
        // CASE 1: Single Event (Radio Button1)
        // ========================================================================
        if (radioValue === 'Radio Button1') {
            $w('#startDatePicker').show();
            $w('#endDatePicker').show();
            $w('#startTimePicker').show();
            $w('#endTimePicker').show();
            $w('#text59').hide();
            $w('#text60').hide();
            $w('#text61').hide();
            return; // Nothing else to show
        }

        // ========================================================================
        // CASE 2: Recurring Event (Radio Button2)
        // ========================================================================
        if (radioValue === 'Radio Button2') {
            $w('#datesdropdown').show(); // Always visible in recurring mode
            $w('#text59').show();
            $w('#text56').hide();
            $w('#text60').show();
            $w('#text61').show();
            // ------------------ specificDates ------------------
            if (datesValue === 'specificDates') {
                $w('#text59').hide();
                $w('#text60').hide();
                $w('#text61').hide();
                $w('#text56').show();
                $w('#startDatePicker').show();
                $w('#endDatePicker').show();
                $w('#startTimePicker').show();
                $w('#endTimePicker').show();
                $w('#datesButton').show();
                return;
            }

            // ------------------ repeatingDates ------------------
            if (datesValue === 'repeatingDates') {
                $w('#text59').show();
                $w('#text56').hide();
                $w('#text60').show();
                $w('#text61').show();
                $w('#startDatePicker').show();
                $w('#endDatePicker').show();
                $w('#startTimePicker').show();
                $w('#endTimePicker').show();
                $w('#datesButton').hide();
                $w('#Endingdate').show();
                $w('#checkboxGroup1').show();
                $w('#endsdropdown').show();
                $w('#frequencydropdown').show();
                $w('#repeatsevery').hide();

                // === Frequency Logic ===
                if (frequencyValue === 'dailyfrequency') {
                    $w('#checkboxGroup1').hide();
                    $w('#repeatson').hide();
                } else if (frequencyValue === 'weeklyfrequency') {
                    $w('#checkboxGroup1').show();
                    $w('#repeatson').hide();
                } else if (frequencyValue === 'monthlyfrequency') {
                    $w('#checkboxGroup1').hide();
                    $w('#repeatson').show();
                } else if (frequencyValue === 'customfrequency') {
                    $w('#checkboxGroup1').hide();
                    $w('#repeatson').hide();
                    $w('#repeatsevery').show();
                    $w('#Num1').show();

                    // Inside repeatsevery (days/weeks/months)
                    if (repeatEveryValue === 'daysrepeats') {
                        $w('#Num1').show();
                        $w('#checkboxGroup1').hide();
                    } else if (repeatEveryValue === 'weeksrepeats') {
                        $w('#Num1').show();
                        $w('#checkboxGroup1').show();
                    } else if (repeatEveryValue === 'monthsrepeats') {
                        $w('#Num1').show();
                        $w('#repeatson').show();
                        $w('#checkboxGroup1').hide();
                    }
                }

                // === Ends Dropdown Logic ===
                if (endsValue === 'specificdate') {
                    $w('#Endingdate').show();
                    $w('#Num2').hide();
                } else if (endsValue === 'noofevents') {
                    $w('#Num2').show();
                    $w('#Endingdate').hide();
                }
            }
        }
    }

    $w('#radioGroup3').value = 'Radio Button1';
    $w('#datesdropdown').value = 'specificDates';
    updateAllVisibility();

    // Listeners — call the same function on every change
    $w('#radioGroup3').onChange(updateAllVisibility);
    $w('#datesdropdown').onChange(updateAllVisibility);
    $w('#frequencydropdown').onChange(updateAllVisibility);
    $w('#repeatsevery').onChange(updateAllVisibility);
    $w('#endsdropdown').onChange(updateAllVisibility);

    // ==========================================================================

    // Function to refresh dropdowns so selected categories are removed from others
    function refreshCategoryDropdowns(changedDropdown) {
        // Collect all selected categories (ignore placeholder values)
        const selectedValues = [
            $w('#category1').value,
            $w('#category2').value,
            $w('#category3').value
        ].filter(val => !val.startsWith("Select a Event Category"));

        // For each dropdown (1, 2, 3)
        [$w('#category1'), $w('#category2'), $w('#category3')].forEach((dropdown, index) => {
            const placeholder = `Select a Event Category ${index + 1}`;
            const currentValue = dropdown.value;

            // Filter available options so other dropdowns can’t pick already-selected ones
            const availableOptions = allCategoryOptions.filter(opt =>
                !selectedValues.includes(opt.value) || opt.value === currentValue
            );

            // Rebuild dropdown options
            dropdown.options = [
                { label: placeholder, value: placeholder },
                ...availableOptions
            ];

            // Keep the user’s selection visible even after refresh
            if (availableOptions.some(opt => opt.value === currentValue)) {
                dropdown.value = currentValue;
            } else {
                dropdown.value = placeholder;
            }
        });
    }

    // Attach listeners to update others when any category changes
    ['#category1', '#category2', '#category3'].forEach(id => {
        $w(id).onChange(() => refreshCategoryDropdowns($w(id)));
    });

 

    $w('#createEventBtn').onClick(async () => {
        // Validate required fields before showing loader
        const eventName = safeTrim($w('#eventNameInput').value);
        const selectedLocationRaw = $w('#radioGroup2').value;
        const addressInput = $w('#physicalLocationInput').value;
        const onlineLink = safeTrim($w('#onlineLocationInput').value);
        const otherLocation = safeTrim($w('#locationTBD').value);
        const startDate = $w('#startDatePicker').value;
        const endDate = $w('#endDatePicker').value;
        const startTime = $w('#startTimePicker').value;
        const endTime = $w('#endTimePicker').value;

        const result2 = addressInput.formatted.split(",");
        const streetname = result2[0];
        // console.log("===== Result2", streetname);

        console.log('Raw inputs:', {
            eventName,
            physicalLocation: addressInput,
            onlineLocation: onlineLink,
            otherLocation,
            selectedLocationType: selectedLocationRaw,
            imageUpload: $w('#imageUpload').value,
            uploadedImageUrl
        });

        // Validate event name
        if (!eventName) {
            showToast('Event name is required', 'error');
            return;
        }

        const valueMap = {
            'Radio button1': 'Physical location',
            'Radio button2': 'Online',
            'Radio button3': 'To be decided (TBD)'
        };

        const selectedLocationType = valueMap[selectedLocationRaw];
        //Location object
        let locationData = {};

        if (selectedLocationType === 'Physical location') {
            if (!addressInput || !addressInput.formatted || addressInput.formatted.trim() === '') {
                showToast('Physical Location is required', 'error');
                return;
            }

            const { city, country, streetAddress, postalCode, subdivision } = addressInput;

            const countryCode = countryMap[country] || countryMap[country?.toUpperCase()] || 'IN';

            // Street Name

            const result2 = addressInput.formatted.split(",");
            const streetname = result2[0];
            console.log("===== Result2", streetname);

            const streetName = streetname;
            const streetNumber = safeTrim(streetAddress?.number) || '';
            const validPostalCode = safeTrim(postalCode) && postalCode !== 'undefined' ? postalCode : '000000';

            locationData = {
                type: 'VENUE',
                address: {
                    country: countryCode,
                    city: safeTrim(city),
                    streetAddress: {
                        name: streetName,
                        number: streetNumber
                    },
                    postalCode: validPostalCode,
                    subdivision: safeTrim(subdivision) || ''
                }
            };
        } else if (selectedLocationType === 'Online') {
            if (onlineLink || onlineLink.trim() !== '') {
                showToast('Physical location type is required', 'error');
                return;
            }
            locationData = {
                type: 'ONLINE',
                conferenceLink: safeTrim($w('#conferenceLinkInput').value)
            };
        } else if (selectedLocationType === 'To be decided (TBD)') {
            if (otherLocation || otherLocation.trim() !== '') {
                showToast('Physical location type is required', 'error');
                return;
            }
            locationData = {
                type: 'UNKNOWN_LOCATION',
                locationTbd: true,
                name: otherLocation || 'To be decided'
            };
        } else {
            showToast('Invalid location type selected', 'error');
            return;
        }

        // Validate date and time fields
        if (!startDate || !endDate && !startTime || !endTime) {
            showToast('Date and time fields are required', 'error');
            return;
        }

        // Check if end date is before start date
        if (endDate < startDate) {
            showToast('End date cannot be before start date', 'error');
            return;
        }

        if (!startDate || !endDate) {
            showToast('Date fields are required', 'error');
            return;
        }

        if (!startTime || !endTime) {
            showToast('Time fields are required', 'error');
            return;
        }

        // If all validations pass, show the loader
        const createBtn = $w('#createEventBtn');
        const originalText = createBtn.label;
        createBtn.label = '⏳ Creating event...';

        createBtn.disable();

        try {
            const startTimeParsed = parseTimeValue(startTime);
            const endTimeParsed = parseTimeValue(endTime);

            function parseTimeValue(timeVal) {
                if (!timeVal) return null;
                if (timeVal instanceof Date) {
                    return { hours: timeVal.getHours(), minutes: timeVal.getMinutes() };
                }
                if (typeof timeVal === 'string') {
                    const match = timeVal.match(/(\d{1,2}):(\d{2})\s*(AM|PM)?/i);
                    if (!match) return null;
                    let hours = parseInt(match[1], 10);
                    const minutes = parseInt(match[2], 10);
                    const ampm = match[3]?.toUpperCase();
                    if (ampm === 'PM' && hours < 12) hours += 12;
                    if (ampm === 'AM' && hours === 12) hours = 0;
                    return { hours, minutes };
                }
                return null;
            }

            const startDateTime = new Date(startDate);
            startDateTime.setHours(startTimeParsed.hours, startTimeParsed.minutes, 0, 0);

            const endDateTime = new Date(endDate);
            endDateTime.setHours(endTimeParsed.hours, endTimeParsed.minutes, 0, 0);

            const descriptionText = safeTrim($w('#conferenceLinkInput').value) ?
                `${safeTrim($w('#conferenceLinkInput').value).replace(/<[^>]+>/g, '')}` :
                '';
            const eventPageUrl = $w('#link').value;

            if (eventPageUrl) {
                const htmlLink = `<a href="${eventPageUrl}" target="_blank">${eventPageUrl}</a>`;
                $w('#conferenceLinkInput').value = htmlLink+" "+descriptionText;
                console.log("eventlink2", htmlLink);
            }
            console.log("eventlink", eventPageUrl);

            // const f=$w('#conferenceLinkInput').value;
            // const f2=safeTrim($w('#conferenceLinkInput').content);
            // const f3=`${safeTrim($w('#conferenceLinkInput').value).replace(/<[^>]+>/g, '')}`;
            // console.log("--Big box value",f);
            // console.log("--Big box2 value",f2);
            // console.log("--Big box3 value",f3);
            const category = [$w('#category1').value, $w('#category2').value, $w('#category3').value]
            const uniqueCategories = new Set(category.filter(Boolean)); // removes empty values too
            if (uniqueCategories.size < category.length) {
                showToast('Each category must be unique.', 'error');
                return;
            }

            if ($w('#radioGroup3').value === 'Radio Button2') {
                try {
                    getRecurringSettings(); // Will throw if dates/times missing
                } catch (err) {
                    showToast(err.message, 'error');
                    return;
                }
            }
            const recurrenceData = getRecurringSettings();  // ← This returns the correct object

            let dateAndTimeSettings;
            if (recurrenceData) {
                // RECURRING EVENT
                dateAndTimeSettings = {
                    timeZoneId: $w('#timezoneDropdown').value || "America/Chicago",
                    startDateTime: recurrenceData.startDateTime,
                    endDateTime: recurrenceData.endDateTime,
                    recurrence: recurrenceData.recurrence,
                    showTimeZone: true
                };
            } else {
                // SINGLE EVENT
                const start = new Date(startDate);
                start.setHours(startTimeParsed.hours, startTimeParsed.minutes, 0, 0);
                const end = new Date(endDate);
                end.setHours(endTimeParsed.hours, endTimeParsed.minutes, 0, 0);

                dateAndTimeSettings = {
                    timeZoneId: $w('#timezoneDropdown').value || "America/Chicago",
                    startDate: start.toISOString(),
                    endDate: end.toISOString(),
                    showTimeZone: true
                };
            }
            // const recurrenceData = getRecurringSettings();

            // const dateAndTimeSettings = {
            //     timeZoneId: $w('#timezoneDropdown').value || 'America/Chicago'
            // };

            // if (recurrenceData && recurrenceData.type === "RECURRING") {
            //     dateAndTimeSettings.recurrence = recurrenceData.recurrence;
            //     dateAndTimeSettings.startDateTime = recurrenceData.startDateTime;
            //     dateAndTimeSettings.endDateTime = recurrenceData.endDateTime;
            // } else {
            //     // Single or specific dates
            //     dateAndTimeSettings.startDate = startDateTime.toISOString();
            //     dateAndTimeSettings.endDate = endDateTime.toISOString();
            // }

            // const eventData = {
            //     event: {
            //         title: eventName,
            //         location: locationData,
            //         // dateAndTimeSettings: dateAndTimeSettings,
            //         description: descriptionText,
            //         languageCode: 'en',
            //         registration: {
            //             initialType: 'TICKETING',
            //             tickets: {
            //                 items: [{
            //                     name: 'General Admission',
            //                     price: {
            //                         amount: '0',
            //                         currency: safeTrim($w('#dropdownCurrency').value, 'GBP')
            //                     },
            //                     taxSettings: { type: 'INCLUDED_IN_PRICE' },
            //                     limitPerOrder: Number(safeTrim($w('#inputTicketLimit').value, '30')) || 30
            //                 }]
            //             }
            //         },
            //         dateAndTimeSettings: {
            //             dateAndTimeTbd: false,

            //             // First occurrence preview (required for Wix summary)
            //             startDate: "2026-01-10T10:00:00.000Z",
            //             endDate: "2026-01-10T11:00:00.000Z",
            //             timeZoneId: "Asia/Kolkata",
            //             showTimeZone: true,

            //             recurringEvents: {
            //                 individualEventDates: [{
            //                         startDate: "2026-01-10T10:00:00.000Z",
            //                         endDate: "2026-01-10T11:00:00.000Z",
            //                         timeZoneId: "Asia/Kolkata",
            //                         showTimeZone: true
            //                     },
            //                     {
            //                         startDate: "2026-01-17T10:00:00.000Z",
            //                         endDate: "2026-01-17T11:00:00.000Z",
            //                         timeZoneId: "Asia/Kolkata",
            //                         showTimeZone: true
            //                     },
            //                     {
            //                         startDate: "2026-01-24T10:00:00.000Z",
            //                         endDate: "2026-01-24T11:00:00.000Z",
            //                         timeZoneId: "Asia/Kolkata",
            //                         showTimeZone: true
            //                     },
            //                     {
            //                         startDate: "2026-01-31T10:00:00.000Z",
            //                         endDate: "2026-01-31T11:00:00.000Z",
            //                         timeZoneId: "Asia/Kolkata",
            //                         showTimeZone: true
            //                     }
            //                 ]
            //             }
            //         },
            //         mainImage: uploadedImageUrl || undefined
            //     },
            //     draft: true,
            // };

  const eventData = {
  event: {
    title: "Yoga Saturdays",
    location: {
      type: "VENUE",
      name: "Yoga Studio Denver",
      address: {
        country: "US",
        subdivision: "CO",
        city: "Denver",
        postalCode: "80202",
        streetAddress: {
          name: "123 Main St",
          number: "123"
        },
        latitude: 39.7392,
        longitude: -104.9903
      }
    },
    mainImage: uploadedImageUrl || undefined,
    dateAndTimeSettings: {
      dateAndTimeTbd: false,
      timeZoneId: "America/Denver",
      showTimeZone: true,
      startDate: "2026-01-10T10:00:00.000Z",
      endDate: "2026-01-10T11:00:00.000Z",
      recurringEvents: {
        individualEventDates: [
          {
            startDate: "2026-01-10T10:00:00.000Z",
            endDate: "2026-01-10T11:00:00.000Z",
            timeZoneId: "America/Denver",
            showTimeZone: true
          },
          {
            startDate: "2026-01-17T10:00:00.000Z",
            endDate: "2026-01-17T11:00:00.000Z",
            timeZoneId: "America/Denver",
            showTimeZone: true
          },
          {
            startDate: "2026-01-24T10:00:00.000Z",
            endDate: "2026-01-24T11:00:00.000Z",
            timeZoneId: "America/Denver",
            showTimeZone: true
          },
          {
            startDate: "2026-01-31T10:00:00.000Z",
            endDate: "2026-01-31T11:00:00.000Z",
            timeZoneId: "America/Denver",
            showTimeZone: true
          }
        ]
      }
    },
    registration: {
      initialType: "TICKETING",
      tickets: {
        items: [
          {
            name: "General Admission",
            price: { amount: "0", currency: "USD" },
            taxSettings: { type: "INCLUDED_IN_PRICE" },
            limitPerOrder: 10
          }
        ]
      }
    }
  },
  draft: true
};


            console.log('Sending eventData to backend:', JSON.stringify(eventData, null, 2));

            const result = await createEvent(eventData);
            console.log('Event Created Result: ', result);
            console.log('EventID:::', [result.data._id]);
            console.log('Category Selected', category);

            if (result.success) {
                showToast('Event created successfully!', 'success');
                for (const cate of category) {
                    try {
                        const categoryUpdated = await updateEventCategory(cate, [result.data._id]);
                        console.log('Category Updated Successfully:', categoryUpdated);
                    } catch (err) {
                        console.error(`Failed to update category ${cate}:`, err);
                    }
                }
                resetForm();
            } else {
                console.log('Result:::', result);
                showToast(result.error || 'Failed to create event', 'error');
            }
        } catch (error) {
            console.log('Result:::', error);
            showToast(error.message || 'An unexpected error occurred', 'error');
        } finally {
            // Restore button state
            createBtn.label = originalText;
            createBtn.enable();
        }
    });
});

This is My code I used in Wix backend:

export const createEvent = webMethod(Permissions.Anyone, async (payload) => {
    try {
        // payload = { event: { title, location, registration, ... }, draft: true }
        const eventFromFrontend = payload.event;

        // SEND EXACTLY WHAT FRONTEND GAVE US — DO NOT REBUILD
        const eventToSend = {
            title: eventFromFrontend.title,
            location: eventFromFrontend.location,
            mainImage: eventFromFrontend.mainImage || undefined,
            dateAndTimeSettings: eventFromFrontend.dateAndTimeSettings,
            registration: eventFromFrontend.registration,  // ← CRITICAL: PASS ENTIRE OBJECT
            draft: payload.draft ?? true
        };

        console.log("SENDING TO WIX API:", JSON.stringify(eventToSend, null, 2));

        const result = await elevatedCreateEvent(eventToSend);

        return {
            success: true,
            message: "Event created!",
            data: result
        };

    } catch (error) {
        console.error("Wix API rejected:", error);
        return {
            success: false,
            message: error.message || "Failed",
            error: error
        };
    }
});

Extra context

Can you help me with it? @noahlovell