---
title: Account Management
slug: php-sdk/xpYS-account-management
docTags: 
createdAt: 2024-05-13T16:02:05.580Z
---

The PHP-SDK provides means of retrieving information about your Klevu account for use within your app. Via the account services , you can

- Generate an Account object containing account information and URL endpoints
- Query features enabled on your account
- Update the URL used by our indexer to download an XML feed of your catalog \[**Shopify and Bigcommerce customers only**]

## Retrieving Klevu Account Information

The AccountLookupService will query the `api.ksearchnet.com/user-account/public/platform/account/details` endpoint using your JS API Key and REST AUTH Key (available via Store Settings in KMC) and return an Account object. The Account object will provide the following information

| Property                        | Description                                                                                                         |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `jsApiKey`                      | Your unique public key<br />Example: `"klevu-1234567890"`                                                           |
| `restAuthKey`                   | Your private key, used to authenticate your account<br />Example: `"ABCDE1234567890"`                               |
| `platform`                      | The platform or framework your account is regstered to integrate with<br />Example: `"magento"`                     |
| `active`                        | Whether this account is currently active<br />Example: `true`                                                       |
| `companyName`                   | The company name entered when signing up to KMC<br />Example: `"Klevu"`                                             |
| `email`                         | The primary email address registered for this account<br />Example: `"contact@klevu.com"`                           |
| `indexingUrl`                   | Domain used to send data for indexing<br />Example: `"indexing.ksearchnet.com"`                                     |
| `searchUrl`                     | Domain used to perform searches on indexed data<br />Example: `"eucs27v2.ksearchnet.com"`                           |
| `smartCategoryMerchandisingUrl` | Domain used to perform Smart Category Merchandising queries on indexed data<br />Example: `"cn27v2.ksearchnet.com"` |
| `analyticsUrl`                  | Domain used to send analytics events<br />Example: `"stats.ksearchnet.com"`                                         |
| `jsUrl`                         | Domain used to embed Klevu-hosted JavaScript asssets<br />Example: `"js.klevu.com"`                                 |
| `tiersUrl`                      | Domain used to retrieve features information for a Klevu account<br />Example: `"tiers.klevu.com"`                  |

### Validation and Exception Handling

- Prior to transmitting data, the provided account credentials are validated as not empty and correctly formatted, throwing a `ValidationException` on failure
- Requests returning a 401 status code from Klevu throw an `AccountNotFoundException`
- Request exceptions, or responses identifying an invalid request throw a`BadRequestException`
- Client or Network exceptions, responses with unexpected status codes, or responses with a missing or invalid body content throw a `BadResponseException`

### Logging

- Request headers and body are logged prior to send at `DEBUG` level
- Response headers, body, and execution time are logged on successful request send at `DEBUG` level

*More information and code samples can be found under&#x20;*[Examples / How To > Account Management > Retrieve Klevu Account Details](docId:1t7gUNUfpS0b-ICOkGwAr)

## Querying Enabled Features for Account

The AccountFeaturesService will query the Tiers endpoint and return an AccountFeatures object containing flags for features enabled on your Klevu account.&#x20;
An AccountFeatures object can also be attached to Account objects, and access via the `Account::getAccountFeatures()` method.

The following feature flags are available:

| Flag                         | Description                                                                                                                               |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `smartCategoryMerchandising` | Whether the [Smart Category Merchandising](https://www.klevu.com/solutions/category-merchandising/) solution is available on this account |
| `smartRecommendations`       | Whether the [Product Recommendations](https://www.klevu.com/solutions/product-recommendations/) solution is available on this account     |
| `preserveLayout`             | Whether Preserve Layout should be available as a frontend layout option for integrations using this account                               |

### Validation and Exception Handling

- Prior to transmitting data, the provided account credentials are validated as not empty and correctly formatted, throwing a `ValidationException` on failure
- Request exceptions, or responses identifying an invalid request throw a`BadRequestException`
- Client or Network exceptions, responses with unexpected status codes, or responses with a missing or invalid body content throw a `BadResponseException`

### Logging

- Request headers and body are logged prior to send at `DEBUG` level
- Response headers, body, and execution time are logged on successful request send at `DEBUG` level
- Requested flags missing from, or unknown flags encountered within, the response are logged at `WARNING` level

*More information and code samples can be found under&#x20;*[Examples / How To > Account Management > Retrieve Klevu Account Details](docId:1t7gUNUfpS0b-ICOkGwAr)

## Updating the Store Feed Endpoint

:::hint{type="warning"}
**Note**: only available for accounts registered to integrate with Shopify or Bigcommerce stores
:::

The URL used by Klevu's indexing service to download and process catalog feeds in XML format can be modified using the UpdateStoreFeedUrlService. URL updates will take effect the next time Klevu's Feed Monitor service performs a scheduled sync.

To update the feed URL value for your account, you will need

- Your JS API and REST AUTH keys
- The platorm for which your account was registered (eg "shopify")
- The base URL associated with your Klevu account
- The full URL from which XML feeds can be downloaded

### Validation and Exception Handling

- Prior to transmitting data, the provided account credentials are validated as not empty and correctly formatted, throwing a `ValidationException` on failure
- Request exceptions, or responses identifying an invalid request throw a`BadRequestException`
- Client or Network exceptions, responses with unexpected status codes, or responses with a missing or invalid body content throw a `BadResponseException`

### Logging

- Request headers and body are logged prior to send at `DEBUG` level
- Response headers, body, and execution time are logged on successful request send at `DEBUG` level
- Requested flags missing from, or unknown flags encountered within, the response are logged at `WARNING` level

*More information and code samples can be found under&#x20;*[Examples / How To > Account Management > Update Store Feed Endpoint](docId\:GkiS-qMoZN9nU2WKWgrqO)
