> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alana.shopping/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Merchant Center

> Google Shopping XML feed format, required fields, and validation.

## Overview

The Google feed returns an RSS 2.0 XML document with Google Merchant Center product attributes (`g:` namespace). Submit this URL directly in Google Merchant Center as a scheduled fetch.

## Feed URL

```
GET /api/v1/feeds/google
```

Add this URL to Google Merchant Center under **Products → Feeds → Fetch URL**.

## XML Format

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">
  <channel>
    <title>Your Store Name</title>
    <link>https://yourstore.com</link>
    <description>Product feed</description>
    <item>
      <g:id>SKU-001</g:id>
      <g:title>Blue Cotton T-Shirt</g:title>
      <g:description>100% cotton, pre-shrunk, available in S-XXL</g:description>
      <g:link>https://yourstore.com/products/blue-tshirt</g:link>
      <g:image_link>https://cdn.yourstore.com/blue-tshirt.jpg</g:image_link>
      <g:availability>in stock</g:availability>
      <g:price>29.99 BRL</g:price>
      <g:brand>YourBrand</g:brand>
      <g:condition>new</g:condition>
      <g:google_product_category>Apparel &amp; Accessories &gt; Clothing</g:google_product_category>
    </item>
  </channel>
</rss>
```

## Required Fields

| Field            | Description                                 |
| ---------------- | ------------------------------------------- |
| `g:id`           | Unique product identifier (SKU)             |
| `g:title`        | Product name (max 150 chars)                |
| `g:description`  | Product description (max 5000 chars)        |
| `g:link`         | Product page URL                            |
| `g:image_link`   | Main product image URL                      |
| `g:availability` | `in stock`, `out of stock`, or `preorder`   |
| `g:price`        | Price with currency code (e.g. `29.99 BRL`) |
| `g:brand`        | Brand name                                  |
| `g:condition`    | `new`, `used`, or `refurbished`             |

## Requesting the Feed

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://app.alana.shopping/api/v1/feeds/google" \
    -H "X-API-Key: sk_live_your_api_key" \
    -o google-feed.xml
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    "https://app.alana.shopping/api/v1/feeds/google",
    { headers: { "X-API-Key": "sk_live_your_api_key" } }
  );
  const xml = await res.text();
  ```

  ```python Python theme={null}
  import requests

  res = requests.get(
      "https://app.alana.shopping/api/v1/feeds/google",
      headers={"X-API-Key": "sk_live_your_api_key"},
  )
  with open("google-feed.xml", "wb") as f:
      f.write(res.content)
  ```
</CodeGroup>

## Validation Endpoint

Check your feed for Google policy violations before submission:

```
GET /api/v1/feeds/google/validate
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://app.alana.shopping/api/v1/feeds/google/validate" \
    -H "X-API-Key: sk_live_your_api_key"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    "https://app.alana.shopping/api/v1/feeds/google/validate",
    { headers: { "X-API-Key": "sk_live_your_api_key" } }
  );
  const report = await res.json();
  console.log(report.errors, report.warnings);
  ```

  ```python Python theme={null}
  import requests

  res = requests.get(
      "https://app.alana.shopping/api/v1/feeds/google/validate",
      headers={"X-API-Key": "sk_live_your_api_key"},
  )
  report = res.json()
  print(report["errors"], report["warnings"])
  ```
</CodeGroup>

## Common Errors

| Error                                 | Cause                       | Fix                                  |
| ------------------------------------- | --------------------------- | ------------------------------------ |
| `Missing required attribute: g:brand` | Product has no brand        | Add brand to product in Alana        |
| `Invalid price format`                | Price missing currency code | Ensure price field includes currency |
| `Image URL not accessible`            | Image returns 404           | Update product image URL             |
| `Title too long`                      | Title exceeds 150 chars     | Shorten product title                |
