How to use the cancelOrder() API reference?

I think you already have found the post with the most informations about how to find a solution for a more complicated question.

My recommendation:

First try to understand your own setup…
a) what is the exact flow of your project? → step by step
b) which elements have been used?
c) do i use enough CONSOLE-LOGS in my project?
d) how could the CONSOLE (my best friend) help me out to get what i want?
e) did i already checked all possible to use APIs for my purposes in the Velo-API-docs ?

Secondly → did i check already similar posts?

Just to mention few of them…

  1. Product Subscription Management - #2 by eduardog
  2. Allow a client to cancel a Plan/Membership on their own - #14 by antanasd
  3. Feature Release: Product Subscriptions in Wix Stores - #14 by alinbaho
  4. Manual subscriptions and renewals...
  5. …and so on…

First collect all information about your issue / topic.

If you still have problems after some trials → open your own post and describe your SETUP in detail, explaining the flow of your project.

You can connect this post to your own later.