curl --request POST \
--url https://app.variable.global/api/v1/location \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Tokyo factory",
"type": "factory",
"address1": "<string>",
"address2": "<string>",
"postCode": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"geoLocation": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
'import requests
url = "https://app.variable.global/api/v1/location"
payload = {
"name": "Tokyo factory",
"type": "factory",
"address1": "<string>",
"address2": "<string>",
"postCode": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"geoLocation": { "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
}
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({
name: 'Tokyo factory',
type: 'factory',
address1: '<string>',
address2: '<string>',
postCode: '<string>',
city: '<string>',
state: '<string>',
country: '<string>',
geoLocation: {uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}
})
};
fetch('https://app.variable.global/api/v1/location', 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://app.variable.global/api/v1/location",
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' => 'Tokyo factory',
'type' => 'factory',
'address1' => '<string>',
'address2' => '<string>',
'postCode' => '<string>',
'city' => '<string>',
'state' => '<string>',
'country' => '<string>',
'geoLocation' => [
'uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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://app.variable.global/api/v1/location"
payload := strings.NewReader("{\n \"name\": \"Tokyo factory\",\n \"type\": \"factory\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"postCode\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"geoLocation\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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://app.variable.global/api/v1/location")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Tokyo factory\",\n \"type\": \"factory\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"postCode\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"geoLocation\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.variable.global/api/v1/location")
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 \"name\": \"Tokyo factory\",\n \"type\": \"factory\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"postCode\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"geoLocation\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}"
response = http.request(request)
puts response.read_body{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Tokyo factory",
"type": "factory",
"owner": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Name"
},
"address1": "1-1 Marunouchi",
"address2": "<string>",
"postCode": "100-0005",
"city": "Tokyo",
"state": "<string>",
"country": "Japan",
"geoLocation": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"googleMapsId": "ChIJA4UGSG_xNIgRNBuiWqEV-Y0",
"name": "Syracuse, NY, USA",
"countryCode": "US",
"latitude": 43.0481,
"longitude": -76.1474,
"locationType": "APPROXIMATE"
}
}{
"message": "token expired"
}Create Location
Create a new location
curl --request POST \
--url https://app.variable.global/api/v1/location \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Tokyo factory",
"type": "factory",
"address1": "<string>",
"address2": "<string>",
"postCode": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"geoLocation": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
'import requests
url = "https://app.variable.global/api/v1/location"
payload = {
"name": "Tokyo factory",
"type": "factory",
"address1": "<string>",
"address2": "<string>",
"postCode": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"geoLocation": { "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
}
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({
name: 'Tokyo factory',
type: 'factory',
address1: '<string>',
address2: '<string>',
postCode: '<string>',
city: '<string>',
state: '<string>',
country: '<string>',
geoLocation: {uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}
})
};
fetch('https://app.variable.global/api/v1/location', 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://app.variable.global/api/v1/location",
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' => 'Tokyo factory',
'type' => 'factory',
'address1' => '<string>',
'address2' => '<string>',
'postCode' => '<string>',
'city' => '<string>',
'state' => '<string>',
'country' => '<string>',
'geoLocation' => [
'uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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://app.variable.global/api/v1/location"
payload := strings.NewReader("{\n \"name\": \"Tokyo factory\",\n \"type\": \"factory\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"postCode\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"geoLocation\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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://app.variable.global/api/v1/location")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Tokyo factory\",\n \"type\": \"factory\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"postCode\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"geoLocation\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.variable.global/api/v1/location")
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 \"name\": \"Tokyo factory\",\n \"type\": \"factory\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"postCode\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"geoLocation\": {\n \"uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}"
response = http.request(request)
puts response.read_body{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Tokyo factory",
"type": "factory",
"owner": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Name"
},
"address1": "1-1 Marunouchi",
"address2": "<string>",
"postCode": "100-0005",
"city": "Tokyo",
"state": "<string>",
"country": "Japan",
"geoLocation": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"googleMapsId": "ChIJA4UGSG_xNIgRNBuiWqEV-Y0",
"name": "Syracuse, NY, USA",
"countryCode": "US",
"latitude": 43.0481,
"longitude": -76.1474,
"locationType": "APPROXIMATE"
}
}{
"message": "token expired"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
"Tokyo factory"
factory, warehouse, office, port, other "factory"
The company to own the site. Defaults to your own company; may instead reference an
unclaimed supplier of yours. Returns 400 if the company is not accessible. Set at create
only — it cannot be changed afterwards.
Show child attributes
Show child attributes
A reference to the geolocation that anchors a site. Provide either an existing point's uuid,
or a googleMapsId (resolved and persisted on your behalf, like POST /v1/geolocation).
- Option 1
- Option 2
Show child attributes
Show child attributes
Response
The created location
A named company site (factory / warehouse / office / port / other), optionally anchored to a geolocation for coordinates. Products, activities, and transport legs reference these internally as a physical origin / destination / location.
"Tokyo factory"
factory, warehouse, office, port, other "factory"
The company that owns the site — your own company, or an unclaimed supplier you registered it for.
Show child attributes
Show child attributes
"1-1 Marunouchi"
"100-0005"
"Tokyo"
"Japan"
Show child attributes
Show child attributes