curl --request POST \
--url https://api.avest.fr/v1/external-integration/sale \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"settings": {
"allocation": {
"agencyGroupId": "66cc8a8e75c9fac35c6ecd73",
"agencyId": "66cc91d475c9fac35c86ed80",
"userId": "66cc91f05f84c9b212d9ec24",
"disableDeduplication": false
},
"step": "QUL"
},
"appointment": {
"date": "2025-01-20T00:00:00.000Z",
"startAt": "2025-01-20T10:00:00.000Z",
"endAt": "2025-01-20T11:00:00.000Z",
"note": "Rendez-vous estimation"
},
"note": {
"title": "Rappel client",
"content": "Client très intéressé"
},
"transactionType": "sale",
"contact": {
"firstName": "Jean",
"lastName": "Dupont",
"email": "jean.dupont@email.com",
"phone": "+33612345678"
},
"address": "11 rue de Paris, 75001 Paris, France",
"transaction": {
"project": "B",
"property": {
"mainType": "apartment",
"size": 85,
"rooms": 4,
"bedrooms": 3,
"hasElevator": true,
"floor": 3,
"DPEEnergyTag": "D",
"DPEGESTag": "C"
},
"fieldValue": {
"low": 220000,
"high": 260000
},
"mandate": {
"sellPrice": 250000,
"agencyCommission": 12500,
"feeResponsibility": "buyer",
"type": "exclusive"
},
"parsingCustomId": "EXT-2025-001"
}
}
'import requests
url = "https://api.avest.fr/v1/external-integration/sale"
payload = {
"settings": {
"allocation": {
"agencyGroupId": "66cc8a8e75c9fac35c6ecd73",
"agencyId": "66cc91d475c9fac35c86ed80",
"userId": "66cc91f05f84c9b212d9ec24",
"disableDeduplication": False
},
"step": "QUL"
},
"appointment": {
"date": "2025-01-20T00:00:00.000Z",
"startAt": "2025-01-20T10:00:00.000Z",
"endAt": "2025-01-20T11:00:00.000Z",
"note": "Rendez-vous estimation"
},
"note": {
"title": "Rappel client",
"content": "Client très intéressé"
},
"transactionType": "sale",
"contact": {
"firstName": "Jean",
"lastName": "Dupont",
"email": "jean.dupont@email.com",
"phone": "+33612345678"
},
"address": "11 rue de Paris, 75001 Paris, France",
"transaction": {
"project": "B",
"property": {
"mainType": "apartment",
"size": 85,
"rooms": 4,
"bedrooms": 3,
"hasElevator": True,
"floor": 3,
"DPEEnergyTag": "D",
"DPEGESTag": "C"
},
"fieldValue": {
"low": 220000,
"high": 260000
},
"mandate": {
"sellPrice": 250000,
"agencyCommission": 12500,
"feeResponsibility": "buyer",
"type": "exclusive"
},
"parsingCustomId": "EXT-2025-001"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
settings: {
allocation: {
agencyGroupId: '66cc8a8e75c9fac35c6ecd73',
agencyId: '66cc91d475c9fac35c86ed80',
userId: '66cc91f05f84c9b212d9ec24',
disableDeduplication: false
},
step: 'QUL'
},
appointment: {
date: '2025-01-20T00:00:00.000Z',
startAt: '2025-01-20T10:00:00.000Z',
endAt: '2025-01-20T11:00:00.000Z',
note: 'Rendez-vous estimation'
},
note: {title: 'Rappel client', content: 'Client très intéressé'},
transactionType: 'sale',
contact: {
firstName: 'Jean',
lastName: 'Dupont',
email: 'jean.dupont@email.com',
phone: '+33612345678'
},
address: '11 rue de Paris, 75001 Paris, France',
transaction: {
project: 'B',
property: {
mainType: 'apartment',
size: 85,
rooms: 4,
bedrooms: 3,
hasElevator: true,
floor: 3,
DPEEnergyTag: 'D',
DPEGESTag: 'C'
},
fieldValue: {low: 220000, high: 260000},
mandate: {
sellPrice: 250000,
agencyCommission: 12500,
feeResponsibility: 'buyer',
type: 'exclusive'
},
parsingCustomId: 'EXT-2025-001'
}
})
};
fetch('https://api.avest.fr/v1/external-integration/sale', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.avest.fr/v1/external-integration/sale",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'settings' => [
'allocation' => [
'agencyGroupId' => '66cc8a8e75c9fac35c6ecd73',
'agencyId' => '66cc91d475c9fac35c86ed80',
'userId' => '66cc91f05f84c9b212d9ec24',
'disableDeduplication' => false
],
'step' => 'QUL'
],
'appointment' => [
'date' => '2025-01-20T00:00:00.000Z',
'startAt' => '2025-01-20T10:00:00.000Z',
'endAt' => '2025-01-20T11:00:00.000Z',
'note' => 'Rendez-vous estimation'
],
'note' => [
'title' => 'Rappel client',
'content' => 'Client très intéressé'
],
'transactionType' => 'sale',
'contact' => [
'firstName' => 'Jean',
'lastName' => 'Dupont',
'email' => 'jean.dupont@email.com',
'phone' => '+33612345678'
],
'address' => '11 rue de Paris, 75001 Paris, France',
'transaction' => [
'project' => 'B',
'property' => [
'mainType' => 'apartment',
'size' => 85,
'rooms' => 4,
'bedrooms' => 3,
'hasElevator' => true,
'floor' => 3,
'DPEEnergyTag' => 'D',
'DPEGESTag' => 'C'
],
'fieldValue' => [
'low' => 220000,
'high' => 260000
],
'mandate' => [
'sellPrice' => 250000,
'agencyCommission' => 12500,
'feeResponsibility' => 'buyer',
'type' => 'exclusive'
],
'parsingCustomId' => 'EXT-2025-001'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.avest.fr/v1/external-integration/sale"
payload := strings.NewReader("{\n \"settings\": {\n \"allocation\": {\n \"agencyGroupId\": \"66cc8a8e75c9fac35c6ecd73\",\n \"agencyId\": \"66cc91d475c9fac35c86ed80\",\n \"userId\": \"66cc91f05f84c9b212d9ec24\",\n \"disableDeduplication\": false\n },\n \"step\": \"QUL\"\n },\n \"appointment\": {\n \"date\": \"2025-01-20T00:00:00.000Z\",\n \"startAt\": \"2025-01-20T10:00:00.000Z\",\n \"endAt\": \"2025-01-20T11:00:00.000Z\",\n \"note\": \"Rendez-vous estimation\"\n },\n \"note\": {\n \"title\": \"Rappel client\",\n \"content\": \"Client très intéressé\"\n },\n \"transactionType\": \"sale\",\n \"contact\": {\n \"firstName\": \"Jean\",\n \"lastName\": \"Dupont\",\n \"email\": \"jean.dupont@email.com\",\n \"phone\": \"+33612345678\"\n },\n \"address\": \"11 rue de Paris, 75001 Paris, France\",\n \"transaction\": {\n \"project\": \"B\",\n \"property\": {\n \"mainType\": \"apartment\",\n \"size\": 85,\n \"rooms\": 4,\n \"bedrooms\": 3,\n \"hasElevator\": true,\n \"floor\": 3,\n \"DPEEnergyTag\": \"D\",\n \"DPEGESTag\": \"C\"\n },\n \"fieldValue\": {\n \"low\": 220000,\n \"high\": 260000\n },\n \"mandate\": {\n \"sellPrice\": 250000,\n \"agencyCommission\": 12500,\n \"feeResponsibility\": \"buyer\",\n \"type\": \"exclusive\"\n },\n \"parsingCustomId\": \"EXT-2025-001\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.avest.fr/v1/external-integration/sale")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"settings\": {\n \"allocation\": {\n \"agencyGroupId\": \"66cc8a8e75c9fac35c6ecd73\",\n \"agencyId\": \"66cc91d475c9fac35c86ed80\",\n \"userId\": \"66cc91f05f84c9b212d9ec24\",\n \"disableDeduplication\": false\n },\n \"step\": \"QUL\"\n },\n \"appointment\": {\n \"date\": \"2025-01-20T00:00:00.000Z\",\n \"startAt\": \"2025-01-20T10:00:00.000Z\",\n \"endAt\": \"2025-01-20T11:00:00.000Z\",\n \"note\": \"Rendez-vous estimation\"\n },\n \"note\": {\n \"title\": \"Rappel client\",\n \"content\": \"Client très intéressé\"\n },\n \"transactionType\": \"sale\",\n \"contact\": {\n \"firstName\": \"Jean\",\n \"lastName\": \"Dupont\",\n \"email\": \"jean.dupont@email.com\",\n \"phone\": \"+33612345678\"\n },\n \"address\": \"11 rue de Paris, 75001 Paris, France\",\n \"transaction\": {\n \"project\": \"B\",\n \"property\": {\n \"mainType\": \"apartment\",\n \"size\": 85,\n \"rooms\": 4,\n \"bedrooms\": 3,\n \"hasElevator\": true,\n \"floor\": 3,\n \"DPEEnergyTag\": \"D\",\n \"DPEGESTag\": \"C\"\n },\n \"fieldValue\": {\n \"low\": 220000,\n \"high\": 260000\n },\n \"mandate\": {\n \"sellPrice\": 250000,\n \"agencyCommission\": 12500,\n \"feeResponsibility\": \"buyer\",\n \"type\": \"exclusive\"\n },\n \"parsingCustomId\": \"EXT-2025-001\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avest.fr/v1/external-integration/sale")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"settings\": {\n \"allocation\": {\n \"agencyGroupId\": \"66cc8a8e75c9fac35c6ecd73\",\n \"agencyId\": \"66cc91d475c9fac35c86ed80\",\n \"userId\": \"66cc91f05f84c9b212d9ec24\",\n \"disableDeduplication\": false\n },\n \"step\": \"QUL\"\n },\n \"appointment\": {\n \"date\": \"2025-01-20T00:00:00.000Z\",\n \"startAt\": \"2025-01-20T10:00:00.000Z\",\n \"endAt\": \"2025-01-20T11:00:00.000Z\",\n \"note\": \"Rendez-vous estimation\"\n },\n \"note\": {\n \"title\": \"Rappel client\",\n \"content\": \"Client très intéressé\"\n },\n \"transactionType\": \"sale\",\n \"contact\": {\n \"firstName\": \"Jean\",\n \"lastName\": \"Dupont\",\n \"email\": \"jean.dupont@email.com\",\n \"phone\": \"+33612345678\"\n },\n \"address\": \"11 rue de Paris, 75001 Paris, France\",\n \"transaction\": {\n \"project\": \"B\",\n \"property\": {\n \"mainType\": \"apartment\",\n \"size\": 85,\n \"rooms\": 4,\n \"bedrooms\": 3,\n \"hasElevator\": true,\n \"floor\": 3,\n \"DPEEnergyTag\": \"D\",\n \"DPEGESTag\": \"C\"\n },\n \"fieldValue\": {\n \"low\": 220000,\n \"high\": 260000\n },\n \"mandate\": {\n \"sellPrice\": 250000,\n \"agencyCommission\": 12500,\n \"feeResponsibility\": \"buyer\",\n \"type\": \"exclusive\"\n },\n \"parsingCustomId\": \"EXT-2025-001\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"avestId": "V-2025-001",
"user": {
"id": "66cc91f05f84c9b212d9ec24",
"firstName": "Marie",
"lastName": "Martin",
"jobTitle": "Agent immobilier",
"email": "marie.martin@agence.com",
"phone": "+33601020304"
},
"contact": {
"id": "618a35a36d932054e195ca0a",
"firstName": "Jean",
"lastName": "Dupont"
},
"transaction": {
"id": "619b46b47e043165f206db1b",
"customId": "V-2025-001",
"step": "QUL",
"project": "B",
"property": {
"addressData": {
"streetNumber": "11",
"route": "Rue de Paris",
"postalCode": "75001",
"city": "Paris",
"country": "France",
"countryCode": "FR",
"formattedAddress": "11 Rue de Paris, 75001 Paris, France"
},
"addresses": [
{
"streetNumber": "11",
"route": "Rue de Paris",
"postalCode": "75001",
"city": "Paris",
"country": "France",
"countryCode": "FR",
"formattedAddress": "11 Rue de Paris, 75001 Paris, France"
}
]
}
}
}Créer ou mettre à jour une vente
Crée ou met à jour une vente (estimation / mandat vendeur) avec déduplication automatique du contact et de la transaction.
Déduplication : recherche d’un contact existant par téléphone ou email dans le groupe d’agences (mise à jour si trouvé, création sinon), puis recherche d’une vente active à la même adresse pour ce contact. Allocation automatique d’un utilisateur / agence selon les règles configurées (forçable via settings.allocation). Étape calculée automatiquement selon le projet (forçable via settings.step sur une nouvelle vente ; sur une vente retrouvée, l’étape ne change pas).
appointment est disponible pour les ventes et les locations, et crée une activité « meeting » liée à la transaction, sans renseigner les dates d’estimation de la fiche. Avec settings.step: RDV dans la même requête, la vente est créée à l’étape RDV avec son rendez-vous à venir. note crée une activité « note ». En cas d’erreur sur ces créations, la transaction est quand même créée. parsingCustomId est enregistré et renvoyé en lecture ; il ne sert pas à la déduplication.
settings.allocation.agencyGroupId doit être le groupe de votre clé, et agencyId, s’il est fourni, une agence de GET Agencies. Sinon 400, aucun lead créé (LeadGenerationExternalSale : Agency group is not in the authorized scope of this LinkedAPI, LeadGenerationExternalSale : Agency is not in the authorized scope of this LinkedAPI). Sans agencyId, l’attribution est automatique, parmi les agences du groupe. Les identifiants de l’exemple sont ceux de l’exemple de GET Agencies : remplacez-les par ceux que GET Agencies renvoie pour votre clé, et userId par un collaborateur de cette agence (GET Users liste ceux du groupe).
curl --request POST \
--url https://api.avest.fr/v1/external-integration/sale \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"settings": {
"allocation": {
"agencyGroupId": "66cc8a8e75c9fac35c6ecd73",
"agencyId": "66cc91d475c9fac35c86ed80",
"userId": "66cc91f05f84c9b212d9ec24",
"disableDeduplication": false
},
"step": "QUL"
},
"appointment": {
"date": "2025-01-20T00:00:00.000Z",
"startAt": "2025-01-20T10:00:00.000Z",
"endAt": "2025-01-20T11:00:00.000Z",
"note": "Rendez-vous estimation"
},
"note": {
"title": "Rappel client",
"content": "Client très intéressé"
},
"transactionType": "sale",
"contact": {
"firstName": "Jean",
"lastName": "Dupont",
"email": "jean.dupont@email.com",
"phone": "+33612345678"
},
"address": "11 rue de Paris, 75001 Paris, France",
"transaction": {
"project": "B",
"property": {
"mainType": "apartment",
"size": 85,
"rooms": 4,
"bedrooms": 3,
"hasElevator": true,
"floor": 3,
"DPEEnergyTag": "D",
"DPEGESTag": "C"
},
"fieldValue": {
"low": 220000,
"high": 260000
},
"mandate": {
"sellPrice": 250000,
"agencyCommission": 12500,
"feeResponsibility": "buyer",
"type": "exclusive"
},
"parsingCustomId": "EXT-2025-001"
}
}
'import requests
url = "https://api.avest.fr/v1/external-integration/sale"
payload = {
"settings": {
"allocation": {
"agencyGroupId": "66cc8a8e75c9fac35c6ecd73",
"agencyId": "66cc91d475c9fac35c86ed80",
"userId": "66cc91f05f84c9b212d9ec24",
"disableDeduplication": False
},
"step": "QUL"
},
"appointment": {
"date": "2025-01-20T00:00:00.000Z",
"startAt": "2025-01-20T10:00:00.000Z",
"endAt": "2025-01-20T11:00:00.000Z",
"note": "Rendez-vous estimation"
},
"note": {
"title": "Rappel client",
"content": "Client très intéressé"
},
"transactionType": "sale",
"contact": {
"firstName": "Jean",
"lastName": "Dupont",
"email": "jean.dupont@email.com",
"phone": "+33612345678"
},
"address": "11 rue de Paris, 75001 Paris, France",
"transaction": {
"project": "B",
"property": {
"mainType": "apartment",
"size": 85,
"rooms": 4,
"bedrooms": 3,
"hasElevator": True,
"floor": 3,
"DPEEnergyTag": "D",
"DPEGESTag": "C"
},
"fieldValue": {
"low": 220000,
"high": 260000
},
"mandate": {
"sellPrice": 250000,
"agencyCommission": 12500,
"feeResponsibility": "buyer",
"type": "exclusive"
},
"parsingCustomId": "EXT-2025-001"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
settings: {
allocation: {
agencyGroupId: '66cc8a8e75c9fac35c6ecd73',
agencyId: '66cc91d475c9fac35c86ed80',
userId: '66cc91f05f84c9b212d9ec24',
disableDeduplication: false
},
step: 'QUL'
},
appointment: {
date: '2025-01-20T00:00:00.000Z',
startAt: '2025-01-20T10:00:00.000Z',
endAt: '2025-01-20T11:00:00.000Z',
note: 'Rendez-vous estimation'
},
note: {title: 'Rappel client', content: 'Client très intéressé'},
transactionType: 'sale',
contact: {
firstName: 'Jean',
lastName: 'Dupont',
email: 'jean.dupont@email.com',
phone: '+33612345678'
},
address: '11 rue de Paris, 75001 Paris, France',
transaction: {
project: 'B',
property: {
mainType: 'apartment',
size: 85,
rooms: 4,
bedrooms: 3,
hasElevator: true,
floor: 3,
DPEEnergyTag: 'D',
DPEGESTag: 'C'
},
fieldValue: {low: 220000, high: 260000},
mandate: {
sellPrice: 250000,
agencyCommission: 12500,
feeResponsibility: 'buyer',
type: 'exclusive'
},
parsingCustomId: 'EXT-2025-001'
}
})
};
fetch('https://api.avest.fr/v1/external-integration/sale', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.avest.fr/v1/external-integration/sale",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'settings' => [
'allocation' => [
'agencyGroupId' => '66cc8a8e75c9fac35c6ecd73',
'agencyId' => '66cc91d475c9fac35c86ed80',
'userId' => '66cc91f05f84c9b212d9ec24',
'disableDeduplication' => false
],
'step' => 'QUL'
],
'appointment' => [
'date' => '2025-01-20T00:00:00.000Z',
'startAt' => '2025-01-20T10:00:00.000Z',
'endAt' => '2025-01-20T11:00:00.000Z',
'note' => 'Rendez-vous estimation'
],
'note' => [
'title' => 'Rappel client',
'content' => 'Client très intéressé'
],
'transactionType' => 'sale',
'contact' => [
'firstName' => 'Jean',
'lastName' => 'Dupont',
'email' => 'jean.dupont@email.com',
'phone' => '+33612345678'
],
'address' => '11 rue de Paris, 75001 Paris, France',
'transaction' => [
'project' => 'B',
'property' => [
'mainType' => 'apartment',
'size' => 85,
'rooms' => 4,
'bedrooms' => 3,
'hasElevator' => true,
'floor' => 3,
'DPEEnergyTag' => 'D',
'DPEGESTag' => 'C'
],
'fieldValue' => [
'low' => 220000,
'high' => 260000
],
'mandate' => [
'sellPrice' => 250000,
'agencyCommission' => 12500,
'feeResponsibility' => 'buyer',
'type' => 'exclusive'
],
'parsingCustomId' => 'EXT-2025-001'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.avest.fr/v1/external-integration/sale"
payload := strings.NewReader("{\n \"settings\": {\n \"allocation\": {\n \"agencyGroupId\": \"66cc8a8e75c9fac35c6ecd73\",\n \"agencyId\": \"66cc91d475c9fac35c86ed80\",\n \"userId\": \"66cc91f05f84c9b212d9ec24\",\n \"disableDeduplication\": false\n },\n \"step\": \"QUL\"\n },\n \"appointment\": {\n \"date\": \"2025-01-20T00:00:00.000Z\",\n \"startAt\": \"2025-01-20T10:00:00.000Z\",\n \"endAt\": \"2025-01-20T11:00:00.000Z\",\n \"note\": \"Rendez-vous estimation\"\n },\n \"note\": {\n \"title\": \"Rappel client\",\n \"content\": \"Client très intéressé\"\n },\n \"transactionType\": \"sale\",\n \"contact\": {\n \"firstName\": \"Jean\",\n \"lastName\": \"Dupont\",\n \"email\": \"jean.dupont@email.com\",\n \"phone\": \"+33612345678\"\n },\n \"address\": \"11 rue de Paris, 75001 Paris, France\",\n \"transaction\": {\n \"project\": \"B\",\n \"property\": {\n \"mainType\": \"apartment\",\n \"size\": 85,\n \"rooms\": 4,\n \"bedrooms\": 3,\n \"hasElevator\": true,\n \"floor\": 3,\n \"DPEEnergyTag\": \"D\",\n \"DPEGESTag\": \"C\"\n },\n \"fieldValue\": {\n \"low\": 220000,\n \"high\": 260000\n },\n \"mandate\": {\n \"sellPrice\": 250000,\n \"agencyCommission\": 12500,\n \"feeResponsibility\": \"buyer\",\n \"type\": \"exclusive\"\n },\n \"parsingCustomId\": \"EXT-2025-001\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.avest.fr/v1/external-integration/sale")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"settings\": {\n \"allocation\": {\n \"agencyGroupId\": \"66cc8a8e75c9fac35c6ecd73\",\n \"agencyId\": \"66cc91d475c9fac35c86ed80\",\n \"userId\": \"66cc91f05f84c9b212d9ec24\",\n \"disableDeduplication\": false\n },\n \"step\": \"QUL\"\n },\n \"appointment\": {\n \"date\": \"2025-01-20T00:00:00.000Z\",\n \"startAt\": \"2025-01-20T10:00:00.000Z\",\n \"endAt\": \"2025-01-20T11:00:00.000Z\",\n \"note\": \"Rendez-vous estimation\"\n },\n \"note\": {\n \"title\": \"Rappel client\",\n \"content\": \"Client très intéressé\"\n },\n \"transactionType\": \"sale\",\n \"contact\": {\n \"firstName\": \"Jean\",\n \"lastName\": \"Dupont\",\n \"email\": \"jean.dupont@email.com\",\n \"phone\": \"+33612345678\"\n },\n \"address\": \"11 rue de Paris, 75001 Paris, France\",\n \"transaction\": {\n \"project\": \"B\",\n \"property\": {\n \"mainType\": \"apartment\",\n \"size\": 85,\n \"rooms\": 4,\n \"bedrooms\": 3,\n \"hasElevator\": true,\n \"floor\": 3,\n \"DPEEnergyTag\": \"D\",\n \"DPEGESTag\": \"C\"\n },\n \"fieldValue\": {\n \"low\": 220000,\n \"high\": 260000\n },\n \"mandate\": {\n \"sellPrice\": 250000,\n \"agencyCommission\": 12500,\n \"feeResponsibility\": \"buyer\",\n \"type\": \"exclusive\"\n },\n \"parsingCustomId\": \"EXT-2025-001\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avest.fr/v1/external-integration/sale")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"settings\": {\n \"allocation\": {\n \"agencyGroupId\": \"66cc8a8e75c9fac35c6ecd73\",\n \"agencyId\": \"66cc91d475c9fac35c86ed80\",\n \"userId\": \"66cc91f05f84c9b212d9ec24\",\n \"disableDeduplication\": false\n },\n \"step\": \"QUL\"\n },\n \"appointment\": {\n \"date\": \"2025-01-20T00:00:00.000Z\",\n \"startAt\": \"2025-01-20T10:00:00.000Z\",\n \"endAt\": \"2025-01-20T11:00:00.000Z\",\n \"note\": \"Rendez-vous estimation\"\n },\n \"note\": {\n \"title\": \"Rappel client\",\n \"content\": \"Client très intéressé\"\n },\n \"transactionType\": \"sale\",\n \"contact\": {\n \"firstName\": \"Jean\",\n \"lastName\": \"Dupont\",\n \"email\": \"jean.dupont@email.com\",\n \"phone\": \"+33612345678\"\n },\n \"address\": \"11 rue de Paris, 75001 Paris, France\",\n \"transaction\": {\n \"project\": \"B\",\n \"property\": {\n \"mainType\": \"apartment\",\n \"size\": 85,\n \"rooms\": 4,\n \"bedrooms\": 3,\n \"hasElevator\": true,\n \"floor\": 3,\n \"DPEEnergyTag\": \"D\",\n \"DPEGESTag\": \"C\"\n },\n \"fieldValue\": {\n \"low\": 220000,\n \"high\": 260000\n },\n \"mandate\": {\n \"sellPrice\": 250000,\n \"agencyCommission\": 12500,\n \"feeResponsibility\": \"buyer\",\n \"type\": \"exclusive\"\n },\n \"parsingCustomId\": \"EXT-2025-001\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"avestId": "V-2025-001",
"user": {
"id": "66cc91f05f84c9b212d9ec24",
"firstName": "Marie",
"lastName": "Martin",
"jobTitle": "Agent immobilier",
"email": "marie.martin@agence.com",
"phone": "+33601020304"
},
"contact": {
"id": "618a35a36d932054e195ca0a",
"firstName": "Jean",
"lastName": "Dupont"
},
"transaction": {
"id": "619b46b47e043165f206db1b",
"customId": "V-2025-001",
"step": "QUL",
"project": "B",
"property": {
"addressData": {
"streetNumber": "11",
"route": "Rue de Paris",
"postalCode": "75001",
"city": "Paris",
"country": "France",
"countryCode": "FR",
"formattedAddress": "11 Rue de Paris, 75001 Paris, France"
},
"addresses": [
{
"streetNumber": "11",
"route": "Rue de Paris",
"postalCode": "75001",
"city": "Paris",
"country": "France",
"countryCode": "FR",
"formattedAddress": "11 Rue de Paris, 75001 Paris, France"
}
]
}
}
}Autorisations
Token LinkedAPI avec scope externalIntegration. La clé doit avoir un agencyGroup configuré (sinon 400 LinkedAPI agencyGroup is required). Fourni via l'en-tête Authorization: Bearer {linkedAPI_token}. Si la clé a secure === true, l'IP appelante doit être whitelistée (en-tête X-Real-IP), sinon 403 Not authorized to access this resource.
La clé porte aussi un niveau d'accès : en lecture seule, elle n'autorise que les GET ; un POST ou un PATCH renvoie alors 403 Not authorized to access this resource, soit la même réponse qu'une requête sans en-tête Authorization. Voir le guide Authentification.
Corps
Adresse complète du bien (ex: "11 rue de Paris, 75001 Paris, France"), située par Google. Si Google ne situe que la ville, la vente est enregistrée sans numéro ni rue et la réponse reste un succès : contrôlez transaction.property.addressData dans la réponse, ou property.addressData avec GET Sale.
Réponse
Vente créée ou mise à jour. Peut aussi retourner { success: true, message: "BILLING_STANDBY" } lorsque le compte est en standby de facturation.