About creating order and payment manually for a custom payment provider

Hello,

I have implemented a custom payment provider for my Wix site.

but after paying on the provider site and successfully returning a failed transaction when my createTransaction function gets called it does not automatically create a new order.

That means I have to create my orders manually I found the Wix API for that but I am having an issue with authorization to send the request.

I need help with this info

  1. how can I generate an auth token or key or a secret for requests to the API
  2. how can I use them on the request