Osiset\ShopifyApp\Exceptions\ApiException - Unknown Error on Billing Redirect in Laravel Middleware #385
-
I am encountering the following error while redirecting to the billing route in my Laravel app: Error Context: The app throws the above error. Code in Middleware: user(); if (! $shop->plan && ! $shop->isFreemium() && ! $shop->isGrandfathered()) { $redirectUrl = route( Util::getShopifyConfig('route_names.billing'), [ 'shop' => $shop->getDomain()->toNative(), 'host' => $request->get('host'), ] ); return Inertia::render('BillableRedirect', [ 'url' => $redirectUrl ])->toResponse($request); } return $next($request); } } Give solution for this error, In local system working fine. getting error on production server |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hello @Kyon147, kindly help us with this error. I am developing apps with the package, but we got the same error while we were redirected to the billing page. The billing page is working fine for the local, but while I go live on the production server, it shows me the same error, and I can't find a solution for it. |
Beta Was this translation helpful? Give feedback.
Hey @Kyon147 !
I had already passed a host with it. I think I’ve found the root cause—though I’m not 100% sure—but it seems to be related to a version mismatch.
Initially, I was using ^19.0, and later upgraded to ^23.0. After the upgrade, I started facing issues where some APIs—especially those related to Billable and Auth—were behaving as if they were still on version 19.0. I also ran into a problem with flash-message, which I wasn’t even using, but it still threw errors during the build.
I managed to fix it by making a few changes across a couple of files. It’s working now, but I’m still unclear on why exactly the error popped up in the first place.