MENU navbar-image

Introduction

The API resources allows you to use most of the features of Garchi Headless CMS to create your own Headless app.

This documentation is for v2 and aims to provide all the information you need to work with our API. As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile). You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).

The API has a rate limit of 600 requests per minute. If more than 600 requests are made within a 1 minute sliding window, the API will return a 429 "Too Many Requests" status code until the rate limit resets. The rate limit window is measured in 1 minute intervals. If the rate limit is exceeded at 10:05, requests will be throttled until at least 10:06. The rate limit counter is reset after each 1 minute window has passed, allowing another 600 requests. Getting throttled does not permanently block access; your code should handle the 429 response by retrying requests later.

Base URL

https://garchi.co.uk

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_API_TOKEN}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your dashboard. To create a new token check the Subscription section in your dashboard.

Customer

Register a customer

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"firstname\": \"Aditya\",
    \"lastname\": \"Kadam\",
    \"email\": \"aditya@example.com\",
    \"password\": \"Str0ngPa$$word\",
    \"password_confirmation\": \"Str0ngPa$$word\",
    \"contact\": \"0123092312312\",
    \"cannotify\": \"true\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/register"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "firstname": "Aditya",
    "lastname": "Kadam",
    "email": "aditya@example.com",
    "password": "Str0ngPa$$word",
    "password_confirmation": "Str0ngPa$$word",
    "contact": "0123092312312",
    "cannotify": "true"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/register',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'firstname' => 'Aditya',
            'lastname' => 'Kadam',
            'email' => 'aditya@example.com',
            'password' => 'Str0ngPa$$word',
            'password_confirmation' => 'Str0ngPa$$word',
            'contact' => '0123092312312',
            'cannotify' => 'true',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/register'
payload = {
    "firstname": "Aditya",
    "lastname": "Kadam",
    "email": "aditya@example.com",
    "password": "Str0ngPa$$word",
    "password_confirmation": "Str0ngPa$$word",
    "contact": "0123092312312",
    "cannotify": "true"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/register"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "firstname": "Aditya",
    "lastname": "Kadam",
    "email": "aditya@example.com",
    "password": "Str0ngPa$$word",
    "password_confirmation": "Str0ngPa$$word",
    "contact": "0123092312312",
    "cannotify": "true"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/register';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "firstname": "Aditya",
    "lastname": "Kadam",
    "email": "aditya@example.com",
    "password": "Str0ngPa$$word",
    "password_confirmation": "Str0ngPa$$word",
    "contact": "0123092312312",
    "cannotify": "true"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": {
        "firstname": "Aditya",
        "lastname": "Kadam",
        "email": "aditya@example.com",
        "contact": "0123092312312",
        "uid": "uid string",
        "email_verified": null
    }
}
 

Request   

POST api/v2/register

Body Parameters

firstname  string  

lastname  string  

email  string  

password  string  

password_confirmation  string  

Confirmed Password of the user.

contact  string optional  

cannotify  boolean. optional  

Whether the user has given permission for notification to you.

Login a customer

Takes in email and password. On success returns the user details.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"email\": \"aditya@example.com\",
    \"password\": \"Str0ngPa$$word\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "email": "aditya@example.com",
    "password": "Str0ngPa$$word"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/login',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'email' => 'aditya@example.com',
            'password' => 'Str0ngPa$$word',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/login'
payload = {
    "email": "aditya@example.com",
    "password": "Str0ngPa$$word"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/login"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "email": "aditya@example.com",
    "password": "Str0ngPa$$word"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/login';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "email": "aditya@example.com",
    "password": "Str0ngPa$$word"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": {
        "firstname": "Aditya",
        "lastname": "Kadam",
        "email": "aditya@example.com",
        "contact": "0123092312312",
        "uid": "uid string",
        "email_verified": null
    }
}
 

Request   

POST api/v2/login

Body Parameters

email  string  

password  string  

Mark Email as Verified

Need to pass the uid of the person after the email is verified. Make sure that the email verification complete process has to be carried out by you. After making the request this api will simply set the timestamp of the request in the email_verified field

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/markemailverified" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"uid\": \"73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/markemailverified"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/markemailverified',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'uid' => '73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/markemailverified'
payload = {
    "uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/markemailverified"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/markemailverified';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": {
        "firstname": "Aditya",
        "lastname": "Kadam",
        "email": "aditya@example.com",
        "contact": "0123092312312",
        "uid": "uid string",
        "email_verified": null
    }
}
 

Request   

POST api/v2/markemailverified

Body Parameters

uid  string  

uid of the user whose email is already verified by you.

Password Reset

Need to pass in the uid of the user, and the new_password with confirmation. This API assumes that you have validated the password reset request of the user either by sending password reset link to their email or via some other secure method. Password should be a plain text. It will be hashed before storing.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/customer/changepassword" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"uid\": \"73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a\",
    \"new_password\": \"NewStr0ngestPa$$word\",
    \"new_password_confirmation\": \"NewStr0ngestPa$$word\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/customer/changepassword"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "new_password": "NewStr0ngestPa$$word",
    "new_password_confirmation": "NewStr0ngestPa$$word"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/customer/changepassword',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'uid' => '73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a',
            'new_password' => 'NewStr0ngestPa$$word',
            'new_password_confirmation' => 'NewStr0ngestPa$$word',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/customer/changepassword'
payload = {
    "uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "new_password": "NewStr0ngestPa$$word",
    "new_password_confirmation": "NewStr0ngestPa$$word"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/customer/changepassword"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "new_password": "NewStr0ngestPa$$word",
    "new_password_confirmation": "NewStr0ngestPa$$word"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/customer/changepassword';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "new_password": "NewStr0ngestPa$$word",
    "new_password_confirmation": "NewStr0ngestPa$$word"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": {
        "firstname": "Aditya",
        "lastname": "Kadam",
        "email": "aditya@example.com",
        "contact": "1310003912322",
        "uid": "uid string",
        "email_verified": null
    }
}
 

Request   

POST api/v2/customer/changepassword

Body Parameters

uid  string  

uid of the user.

new_password  string  

new_password_confirmation  string  

Update customer details

Updates details of the customers. Only provided fields will be updated rest will be kept as it is.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/customer/update" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"firstname\": \"Aditya\",
    \"lastname\": \"Kadam\",
    \"email\": \"aditya@example.com\",
    \"uid\": \"73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a\",
    \"contact\": \"1310003912322\",
    \"notifyme\": true
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/customer/update"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "firstname": "Aditya",
    "lastname": "Kadam",
    "email": "aditya@example.com",
    "uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "contact": "1310003912322",
    "notifyme": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/customer/update',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'firstname' => 'Aditya',
            'lastname' => 'Kadam',
            'email' => 'aditya@example.com',
            'uid' => '73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a',
            'contact' => '1310003912322',
            'notifyme' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/customer/update'
payload = {
    "firstname": "Aditya",
    "lastname": "Kadam",
    "email": "aditya@example.com",
    "uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "contact": "1310003912322",
    "notifyme": true
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/customer/update"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "firstname": "Aditya",
    "lastname": "Kadam",
    "email": "aditya@example.com",
    "uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "contact": "1310003912322",
    "notifyme": true
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/customer/update';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "firstname": "Aditya",
    "lastname": "Kadam",
    "email": "aditya@example.com",
    "uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "contact": "1310003912322",
    "notifyme": true
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": {
        "firstname": "Aditya",
        "lastname": "Kadam",
        "email": "aditya@example.com",
        "contact": "1310003912322",
        "uid": "uid string",
        "email_verified": null
    }
}
 

Request   

POST api/v2/customer/update

Body Parameters

firstname  string  

lastname  string  

email  string  

uid  string  

uid of the user.

contact  string optional  

notifyme  boolean optional  

required. Whether the user has given permission for notification to you.

List Customers

Returns the list of registered customers. You can pass the filter like email to get the single customer details.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/customers?email=aditya%40example.com&size=50" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/customers"
);

const params = {
    "email": "aditya@example.com",
    "size": "50",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/customers',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'query' => [
            'email'=> 'aditya@example.com',
            'size'=> '50',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/customers'
params = {
  'email': 'aditya@example.com',
  'size': '50',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/customers"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

Map<Object, Object> params = {
  "email": "aditya@example.com",
  "size": "50",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/customers';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$queryParams = {
  'email': 'aditya@example.com',
  'size': '50',
};

$url .= '?'. $queryParams;

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{

"data": [
   {
       "firstname": "Aditya",
       "lastname": "Kadam",
       "email": "aditya@example.com",
       "contact": "07948048596",
       "uid": "de3523f0-9661-4d94-b0d7-04b4a31c06663cb128d0-296d-430b-adfa-badeee6a51935971fc62-2425-4e40-a425-c46008d4f16f3d494fca-46d9-4be6-8",
       "email_verified": "2021-04-18 20:27:35"
   },
],
"links": {
   "first": "https://garchi.co.uk/api/v2/customers?page=1",
   "last": "https://garchi.co.uk/api/v2/customers?page=1",
   "prev": null,
   "next": null
},
"meta": {
   "current_page": 1,
   "from": 1,
   "last_page": 1,
   "links": [
       {
           "url": null,
           "label": "&laquo; Previous",
           "active": false
       },
       {
           "url": "https://garchi.co.uk/api/v2/customers?page=1",
           "label": "1",
           "active": true
       },
       {
           "url": null,
           "label": "Next &raquo;",
           "active": false
       }
   ],
   "path": "https://garchi.co.uk/api/v2/customers",
   "per_page": 50,
   "to": 1,
   "total": 1
}

}
 

Request   

GET api/v2/customers

Query Parameters

email  string optional  

email of the user.

size  integer optional  

results per page. Default is 50

Return a single customer details

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/customer/73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/customer/73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/customer/73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/customer/73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/customer/73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/customer/73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{
    "data": {
        "firstname": "Aditya",
        "lastname": "Kadam",
        "email": "aditya@example.com",
        "contact": "0123092312312",
        "uid": "uid string",
        "email_verified": null
    }
}
 

Request   

GET api/v2/customer/{uid}

URL Parameters

uid  string optional  

Orders

Create an Order

Creates new order for a customer. Make sure to call this api after successful payment transaction.You need to handle payment from your side. You can pass the payment_id and the payment_method (eg: stripe) as a part of request body for transaction records.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/order/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"cart_items\": [
        {
            \"item_id\": 2,
            \"item_name\": \"Web Dev Book\",
            \"quantity\": 2,
            \"delivery_date\": \"2022-12-12\",
            \"attributes\": [
                {
                    \"attribute_name\": \"Date\",
                    \"selected_options\": [
                        {
                            \"subattr\": \"21st March\",
                            \"price\": 1,
                            \"subattr_id\": 3
                        }
                    ]
                }
            ]
        }
    ],
    \"shipping_amount\": 5,
    \"sub_total_amount\": 80,
    \"tax_amount\": 10,
    \"customer_uid\": \"73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a\",
    \"coupon_code\": \"AK123\",
    \"coupon_id\": 2,
    \"discount_value\": 12,
    \"guest_name\": \"keep_blank_if_using_login_api_else_provide_user_full_name\",
    \"guest_email\": \"keep_blank_if_using_login_api_else_provide_user_email\",
    \"guest_contact\": \"keep_blank_if_using_login_api_else_provide_user_contact\",
    \"delivery_address\": \"Street 1, XYZ Road, London, LLL 111\",
    \"payment_id\": \"pi_1IglpAJBBrYOr00bW4tJ312\",
    \"payment_provider\": \"stripe\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/order/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "cart_items": [
        {
            "item_id": 2,
            "item_name": "Web Dev Book",
            "quantity": 2,
            "delivery_date": "2022-12-12",
            "attributes": [
                {
                    "attribute_name": "Date",
                    "selected_options": [
                        {
                            "subattr": "21st March",
                            "price": 1,
                            "subattr_id": 3
                        }
                    ]
                }
            ]
        }
    ],
    "shipping_amount": 5,
    "sub_total_amount": 80,
    "tax_amount": 10,
    "customer_uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "coupon_code": "AK123",
    "coupon_id": 2,
    "discount_value": 12,
    "guest_name": "keep_blank_if_using_login_api_else_provide_user_full_name",
    "guest_email": "keep_blank_if_using_login_api_else_provide_user_email",
    "guest_contact": "keep_blank_if_using_login_api_else_provide_user_contact",
    "delivery_address": "Street 1, XYZ Road, London, LLL 111",
    "payment_id": "pi_1IglpAJBBrYOr00bW4tJ312",
    "payment_provider": "stripe"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/order/create',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'cart_items' => [
                [
                    'item_id' => 2,
                    'item_name' => 'Web Dev Book',
                    'quantity' => 2,
                    'delivery_date' => '2022-12-12',
                    'attributes' => [
                        [
                            'attribute_name' => 'Date',
                            'selected_options' => [
                                [
                                    'subattr' => '21st March',
                                    'price' => 1.0,
                                    'subattr_id' => 3,
                                ],
                            ],
                        ],
                    ],
                ],
            ],
            'shipping_amount' => 5.0,
            'sub_total_amount' => 80.0,
            'tax_amount' => 10.0,
            'customer_uid' => '73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a',
            'coupon_code' => 'AK123',
            'coupon_id' => 2,
            'discount_value' => 12.0,
            'guest_name' => 'keep_blank_if_using_login_api_else_provide_user_full_name',
            'guest_email' => 'keep_blank_if_using_login_api_else_provide_user_email',
            'guest_contact' => 'keep_blank_if_using_login_api_else_provide_user_contact',
            'delivery_address' => 'Street 1, XYZ Road, London, LLL 111',
            'payment_id' => 'pi_1IglpAJBBrYOr00bW4tJ312',
            'payment_provider' => 'stripe',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/order/create'
