New Pricing Plans APIs: wix-pricing-plans and wix-pricing-plans-backend

We added new APIs for order management of pricing plans. The additions include order management functions both on the frontend and the backend , and more backend events .

The newly supported activities include:

Please note the deprecation and migration instructions we added to the Paid Plans documentation.

3 Likes

Trying to use the Orders function from the online and it is not loading on a dev environment. Only on a live site, it is working.

When I move the mouse over the line code
import { orders } from ‘wix-pricing-plans’ ;

I see this message showing: “Cannot find module ‘wix-pricing-plans’ or Its corresponding type declaration”

Please advise

Hello. Not all API’s work in preview mode, as you will see in the API docs for pricing plans, it only works on a published site

“To work with the Pricing Plans API, you need to publish your site.”

Really more difficult to test any code changes in that way. Is there a possibility that it can work eventually in a dev environment

I cannot say for sure, but I will pass along the feedback to the team

Have you looked into creating a test site for dev purposes?

About Test Sites

I used the backend function instead and it is working in the dev environment. Really more usefull for testing purposes.

Hi, has anyone had any luck with the postpone order function? I can’t seem to get the date right for mine and it is driving me crazy.

Hi Aaron, I was able to run it just now using this date & time format - ‘April 15, 2023 10:00:00’.

Please let me know if that works for you.

How can I get the additional info that users input in the custom form because when checking out it does not save to a database?

The only way to see the information a user has submitted is in Dashboard> Subscription > and it’s information per member.

I have been trying to figure this out for the past 2 weeks. I added code to “my subscriptions” member page and I can see the pricing plans coming in the console but the form data / submission data is an object and it is empty. I only get the form Id and submission Id. How can I get this information and tie it together with the subscription plan so the member can see the information they put in the form?
Please help.

This is the code:
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 ); 
}) 

});

Thank you in advance.

I’m entering starting date in createOnlineOrder but it’s not working giving me the same date of current time…i tried startDate in createOfflineOrder also but here it’s also not working does anyone have the solution or code so i can get the