Error
A valid request URL is required to generate request examples{
"version": "4.6.0",
"title": "Example Store",
"description": "Your trusted online retailer for electronics, clothing, and more",
"home_url": "https://example-store.com",
"language": "en_US",
"gmt_offset": "-5",
"timezone_string": "America/New_York",
"store_address": {
"address": "123 Commerce Street",
"address_2": "Suite 500",
"city": "New York",
"state": "NY",
"postcode": "10001",
"country": "US"
},
"routes": {
"/cart": "Manage shopping cart",
"/cart/add-item": "Add item to cart",
"/cart/items": "Get cart items",
"/products": "Browse products",
"/products/categories": "Browse product categories",
"/login": "User authentication",
"/logout": "User logout"
}
}GET
/
store
Get store information
curl --request GET \
--url {protocol}://{host}/wp-json/cocart/v2/storeimport requests
url = "{protocol}://{host}/wp-json/cocart/v2/store"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('{protocol}://{host}/wp-json/cocart/v2/store', 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/v2/store",
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/v2/store"
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/v2/store")
.asString();require 'uri'
require 'net/http'
url = URI("{protocol}://{host}/wp-json/cocart/v2/store")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"version": "4.6.0",
"title": "Example Store",
"description": "Your trusted online retailer for electronics, clothing, and more",
"home_url": "https://example-store.com",
"language": "en_US",
"gmt_offset": "-5",
"timezone_string": "America/New_York",
"store_address": {
"address": "123 Commerce Street",
"address_2": "Suite 500",
"city": "New York",
"state": "NY",
"postcode": "10001",
"country": "US"
},
"routes": {
"/cart": "Manage shopping cart",
"/cart/add-item": "Add item to cart",
"/cart/items": "Get cart items",
"/products": "Browse products",
"/products/categories": "Browse product categories",
"/login": "User authentication",
"/logout": "User logout"
}
}Response
200 - application/json
Store information retrieved successfully.