Publishable API needs to have a sales channel Error

If you send a request to the /store/products or /store/products/:id API routes and receive the following error in the response:

Terminal
{  "type": "invalid_data",  "message": "Publishable key needs to have a sales channel configured."}

Why this Error Occurred#

This error means you passed a valid x-publishable-api-key header, but the key does not have a sales channel configured. The sales channel is required to make requests to the /store/products and /store/products/:id routes, as it's used to retrieve products available in that sales channel.


How to Fix it#

To resolve this error, you need to add at least one sales channel to your publishable API key. Refer to the Manage Publishable API Key User Guide to learn how to do that.

Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break