How can I resolve a CORS error in Shopify Billing API?

Please try with blow codes.

API response:

const billingResponse = await shopify.api.billing.request({
      session,
      plan: plan_select,
      trialDays: 7,
      isTest: true,
      returnObject: true,
    });
    
    res.status(200).send({success: true, confirmationUrl: billingResponse.confirmationUrl});

React code

import createApp from '@shopify/app-bridge';
import {Redirect} from '@shopify/app-bridge/actions';

.......
.......
const config = {
    // The client ID provided for your application in the Partner Dashboard.
    apiKey: "Your client ID",
    // The host of the specific shop that's embedding your app. This value is provided by Shopify as a URL query parameter that's appended to your application URL when your app is loaded inside the Shopify admin.
    host: new URLSearchParams(location.search).get("host"),
    forceRedirect: true
  };
  const app = createApp(config);
  const redirect = Redirect.create(app);
redirect.dispatch(Redirect.Action.REMOTE, {
          url: data.confirmationUrl,
          newContext: true,
 });