Créer un établissement dans une organisation
curl --request POST \
--url https://server.chataigne.ai/v1/organizations/{organization_id}/locations \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"currency": "EUR",
"country": "FR",
"timezone": "Europe/Paris",
"address": {
"line1": "1 Rue de Rivoli",
"postal_code": "75001",
"city": "Paris",
"country": "FR",
"latitude": 48.8566,
"longitude": 2.3522,
"line2": "<string>"
},
"default_language": "<string>",
"contact_information": "<string>"
}
'import requests
url = "https://server.chataigne.ai/v1/organizations/{organization_id}/locations"
payload = {
"name": "<string>",
"currency": "EUR",
"country": "FR",
"timezone": "Europe/Paris",
"address": {
"line1": "1 Rue de Rivoli",
"postal_code": "75001",
"city": "Paris",
"country": "FR",
"latitude": 48.8566,
"longitude": 2.3522,
"line2": "<string>"
},
"default_language": "<string>",
"contact_information": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
currency: 'EUR',
country: 'FR',
timezone: 'Europe/Paris',
address: {
line1: '1 Rue de Rivoli',
postal_code: '75001',
city: 'Paris',
country: 'FR',
latitude: 48.8566,
longitude: 2.3522,
line2: '<string>'
},
default_language: '<string>',
contact_information: '<string>'
})
};
fetch('https://server.chataigne.ai/v1/organizations/{organization_id}/locations', 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://server.chataigne.ai/v1/organizations/{organization_id}/locations",
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([
'name' => '<string>',
'currency' => 'EUR',
'country' => 'FR',
'timezone' => 'Europe/Paris',
'address' => [
'line1' => '1 Rue de Rivoli',
'postal_code' => '75001',
'city' => 'Paris',
'country' => 'FR',
'latitude' => 48.8566,
'longitude' => 2.3522,
'line2' => '<string>'
],
'default_language' => '<string>',
'contact_information' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-api-key: <api-key>"
],
]);
$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://server.chataigne.ai/v1/organizations/{organization_id}/locations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"currency\": \"EUR\",\n \"country\": \"FR\",\n \"timezone\": \"Europe/Paris\",\n \"address\": {\n \"line1\": \"1 Rue de Rivoli\",\n \"postal_code\": \"75001\",\n \"city\": \"Paris\",\n \"country\": \"FR\",\n \"latitude\": 48.8566,\n \"longitude\": 2.3522,\n \"line2\": \"<string>\"\n },\n \"default_language\": \"<string>\",\n \"contact_information\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
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://server.chataigne.ai/v1/organizations/{organization_id}/locations")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"currency\": \"EUR\",\n \"country\": \"FR\",\n \"timezone\": \"Europe/Paris\",\n \"address\": {\n \"line1\": \"1 Rue de Rivoli\",\n \"postal_code\": \"75001\",\n \"city\": \"Paris\",\n \"country\": \"FR\",\n \"latitude\": 48.8566,\n \"longitude\": 2.3522,\n \"line2\": \"<string>\"\n },\n \"default_language\": \"<string>\",\n \"contact_information\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.chataigne.ai/v1/organizations/{organization_id}/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"currency\": \"EUR\",\n \"country\": \"FR\",\n \"timezone\": \"Europe/Paris\",\n \"address\": {\n \"line1\": \"1 Rue de Rivoli\",\n \"postal_code\": \"75001\",\n \"city\": \"Paris\",\n \"country\": \"FR\",\n \"latitude\": 48.8566,\n \"longitude\": 2.3522,\n \"line2\": \"<string>\"\n },\n \"default_language\": \"<string>\",\n \"contact_information\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "loc_023d6847de544fdb9a5510db",
"object": "location",
"organization_id": "<string>",
"name": "Pokawa Châtelet",
"currency": "EUR",
"country": "FR",
"timezone": "Europe/Paris",
"default_language": "fr",
"address": {
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"country": "<string>",
"latitude": 123,
"longitude": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}Organisations
Créer un établissement dans une organisation
POST
/
v1
/
organizations
/
{organization_id}
/
locations
Créer un établissement dans une organisation
curl --request POST \
--url https://server.chataigne.ai/v1/organizations/{organization_id}/locations \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"currency": "EUR",
"country": "FR",
"timezone": "Europe/Paris",
"address": {
"line1": "1 Rue de Rivoli",
"postal_code": "75001",
"city": "Paris",
"country": "FR",
"latitude": 48.8566,
"longitude": 2.3522,
"line2": "<string>"
},
"default_language": "<string>",
"contact_information": "<string>"
}
'import requests
url = "https://server.chataigne.ai/v1/organizations/{organization_id}/locations"
payload = {
"name": "<string>",
"currency": "EUR",
"country": "FR",
"timezone": "Europe/Paris",
"address": {
"line1": "1 Rue de Rivoli",
"postal_code": "75001",
"city": "Paris",
"country": "FR",
"latitude": 48.8566,
"longitude": 2.3522,
"line2": "<string>"
},
"default_language": "<string>",
"contact_information": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
currency: 'EUR',
country: 'FR',
timezone: 'Europe/Paris',
address: {
line1: '1 Rue de Rivoli',
postal_code: '75001',
city: 'Paris',
country: 'FR',
latitude: 48.8566,
longitude: 2.3522,
line2: '<string>'
},
default_language: '<string>',
contact_information: '<string>'
})
};
fetch('https://server.chataigne.ai/v1/organizations/{organization_id}/locations', 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://server.chataigne.ai/v1/organizations/{organization_id}/locations",
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([
'name' => '<string>',
'currency' => 'EUR',
'country' => 'FR',
'timezone' => 'Europe/Paris',
'address' => [
'line1' => '1 Rue de Rivoli',
'postal_code' => '75001',
'city' => 'Paris',
'country' => 'FR',
'latitude' => 48.8566,
'longitude' => 2.3522,
'line2' => '<string>'
],
'default_language' => '<string>',
'contact_information' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-api-key: <api-key>"
],
]);
$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://server.chataigne.ai/v1/organizations/{organization_id}/locations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"currency\": \"EUR\",\n \"country\": \"FR\",\n \"timezone\": \"Europe/Paris\",\n \"address\": {\n \"line1\": \"1 Rue de Rivoli\",\n \"postal_code\": \"75001\",\n \"city\": \"Paris\",\n \"country\": \"FR\",\n \"latitude\": 48.8566,\n \"longitude\": 2.3522,\n \"line2\": \"<string>\"\n },\n \"default_language\": \"<string>\",\n \"contact_information\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
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://server.chataigne.ai/v1/organizations/{organization_id}/locations")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"currency\": \"EUR\",\n \"country\": \"FR\",\n \"timezone\": \"Europe/Paris\",\n \"address\": {\n \"line1\": \"1 Rue de Rivoli\",\n \"postal_code\": \"75001\",\n \"city\": \"Paris\",\n \"country\": \"FR\",\n \"latitude\": 48.8566,\n \"longitude\": 2.3522,\n \"line2\": \"<string>\"\n },\n \"default_language\": \"<string>\",\n \"contact_information\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.chataigne.ai/v1/organizations/{organization_id}/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"currency\": \"EUR\",\n \"country\": \"FR\",\n \"timezone\": \"Europe/Paris\",\n \"address\": {\n \"line1\": \"1 Rue de Rivoli\",\n \"postal_code\": \"75001\",\n \"city\": \"Paris\",\n \"country\": \"FR\",\n \"latitude\": 48.8566,\n \"longitude\": 2.3522,\n \"line2\": \"<string>\"\n },\n \"default_language\": \"<string>\",\n \"contact_information\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "loc_023d6847de544fdb9a5510db",
"object": "location",
"organization_id": "<string>",
"name": "Pokawa Châtelet",
"currency": "EUR",
"country": "FR",
"timezone": "Europe/Paris",
"default_language": "fr",
"address": {
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"country": "<string>",
"latitude": 123,
"longitude": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}Autorisations
Clé API d’établissement ou d’organisation.
En-têtes
Clé unique permettant de réessayer cette création en toute sécurité ; les répétitions renvoient la réponse d’origine.
Paramètres de chemin
Corps
application/json
Réponse
Établissement créé.
Exemple:
"loc_023d6847de544fdb9a5510db"
Options disponibles:
location Exemple:
"Pokawa Châtelet"
Exemple:
"EUR"
Exemple:
"FR"
Exemple:
"Europe/Paris"
Exemple:
"fr"
Show child attributes
Show child attributes