Wix Backend API events not firing

Question:
Hi All,
I’m trying to capture an event when an order is being paid (in my case i’m using Wix Bookings). I want first to capture event when an order is marked as PAID from the backend… i tried all possible Api events, so far nothing is firing… please help

// Place this code in the events.js file
// of your site's Backend section.
// export function <wixAppName>_<eventName>(event) { }

//import wixStoresBackend from 'wix-stores-backend';

//import wixData from 'wix-data';

export function wixPricingPlans_onPlanPurchased(event) {console.log("wixPricingPlans_onPlanPurchased Fired! : ", event)}
export function wixPricingPlans_onOrderPurchased(event) {console.log("wixPricingPlans_onOrderPurchased Fired! : ", event)}
export function wixPricingPlans_onOrderMarkedAsPaid(event) {console.log("wixPricingPlans_onOrderMarkedAsPaid Fired! : ", event)}
export function wixPricingPlans_onOrderStarted(event) {console.log("wixPricingPlans_onOrderStarted Fired! : ", event)}
export function wixPricingPlans_onOrderEnded(event) {console.log("wixPricingPlans_onOrderEnded Fired! : ", event)}
export function wixBookingsBackend_onBookingConfirmed(event) {console.log("wixBookingsBackend_onBookingConfirmed Fired! : ", event)}
export function wixPricingPlansBackend_onOrderMarkedAsPaid(event) {console.log("wixPricingPlansBackend_onOrderMarkedAsPaid Fired! : ", event)}
export function wixBillingBackend_onInvoicePaid(event) {console.log("wixBillingBackend_onInvoicePaid Fired! : ", event)}
export function wixPricingPlansBackend_onOrderPurchased(event) {console.log("wixPricingPlansBackend_onOrderPurchased Fired! : ", event)}
export function wixStoresBackend_onOrderPaid (event) {console.log("wixStoresBackend_onOrderPaid Fired! : ", event)}
export function wixEcomBackend_onOrderPaymentStatusUpdated(event) {
  try {
        console.log('wixEcomBackend_onOrderPaymentStatusUpdated Fired! - Order payment status updated', event)
    } catch (error) {
        console.log("Error creating Review", error);
        
    }
}

Can you confirm:

  1. These are placed in a file called events.js in your backend folder?
  2. That you’re looking at either the realtime site logs when an event happens or Google Operations? These console.logs won’t appear anywhere else.

Hi anthony,

  1. Yes confirmed, all those are placed in events.js backend folder file…
  2. Correct, i’m trying to capture real time events when bookings are being paid ?

Hello Stephane,

Not sure if you were able to resolve this but are you monitoring the calls inside the the developer console (not the browser console)? If not, these calls can be read under developer tools => Logs => View Site Events

If you cannot see the console.log() call, turn it into a variable and return the variable. Returns will show up in the logs as well.

Hi oakstreetassociates,
Yes indeed i managed to get my debug messages in tools logs view events and also storing some events in a collection for analysis… This has solved the debug issue…
Still not sure which backend events are being fired when Bookings are being paid…
Thanks