Examples / How To
Account Management
Update Store Feed Endpoint (Shopify / Bigcommerce)
4min
this guide assumes you have installed the latest version of klevu/php sdk , either via composer or from source, and autoloading is functioning as expected this guide is applicable to shopify and bigcommerce stores only before making changes to your feed endpoint, please consult with our support team updating store feed endpoint to update the endpoint used by klevu's xml feed monitoring service, first locate your klevu api and rest auth keys and create an accountcredentials object (see quickstart for steps) next, instantiate an updatestorefeedurlservice object and call the execute method with the following information account credentials retrieved above the full url which should be used to download your xml feed the store type (from the platforms enum options) the url used to register your account note the domain should contain either myshopify com or mybigcommerce com this call will throw exceptions if any issues arise, so you should catch and handle these appropriately at this point, you will have an apiresponseinterface which can be checked for success status, as well as any errors returned by the klevu api \<?php declare(strict types=1); use klevu\phpsdk\exception\api\badrequestexception; use klevu\phpsdk\exception\api\badresponseexception; use klevu\phpsdk\exception\validationexception; use klevu\phpsdk\model\accountcredentials; use klevu\phpsdk\model\platforms; use klevu\phpsdk\service\account\updatestorefeedurlservice; $accountcredentials = new accountcredentials( jsapikey "klevu 123456780", restauthkey "abcde1234567890", ); $updatestorefeedurlservice = new updatestorefeedurlservice( // inject any relevant dependencies, such as http client; logger; or user agent provider ); $response = null; try { $response = $updatestorefeedurlservice >execute( accountcredentials $accountcredentials, indexingurl 'https //www example com/feed xml', storetype platforms shopify >value, // "shopify" storeurl 'https //example myshopify com', ); } catch (validationexception $exception) { // one or more supplied arguments are missing or invalid } catch (badrequestexception $exception) { // klevu api rejected the request as invalid } catch (badresponseexception $exception) { // klevu api responded in an unexpected manner } $updatedsuccessfully = $response? >issuccess() ? false; $messages = $response? >getmessages() ? \[]; source code reference exception\api\ badrequestexception exception\api\ badresponseexception exception\ validationexception model\ accountcredentials model\ platforms service\account\ updatestorefeedurlservice