payload = {
    "cart_items": [
        {
            "item_id": 2,
            "item_name": "Web Dev Book",
            "quantity": 2,
            "delivery_date": "2022-12-12",
            "attributes": [
                {
                    "attribute_name": "Date",
                    "selected_options": [
                        {
                            "subattr": "21st March",
                            "price": 1,
                            "subattr_id": 3
                        }
                    ]
                }
            ]
        }
    ],
    "shipping_amount": 5,
    "sub_total_amount": 80,
    "tax_amount": 10,
    "customer_uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "coupon_code": "AK123",
    "coupon_id": 2,
    "discount_value": 12,
    "guest_name": "keep_blank_if_using_login_api_else_provide_user_full_name",
    "guest_email": "keep_blank_if_using_login_api_else_provide_user_email",
    "guest_contact": "keep_blank_if_using_login_api_else_provide_user_contact",
    "delivery_address": "Street 1, XYZ Road, London, LLL 111",
    "payment_id": "pi_1IglpAJBBrYOr00bW4tJ312",
    "payment_provider": "stripe"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/order/create"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "cart_items": [
        {
            "item_id": 2,
            "item_name": "Web Dev Book",
            "quantity": 2,
            "delivery_date": "2022-12-12",
            "attributes": [
                {
                    "attribute_name": "Date",
                    "selected_options": [
                        {
                            "subattr": "21st March",
                            "price": 1,
                            "subattr_id": 3
                        }
                    ]
                }
            ]
        }
    ],
    "shipping_amount": 5,
    "sub_total_amount": 80,
    "tax_amount": 10,
    "customer_uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "coupon_code": "AK123",
    "coupon_id": 2,
    "discount_value": 12,
    "guest_name": "keep_blank_if_using_login_api_else_provide_user_full_name",
    "guest_email": "keep_blank_if_using_login_api_else_provide_user_email",
    "guest_contact": "keep_blank_if_using_login_api_else_provide_user_contact",
    "delivery_address": "Street 1, XYZ Road, London, LLL 111",
    "payment_id": "pi_1IglpAJBBrYOr00bW4tJ312",
    "payment_provider": "stripe"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/order/create';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "cart_items": [
        {
            "item_id": 2,
            "item_name": "Web Dev Book",
            "quantity": 2,
            "delivery_date": "2022-12-12",
            "attributes": [
                {
                    "attribute_name": "Date",
                    "selected_options": [
                        {
                            "subattr": "21st March",
                            "price": 1,
                            "subattr_id": 3
                        }
                    ]
                }
            ]
        }
    ],
    "shipping_amount": 5,
    "sub_total_amount": 80,
    "tax_amount": 10,
    "customer_uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "coupon_code": "AK123",
    "coupon_id": 2,
    "discount_value": 12,
    "guest_name": "keep_blank_if_using_login_api_else_provide_user_full_name",
    "guest_email": "keep_blank_if_using_login_api_else_provide_user_email",
    "guest_contact": "keep_blank_if_using_login_api_else_provide_user_contact",
    "delivery_address": "Street 1, XYZ Road, London, LLL 111",
    "payment_id": "pi_1IglpAJBBrYOr00bW4tJ312",
    "payment_provider": "stripe"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 600
x-ratelimit-remaining: 595
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

POST api/v2/order/create

Body Parameters

cart_items  object[]  

Cart items array.

cart_items[].item_id  integer  

Id of the item.

cart_items[].item_name  string  

Name of the item.

cart_items[].quantity  integer  

Quantity of item added.

cart_items[].delivery_date  date optional  

Delivery date for the item.

cart_items[].attributes  object[] optional  

