Get cart owner details
curl --request GET \
--url {protocol}://{host}/wp-json/cocart/v1/customerimport requests
url = "{protocol}://{host}/wp-json/cocart/v1/customer"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('{protocol}://{host}/wp-json/cocart/v1/customer', 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/v1/customer",
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/v1/customer"
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/v1/customer")
.asString();require 'uri'
require 'net/http'
url = URI("{protocol}://{host}/wp-json/cocart/v1/customer")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"user": {
"ID": 123,
"first_name": "<string>",
"last_name": "<string>"
},
"billing": {
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"email": "<string>",
"phone": "<string>",
"country": "<string>",
"state": "<string>",
"postcode": "<string>",
"city": "<string>",
"address": "<string>",
"address_1": "<string>",
"address_2": "<string>"
},
"shipping": {
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"country": "<string>",
"state": "<string>",
"postcode": "<string>",
"city": "<string>",
"address": "<string>",
"address_1": "<string>",
"address_2": "<string>"
},
"has_calculated_shipping": true,
"is_vat_exempt": "<string>"
}Get Customer Details
Retrieve customer details associated with the cart.
GET
/
customer
Error
A valid request URL is required to generate request examples{
"user": {
"ID": 123,
"first_name": "<string>",
"last_name": "<string>"
},
"billing": {
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"email": "<string>",
"phone": "<string>",
"country": "<string>",
"state": "<string>",
"postcode": "<string>",
"city": "<string>",
"address": "<string>",
"address_1": "<string>",
"address_2": "<string>"
},
"shipping": {
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"country": "<string>",
"state": "<string>",
"postcode": "<string>",
"city": "<string>",
"address": "<string>",
"address_1": "<string>",
"address_2": "<string>"
},
"has_calculated_shipping": true,
"is_vat_exempt": "<string>"
}Was this page helpful?
⌘I