Show Together API is private

hey everyone,

I’m trying to use the API: Catalog API but it’s a private API, and I need to access the SKUs of the products registered in the “buy together” feature. Right now I can only see this in the development environment because when it goes to prod it throws an error since it requires tokens. I don’t even know where to start to get this working, and I haven’t found any other API that returns the same data — and I’ve looked a lot. There’s just scattered information across various forums, but it’s like people assume everyone already knows how to do everything, so they just drop some doc link and say “just do that” and in the end nothing works.

can anyone at least give me an overview of how I can get this working?

ps. I’m developing a front-end app for a “buy together” feature

Hi @MMendes, how are you?

I had a few questions:

:small_blue_diamond: 1. Do you want to use “Buy Together” just to display related products (natively)?

In that case, there’s no need to develop an app. VTEX already has this feature natively through the CMS and Admin:

:white_check_mark: How to use the native “Buy Together”:

  1. Go to Catalog > Products > Related Products.
  2. You can manually register related SKUs under the “Show Together” or “Accessories” tab.
  3. This data is automatically exposed on the front end using VTEX IO’s native components (product-related and product-accessories).

:backhand_index_pointing_right: You can use VTEX’s own Show Together feature. Official documentation:

:small_blue_diamond: 2. Are you building a custom front-end app and need to access the private API (Catalog API) to fetch related SKUs?

If so, you cannot call that API directly from the front end in production, as it requires authentication (appKey and appToken), and these credentials should never be exposed on the front end for security reasons.

:white_check_mark: How to solve this:

You’ll need to set up an architecture with an intermediary back-end application. This back-end app will:

  1. Receive the request from your front-end app.
  2. Call the Catalog API using the appKey and appToken.
  3. Return only the necessary data to your front end.

I’ll assume you’ve already obtained your App Key + Token. If not, refer to Application Keys

This way, for your custom app to work, you’ll need a backend application to “encapsulate” the credentials. In other words, instead of calling the VTEX endpoint directly, you’ll call your backend API, which will hold the tokens. So you’ll only need to set up the call logic pointing to your backend application.

This is the approach you’ll want to use in production.

:wrench: Practical tips for the Backend:

Remember to allow CORS for:

  • *.myvtex.com
  • *.vtexcommercestable.com.br
  • Your public domain (www.yourstore.com)

NOTE: The backend application also needs to be hosted on an online server.

I hope this information helps clarify how to move forward.

Best regards,
Four2One Management