Attributes selected for a item. This needs to be in specific format. The correct format is [{attribute_name: 'main_attribute_name', selected_options: [{subattr:"selected option", price: "option price", subattr_id:'option_id'}]'].

cart_items[].attributes[].attribute_name  string optional  

Name of the attribute.

cart_items[].attributes[].selected_options  object[] optional  

Array of selected options for a attribute

cart_items[].attributes[].selected_options[].subattr  string optional  

Name of selected option.

cart_items[].attributes[].selected_options[].price  number optional  

price of the selected option.

cart_items[].attributes[].selected_options[].subattr_id  integer optional  

id of selected option.

shipping_amount  number optional  

shipping cost.

sub_total_amount  number  

Cart sub total excluding the discount price. This is the on which discount will be calculated.

tax_amount  number optional  

tax amount.

customer_uid  string optional  

uid of the customer if you are using login api. Keep blank if you are using other authentication method (like firebase) or guest checkout.

coupon_code  string optional  

Coupon code if the coupon was used. Make sure to validate the coupon before creating order.

coupon_id  integer optional  

id of the coupon recieved in the response of validate-coupon api.

discount_value  number optional  

discount amount for the coupon recieved in the response of validate-coupon api.

guest_name  string optional  

If you choose to use other authentication method (firebase or guest checkout) then full name of the user.

guest_email  string optional  

If you choose to use other authentication method (firebase or guest checkout) then email name of the user.

guest_contact  string optional  

If you choose to use other authentication method (firebase or guest checkout) then contact number of the user.

delivery_address  string  

Delivery address provided by the user.

payment_id  string optional  

Payment id after successful payment that will help you to keep track of payments.

payment_provider  string optional  

Payment provider used. Accepted values stripe, paypal, razorpay, other.

Mark as refunded for an item ordered

Changes an ordered item status to refunded.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/order/markasrefunded" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"line_item_id\": 30,
    \"invoice_number\": \"bd402d30-9810-43b3-8c98-3f1c0208c098\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/order/markasrefunded"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "line_item_id": 30,
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/order/markasrefunded',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'line_item_id' => 30,
            'invoice_number' => 'bd402d30-9810-43b3-8c98-3f1c0208c098',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/order/markasrefunded'
payload = {
    "line_item_id": 30,
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/order/markasrefunded"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "line_item_id": 30,
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/order/markasrefunded';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "line_item_id": 30,
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "message": "Item order was marked as refunded"
}
 

Request   

POST api/v2/order/markasrefunded

Body Parameters

line_item_id  integer  

ordered item id which is different from product id.

invoice_number  string  

Invoice number.

Mark as cancel for an item ordered

Changes an ordered item status to cancelled.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/order/markascancel" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"line_item_id\": 30,
    \"invoice_number\": \"bd402d30-9810-43b3-8c98-3f1c0208c098\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/order/markascancel"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "line_item_id": 30,
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/order/markascancel',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'line_item_id' => 30,
            'invoice_number' => 'bd402d30-9810-43b3-8c98-3f1c0208c098',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/order/markascancel'
payload = {
    "line_item_id": 30,
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/order/markascancel"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "line_item_id": 30,
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/order/markascancel';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "line_item_id": 30,
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "message": "Item order cancelled"
}
 

Request   

POST api/v2/order/markascancel

Body Parameters

line_item_id  integer  

ordered item id which is different from product id.

invoice_number  string  

Invoice number.

Mark the entire order as cancelled

Marks the entire order status and the line items order status as cancelled.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/orders/markascancel" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"invoice_number\": \"bd402d30-9810-43b3-8c98-3f1c0208c098\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/orders/markascancel"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/orders/markascancel',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'invoice_number' => 'bd402d30-9810-43b3-8c98-3f1c0208c098',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/orders/markascancel'
payload = {
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/orders/markascancel"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/orders/markascancel';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
 message: The order with bd402d30-9810-43b3-8c98-3f1c0208c098 was cancelled successfully
}
 

Request   

POST api/v2/orders/markascancel

Body Parameters

invoice_number  string  

Invoice number.

Mark entire order as refunded

This is api is used to change status of the entire order/all the ordered items status to refunded

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/orders/markasrefund" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"invoice_number\": \"bd402d30-9810-43b3-8c98-3f1c0208c098\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/orders/markasrefund"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/orders/markasrefund',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'invoice_number' => 'bd402d30-9810-43b3-8c98-3f1c0208c098',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/orders/markasrefund'
payload = {
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/orders/markasrefund"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/orders/markasrefund';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "invoice_number": "bd402d30-9810-43b3-8c98-3f1c0208c098"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
 message: The complete order with bd402d30-9810-43b3-8c98-3f1c0208c098 was marked as refunded successfully
}
 

Request   

POST api/v2/orders/markasrefund

Body Parameters

invoice_number  string  

Invoice number.

List all orders for guest customer

This api lists all the orders for a customer that you registered/created using third party resources like Firebase Auth, etc. If you are using register api then see this section

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/orders/guest" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"guest_email\": \"schroeder.art@example.net\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/orders/guest"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "guest_email": "schroeder.art@example.net"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/orders/guest',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'guest_email' => 'schroeder.art@example.net',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/orders/guest'
payload = {
    "guest_email": "schroeder.art@example.net"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/orders/guest"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "guest_email": "schroeder.art@example.net"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/orders/guest';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "guest_email": "schroeder.art@example.net"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
"data": [
{
       "invoice": "64ba7caf-e18d-40f8-b7bd-3ea291501618",
       "sub_total_amount": 80,
       "tax_amount": null,
       "shipping_amount": 5,
       "payment_transaction": {
           "payment_id": "pi_1IglpAJBBrYOr00bW4tJ312",
           "refunded": false,
           "payment_provider": "stripe",
           "created_at": "2022-04-16T11:19:25.000000Z",
           "last_updated": "2022-04-16T11:19:25.000000Z"
       },
       "line_items": [
           {
               "line_item_id": 38,
               "delivery_address": "Street 1, XYZ Road, London, LLL 111",
               "quantity": 2,
               "options": null,
               "price": 0,
               "delivery_dt": "2022-12-12",
               "status": "placed",
               "placed_at": "2022-04-16T11:19:25.000000Z",
               "items": {
                   "item_id": 15,
                   "sku": "SKU123123123",
                  "slug": "Web-app-with-Vue-3-and-Tailwind-CSS",
                   "name": "Web app with Vue 3 and Tailwind CSS",
                   "price": 40,
                   "space": {
                       "name": "Space 1"
                   }
               }
           },
       ]
   }
]
}
 

Request   

POST api/v2/orders/guest

Body Parameters

guest_email  string  

Email address of the registered user.

Change guest user details

If you are not using login api for authenticating the user or if you are using third party authentication like Firebase or if you are handling the authentication by yourself then this api might be handy to keep the user record updated.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/orders/guest/update" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"guest_email\": \"aditya@example.com\",
    \"guest_contact\": \"111111111\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/orders/guest/update"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "guest_email": "aditya@example.com",
    "guest_contact": "111111111"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/orders/guest/update',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'guest_email' => 'aditya@example.com',
            'guest_contact' => '111111111',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/orders/guest/update'
payload = {
    "guest_email": "aditya@example.com",
    "guest_contact": "111111111"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/orders/guest/update"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "guest_email": "aditya@example.com",
    "guest_contact": "111111111"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/orders/guest/update';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "guest_email": "aditya@example.com",
    "guest_contact": "111111111"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "message": "Details updated successfully"
}
 

Request   

POST api/v2/orders/guest/update

Body Parameters

guest_email  string  

Email of the user

guest_contact  string optional  

Phone number of the user

List all orders for registered customer

List order details for a registered customer. This API works for customers registered using Register API.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/orders/de3523f0-9661-4d94-b0d7-04b4a31c06663cb128d0-296d-430b-adfa-badeee6a51935971fc62-2425-4e40-a425-c46008d4f16f3d494fca-46d9-4be6-8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/orders/de3523f0-9661-4d94-b0d7-04b4a31c06663cb128d0-296d-430b-adfa-badeee6a51935971fc62-2425-4e40-a425-c46008d4f16f3d494fca-46d9-4be6-8"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/orders/de3523f0-9661-4d94-b0d7-04b4a31c06663cb128d0-296d-430b-adfa-badeee6a51935971fc62-2425-4e40-a425-c46008d4f16f3d494fca-46d9-4be6-8',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/orders/de3523f0-9661-4d94-b0d7-04b4a31c06663cb128d0-296d-430b-adfa-badeee6a51935971fc62-2425-4e40-a425-c46008d4f16f3d494fca-46d9-4be6-8'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/orders/de3523f0-9661-4d94-b0d7-04b4a31c06663cb128d0-296d-430b-adfa-badeee6a51935971fc62-2425-4e40-a425-c46008d4f16f3d494fca-46d9-4be6-8"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/orders/de3523f0-9661-4d94-b0d7-04b4a31c06663cb128d0-296d-430b-adfa-badeee6a51935971fc62-2425-4e40-a425-c46008d4f16f3d494fca-46d9-4be6-8';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{
    "data": [
        {
            "invoice": "64ba7caf-e18d-40f8-b7bd-3ea291501618",
            "sub_total_amount": 80,
            "tax_amount": null,
            "shipping_amount": 5,
            "payment_transaction": {
                "payment_id": "pi_1IglpAJBBrYOr00bW4tJ312",
                "refunded": false,
                "payment_provider": "stripe",
                "created_at": "2022-04-16T11:19:25.000000Z",
                "last_updated": "2022-04-16T11:19:25.000000Z"
            },
            "line_items": [
                {
                    "line_item_id": 38,
                    "delivery_address": "Street 1, XYZ Road, London, LLL 111",
                    "quantity": 2,
                    "options": null,
                    "price": 0,
                    "delivery_dt": "2022-12-12",
                    "status": "placed",
                    "placed_at": "2022-04-16T11:19:25.000000Z",
                    "items": {
                        "item_id": 15,
                        "sku": "SKU123123123",
                        "external_link": "",
                        "slug": "Web-app-with-Vue-3-and-Tailwind-CSS",
                        "name": "Web app with Vue 3 and Tailwind CSS",
                        "price": 40,
                        "space": {
                            "name": "Space 1"
                        }
                    }
                },
                {
                    "line_item_id": 39,
                    "delivery_address": "Street 1, XYZ Road, London, LLL 111",
                    "quantity": 2,
                    "options": null,
                    "price": 0,
                    "delivery_dt": "2022-12-12",
                    "status": "placed",
                    "placed_at": "2022-04-16T11:19:25.000000Z",
                    "items": {
                        "item_id": 16,
                        "external_link": "",
                        "sku": null,
                        "slug": null,
                        "name": "Designing with Canva ",
                        "price": 15.99,
                        "space": {
                            "name": "Space 2"
                        }
                    }
                }
            ]
        }
    ]
}
 

Request   

GET api/v2/orders/{uid}

URL Parameters

uid  string  

UID of the customer.

Get Invoice/Order details

Provides the details of the invoice including the information of the line items ordered

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/order/bd402d30-9810-43b3-8c98-3f1c0208c098" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/order/bd402d30-9810-43b3-8c98-3f1c0208c098"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/order/bd402d30-9810-43b3-8c98-3f1c0208c098',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/order/bd402d30-9810-43b3-8c98-3f1c0208c098'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/order/bd402d30-9810-43b3-8c98-3f1c0208c098"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/order/bd402d30-9810-43b3-8c98-3f1c0208c098';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{
    "data": [
        {
            "invoice": "bd402d30-9810-43b3-8c98-3f1c0208c098",
            "total_amount": 80,
            "payment_transaction": {
                "payment_id": "pi_1IglpAJBBrYOr00bW4tJ312",
                "refunded": "entire",
                "payment_provider": "stripe",
                "created_at": "2022-02-18T01:30:26.000000Z",
                "last_updated": "2022-02-22T18:28:38.000000Z"
            },
            "line_items": [
                {
                    "line_item_id": 30,
                    "quantity": 2,
                    "options": null,
                    "price": 80,
                    "delivery_dt": "2022-12-12",
                    "status": "refunded",
                    "placed_at": "2022-02-18T01:30:26.000000Z",
                    "items": {
                        "item_id": 15,
                        "external_link": "",
                        "name": "Web app with Vue 3 and Tailwind CSS",
                        "slug": "Web-app-with-Vue-3-and-Tailwind-CSS",
                        "space": {
                            "name": "Space 1"
                        }
                    }
                }
            ]
        }
    ]
}
 

Request   

GET api/v2/order/{invoice_number}

URL Parameters

invoice_number  string  

Invoice number.

Category

Create a category

Creates a new cateogry for a space

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/category" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"space_uid\": \"635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1\",
    \"category\": \"facilis\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/category"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "facilis"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/category',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'space_uid' => '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
            'category' => 'facilis',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/category'
payload = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "facilis"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/category"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "facilis"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/category';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "facilis"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": {
        "id": 43,
        "name": "Events"
    }
}
 

Request   

POST api/v2/category

Body Parameters

space_uid  string  

UID of the space.

category  string  

Category name

Delete a category

Deletes a category and all the associated items of that category for a space

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": "Category deleted successfully"
}
 

Request   

POST api/v2/delete/category/{space_uid}/{category_id}

URL Parameters

space_uid  string  

UID of the space.

category_id  integer  

Id of the category.

Update a category

Update a cateogry for a space

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/update/category/43" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"space_uid\": \"635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1\",
    \"category\": \"consequatur\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/update/category/43"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "consequatur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/update/category/43',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'space_uid' => '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
            'category' => 'consequatur',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/update/category/43'
payload = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "consequatur"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/update/category/43"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "consequatur"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/update/category/43';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "consequatur"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": "Category updated successfully"
}
 

Request   

POST api/v2/update/category/{category_id}

URL Parameters

category_id  integer  

Id of the category.

Body Parameters

space_uid  string  

UID of the space.

category  string  

Category name

Get all Categories for a space

Returns all the categories of the specified space.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{
"data": [
  {
     "id": 22,
     "name": "Web Development Bootcamp"
},
{
   "id": 23,
   "name": "Programming"
},
{
   "id": 36,
   "name": "Mobile App Development"
}
]
 

Request   

GET api/v2/space/{uid}/categories

URL Parameters

uid  string  

Uid of the space.

Get all Categories

Returns all the categories for all the spaces.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/categories" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/categories"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/categories',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/categories'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/categories"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/categories';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{
"data": [
  {
     "id": 22,
     "name": "Web Development Bootcamp"
},
{
   "id": 23,
   "name": "Programming"
},
{
   "id": 36,
   "name": "Mobile App Development"
}
]
 

Request   

GET api/v2/categories

Item

Create a new item

Adds a new item for a space

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/item" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"space_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\",
    \"name\": \"\\\"item ABC\\\"\",
    \"categories\": [
        44,
        45
    ],
    \"sku\": \"SKU11111\",
    \"stock\": 5,
    \"price\": \"10\",
    \"scratched_price\": 5,
    \"detail_description\": \"This is an amazing <b>item<\\/b>\",
    \"external_url\": \"https:\\/\\/productabc.com\",
    \"slug\": \"item-abc\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/item"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "categories": [
        44,
        45
    ],
    "sku": "SKU11111",
    "stock": 5,
    "price": "10",
    "scratched_price": 5,
    "detail_description": "This is an amazing <b>item<\/b>",
    "external_url": "https:\/\/productabc.com",
    "slug": "item-abc"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/item',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'space_uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
            'name' => '"item ABC"',
            'categories' => [
                44,
                45,
            ],
            'sku' => 'SKU11111',
            'stock' => 5,
            'price' => '10',
            'scratched_price' => 5.0,
            'detail_description' => 'This is an amazing <b>item</b>',
            'external_url' => 'https://productabc.com',
            'slug' => 'item-abc',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/item'
