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

# Modèle Advert

> Schéma complet d'une advert — annonce individuelle sur un portail (1 URL = 1 advert).

Une **Advert** = annonce individuelle sur un portail. **1 URL = 1 Advert.** Plusieurs adverts décrivant le même bien physique sont rattachées à une même `Property` parente après déduplication.

```mermaid theme={null}
flowchart LR
  A1["Advert · portail A<br/>flxId=adv_a"] --> P[("Property<br/>flxId=prop_X")]
  A2["Advert · portail B<br/>flxId=adv_b"] --> P
  A3["Advert · portail C<br/>flxId=adv_c"] --> P
```

## Champs principaux

Schéma OpenAPI complet rendu plus bas par Mintlify (`AdvertDto`). Tableau ci-dessous : champs métier + champs spécifiques advert.

| Champ                 | Type                | Description                                                                                                                                                                                                                                    |
| --------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `flxId`               | `string`            | Identifiant unique Fluximmo de l'advert.                                                                                                                                                                                                       |
| `propertyFlxId`       | `string`            | flxId de la `Property` parente côté Fluximmo (toujours présent en prod). **Deux adverts avec le même `propertyFlxId` sont des doublons d'un même bien physique.**                                                                              |
| `mainPropertyAdFlxId` | `string`            | flxId de l'**Advert** primaire (premier dupliqué détecté) au sein du groupe. À distinguer de `propertyFlxId` qui pointe vers la **Property** parente. (**déprécié** — utiliser `propertyFlxId` à la place. Conservé pour rétro-compatibilité.) |
| `type`                | `enum`              | Mêmes valeurs que [`PropertyDto.type`](/api-v2-reference/_api-models/property#champs-principaux).                                                                                                                                              |
| `title`               | `string`            | Titre de l'annonce tel que sur le portail source.                                                                                                                                                                                              |
| `description`         | `string`            | Description telle que sur le portail source.                                                                                                                                                                                                   |
| `source`              | `SourceDto`         | `{ flxId, url, website }` — `website` = identifiant du portail/source (grands réseaux d'agences, mandataires indépendants, agences locales, etc.) + URL canonique.                                                                             |
| `seller`              | `LightSellerDto`    | `{ flxId, name, siren, type }` avec `type` ∈ `SELLER_TYPE_AGENCY`, `SELLER_TYPE_NETWORK`, `SELLER_TYPE_UNKNOWN`.                                                                                                                               |
| `contactInCharge`     | `ContactDto`        | Contact en charge (quand disponible).                                                                                                                                                                                                          |
| `isOnline`            | `boolean`           | Annonce actuellement en ligne sur le portail.                                                                                                                                                                                                  |
| `isPro`               | `boolean`           | Vendeur professionnel.                                                                                                                                                                                                                         |
| `isExclusive`         | `boolean`           | Annonce déclarée exclusive par le vendeur.                                                                                                                                                                                                     |
| `isAuction`           | `boolean`           | Annonce de type enchère.                                                                                                                                                                                                                       |
| `isUrgent`            | `boolean`           | Marquée urgent.                                                                                                                                                                                                                                |
| `firstSeenAt`         | `Date`              | Première fois que Fluximmo a vu cette advert (ISO 8601).                                                                                                                                                                                       |
| `lastSeenAt`          | `Date`              | Dernière fois vue.                                                                                                                                                                                                                             |
| `lastModifiedAt`      | `Date`              | Dernière modification détectée (ISO 8601).                                                                                                                                                                                                     |
| `currentPrice`        | `AdvertPriceDto`    | `{ value, valuePerArea }` — prix courant de l'advert (€).                                                                                                                                                                                      |
| `currency`            | `enum`              | `CURRENCY_EUR` ou `CURRENCY_USD`.                                                                                                                                                                                                              |
| `scope`               | `enum`              | `PRICING_ONE_OFF` ou `PRICING_MENSUAL`.                                                                                                                                                                                                        |
| `charges`             | `ChargesDto`        | Charges récurrentes, taxes, suppléments de loyer, frais annuels.                                                                                                                                                                               |
| `warrantyDeposit`     | `number`            | Dépôt de garantie (location).                                                                                                                                                                                                                  |
| `offer`               | `OfferDto`          | Voir [Property → offer](/api-v2-reference/_api-models/property#champs-principaux).                                                                                                                                                             |
| `location`            | `AdLocationDto`     | Voir [Property → location](/api-v2-reference/_api-models/property#champs-principaux) (équivalent, sans `region`/`country` natifs — utiliser `department` et `postalCode`).                                                                     |
| `habitation`          | `TypeHabitationDto` | Idem Property : `{ surface, roomCount, bedroomCount, climate (DPE/GES), characteristics, features, … }`.                                                                                                                                       |
| `land`                | `TypeLandDto`       | Détails terrain.                                                                                                                                                                                                                               |
| `parking`             | `TypeParkingDto`    | Détails parking.                                                                                                                                                                                                                               |
| `medias`              | `MediasDto`         | Photos / médias de cette advert.                                                                                                                                                                                                               |
| `tags`                | `string[]`          | Tags non structurés.                                                                                                                                                                                                                           |
| `hasAnomaly`          | `boolean`           | Incohérence détectée.                                                                                                                                                                                                                          |

> **Note** — pour les structures partagées (`OfferDto`, `TypeHabitationDto`, `MetaDto`-like), voir la page [Property](/api-v2-reference/_api-models/property). L'Advert n'a pas de bloc `meta` séparé : `firstSeenAt`, `lastSeenAt`, `lastModifiedAt`, `isOnline` sont au niveau racine de l'advert.

## Events spécifiques aux adverts

L'Advert est l'objet **dynamique** (ce qui change dans le temps). Les webhooks `ALERT_MATCH_ADVERT_EVENT` couvrent :

* `PRICE` — toute variation de prix (même 1 €).
* `REPUBLISHED` — passage `isOnline: false` → `true`.
* `UNPUBLISHED` — passage `isOnline: true` → `false`.

Le check interne `CHECK` (vérification sans changement détecté) ne déclenche **pas** de webhook. Détails : [Match types & cycle alerte](/concepts/match-types-cycle-alerte).

<Snippet file="warning-city-deprecated.mdx" />

## JSON exemple

```json theme={null}
{
  "flxId": "adv_01HXY...",
  "propertyFlxId": "prop_01HXY...",
  "mainPropertyAdFlxId": "adv_01HXY_main",
  "type": "CLASS_FLAT",
  "title": "T3 75m² Bastille - terrasse",
  "source": {
    "website": "<portail-a>",
    "url": "https://<portail-a>.example/annonces/...",
    "flxId": "src_01HXY..."
  },
  "seller": { "name": "Agence Bastille Immo", "type": "SELLER_TYPE_AGENCY", "siren": "812345678" },
  "isOnline": true,
  "isPro": true,
  "isExclusive": false,
  "isAuction": false,
  "currency": "CURRENCY_EUR",
  "scope": "PRICING_ONE_OFF",
  "currentPrice": { "value": 435000, "valuePerArea": 5800 },
  "offer": { "type": "OFFER_BUY", "isCurrentlyOccupied": false },
  "location": {
    "postalCode": "75011", "inseeCode": "75111", "city": "Paris",
    "locationCoordinate": { "lat": 48.857, "lng": 2.376 }
  },
  "habitation": { "surface": { "total": 75 }, "roomCount": 3, "bedroomCount": 2 },
  "firstSeenAt": "2025-04-22T09:11:00.000Z",
  "lastSeenAt":  "2025-04-30T18:42:00.000Z",
  "lastModifiedAt": "2025-04-29T07:00:00.000Z"
}
```

Échantillon live : `GET /v2/sample/adverts` — voir [Sample data](/demarrer/sample-data).

## Différences clés vs Property

<Snippet file="decision-matrix-property-vs-advert.mdx" />

Détails conceptuels : [Property vs Advert](/concepts/property-vs-advert).

## Déduplication côté client (`propertyFlxId`)

Chaque advert porte un `propertyFlxId` qui pointe vers sa `Property` parente côté Fluximmo. **Deux adverts avec le même `propertyFlxId` sont des doublons d'un même bien physique.**

Pour identifier l'advert primaire d'un groupe (le premier dupliqué détecté), utilisez `mainPropertyAdFlxId`.

```json theme={null}
// Advert 1 — racine de la chaîne
{ "flxId": "adv_aaa", "propertyFlxId": "prop_xxx", "mainPropertyAdFlxId": "adv_aaa", "source": { "website": "<portail-a>" } }

// Advert 2 — doublon ingéré 12 h plus tard sur un autre portail
{ "flxId": "adv_bbb", "propertyFlxId": "prop_xxx", "mainPropertyAdFlxId": "adv_aaa", "source": { "website": "<portail-b>" } }
```

Côté DB, vous savez que `adv_bbb` est doublon de `adv_aaa` (même `propertyFlxId`). Un client ADVERTS-only peut ainsi reconstruire sa propre vue agrégée à la `Property` en groupant par `propertyFlxId` — sans dépendre de l'API properties côté Fluximmo.

## Cas d'usage

**Alerte chasseur temps réel.** Vous voulez chaque variation de prix, chaque republication d'annonce ? Souscrivez `ALERT_MATCH_ADVERT_EVENT` — payload **complet** dans le webhook (pas de refetch nécessaire).

**Réplication BDD source-par-source.** 1 advert = 1 ligne par portail. Idéal pour reconstituer en local le flux brut multi-portail, garder la trace de chaque URL et de qui (quel `seller`) a publié quoi.

**Tracking concurrentiel par agence.** `seller.flxId` + `source.website` permettent de suivre l'inventaire d'une agence donnée sur un portail donné, et de mesurer `firstSeenAt` → `UNPUBLISHED` (durée de vie de l'annonce).

## Endpoints associés

* [`GET /v2/protected/adverts/{flxId}`](/api-v2-reference/adverts/get-adverts-byt-their-flx_id) — fetch direct par flxId.
* [`PUT /v2/protected/adverts/search/alerts`](/api-v2-reference/adverts-alerts/create-a-new-advert-alert-for-this-search) — alerte temps réel sur les nouveaux adverts.
* [Match types & cycle alerte](/concepts/match-types-cycle-alerte) — events `PRICE`, `REPUBLISHED`, `UNPUBLISHED`.
