Get full address details
curl --request GET \
--url {protocol}://{host}/wp-json/cocart/preview/address/detailsimport requests
url = "{protocol}://{host}/wp-json/cocart/preview/address/details"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('{protocol}://{host}/wp-json/cocart/preview/address/details', 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 => "{protocol}://{host}/wp-json/cocart/preview/address/details",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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 := "{protocol}://{host}/wp-json/cocart/preview/address/details"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("{protocol}://{host}/wp-json/cocart/preview/address/details")
.asString();require 'uri'
require 'net/http'
url = URI("{protocol}://{host}/wp-json/cocart/preview/address/details")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"address": {
"address_1": "123 Main Street",
"address_2": "",
"city": "Anytown",
"state": "CA",
"postcode": "12345",
"country": "US"
},
"provider": {
"id": "google",
"name": "Google Places"
}
}{
"code": "<string>",
"message": "<string>",
"data": {
"status": 123
}
}{
"code": "<string>",
"message": "<string>",
"data": {
"status": 123
}
}{
"code": "<string>",
"message": "<string>",
"data": {
"status": 123
}
}Retrieve complete address details for a selected suggestion from address search
GET
/
address
/
details
Error
A valid request URL is required to generate request examples{
"address": {
"address_1": "123 Main Street",
"address_2": "",
"city": "Anytown",
"state": "CA",
"postcode": "12345",
"country": "US"
},
"provider": {
"id": "google",
"name": "Google Places"
}
}{
"code": "<string>",
"message": "<string>",
"data": {
"status": 123
}
}{
"code": "<string>",
"message": "<string>",
"data": {
"status": 123
}
}{
"code": "<string>",
"message": "<string>",
"data": {
"status": 123
}
}This endpoint is currently shown as a preview of what’s currently in development and is subject to change.
Was this page helpful?
⌘I