payload = {
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "categories": [
        44,
        45
    ],
    "sku": "SKU11111",
    "stock": 5,
    "price": "10",
    "scratched_price": 5,
    "detail_description": "This is an amazing <b>item<\/b>",
    "external_url": "https:\/\/productabc.com",
    "slug": "item-abc"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/item"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "categories": [
        44,
        45
    ],
    "sku": "SKU11111",
    "stock": 5,
    "price": "10",
    "scratched_price": 5,
    "detail_description": "This is an amazing <b>item<\/b>",
    "external_url": "https:\/\/productabc.com",
    "slug": "item-abc"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/item';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "categories": [
        44,
        45
    ],
    "sku": "SKU11111",
    "stock": 5,
    "price": "10",
    "scratched_price": 5,
    "detail_description": "This is an amazing <b>item<\/b>",
    "external_url": "https:\/\/productabc.com",
    "slug": "item-abc"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": {
        "item_id": 50,
        "sku": "SKU111111",
        "external_link": null,
        "slug": null,
        "name": "Item ABC",
        "stock": 5,
        "price": 10,
        "scratched_price": 5,
        "one_liner": null,
        "description": null,
        "delivery_type": null,
        "main_image": "NA",
        "other_images": [],
        "space": {
            "uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
            "name": "Shop XYZ"
        },
        "avg_rating": null
    }
}
 

Request   

POST api/v2/item

Body Parameters

space_uid  string  

UID of the space.

name  string  

Name of the item.

categories  integer[]  

Ids of the categories to which the item should belong.

sku  string. optional  

SKU of the item if applicable.

stock  integer optional  

Quantity/stock of the item.

price  Price optional  

of the item.

scratched_price  number optional  

Marketing or promotional price of the item.

detail_description  string. optional  

Detail description body of the item.

external_url  string. optional  

If the item is an external item and has an external url.

slug  string. optional  

Slug of the item.

Delete an item

Deletes an item and it's associated meta data and attributes for a space

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/delete/item" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"item_id\": 50,
    \"space_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/delete/item"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/delete/item',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'item_id' => 50,
            'space_uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/delete/item'
payload = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/delete/item"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/delete/item';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{

   "data": "Item deleted successfully"

}
}
 

Request   

POST api/v2/delete/item

Body Parameters

item_id  integer optional  

required. Id of the item.

space_uid  string optional  

required. UID of the space.

Update a item

Update a item for a space

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/update/item" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"item_id\": 50,
    \"space_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\",
    \"name\": \"\\\"item ABC\\\"\",
    \"sku\": \"SKU11111\",
    \"stock\": 5,
    \"categories\": [
        44
    ],
    \"price\": 10,
    \"scratched_price\": \"5\",
    \"detail_description\": \"This is an amazing <b>item<\\/b>\",
    \"external_url\": \"https:\\/\\/itemabc.com\",
    \"make_public\": \"true\",
    \"slug\": \"item-abc\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/update/item"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "sku": "SKU11111",
    "stock": 5,
    "categories": [
        44
    ],
    "price": 10,
    "scratched_price": "5",
    "detail_description": "This is an amazing <b>item<\/b>",
    "external_url": "https:\/\/itemabc.com",
    "make_public": "true",
    "slug": "item-abc"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/update/item',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'item_id' => 50,
            'space_uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
            'name' => '"item ABC"',
            'sku' => 'SKU11111',
            'stock' => 5,
            'categories' => [
                44,
            ],
            'price' => 10.0,
            'scratched_price' => '5',
            'detail_description' => 'This is an amazing <b>item</b>',
            'external_url' => 'https://itemabc.com',
            'make_public' => 'true',
            'slug' => 'item-abc',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/update/item'
payload = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "sku": "SKU11111",
    "stock": 5,
    "categories": [
        44
    ],
    "price": 10,
    "scratched_price": "5",
    "detail_description": "This is an amazing <b>item<\/b>",
    "external_url": "https:\/\/itemabc.com",
    "make_public": "true",
    "slug": "item-abc"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/update/item"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "sku": "SKU11111",
    "stock": 5,
    "categories": [
        44
    ],
    "price": 10,
    "scratched_price": "5",
    "detail_description": "This is an amazing <b>item<\/b>",
    "external_url": "https:\/\/itemabc.com",
    "make_public": "true",
    "slug": "item-abc"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/update/item';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "sku": "SKU11111",
    "stock": 5,
    "categories": [
        44
    ],
    "price": 10,
    "scratched_price": "5",
    "detail_description": "This is an amazing <b>item<\/b>",
    "external_url": "https:\/\/itemabc.com",
    "make_public": "true",
    "slug": "item-abc"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{

   "data": "Item updated successfully"

}
}
 

Request   

POST api/v2/update/item

Body Parameters

item_id  integer optional  

required. Id of the item.

space_uid  string optional  

required. UID of the space.

name  string optional  

Name of the item.

sku  string optional  

SKU of the item if applicable.

stock  integer optional  

Quantity/stock of the item.

categories  integer[] optional  

Cateogory id to which the item should belong.

price  number optional  

Price of the item.

scratched_price  float. optional  

Marketing or promotional price of the item.

detail_description  string. optional  

Detail description body of the item.

external_url  string. optional  

If the item is an external item and has an external url.

make_public  boolean. optional  

If the item should be made public or not.

slug  string. optional  

Slug of the item.

Create meta information about a item

This api allows you to add extra information or meta data for a item. The data is added as a key value pair

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/item_meta" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"meta\": [
        {
            \"key\": \"website\",
            \"value\": \"https:\\/\\/adiranids.com\",
            \"type\": \"url\"
        }
    ],
    \"item_id\": 51
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/item_meta"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "meta": [
        {
            "key": "website",
            "value": "https:\/\/adiranids.com",
            "type": "url"
        }
    ],
    "item_id": 51
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/item_meta',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
            $o = [
                clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
            ],
            null,
            [
                'stdClass' => [
                    'key' => [
                        'website',
                    ],
                    'value' => [
                        'https://adiranids.com',
                    ],
                    'type' => [
                        'url',
                    ],
                ],
            ],
            [
                'meta' => [
                    $o[0],
                ],
                'item_id' => 51,
            ],
            []
        ),
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/item_meta'
payload = {
    "meta": [
        {
            "key": "website",
            "value": "https:\/\/adiranids.com",
            "type": "url"
        }
    ],
    "item_id": 51
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/item_meta"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "meta": [
        {
            "key": "website",
            "value": "https:\/\/adiranids.com",
            "type": "url"
        }
    ],
    "item_id": 51
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/item_meta';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "meta": [
        {
            "key": "website",
            "value": "https:\/\/adiranids.com",
            "type": "url"
        }
    ],
    "item_id": 51
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": [
        {
            "id": 606,
            "key": "website",
            "value": "https://adiranids.com",
            "type": "url"
        }
    ]
}
 

Request   

POST api/v2/item_meta

Body Parameters

meta  object[] optional  

required. Array of meta information.

meta[].key  string optional  

required. Key of for the meta information.

meta[].type  string optional  

required. Type of the key value. Allowed values are string, array, url, object, numeric, email, date.

meta[].value  string optional  

required. Value for the key.

item_id  integer optional  

required. Id of the item.

Delete meta information about a item for a space

This api allows you to delete extra information or meta data for a item. The data is added as a key value pair

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/delete/item_meta" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"meta_id\": 55,
    \"item_id\": 51,
    \"space_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/delete/item_meta"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "meta_id": 55,
    "item_id": 51,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/delete/item_meta',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'meta_id' => 55,
            'item_id' => 51,
            'space_uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/delete/item_meta'
payload = {
    "meta_id": 55,
    "item_id": 51,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/delete/item_meta"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "meta_id": 55,
    "item_id": 51,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/delete/item_meta';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "meta_id": 55,
    "item_id": 51,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": "Item meta deleted successfully"
}
 

Request   

POST api/v2/delete/item_meta

Body Parameters

meta_id  integer  

Meta id of the item meta info.

item_id  integer optional  

required. Id of the item.

space_uid  string optional  

required. UID of the space.

Update meta information about a item for a space

This api allows you to update extra information or meta data for a item. The data is added as a key value pair

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/update/item_meta" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"key\": \"website\",
    \"type\": \"url\",
    \"value\": \"https:\\/\\/adiranids.com\",
    \"meta_id\": 55,
    \"item_id\": 51
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/update/item_meta"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "key": "website",
    "type": "url",
    "value": "https:\/\/adiranids.com",
    "meta_id": 55,
    "item_id": 51
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/update/item_meta',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'key' => 'website',
            'type' => 'url',
            'value' => 'https://adiranids.com',
            'meta_id' => 55,
            'item_id' => 51,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/update/item_meta'
payload = {
    "key": "website",
    "type": "url",
    "value": "https:\/\/adiranids.com",
    "meta_id": 55,
    "item_id": 51
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/update/item_meta"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "key": "website",
    "type": "url",
    "value": "https:\/\/adiranids.com",
    "meta_id": 55,
    "item_id": 51
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/update/item_meta';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "key": "website",
    "type": "url",
    "value": "https:\/\/adiranids.com",
    "meta_id": 55,
    "item_id": 51
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": "Item meta updated successfully"
}
 

Request   

POST api/v2/update/item_meta

Body Parameters

key  string. optional  

Key of for the meta information.

type  string. optional  

Type of the key value. Allowed values are string, array, url, object, numeric, email, date.

value  string. optional  

Value for the key.

meta_id  integer  

Meta id of the item meta info.

item_id  integer optional  

required. Id of the item.

List all items for a space

Returns list of all the items with pagination links for a particular space

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/space/facilis/items?size=8&order_key=price&order_by=desc&reactions=include&description=exclude" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/space/facilis/items"
);

