public function api()
    {
        if (!$this->api) {
            // Get the domain and token
            $shopDomain = $this->shopify_domain;
            $token = $this->session()->getToken();

            // Create new API instance
            $this->api = ShopifyApp::api();
            $this->api->setSession($shopDomain, $token);
        }

        // Return existing instance
        return $this->api;
    }
public function api()
    {
        if (!$this->api) {
            
            $shopDomain = $this->shopify_domain;
            $token = $this->session()->getToken();

            
            $this->api = ShopifyApp::api();
            $this->api->setSession($shopDomain, $token);
        }

        
        return $this->api;
    }
public function api ( ) { if ( ! $ this -> api ) { // Get the domain and token $ shopDomain = $ this -> shopify_domain ; $ token = $ this -> session ( ) -> getToken ( ) ; // Create new API instance $ this -> api = ShopifyApp :: api ( ) ; $ this -> api -> setSession ( $ shopDomain , $ token ) ; } // Return existing instance return $ this -> api ; }
Creates or returns an instance of API for the shop.

@return \OhMyBrew\BasicShopifyAPI
Creates or returns an instance of API for the shop .