Add or reuse a recipient address
curl --request POST \
--url https://developer.haulstow.co/v1/recipients/{recipient_id}/addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"label": "Home",
"address": "15 Independence Avenue, Accra",
"latitude": 5.56,
"longitude": -0.2057,
"municipality": "Accra Metropolitan",
"delivery_notes": "Call when you arrive"
}
'import requests
url = "https://developer.haulstow.co/v1/recipients/{recipient_id}/addresses"
payload = {
"label": "Home",
"address": "15 Independence Avenue, Accra",
"latitude": 5.56,
"longitude": -0.2057,
"municipality": "Accra Metropolitan",
"delivery_notes": "Call when you arrive"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
label: 'Home',
address: '15 Independence Avenue, Accra',
latitude: 5.56,
longitude: -0.2057,
municipality: 'Accra Metropolitan',
delivery_notes: 'Call when you arrive'
})
};
fetch('https://developer.haulstow.co/v1/recipients/{recipient_id}/addresses', 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://developer.haulstow.co/v1/recipients/{recipient_id}/addresses",
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([
'label' => 'Home',
'address' => '15 Independence Avenue, Accra',
'latitude' => 5.56,
'longitude' => -0.2057,
'municipality' => 'Accra Metropolitan',
'delivery_notes' => 'Call when you arrive'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://developer.haulstow.co/v1/recipients/{recipient_id}/addresses"
payload := strings.NewReader("{\n \"label\": \"Home\",\n \"address\": \"15 Independence Avenue, Accra\",\n \"latitude\": 5.56,\n \"longitude\": -0.2057,\n \"municipality\": \"Accra Metropolitan\",\n \"delivery_notes\": \"Call when you arrive\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://developer.haulstow.co/v1/recipients/{recipient_id}/addresses")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Home\",\n \"address\": \"15 Independence Avenue, Accra\",\n \"latitude\": 5.56,\n \"longitude\": -0.2057,\n \"municipality\": \"Accra Metropolitan\",\n \"delivery_notes\": \"Call when you arrive\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.haulstow.co/v1/recipients/{recipient_id}/addresses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Home\",\n \"address\": \"15 Independence Avenue, Accra\",\n \"latitude\": 5.56,\n \"longitude\": -0.2057,\n \"municipality\": \"Accra Metropolitan\",\n \"delivery_notes\": \"Call when you arrive\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "<string>",
"data": {
"id": "adr_78de60204f574a64be88ba9bd94a049f",
"recipient_id": "rcp_3f1a821cdb58498cbb52f4706545a089",
"address": "<string>",
"latitude": 123,
"longitude": 123,
"created_at": "2023-11-07T05:31:56Z",
"label": "<string>",
"municipality": "<string>",
"delivery_notes": "<string>"
}
}Recipients
Add or reuse a recipient address
Adds a reusable address to a recipient. An exact normalized address
match returns the existing address with 200; a new address returns 201.
POST
/
recipients
/
{recipient_id}
/
addresses
Add or reuse a recipient address
curl --request POST \
--url https://developer.haulstow.co/v1/recipients/{recipient_id}/addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"label": "Home",
"address": "15 Independence Avenue, Accra",
"latitude": 5.56,
"longitude": -0.2057,
"municipality": "Accra Metropolitan",
"delivery_notes": "Call when you arrive"
}
'import requests
url = "https://developer.haulstow.co/v1/recipients/{recipient_id}/addresses"
payload = {
"label": "Home",
"address": "15 Independence Avenue, Accra",
"latitude": 5.56,
"longitude": -0.2057,
"municipality": "Accra Metropolitan",
"delivery_notes": "Call when you arrive"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
label: 'Home',
address: '15 Independence Avenue, Accra',
latitude: 5.56,
longitude: -0.2057,
municipality: 'Accra Metropolitan',
delivery_notes: 'Call when you arrive'
})
};
fetch('https://developer.haulstow.co/v1/recipients/{recipient_id}/addresses', 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://developer.haulstow.co/v1/recipients/{recipient_id}/addresses",
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([
'label' => 'Home',
'address' => '15 Independence Avenue, Accra',
'latitude' => 5.56,
'longitude' => -0.2057,
'municipality' => 'Accra Metropolitan',
'delivery_notes' => 'Call when you arrive'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://developer.haulstow.co/v1/recipients/{recipient_id}/addresses"
payload := strings.NewReader("{\n \"label\": \"Home\",\n \"address\": \"15 Independence Avenue, Accra\",\n \"latitude\": 5.56,\n \"longitude\": -0.2057,\n \"municipality\": \"Accra Metropolitan\",\n \"delivery_notes\": \"Call when you arrive\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://developer.haulstow.co/v1/recipients/{recipient_id}/addresses")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Home\",\n \"address\": \"15 Independence Avenue, Accra\",\n \"latitude\": 5.56,\n \"longitude\": -0.2057,\n \"municipality\": \"Accra Metropolitan\",\n \"delivery_notes\": \"Call when you arrive\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.haulstow.co/v1/recipients/{recipient_id}/addresses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Home\",\n \"address\": \"15 Independence Avenue, Accra\",\n \"latitude\": 5.56,\n \"longitude\": -0.2057,\n \"municipality\": \"Accra Metropolitan\",\n \"delivery_notes\": \"Call when you arrive\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "<string>",
"data": {
"id": "adr_78de60204f574a64be88ba9bd94a049f",
"recipient_id": "rcp_3f1a821cdb58498cbb52f4706545a089",
"address": "<string>",
"latitude": 123,
"longitude": 123,
"created_at": "2023-11-07T05:31:56Z",
"label": "<string>",
"municipality": "<string>",
"delivery_notes": "<string>"
}
}Authorizations
A business-bound HaulStow API key. Send
Authorization: Bearer hsg_live_key_... to the live server or a
hsg_test_key_... key to the sandbox server. Never expose this key in a browser.
Headers
Optional caller correlation ID. Use 1–128 ASCII letters, digits, ., _,
-, or :. Invalid values are replaced. The accepted/generated value is
returned in the response.
Required string length:
1 - 128Pattern:
^[A-Za-z0-9._:-]+$A unique key for this logical mutation. Retained for 24 hours.
Required string length:
8 - 255Path Parameters
Pattern:
^rcp_[a-f0-9]{32}$Example:
"rcp_3f1a821cdb58498cbb52f4706545a089"
Body
application/json
Required string length:
2 - 500Required range:
-90 <= x <= 90Required range:
-180 <= x <= 180Maximum string length:
64Maximum string length:
128Maximum string length:
500⌘I
