We are presenting the following problem: we need to create a service (middleware) for the Credit Control API. The goal is to build a Custom Page in My Account to display the customer’s Credit information.
But if not, you can use them as a starting point. Below I’ll share an example of how I use policies when working with VTEX APIs as services and/or middleware.
I saw the evidence in your post — you’re calling portal.vtexcommercestable.com.br
In my client files I usually use this header format in the constructor, always adapting it to the required attributes according to the documentation. I’m not sure all that information is strictly necessary, though. Here BASE_URL_VTEX, APP_KEY, and APP_TOKEN are const values as strings, matching your sensitive credentials.