Docs

Log into read the version of docs relevant to your site.

Error: 'Access-Control-Allow-Origin'

Problem Statement

This article explains why you may see the 'Access-Control-Allow-Origin' error in the browser console when using Chargebee (e.g. built-in checkout or JS API) and how to resolve it.

  • Using Chargebee built-in checkout and seeing an origin-access control blocked error.
  • Consistently seeing 'Access-Control-Allow-Origin' when loading the Chargebee JS API.
  • Issues with CORS setup.

Solution

The error can be due to (1) a client-side CORS issue or (2) server-side response headers. Both are harmless and do not affect billing or checkout.

Note:

These errors are harmless and will not affect your billing/checkout flow in any way.

1. Client-side: Using a full-access API key in client-side code can trigger a CORS error. Use publishable keys instead. For more on CORS, see Understanding CORS.

2. Server-side: If the issue is with response headers, contact Chargebee Support. Chargebee controls the headers and can help resolve it.

Was this article helpful?