---
title: Update Store Feed Endpoint (Shopify / Bigcommerce)
slug: php-sdk/update-xml-feed-endpoi
docTags: 
createdAt: 2024-05-13T16:03:09.046Z
---

:::hint{type="info"}
*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.*
:::

:::hint{type="warning"}
This guide is applicable to Shopify and Bigcommerce stores only. Before making changes to your feed endpoint, please [consult with our support team](https://help.klevu.com/support/tickets/new).
:::

## 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
<?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](https://github.com/klevu/php-sdk/blob/master/src/Exception/Api/BadRequestException.php)
- Exception\Api\\[BadResponseException](https://github.com/klevu/php-sdk/blob/master/src/Exception/Api/BadResponseException.php)
- Exception\\[ValidationException](https://github.com/klevu/php-sdk/blob/master/src/Exception/ValidationException.php)
- Model\\[AccountCredentials](https://github.com/klevu/php-sdk/blob/master/src/Model/AccountCredentials.php)
- Model\\[Platforms](https://github.com/klevu/php-sdk/blob/master/src/Model/Platforms.php)
- Service\Account\\[UpdateStoreFeedUrlService](https://github.com/klevu/php-sdk/blob/master/src/Service/Account/UpdateStoreFeedUrlService.php)







