Update an address
curl --request PUT \
--url https://api.leanpay.fr/v1/public/addresses/{addressId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Ada Martin",
"company": "Acme",
"line1": "12 rue de la Paix",
"line2": "Bâtiment B",
"line3": "3e étage",
"city": "Paris",
"postalCode": "75002",
"country": "FR",
"externalId": "ADR-0042",
"main": true
}
'import requests
url = "https://api.leanpay.fr/v1/public/addresses/{addressId}"
payload = {
"name": "Ada Martin",
"company": "Acme",
"line1": "12 rue de la Paix",
"line2": "Bâtiment B",
"line3": "3e étage",
"city": "Paris",
"postalCode": "75002",
"country": "FR",
"externalId": "ADR-0042",
"main": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Ada Martin',
company: 'Acme',
line1: '12 rue de la Paix',
line2: 'Bâtiment B',
line3: '3e étage',
city: 'Paris',
postalCode: '75002',
country: 'FR',
externalId: 'ADR-0042',
main: true
})
};
fetch('https://api.leanpay.fr/v1/public/addresses/{addressId}', 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.leanpay.fr/v1/public/addresses/{addressId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Ada Martin',
'company' => 'Acme',
'line1' => '12 rue de la Paix',
'line2' => 'Bâtiment B',
'line3' => '3e étage',
'city' => 'Paris',
'postalCode' => '75002',
'country' => 'FR',
'externalId' => 'ADR-0042',
'main' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.leanpay.fr/v1/public/addresses/{addressId}"
payload := strings.NewReader("{\n \"name\": \"Ada Martin\",\n \"company\": \"Acme\",\n \"line1\": \"12 rue de la Paix\",\n \"line2\": \"Bâtiment B\",\n \"line3\": \"3e étage\",\n \"city\": \"Paris\",\n \"postalCode\": \"75002\",\n \"country\": \"FR\",\n \"externalId\": \"ADR-0042\",\n \"main\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<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.put("https://api.leanpay.fr/v1/public/addresses/{addressId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ada Martin\",\n \"company\": \"Acme\",\n \"line1\": \"12 rue de la Paix\",\n \"line2\": \"Bâtiment B\",\n \"line3\": \"3e étage\",\n \"city\": \"Paris\",\n \"postalCode\": \"75002\",\n \"country\": \"FR\",\n \"externalId\": \"ADR-0042\",\n \"main\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leanpay.fr/v1/public/addresses/{addressId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Ada Martin\",\n \"company\": \"Acme\",\n \"line1\": \"12 rue de la Paix\",\n \"line2\": \"Bâtiment B\",\n \"line3\": \"3e étage\",\n \"city\": \"Paris\",\n \"postalCode\": \"75002\",\n \"country\": \"FR\",\n \"externalId\": \"ADR-0042\",\n \"main\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "ceaf7fac-8801-44ec-99e9-375670661a92",
"tenantId": "344ca963-6bf0-4bbb-b00f-3e377e5dc358",
"clientId": "9bfc607e-4e58-4f4e-a93b-cd934958933f",
"name": "Ada Martin",
"company": "Acme",
"line1": "12 rue de la Paix",
"line2": "Bâtiment B",
"line3": "3e étage",
"city": "Paris",
"postalCode": "75002",
"country": "FR",
"externalId": "ADR-0042",
"main": true,
"createdAt": "2026-03-12T09:41:27.000Z",
"updatedAt": "2026-10-06T08:00:12.000Z"
}addresses
Update an address
Update the address. The update is full: a field left out is cleared, except main.
line1, city, postalCode, country, and name or company, are required. null clears externalId, name, company, line2 and line3. main: null is ignored.
PUT
/
addresses
/
{addressId}
Update an address
curl --request PUT \
--url https://api.leanpay.fr/v1/public/addresses/{addressId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Ada Martin",
"company": "Acme",
"line1": "12 rue de la Paix",
"line2": "Bâtiment B",
"line3": "3e étage",
"city": "Paris",
"postalCode": "75002",
"country": "FR",
"externalId": "ADR-0042",
"main": true
}
'import requests
url = "https://api.leanpay.fr/v1/public/addresses/{addressId}"
payload = {
"name": "Ada Martin",
"company": "Acme",
"line1": "12 rue de la Paix",
"line2": "Bâtiment B",
"line3": "3e étage",
"city": "Paris",
"postalCode": "75002",
"country": "FR",
"externalId": "ADR-0042",
"main": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Ada Martin',
company: 'Acme',
line1: '12 rue de la Paix',
line2: 'Bâtiment B',
line3: '3e étage',
city: 'Paris',
postalCode: '75002',
country: 'FR',
externalId: 'ADR-0042',
main: true
})
};
fetch('https://api.leanpay.fr/v1/public/addresses/{addressId}', 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.leanpay.fr/v1/public/addresses/{addressId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Ada Martin',
'company' => 'Acme',
'line1' => '12 rue de la Paix',
'line2' => 'Bâtiment B',
'line3' => '3e étage',
'city' => 'Paris',
'postalCode' => '75002',
'country' => 'FR',
'externalId' => 'ADR-0042',
'main' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.leanpay.fr/v1/public/addresses/{addressId}"
payload := strings.NewReader("{\n \"name\": \"Ada Martin\",\n \"company\": \"Acme\",\n \"line1\": \"12 rue de la Paix\",\n \"line2\": \"Bâtiment B\",\n \"line3\": \"3e étage\",\n \"city\": \"Paris\",\n \"postalCode\": \"75002\",\n \"country\": \"FR\",\n \"externalId\": \"ADR-0042\",\n \"main\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<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.put("https://api.leanpay.fr/v1/public/addresses/{addressId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ada Martin\",\n \"company\": \"Acme\",\n \"line1\": \"12 rue de la Paix\",\n \"line2\": \"Bâtiment B\",\n \"line3\": \"3e étage\",\n \"city\": \"Paris\",\n \"postalCode\": \"75002\",\n \"country\": \"FR\",\n \"externalId\": \"ADR-0042\",\n \"main\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leanpay.fr/v1/public/addresses/{addressId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Ada Martin\",\n \"company\": \"Acme\",\n \"line1\": \"12 rue de la Paix\",\n \"line2\": \"Bâtiment B\",\n \"line3\": \"3e étage\",\n \"city\": \"Paris\",\n \"postalCode\": \"75002\",\n \"country\": \"FR\",\n \"externalId\": \"ADR-0042\",\n \"main\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "ceaf7fac-8801-44ec-99e9-375670661a92",
"tenantId": "344ca963-6bf0-4bbb-b00f-3e377e5dc358",
"clientId": "9bfc607e-4e58-4f4e-a93b-cd934958933f",
"name": "Ada Martin",
"company": "Acme",
"line1": "12 rue de la Paix",
"line2": "Bâtiment B",
"line3": "3e étage",
"city": "Paris",
"postalCode": "75002",
"country": "FR",
"externalId": "ADR-0042",
"main": true,
"createdAt": "2026-03-12T09:41:27.000Z",
"updatedAt": "2026-10-06T08:00:12.000Z"
}Body
application/json
Response
The updated address.
