Publishable API key required Error

If you receive the following error response when you send a request to a /store route:

Code
1{2  "type": "not_allowed",3  "message": "Publishable API key required in the request header: x-publishable-api-key. You can manage your keys in settings in the dashboard."4}

Why this Error Occurred#

This error occurs because the request is missing the x-publishable-api-key header. The x-publishable-api-key header is required for all requests to the /store route.


How to Fix it#

To resolve this error, add the x-publishable-api-key header to your request. You can find your publishable API key in the Medusa Admin Dashboard.

For example:

Code
1curl -X GET https://localhost:9000/store/products \2  -H "x-publishable-api-key: your-publishable-api-key"

Where your-publishable-api-key is your publishable API key.


Additional Resources#

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