# Store

> This page documents the **new** Vitrin store functions and shows the old Zid equivalents.

All functions are available via **`window.zid.store`**.

---

## List Countries

**New:** `zid.store.countries()`
**Old:** `zid.store.settings.fetchCountries()`

**Description:** Retrieve a list of countries available in the store.

### Usage

```js
const countries = await zid.store.countries();
console.log(countries);

// Or using then/catch
zid.store.countries()
  .then(countries => {
    console.log(countries);
  })
  .catch(error => {
    console.log(error.status, error.responseData);
  });
```

---

## Get Cities of a Country

**New:** `zid.store.getCities(country_id)`
**Old:** `zid.store.settings.fetchCitiesOfCountry(countryId)`

**Description:** Retrieve a list of cities for a given country.

### Arguments

* **`country_id`** *(number, required)* — The ID of the country.

### Usage

```js
const cities = await zid.store.getCities(1);
console.log(cities);

// Or using then/catch
zid.store.getCities(1)
  .then(cities => {
    console.log(cities);
  })
  .catch(error => {
    console.log(error.status, error.responseData);
  });
```

---

## Get Terms and Conditions

**New:** `zid.store.getTermsAndCondition()`
**Old:** `zid.store.settings.fetchTermsAndCondition()`

**Description:** Retrieve the Terms and Conditions page of the store.

### Usage

```js
const terms = await zid.store.getTermsAndCondition();
console.log(terms);

// Or using then/catch
zid.store.getTermsAndCondition()
  .then(terms => {
    console.log(terms);
  })
  .catch(error => {
    console.log(error.status, error.responseData);
  });
```

---

## Get Privacy Policy

**New:** `zid.store.getPrivacyPolicy()`
**Old:** `zid.store.settings.fetchPrivacyPolicy()`

**Description:** Retrieve the Privacy Policy page of the store.

### Usage

```js
const policy = await zid.store.getPrivacyPolicy();
console.log(policy);

// Or using then/catch
zid.store.getPrivacyPolicy()
  .then(policy => {
    console.log(policy);
  })
  .catch(error => {
    console.log(error.status, error.responseData);
  });
```

---

## Get FAQs

**New:** `zid.store.getFaqs()`
**Old:** `zid.store.page.fetchFaqs()`

**Description:** Retrieve all Frequently Asked Questions (FAQs).

### Usage

```js
const faqs = await zid.store.getFaqs();
console.log(faqs);

// Or using then/catch
zid.store.getFaqs()
  .then(faqs => {
    console.log(faqs);
  })
  .catch(error => {
    console.log(error.status, error.responseData);
  });
```

---

## Get Shipping and Payment

**New:** `zid.store.getShippingAndPayment()`
**Old:** `zid.store.page.fetchShippingAndPayment()`

**Description:** Retrieve information about shipping and payment options in the store.

### Usage

```js
const info = await zid.store.getShippingAndPayment();
console.log(info);

// Or using then/catch
zid.store.getShippingAndPayment()
  .then(info => {
    console.log(info);
  })
  .catch(error => {
    console.log(error.status, error.responseData);
  });
```

