What to do next after installed shopify-api-php and merged shopify-app-template-php

Topic summary

A developer new to Shopify custom app development successfully completed initial setup steps:

Completed Setup:

  • Created custom app following Shopify documentation
  • Installed Laravel framework on server
  • Integrated shopify-api-php library and shopify-app-template-php template
  • Successfully installed the custom app from shop admin panel

Initial Problem:
The developer was stuck on authentication, unsure how to call the /api/auth route provided in the template. The template included authentication routes and webhook registration code, but the implementation process wasn’t clear.

Resolution:
The issue was self-resolved by updating the application URL to include /api/auth. Once the app was reinstalled from the dashboard with this updated URL, the authentication route was called automatically and authentication completed successfully.

Status: Resolved - the developer can now proceed with authenticated API calls.

Summarized with AI on November 17. AI used: claude-sonnet-4-5-20250929.

Hi.

I’m new on developing Shopify Custom App.

  1. I have created the custom app as explained in this page .

  2. I have installed Laravel on the server as explained in this page.

  3. I have installed this library and merged this template.

  4. I have created the test shop and could installed the custom app from the shop admin panel into the shop successfully.

  5. Next I want to authenticate the shop and there is a route to authenticate the shop in the template as follows:

    Route::get('/api/auth', function (Request $request) {
        $shop = Utils::sanitizeShopDomain($request->query('shop'));
    
        // Delete any previously created OAuth sessions that were not completed (don't have an access token)
        Session::where('shop', $shop)->where('access_token', null)->delete();
    
        return AuthRedirection::redirect($request);
    });
    
    Route::get('/api/auth/callback', function (Request $request) {
        $session = OAuth::callback(
            $request->cookie(),
            $request->query(),
            ['App\Lib\CookieHandler', 'saveShopifyCookie'],
        );
    
        $host = $request->query('host');
        $shop = Utils::sanitizeShopDomain($request->query('shop'));
    
        $response = Registry::register('/api/webhooks', Topics::APP_UNINSTALLED, $shop, $session->getAccessToken());
        if ($response->isSuccess()) {
            Log::debug("Registered APP_UNINSTALLED webhook for shop $shop");
        } else {
            Log::error(
                "Failed to register APP_UNINSTALLED webhook for shop $shop with response body: " .
                print_r($response->getBody(), true)
            );
        }
    
        $redirectUrl = Utils::getEmbeddedAppUrl($host);
        if (Config::get('shopify.billing.required')) {
            list($hasPayment, $confirmationUrl) = EnsureBilling::check($session, Config::get('shopify.billing'));
    
            if (!$hasPayment) {
                $redirectUrl = $confirmationUrl;
            }
        }
    
        return redirect($redirectUrl);
    });
    

    But I have no idea how to call this route.

Can anyone let me know how to authenticate or show me the explanation or sample?

Thanks in advance.

I could solve this issue by myself.

I updated the application URL with /api/auth from the dashboard and installed the application then this url was called and authenticated.