const params = {
    "size": "8",
    "order_key": "price",
    "order_by": "desc",
    "reactions": "include",
    "description": "exclude",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/space/facilis/items',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'query' => [
            'size'=> '8',
            'order_key'=> 'price',
            'order_by'=> 'desc',
            'reactions'=> 'include',
            'description'=> 'exclude',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/space/facilis/items'
params = {
  'size': '8',
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'description': 'exclude',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/facilis/items"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

Map<Object, Object> params = {
  "size": "8",
  "order_key": "price",
  "order_by": "desc",
  "reactions": "include",
  "description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space/facilis/items';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$queryParams = {
  'size': '8',
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'description': 'exclude',
};

$url .= '?'. $queryParams;

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{
"data": [
{
"item_id": 15,
"sku": "",
"name": "Web app with Vue 3 and Tailwind CSS",
"slug": "Web-app-with-Vue-3-and-Tailwind-CSS"
"price": 40,
"external_link": "",
"scratched_price": 0,
"one_liner": "A complete Vue.js course with front end web app development",
"delivery_type": "online",
"main_image": "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/Products/ProductImg15png",
"other_images": [],
"attributes": [],
"scheduled_for": "2022-01-01 00:00",
"space": {
      "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
      "name": "Aditya"
},
"avg_rating": null
"created": "2021-12-01 00:00",
},
{
"item_id": 29,
"sku": "",
"external_link": "",
"name": "React native expo boot camp",
"slug": null,
"stock": 0,
"price": 75,
"scratched_price": 0,
"one_liner": "Learn react native expo from beginner to pro",
"delivery_type": "online",
"main_image": "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/Products/ProductImgMain29png",
"other_images": [],
"attributes": [],
"space": {
      "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
      "name": "Aditya"
},
"avg_rating": null,
"item_meta": [
          {
               "key" : "website",
              "value": "https://adiranids.com",
              "type": "url"
          }
]
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
},

],
"links": {
   "first": "https://garchi.co.uk/api/v2/items?page=1",
   "last": "https://garchi.co.uk/api/v2/items?page=1",
  "prev": null,
 "next": null
},
"meta": {
  "current_page": 1,
  "from": 1,
  "last_page": 1,
  "links": [
      {
         "url": null,
         "label": "&laquo; Previous",
         "active": false
     },
     {
         "url": "https://garchi.co.uk/api/v2/items?page=1",
         "label": "1",
         "active": true
     },
     {
         "url": null,
         "label": "Next &raquo;",
         "active": false
     }
 ],
"path": "https://garchi.co.uk/api/v2/items",
"per_page": 10,
"to": 3,
"total": 3
}
}
 

Request   

GET api/v2/space/{uid}/items

URL Parameters

uid  string  

Query Parameters

size  integer optional  

int. Max number of entries on one page or size of chunk per page. By default it is set to 10.

order_key  string optional  

string. Key to order the items by. Allowed values are name, price, created, meta.*. meta.* is useful if you want to order items based on the item meta information keys.

order_by  string optional  

string. Order by ascending or descending. Allowed values are asc, desc.

reactions  string optional  

string. If you want to include or exclude reactions for the items.

description  string optional  

string. If you want to include or exclude markdown description for the items.

Before you use this API make sure to create embeddings from your dashboard . This endpoint returns the list of items based on semantic search. The search is based on the description and name of the items. The response body is similar to list all items api .

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/items/semantic-search?q=web+app&threshold=0.5&reactions=include&description=exclude" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/items/semantic-search"
);

const params = {
    "q": "web app",
    "threshold": "0.5",
    "reactions": "include",
    "description": "exclude",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/items/semantic-search',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'query' => [
            'q'=> 'web app',
            'threshold'=> '0.5',
            'reactions'=> 'include',
            'description'=> 'exclude',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/items/semantic-search'
params = {
  'q': 'web app',
  'threshold': '0.5',
  'reactions': 'include',
  'description': 'exclude',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/semantic-search"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

Map<Object, Object> params = {
  "q": "web app",
  "threshold": "0.5",
  "reactions": "include",
  "description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/items/semantic-search';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$queryParams = {
  'q': 'web app',
  'threshold': '0.5',
  'reactions': 'include',
  'description': 'exclude',
};

$url .= '?'. $queryParams;

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{
"data": [
{
"item_id": 15,
"sku": "",
"name": "Web app with Vue 3 and Tailwind CSS",
"slug": "Web-app-with-Vue-3-and-Tailwind-CSS",
"price": 40,
"external_link": "",
"scratched_price": 0,
"one_liner": "A complete Vue.js course with front end web app development",
"delivery_type": "online",
"main_image": "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/Products/ProductImg15png",
"other_images": [],
"attributes": [],
"space": {
      "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
      "name": "Aditya"
},
"avg_rating": null,
"scheduled_for": null,
"categories" : [
{
  "id": 22,
 "name": "Web Development Bootcamp"
}
],
"item_meta": [
          {
               "key" : "website",
              "value": "https://adiranids.com",
              "type": "url"
          }
     ],
 "reactions": [
          {
              "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
              "reaction": "like",
              "user_identifier": "aditya@example.com",
              "created_at": "2024-01-07T09:54:12.000000Z",
              "updated_at": "2024-01-07T09:54:12.000000Z"
          }
      ],
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
"similarity": 0.8
},
{
"item_id": 29,
"sku": "",
"name": "React native expo boot camp",
"slug": null,
"stock": 0,
"price": 75,
"scratched_price": 0,
"one_liner": "Learn react native expo from beginner to pro",
"delivery_type": "online",
"main_image": "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/Products/ProductImgMain29png",
"other_images": [],
"attributes": [],
"space": {
      "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
      "name": "Aditya"
},
"avg_rating": null,
"scheduled_for": null,
  "item_meta": [
     ]
"categories" : [
 {
  "id": 23,
 "name": "Mobile App Development Bootcamp"
}
],
"reactions": [],
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16",
"similarity": 0.6
}
],
"links": {
   "first": "https://garchi.co.uk/api/v2/items?page=1",
   "last": "https://garchi.co.uk/api/v2/items?page=1",
  "prev": null,
 "next": null
},
"meta": {
  "current_page": 1,
  "from": 1,
  "last_page": 1,
  "links": [
      {
         "url": null,
         "label": "&laquo; Previous",
         "active": false
     },
     {
         "url": "https://garchi.co.uk/api/v2/items?page=1",
         "label": "1",
         "active": true
     },
     {
         "url": null,
         "label": "Next &raquo;",
         "active": false
     }
 ],
"path": "https://garchi.co.uk/api/v2/items",
"per_page": 10,
"to": 3,
"total": 3
}
}
 

This endpoint returns the list of featured items that you set from your dashboard. The response body is similar to list all items api .

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/items/featured?reactions=include&description=exclude" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/items/featured"
);

const params = {
    "reactions": "include",
    "description": "exclude",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/items/featured',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'query' => [
            'reactions'=> 'include',
            'description'=> 'exclude',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/items/featured'
params = {
  'reactions': 'include',
  'description': 'exclude',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/featured"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

Map<Object, Object> params = {
  "reactions": "include",
  "description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/items/featured';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$queryParams = {
  'reactions': 'include',
  'description': 'exclude',
};

$url .= '?'. $queryParams;

$response = $client->GET($url);

$responseBody = $response->json();

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 600
x-ratelimit-remaining: 599
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Get Item Details

Returns details of a single item based on the item_id or slug passed.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/item/3?reactions=include" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/item/3"
);

const params = {
    "reactions": "include",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/item/3',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'query' => [
            'reactions'=> 'include',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/item/3'
params = {
  'reactions': 'include',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/item/3"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

Map<Object, Object> params = {
  "reactions": "include",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/item/3';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$queryParams = {
  'reactions': 'include',
};

$url .= '?'. $queryParams;

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{
"data": [
{
"item_id": 26,
"sku": "",
"name": "Webdev courses in depth",
"stock": 100,
"categories" : [
     {
         "id": 22,
         "name": "Web Development Bootcamp"
     }
]
"price": 40,
"external_link": "",
"scratched_price": null,
"one_liner": "Best book for begineer",
"description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
"delivery_type": "can_deliver",
"main_image": "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/Products/ProductImgMainpng",
"other_images": [
   "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/Products/ProductImg1png",
   "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/Products/ProductImg2png"
   ],
"attributes": [
{
        "id": 16,
        "name": "Book Cover",
        "min": "1",
        "options": [
         {
          "id": 29,
          "name": "Paper",
          "price": 0.5
         },
   {
      "id": 30,
      "name": "Binded",
      "price": 1
   }
]
}
],
"space": {
  "uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
 "name": "Web Course Books"
},
"avg_rating": null,
"scheduled_for": null,
 "item_meta": [
          {
              "key" : "website",
              "value": "https://adiranids.com",
              "type": "url"
          }
     ],
 "reactions": [
          {
              "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
              "reaction": "like",
              "user_identifier": "aditya@example.com",
              "created_at": "2024-01-07T09:54:12.000000Z",
              "updated_at": "2024-01-07T09:54:12.000000Z"
          }
      ],
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
}
]
}
 

Request   

GET api/v2/item/{item}

URL Parameters

item  string  

id or slug of the item.

Query Parameters

reactions  string optional  

If you want to include or exclude reactions for the items.

List all items

Returns list of all the items with pagination links. You can also use this api to search items by their name, slug, or category.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/items?size=10&search_keyword=Web+app+with&order_key=price&order_by=desc&reactions=include&description=exclude" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/items"
);

const params = {
    "size": "10",
    "search_keyword": "Web app with",
    "order_key": "price",
    "order_by": "desc",
    "reactions": "include",
    "description": "exclude",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/items',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'query' => [
            'size'=> '10',
            'search_keyword'=> 'Web app with',
            'order_key'=> 'price',
            'order_by'=> 'desc',
            'reactions'=> 'include',
            'description'=> 'exclude',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/items'
params = {
  'size': '10',
  'search_keyword': 'Web app with',
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'description': 'exclude',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

Map<Object, Object> params = {
  "size": "10",
  "search_keyword": "Web app with",
  "order_key": "price",
  "order_by": "desc",
  "reactions": "include",
  "description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/items';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$queryParams = {
  'size': '10',
  'search_keyword': 'Web app with',
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'description': 'exclude',
};

$url .= '?'. $queryParams;

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{
"data": [
{
"item_id": 15,
"sku": "",
"name": "Web app with Vue 3 and Tailwind CSS",
"slug": "Web-app-with-Vue-3-and-Tailwind-CSS",
"price": 40,
"external_link": "",
"scratched_price": 0,
"one_liner": "A complete Vue.js course with front end web app development",
"delivery_type": "online",
"main_image": "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/Products/ProductImg15png",
"other_images": [],
"attributes": [],
"space": {
      "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
      "name": "Aditya"
},
"avg_rating": null,
"scheduled_for": null,
"categories" : [
{
  "id": 22,
 "name": "Web Development Bootcamp"
}
],
"item_meta": [
          {
               "key" : "website",
              "value": "https://adiranids.com",
              "type": "url"
          }
     ],
 "reactions": [
          {
              "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
              "reaction": "like",
              "user_identifier": "aditya@example.com",
              "created_at": "2024-01-07T09:54:12.000000Z",
              "updated_at": "2024-01-07T09:54:12.000000Z"
          }
      ],
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
},
{
"item_id": 29,
"sku": "",
"name": "React native expo boot camp",
"slug": null,
"stock": 0,
"price": 75,
"scratched_price": 0,
"one_liner": "Learn react native expo from beginner to pro",
"delivery_type": "online",
"main_image": "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/Products/ProductImgMain29png",
"other_images": [],
"attributes": [],
"space": {
      "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
      "name": "Aditya"
},
"avg_rating": null,
"scheduled_for": null,
  "item_meta": [
     ]
"categories" : [
 {
  "id": 23,
 "name": "Mobile App Development Bootcamp"
}
],
"reactions": [],
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
}
],
"links": {
   "first": "https://garchi.co.uk/api/v2/items?page=1",
   "last": "https://garchi.co.uk/api/v2/items?page=1",
  "prev": null,
 "next": null
},
"meta": {
  "current_page": 1,
  "from": 1,
  "last_page": 1,
  "links": [
      {
         "url": null,
         "label": "&laquo; Previous",
         "active": false
     },
     {
         "url": "https://garchi.co.uk/api/v2/items?page=1",
         "label": "1",
         "active": true
     },
     {
         "url": null,
         "label": "Next &raquo;",
         "active": false
     }
 ],
"path": "https://garchi.co.uk/api/v2/items",
"per_page": 10,
"to": 3,
"total": 3
}
}
 

Request   

GET api/v2/items

Query Parameters

size  integer optional  

int. Max number of entries on one page or size of chunk per page. By default it is set to 10.

search_keyword  string optional  

string. Could be name of the item, slug of the item, or category name.

order_key  string optional  

string. Key to order the items by. Allowed values are name, price, created, meta.*. meta.* is useful if you want to order items based on the item meta information keys.

order_by  string optional  

string. Order by ascending or descending. Allowed values are asc, desc.

reactions  string optional  

string. If you want to include or exclude reactions for the items.

description  string optional  

string. If you want to include or exclude markdown description for the items.

Filter items

Based on the filters passed, does logically and of all filters and returns the list of items with pagination. The response body is similar to list all items api . The accepted filters are spaces, categories and priceOrder. If any of these filter is null or blank or empty then it will be ignored.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/items/filter?reactions=include&order_key=price&order_by=desc&description=exclude" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"spaces\": \"[\'2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1\']\",
    \"categories\": \"[23,4,1]\",
    \"priceOrder\": \"\\\"low-high\\\"\",
    \"size\": \"10\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/items/filter"
);

const params = {
    "reactions": "include",
    "order_key": "price",
    "order_by": "desc",
    "description": "exclude",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "spaces": "['2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1']",
    "categories": "[23,4,1]",
    "priceOrder": "\"low-high\"",
    "size": "10"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/items/filter',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'query' => [
            'reactions'=> 'include',
            'order_key'=> 'price',
            'order_by'=> 'desc',
            'description'=> 'exclude',
        ],
        'json' => [
            'spaces' => '[\'2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1\']',
            'categories' => '[23,4,1]',
            'priceOrder' => '"low-high"',
            'size' => '10',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/items/filter'
payload = {
    "spaces": "['2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1']",
    "categories": "[23,4,1]",
    "priceOrder": "\"low-high\"",
    "size": "10"
}
params = {
  'reactions': 'include',
  'order_key': 'price',
  'order_by': 'desc',
  'description': 'exclude',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/filter"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "spaces": "['2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1']",
    "categories": "[23,4,1]",
    "priceOrder": "\"low-high\"",
    "size": "10"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

Map<Object, Object> params = {
  "reactions": "include",
  "order_key": "price",
  "order_by": "desc",
  "description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/items/filter';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "spaces": "['2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1']",
    "categories": "[23,4,1]",
    "priceOrder": "\"low-high\"",
    "size": "10"
};

$client->withBody($body);

$queryParams = {
  'reactions': 'include',
  'order_key': 'price',
  'order_by': 'desc',
  'description': 'exclude',
};

$url .= '?'. $queryParams;

$response = $client->POST($url);

$responseBody = $response->json();

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 600
x-ratelimit-remaining: 598
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

POST api/v2/items/filter

Query Parameters

reactions  string optional  

string. If you want to include or exclude reactions for the items.

order_key  string optional  

string. Key to order the items by. Allowed values are name, price, created, meta.*. meta.* is useful if you want to order items based on the item meta information keys.

order_by  string optional  

string. Order by ascending or descending. Allowed values are asc, desc.

description  string optional  

string. If you want to include or exclude markdown description for the items.

Body Parameters

spaces  string[]. optional  

Array of uid of spaces.

categories  integer[]. optional  

Array of category id.

priceOrder  string. optional  

Takes either of one value. 'low-high', 'high-low'.

size  int. optional  

Size of the paginated data chunk.

Filter items by meta values

Based on the filters passed for the meta data (Extra details added for an item) and the operation specified, filters the items. Does logical and of the filters. The response body is similar to list all items api .

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/items/filter/bymeta?order_key=price&order_by=desc&reactions=include" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"meta_filters\": [
        {
            \"key\": \"date\",
            \"value\": \"[\'2021-11-21\', \'2020-12-12\']\",
            \"operator\": \"in\"
        }
    ]
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/items/filter/bymeta"
);

const params = {
    "order_key": "price",
    "order_by": "desc",
    "reactions": "include",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "meta_filters": [
        {
            "key": "date",
            "value": "['2021-11-21', '2020-12-12']",
            "operator": "in"
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/items/filter/bymeta',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'query' => [
            'order_key'=> 'price',
            'order_by'=> 'desc',
            'reactions'=> 'include',
        ],
        'json' => [
            'meta_filters' => [
                [
                    'key' => 'date',
                    'value' => '[\'2021-11-21\', \'2020-12-12\']',
                    'operator' => 'in',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/items/filter/bymeta'
payload = {
    "meta_filters": [
        {
            "key": "date",
            "value": "['2021-11-21', '2020-12-12']",
            "operator": "in"
        }
    ]
}
params = {
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/filter/bymeta"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "meta_filters": [
        {
            "key": "date",
            "value": "['2021-11-21', '2020-12-12']",
            "operator": "in"
        }
    ]
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

Map<Object, Object> params = {
  "order_key": "price",
  "order_by": "desc",
  "reactions": "include",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/items/filter/bymeta';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "meta_filters": [
        {
            "key": "date",
            "value": "['2021-11-21', '2020-12-12']",
            "operator": "in"
        }
    ]
};

$client->withBody($body);

$queryParams = {
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
};

$url .= '?'. $queryParams;

$response = $client->POST($url);

$responseBody = $response->json();

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 600
x-ratelimit-remaining: 597
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

POST api/v2/items/filter/bymeta

Query Parameters

order_key  string optional  

string. Key to order the items by. Allowed values are name, price, created, meta.*. meta.* is useful if you want to order items based on the item meta information keys.

order_by  string optional  

string. Order by ascending or descending. Allowed values are asc, desc.

reactions  string optional  

string. If you want to include or exclude reactions for the items.

Body Parameters

meta_filters  object[]  

Array of key value pairs where key refers to the meta key and value refers to the match you are looking for.

meta_filters[].key  required optional  

Key that you are looking for.

meta_filters[].value  required optional  

Value that should be matched for the specified key.

meta_filters[].operator  required optional  

Type of operator to be used. Allowed operators equals, in, like, gte, lte.

List items by list of ids

This endpoint returns list of items based on items_ids given. It could be use to list specific list of items on landing page. The response body is similar to list all items api .

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/items/byids?order_key=price&order_by=desc&reactions=include&description=exclude" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"item_ids\": [
        15,
        29
    ]
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/items/byids"
);

const params = {
    "order_key": "price",
    "order_by": "desc",
    "reactions": "include",
    "description": "exclude",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "item_ids": [
        15,
        29
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/items/byids',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'query' => [
            'order_key'=> 'price',
            'order_by'=> 'desc',
            'reactions'=> 'include',
            'description'=> 'exclude',
        ],
        'json' => [
            'item_ids' => [
                15,
                29,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/items/byids'
payload = {
    "item_ids": [
        15,
        29
    ]
}
params = {
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'description': 'exclude',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/byids"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "item_ids": [
        15,
        29
    ]
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

Map<Object, Object> params = {
  "order_key": "price",
  "order_by": "desc",
  "reactions": "include",
  "description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/items/byids';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "item_ids": [
        15,
        29
    ]
};

$client->withBody($body);

$queryParams = {
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'description': 'exclude',
};

$url .= '?'. $queryParams;

$response = $client->POST($url);

$responseBody = $response->json();

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 600
x-ratelimit-remaining: 596
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

POST api/v2/items/byids

Query Parameters

order_key  string optional  

string. Key to order the items by. Allowed values are name, price, created, meta.*. meta.* is useful if you want to order items based on the item meta information keys.

order_by  string optional  

string. Order by ascending or descending. Allowed values are asc, desc.

reactions  string optional  

string. If you want to include or exclude reactions for the items.

description  string optional  

string. If you want to include or exclude markdown description for the items.

Body Parameters

item_ids  integer[]  

List of item ids.

Reviews

Create new review for the item

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/reviews/item" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"item_id\": 4,
    \"rating\": 4,
    \"review_body\": \"This is a best selling item.\",
    \"user_email\": \"aditya@example.com\",
    \"user_name\": \"Aditya\",
    \"parent_id\": 4
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/reviews/item"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "item_id": 4,
    "rating": 4,
    "review_body": "This is a best selling item.",
    "user_email": "aditya@example.com",
    "user_name": "Aditya",
    "parent_id": 4
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/reviews/item',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'item_id' => 4,
            'rating' => 4,
            'review_body' => 'This is a best selling item.',
            'user_email' => 'aditya@example.com',
            'user_name' => 'Aditya',
            'parent_id' => 4,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/reviews/item'
payload = {
    "item_id": 4,
    "rating": 4,
    "review_body": "This is a best selling item.",
    "user_email": "aditya@example.com",
    "user_name": "Aditya",
    "parent_id": 4
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/reviews/item"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "item_id": 4,
    "rating": 4,
    "review_body": "This is a best selling item.",
    "user_email": "aditya@example.com",
    "user_name": "Aditya",
    "parent_id": 4
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/reviews/item';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "item_id": 4,
    "rating": 4,
    "review_body": "This is a best selling item.",
    "user_email": "aditya@example.com",
    "user_name": "Aditya",
    "parent_id": 4
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
"data": {
   "review_id": 15,
   "review_body": "This is a best selling item",
   "rating": 4,
   "user": {
      "name": "Aditya",
     "email": "aditya@example.com"
    },
   "item_id": 15,
}
}
 

Request   

POST api/v2/reviews/item

Body Parameters

item_id  integer  

id of the item.

rating  integer  

Number of stars or rating. Ranging from 1-5.

review_body  string optional  

Review body. Max 5000 characters.

user_email  string optional  

Email of the reviewer if the reviewer is authenticated using your or third party services like firebase, supabase etc.

user_name  string optional  

Name of the reviewer if the reviewer is authenticated using your or third party services like firebase, supabase etc.

parent_id  integer optional  

Id of the parent review.

Edit a review

Edits a review. Only provided fields will be updated rest will be ignored.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/reviews/edit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"review_id\": 4,
    \"review_body\": \"This is an amazing seller.\",
    \"rating\": 4
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/reviews/edit"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "review_id": 4,
    "review_body": "This is an amazing seller.",
    "rating": 4
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/reviews/edit',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'review_id' => 4,
            'review_body' => 'This is an amazing seller.',
            'rating' => 4,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/reviews/edit'
payload = {
    "review_id": 4,
    "review_body": "This is an amazing seller.",
    "rating": 4
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/reviews/edit"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "review_id": 4,
    "review_body": "This is an amazing seller.",
    "rating": 4
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/reviews/edit';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "review_id": 4,
    "review_body": "This is an amazing seller.",
    "rating": 4
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "message": "1 reviews updated"
}
 

Request   

POST api/v2/reviews/edit

Body Parameters

review_id  integer  

Id of the review.

review_body  string optional  

Review body. Max 5000 characters.

rating  integer  

Number of stars or rating. Ranging from 1-5.

Delete a review

Permenantly deletes a specific review.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/reviews/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"review_id\": 3
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/reviews/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "review_id": 3
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/reviews/delete',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'review_id' => 3,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/reviews/delete'
payload = {
    "review_id": 3
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/reviews/delete"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "review_id": 3
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/reviews/delete';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "review_id": 3
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "message": "1 reviews deleted"
}
 

Request   

POST api/v2/reviews/delete

Body Parameters

review_id  integer  

ID of the review

Get reviews for an item

Returns the reviews for an item

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/reviews/item/15?size=10" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/reviews/item/15"
);

const params = {
    "size": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/reviews/item/15',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'query' => [
            'size'=> '10',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/reviews/item/15'
params = {
  'size': '10',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/reviews/item/15"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

Map<Object, Object> params = {
  "size": "10",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/reviews/item/15';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$queryParams = {
  'size': '10',
};

$url .= '?'. $queryParams;

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{
"data": [
  {
      "review_id": 15,
      "review_body": "This is a best selling item",
      "rating": 4,
      "guest": null,
      "user": {
          "fname": "Adi",
          "lname": "Kadam"
      },
      "item_id": 15,
      "reviewed_at": "2022-02-23T23:00:45.000000Z",
      "replies": []
      "reactions": [],
  }
],
"links": {
    "first": "https://garchi.co.uk/api/v2/reviews/seller/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1?page=1",
   "last": "https://garchi.co.uk/api/v2/reviews/seller/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1?page=1",
    "prev": null,
    "next": null
},
"meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
        {
            "url": null,
            "label": "&laquo; Previous",
            "active": false
        },
        {
            "url": "https://garchi.co.uk/api/v2/reviews/seller/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "Next &raquo;",
            "active": false
        }
    ],
    "path": "https://garchi.co.uk/api/v2/reviews/seller/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
    "per_page": "10",
     "to": 3,
     "total": 3
 }
}
 

Request   

GET api/v2/reviews/item/{item}

URL Parameters

item  string  

ID of the item

Query Parameters

size  integer optional  

Number of reviews per page. Default is set to 5.

Spaces

List all spaces

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/spaces?size=10" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/spaces"
);

const params = {
    "size": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/spaces',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'query' => [
            'size'=> '10',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/spaces'
params = {
  'size': '10',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/spaces"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

Map<Object, Object> params = {
  "size": "10",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/spaces';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$queryParams = {
  'size': '10',
};

$url .= '?'. $queryParams;

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{
"data": [
   {
       "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
       "name": "Aditya Kadam",
       "logo_url": "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/SellersLogo/SellerLogo97T-1633021175.jpg",
       "number_of_items": 3,
   },
],
"links": {
   "first": "https://garchi.co.uk/api/v2/spaces?page=1",
   "last": "https://garchi.co.uk/api/v2/spaces?page=1",
   "prev": null,
   "next": null
},
"meta": {
   "current_page": 1,
   "from": 1,
   "last_page": 1,
   "links": [
       {
          "url": null,
          "label": "&laquo; Previous",
          "active": false
      },
      {
          "url": "https://garchi.co.uk/api/v2/spaces?page=1",
          "label": "1",
          "active": true
      },
      {
          "url": null,
         "label": "Next &raquo;",
          "active": false
      }
  ],
  "path": "https://garchi.co.uk/api/v2/spaces",
  "per_page": 10,
  "to": 3,
  "total": 3
}
}
 

Request   

GET api/v2/spaces

Query Parameters

size  integer optional  

Number of records to fetch in one page. By default it is set to 10.

Get Space details

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{
"data": {
 "uid": "52690642-cc29-4c4d-a9dc-752d4036869e9b64f419-c900-49a8-9109-208a",
"name": null,
 "logo_url": "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/SellersLogo/SellerLogo191.svg",
 "number_of_items": 24,
 "average_rating": null,
}
}
 

Request   

GET api/v2/space/{uid}

URL Parameters

uid  string  

space uid

Create a new space

Creates a new space.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/space" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --form "name="Aditya Kadam"" \
    --form "logo=@/private/var/folders/ls/1kl78ms907qfpl8147rw3bsr0000gn/T/phpui7uXo" 
const url = new URL(
    "https://garchi.co.uk/api/v2/space"
);

const headers = {
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

const body = new FormData();
body.append('name', '"Aditya Kadam"');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/space',
    [
        'headers' => [
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'multipart' => [
            [
                'name' => 'name',
                'contents' => '"Aditya Kadam"'
            ],
            [
                'name' => 'logo',
                'contents' => fopen('/private/var/folders/ls/1kl78ms907qfpl8147rw3bsr0000gn/T/phpui7uXo', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/space'
files = {
  'logo': open('/private/var/folders/ls/1kl78ms907qfpl8147rw3bsr0000gn/T/phpui7uXo', 'rb')
}
payload = {
    "name": "\"Aditya Kadam\""
}
headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, files=files, data=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

Map<Object, Path> files = new HashMap<>(); 

files.put("logo", Path.of("/private/var/folders/ls/1kl78ms907qfpl8147rw3bsr0000gn/T/phpui7uXo"));  

builder.POST(HttpRequest.BodyPublishers.ofByteArray(files));

String body = {
    "name": "\"Aditya Kadam\""
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "multipart/form-data");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space';

$headers = [
  'Content-Type' => 'multipart/form-data',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "name": "\"Aditya Kadam\""
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


"data": {
"uid": "3cbec0da-0c9f-4cd3-99e3-0b962477816dededd79c-d150-45ec-93b6-859c2f52b234",
 "name": "Aditya Kadam",
 "logo_url": "NA",
 "number_of_products": null,
}
 

Request   

POST api/v2/space

Body Parameters

name  string  

Seller's full name

logo  file optional  

Seller's logo image file

Delete a space record

Deletes space record and associated records.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": "Space details deleted successfully"
}
 

Request   

POST api/v2/delete/space/{uid}

URL Parameters

uid  string  

Seller's uid

Update a space

Updates space details.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --form "name="Aditya Kadam"" \
    --form "logo=@/private/var/folders/ls/1kl78ms907qfpl8147rw3bsr0000gn/T/phpj55BkB" 
const url = new URL(
    "https://garchi.co.uk/api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1"
);

const headers = {
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

const body = new FormData();
body.append('name', '"Aditya Kadam"');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
    [
        'headers' => [
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'multipart' => [
            [
                'name' => 'name',
                'contents' => '"Aditya Kadam"'
            ],
            [
                'name' => 'logo',
                'contents' => fopen('/private/var/folders/ls/1kl78ms907qfpl8147rw3bsr0000gn/T/phpj55BkB', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1'
files = {
  'logo': open('/private/var/folders/ls/1kl78ms907qfpl8147rw3bsr0000gn/T/phpj55BkB', 'rb')
}
payload = {
    "name": "\"Aditya Kadam\""
}
headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, files=files, data=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

Map<Object, Path> files = new HashMap<>(); 

files.put("logo", Path.of("/private/var/folders/ls/1kl78ms907qfpl8147rw3bsr0000gn/T/phpj55BkB"));  

builder.POST(HttpRequest.BodyPublishers.ofByteArray(files));

String body = {
    "name": "\"Aditya Kadam\""
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "multipart/form-data");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1';

$headers = [
  'Content-Type' => 'multipart/form-data',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "name": "\"Aditya Kadam\""
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "data": "Space details updated successfully"
}
 

Request   

POST api/v2/update/space/{uid}

URL Parameters

uid  string  

Seller's uid

Body Parameters

name  string optional  

Seller's full name

logo  file optional  

Seller's logo image file

Compound Query

Compound Query

Compound query is useful when you want to fetch data using complex filters. It is advisable to use compound query only in limited cases as it involves querying using multiple conditions which can be slow.
You need to provide the dataset to query, the fields to query, the conditions for the fields, the values for the conditions and the logic whether to perform logical and/or of the conditions.
Field restriction varies based on the dataset.

Allowed fields for items [item_id, name, slug, description, categories, ratings, price, created]

Allowed fields for categories [category_id, category_name]

Allowed fields for reviews [review_id, item_id, rating, review, created]

You can have duplicate fields in the fields array.

The response schema depends on the dataset. Depending on the dataset the response schema will be as follows:

items: list all items api .

reviews: get reviews for a item api .

categories: get all categories api .

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/compound_query?order_key=created&order_by=desc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"dataset\": \"items\",
    \"fields\": [
        \"name\",
        \"price\"
    ],
    \"conditions\": [
        \"eq\",
        \"lte\"
    ],
    \"values\": [
        \"Apple\",
        100
    ],
    \"logic\": \"[\\\"and\\\"]\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/compound_query"
);

const params = {
    "order_key": "created",
    "order_by": "desc",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "dataset": "items",
    "fields": [
        "name",
        "price"
    ],
    "conditions": [
        "eq",
        "lte"
    ],
    "values": [
        "Apple",
        100
    ],
    "logic": "[\"and\"]"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/compound_query',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'query' => [
            'order_key'=> 'created',
            'order_by'=> 'desc',
        ],
        'json' => [
            'dataset' => 'items',
            'fields' => [
                'name',
                'price',
            ],
            'conditions' => [
                'eq',
                'lte',
            ],
            'values' => [
                'Apple',
                100,
            ],
            'logic' => '["and"]',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/compound_query'
payload = {
    "dataset": "items",
    "fields": [
        "name",
        "price"
    ],
    "conditions": [
        "eq",
        "lte"
    ],
    "values": [
        "Apple",
        100
    ],
    "logic": "[\"and\"]"
}
params = {
  'order_key': 'created',
  'order_by': 'desc',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/compound_query"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "dataset": "items",
    "fields": [
        "name",
        "price"
    ],
    "conditions": [
        "eq",
        "lte"
    ],
    "values": [
        "Apple",
        100
    ],
    "logic": "[\"and\"]"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

Map<Object, Object> params = {
  "order_key": "created",
  "order_by": "desc",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/compound_query';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "dataset": "items",
    "fields": [
        "name",
        "price"
    ],
    "conditions": [
        "eq",
        "lte"
    ],
    "values": [
        "Apple",
        100
    ],
    "logic": "[\"and\"]"
};

$client->withBody($body);

$queryParams = {
  'order_key': 'created',
  'order_by': 'desc',
};

$url .= '?'. $queryParams;

$response = $client->POST($url);

$responseBody = $response->json();

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 600
x-ratelimit-remaining: 593
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

POST api/v2/compound_query

Query Parameters

order_key  string optional  

string. Key to order the dataset by. Allowed values are any field allowed for that respective dataset.

order_by  string optional  

string. Order by ascending or descending. Allowed values are asc, desc.

Body Parameters

dataset  string optional  

required. The dataset to query. Allowed values are items, categories, reviews.

fields  string[] optional  

required. The fields for condition. The sequence matters.

conditions  string[] optional  

required. The conditions for the fields. The sequence matters. Allowed conditions eq,gte,lte,gt,lt,like,in,not_eq,not_in.

values  string[] optional  

required. The values for the conditions. The sequence matters.

logic  string[]. optional  

The logic to use for the conditions. The sequence matters. Allowed values are and, or.

Headless Web

Get asset file for a space

This api is used to get the asset (media file) for a space based on the name of the asset.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/space/assets/logo?space_uid=635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v2/space/assets/logo"
);

const params = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://garchi.co.uk/api/v2/space/assets/logo',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'query' => [
            'space_uid'=> '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/space/assets/logo'
params = {
  'space_uid': '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/assets/logo"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

Map<Object, Object> params = {
  "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space/assets/logo';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$queryParams = {
  'space_uid': '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
};

$url .= '?'. $queryParams;

$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):


{
    "id": "06f3310d-d550-4ab2-b824-d47f65ad3b29",
    "path": "https://garchi.s3.eu-west-2.amazonaws.com/headlessweb/62931923-b209-4e5c-9b91-57065cb443d279df607f-3026-45de-b684-5bee/myself2-1692799469.jpg",
    "size": "157.08KB",
    "type": "uploaded-image"
}
 

Request   

GET api/v2/space/assets/{name}

URL Parameters

name  string  

Asset name.

Query Parameters

space_uid  string  

Space uid.

Get Page

This api is used to get a page by slug and space_uid.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/page" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"space_uid\": \"635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1\",
    \"slug\": \"\\/\",
    \"lang\": \"en-US\",
    \"mode\": \"draft\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/page"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "slug": "\/",
    "lang": "en-US",
    "mode": "draft"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/page',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'space_uid' => '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
            'slug' => '/',
            'lang' => 'en-US',
            'mode' => 'draft',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/page'
payload = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "slug": "\/",
    "lang": "en-US",
    "mode": "draft"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/page"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "slug": "\/",
    "lang": "en-US",
    "mode": "draft"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/page';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "slug": "\/",
    "lang": "en-US",
    "mode": "draft"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):


{
    "id": "99bef509-c85a-4957-8340-8b4325421869",
    "title": "Home",
    "slug": "/",
    "image": "http://garchi.s3.eu-west-2.amazonaws.com/headlesswebpages/c7ba17eb-4004-45ef-b5b3-1d557c5c85f4c34f4a69-3d08-444f-86e0-852b/some_file.png",
    "description": "a great space to be",
    "sections": [
        {
            "id": "99c21f3c-c434-4eb5-89ad-46e958a11081",
            "name": "Card",
            "description": "",
            "props": {
                "title": "This is great",
                "description": "Thanks for telling this",
                "image": "http://garchi.s3.eu-west-2.amazonaws.com/headlessweb/c7ba17eb-4004-45ef-b5b3-1d557c5c85f4c34f4a69-3d08-444f-86e0-852b/Header Image-1690661182",
                "header": "http://garchi.s3.eu-west-2.amazonaws.com/headlessweb/c7ba17eb-4004-45ef-b5b3-1d557c5c85f4c34f4a69-3d08-444f-86e0-852b/Header Image-1690661182",
                "data-garchi-section-id": "99c21f3c-c434-4eb5-89ad-46e958a11081",
                "data-garchi-page-id": "99bef509-c85a-4957-8340-8b4325421869"
            },
            "children": [],
            "order": 0
        },
        {
            "id": "99c210e4-330d-458f-9af3-b5eea6af228d",
            "name": "Navbar",
            "description": "/components/Navbar",
            "props": {
                "title": "Home",
                "link": "https://google.com",
                "data-garchi-section-id": "99c210e4-330d-458f-9af3-b5eea6af228d",
                "data-garchi-page-id": "99bef509-c85a-4957-8340-8b4325421869"
            },
            "children": [
                {
                    "id": "99c3f4f6-7193-471e-a9c0-00ebca35811f",
                    "name": "Logo",
                    "description": "Main logo for the home page",
                    "props": {
                        "src": "http://garchi.s3.eu-west-2.amazonaws.com/headlessweb/c7ba17eb-4004-45ef-b5b3-1d557c5c85f4c34f4a69-3d08-444f-86e0-852b/Logo-1690661165",
                        "data-garchi-section-id": "99c3f4f6-7193-471e-a9c0-00ebca35811f",
                        "data-garchi-page-id": "99bef509-c85a-4957-8340-8b4325421869"
                    },
                    "children": [
                        {
                            "id": "99c4274d-941e-42ad-845c-8c34258c729e",
                            "name": "Navbar",
                            "description": "/components/Navbar",
                            "props": {
                                "title": "Logo",
                                "link": "/",
                                "data-garchi-section-id": "99c4274d-941e-42ad-845c-8c34258c729e",
                                "data-garchi-page-id": "99bef509-c85a-4957-8340-8b4325421869"
                            },
                            "children": [],
                            "order": 0
                        }
                    ],
                    "order": 0
                }
            ],
            "order": 1
        },
        {
            "id": "99c21ab9-e234-4a1a-a8af-324369332fc5",
            "name": "Logo",
            "description": "Main logo for the home page",
            "props": {
                "src": "http://garchi.s3.eu-west-2.amazonaws.com/headlessweb/c7ba17eb-4004-45ef-b5b3-1d557c5c85f4c34f4a69-3d08-444f-86e0-852b/Logo-1690661165",
                "data-garchi-section-id": "99c21ab9-e234-4a1a-a8af-324369332fc5",
                "data-garchi-page-id": "99bef509-c85a-4957-8340-8b4325421869"
            },
            "children": [],
            "order": 2
        }
    ]
}
 

Request   

POST api/v2/page

Body Parameters

space_uid  string  

UID of the space.

slug  string  

Slug of the page.

lang  string optional  

i-18n Language code of the page. Default value is en-US

mode  required optional  

Mode of the page. Allowed values are draft, live.

Create or Update Section templates

This api is used to create or update section templates for a space. Section templates are used to create reusable sections on a page.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/section_template" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"space_uid\": \"5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e\",
    \"section_templates\": [
        {
            \"name\": \"HeroSection\",
            \"description\": \"This is a hero section.\",
            \"prev_name\": null,
            \"props\": [
                {
                    \"key\": \"icon\",
                    \"type\": \"select\",
                    \"allowed_values\": \"CheckIcon,CheckCircleIcon\"
                }
            ]
        }
    ]
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/section_template"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "space_uid": "5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e",
    "section_templates": [
        {
            "name": "HeroSection",
            "description": "This is a hero section.",
            "prev_name": null,
            "props": [
                {
                    "key": "icon",
                    "type": "select",
                    "allowed_values": "CheckIcon,CheckCircleIcon"
                }
            ]
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/section_template',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'space_uid' => '5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e',
            'section_templates' => [
                [
                    'name' => 'HeroSection',
                    'description' => 'This is a hero section.',
                    'prev_name' => null,
                    'props' => [
                        [
                            'key' => 'icon',
                            'type' => 'select',
                            'allowed_values' => 'CheckIcon,CheckCircleIcon',
                        ],
                    ],
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/section_template'
payload = {
    "space_uid": "5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e",
    "section_templates": [
        {
            "name": "HeroSection",
            "description": "This is a hero section.",
            "prev_name": null,
            "props": [
                {
                    "key": "icon",
                    "type": "select",
                    "allowed_values": "CheckIcon,CheckCircleIcon"
                }
            ]
        }
    ]
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/section_template"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "space_uid": "5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e",
    "section_templates": [
        {
            "name": "HeroSection",
            "description": "This is a hero section.",
            "prev_name": null,
            "props": [
                {
                    "key": "icon",
                    "type": "select",
                    "allowed_values": "CheckIcon,CheckCircleIcon"
                }
            ]
        }
    ]
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/section_template';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "space_uid": "5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e",
    "section_templates": [
        {
            "name": "HeroSection",
            "description": "This is a hero section.",
            "prev_name": null,
            "props": [
                {
                    "key": "icon",
                    "type": "select",
                    "allowed_values": "CheckIcon,CheckCircleIcon"
                }
            ]
        }
    ]
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 600
x-ratelimit-remaining: 592
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

POST api/v2/section_template

Body Parameters

space_uid  string  

The unique identifier of the space.

section_templates  object[]  

The section templates to be created or updated.

section_templates[].name  string  

The name of the section template.

section_templates[].description  string optional  

The description of the section template.

section_templates[].prev_name  string optional  

The previous name of the section template. This is used when updating a section template.

section_templates[].props  object[] optional  

The properties of the section template.

section_templates[].props[].key  string  

The key of the property.

section_templates[].props[].type  string  

The type of the property. Allowed values are text,longtext,media,richtext,select

section_templates[].props[].allowed_values  string optional  

Comma separated allowed values for the prop. This is required if the type is select.

Reaction

Mark a reaction

Creates a reaction for review, item. If the reaction already exists it will be deleted and a new one will be added.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/manage-reaction" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"reaction\": \"like\",
    \"user_identifier\": \"aditya@example.com\",
    \"review_id\": 4,
    \"item_id\": 4,
    \"reaction_for\": \"review\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v2/manage-reaction"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {Your_API_Key}",
};

let body = {
    "reaction": "like",
    "user_identifier": "aditya@example.com",
    "review_id": 4,
    "item_id": 4,
    "reaction_for": "review"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/manage-reaction',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {Your_API_Key}',
        ],
        'json' => [
            'reaction' => 'like',
            'user_identifier' => 'aditya@example.com',
            'review_id' => 4,
            'item_id' => 4,
            'reaction_for' => 'review',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/manage-reaction'
payload = {
    "reaction": "like",
    "user_identifier": "aditya@example.com",
    "review_id": 4,
    "item_id": 4,
    "reaction_for": "review"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {Your_API_Key}'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/manage-reaction"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);

String body = {
    "reaction": "like",
    "user_identifier": "aditya@example.com",
    "review_id": 4,
    "item_id": 4,
    "reaction_for": "review"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

builder.header("Content-Type", "application/json");
builder.header("Accept", "application/json");
builder.header("Authorization", "Bearer {Your_API_Key}");

HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/manage-reaction';

$headers = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {Your_API_Key}'
]

$client = Http::withHeaders($headers);

$body = {
    "reaction": "like",
    "user_identifier": "aditya@example.com",
    "review_id": 4,
    "item_id": 4,
    "reaction_for": "review"
};

$client->withBody($body);

$response = $client->POST($url);

$responseBody = $response->json();

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 600
x-ratelimit-remaining: 594
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

POST api/v2/manage-reaction

Body Parameters

reaction  string  

Reaction type.

user_identifier  string  

User identifier Could be email or uid.

review_id  integer optional  

Only required if reaction for review.

item_id  integer optional  

Only required if reaction for an item.

reaction_for  string  

Allowed values are review, item.