WIX sample code does not work!!!

Can you help!

This line: “orders” is not in ‘wix-pricing-plans-backend’, therefore code does not work!!

import { orders } from ‘wix-pricing-plans-backend’;

/* Sample orderId value: ‘a8c4a1b2-b5e8-4b33-9693-057ec93e9a27’ *

  • Sample effectiveAt value: ‘IMMEDIATELY’
  • Sample options value:
  • {
  • suppressAuth: true
  • }
    */

export async function myCancelOrderWithOptionsFunction(orderId, effectiveAt, options) {
try {
const order = await orders.cancelOrder(orderId, effectiveAt, options);

return order; 

} catch (error) {
console.error(error);
}
}

It does exist but you might be encountering this issue when trying to import this code on the frontend.

This code is designed to only run on the backend of your website so you’ll need to specify it there.

https://www.wix.com/learn/courses/coding/velo-backend