List the locations this key can read
curl --request GET \
--url https://sandbox-api.craveup.com/api/v1/locations \
--header 'X-API-Key: <api-key>'import requests
url = "https://sandbox-api.craveup.com/api/v1/locations"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://sandbox-api.craveup.com/api/v1/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://sandbox-api.craveup.com/api/v1/locations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.craveup.com/api/v1/locations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox-api.craveup.com/api/v1/locations")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.craveup.com/api/v1/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"locations": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"address": "<string>"
}
]
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": {}
}{
"status": 429,
"message": "<string>"
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": {}
}{
"status": 503,
"code": "RATE_LIMIT_STORE_UNAVAILABLE",
"message": "<string>"
}API Reference
List the locations this key can read
Requires an organization API key with merchant:read. Lists the live locations the key was granted, in the merchant’s own order, with the id to address them by, their name and their formatted address, so an integration can choose one. Archived locations are left out. Carries no order figures: an integration that only needs to pick a location should not pay for the totals the partner dashboard computes.
GET
/
locations
List the locations this key can read
curl --request GET \
--url https://sandbox-api.craveup.com/api/v1/locations \
--header 'X-API-Key: <api-key>'import requests
url = "https://sandbox-api.craveup.com/api/v1/locations"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://sandbox-api.craveup.com/api/v1/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://sandbox-api.craveup.com/api/v1/locations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.craveup.com/api/v1/locations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox-api.craveup.com/api/v1/locations")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.craveup.com/api/v1/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"locations": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"address": "<string>"
}
]
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": {}
}{
"status": 429,
"message": "<string>"
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": {}
}{
"status": 503,
"code": "RATE_LIMIT_STORE_UNAVAILABLE",
"message": "<string>"
}