MENU navbar-image

Introduction

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

This documentation 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).

Base URL

https://garchi.co.uk

Authenticating requests

Authenticate requests to this API's endpoints by sending 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 API section in your dashboard.

Address

Add new address

Creates a new address record for the customer. The last added address is set as default which can be changed by setting default to false

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/customer/address" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"address_line_1\": \"Street 1\",
    \"address_line_2\": \"XYZ road\",
    \"city\": \"London\",
    \"postcode\": \"ABC 123\",
    \"default\": false,
    \"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/v1/customer/address"
);

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

let body = {
    "address_line_1": "Street 1",
    "address_line_2": "XYZ road",
    "city": "London",
    "postcode": "ABC 123",
    "default": false,
    "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());

Example response (200):


{
    "data": {
        "address_id": 7,
        "address_line_1": "Street 1",
        "address_line_2": null,
        "postcode": "ABC 123",
        "city": "London",
        "default": true
    }
}
 

Request   

POST api/v1/customer/address

Body Parameters

address_line_1  string  

First line of the address.

address_line_2  string optional  

Second line of the address.

city  string  

postcode  string  

default  boolean optional  

uid  string  

UID of the customer.

Update an address

Updates the given address fields. Only given fields will be updated.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/customer/address/update" \
    --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\",
    \"address_id\": 2,
    \"address_line_1\": \"Street 2\",
    \"address_line_2\": \"XYZ road\",
    \"city\": \"London\",
    \"postcode\": \"ABC 123\",
    \"default\": false
}"
const url = new URL(
    "https://garchi.co.uk/api/v1/customer/address/update"
);

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",
    "address_id": 2,
    "address_line_1": "Street 2",
    "address_line_2": "XYZ road",
    "city": "London",
    "postcode": "ABC 123",
    "default": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "address_id": 7,
        "address_line_1": "Street 2",
        "address_line_2": null,
        "postcode": "ABC 123",
        "city": "London",
        "default": true
    }
}
 

Request   

POST api/v1/customer/address/update

Body Parameters

uid  string  

UID of the customer.

address_id  integer  

id of the address.

address_line_1  string optional  

First line of the address.

address_line_2  string optional  

Second line of the address.

city  string optional  

postcode  string optional  

default  boolean optional  

List all addresses

Returns a list of all addresses

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "address_line_1": "Street 1",
            "address_line_2": null,
            "postcode": "ABC 123",
            "city": "London",
            "default": 1
        }
    ]
}
 

Request   

GET api/v1/customer/{uid}/addresses

URL Parameters

uid  string  

UID of the customer.

Customer

Register a customer

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/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/v1/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());

Example response (200):


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

Request   

POST api/v1/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/v1/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/v1/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());

Example response (200):


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

Request   

POST api/v1/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/v1/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/v1/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());

Example response (200):


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

Request   

POST api/v1/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/v1/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/v1/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());

Example response (200):


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

Request   

POST api/v1/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/v1/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/v1/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());

Example response (200):


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

Request   

POST api/v1/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.

Return a single customer details

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v1/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/v1/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());

Example response (200):


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

Request   

GET api/v1/customer/{uid}

URL Parameters

uid  string optional  

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/v1/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/v1/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());

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://garchitest.co.uk/api/v1/customers?page=1",
   "last": "https://garchitest.co.uk/api/v1/customers?page=1",
   "prev": null,
   "next": null
},
"meta": {
   "current_page": 1,
   "from": 1,
   "last_page": 1,
   "links": [
       {
           "url": null,
           "label": "« Previous",
           "active": false
       },
       {
           "url": "https://garchitest.co.uk/api/v1/customers?page=1",
           "label": "1",
           "active": true
       },
       {
           "url": null,
           "label": "Next »",
           "active": false
       }
   ],
   "path": "https://garchitest.co.uk/api/v1/customers",
   "per_page": 50,
   "to": 1,
   "total": 1
}

}
 

Request   

GET api/v1/customers

Query Parameters

email  string optional  

email of the user.

size  integer optional  

results per page. Default is 50

Discount

Validate Coupon and Calculate Discount

This api takes in the coupon code and cart items in specific format along with cart total. It validates the coupon and returns the calculated discount value

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/validate-coupon" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"coupon\": \"AK123\",
    \"cart_items\": [
        {
            \"product_id\": 2,
            \"quantity\": 2
        }
    ],
    \"cart_total\": 80,
    \"customer_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/v1/validate-coupon"
);

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

let body = {
    "coupon": "AK123",
    "cart_items": [
        {
            "product_id": 2,
            "quantity": 2
        }
    ],
    "cart_total": 80,
    "customer_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());

Example response (200):


{
    "data": {
        "amount": 12,
        "code": "Test15",
        "coupon_id": 27,
        "type": "percent-user-specific",
        "whitelist_type": "user-specific",
        "max_discount": 20,
        "amount_after_discount": 68
    }
}
 

Request   

POST api/v1/validate-coupon

Body Parameters

coupon  string  

Coupon Code.

cart_items  object[]  

Cart items array.

cart_items[].product_id  integer  

Id of the product.

cart_items[].quantity  integer  

Quantity of product added.

cart_total  number  

Cart total amount. This is the total amount on which discount will be calculated.

customer_uid  string optional  

uid of the customer if the coupon is customer specific.

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/v1/order/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"cart_items\": [
        {
            \"product_id\": 2,
            \"product_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,
    \"notify_seller\": \"no\",
    \"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/v1/order/create"
);

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

let body = {
    "cart_items": [
        {
            "product_id": 2,
            "product_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,
    "notify_seller": "no",
    "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());

Request   

POST api/v1/order/create

Body Parameters

cart_items  object[]  

Cart items array.

cart_items[].product_id  integer  

Id of the product.

cart_items[].product_name  string  

Name of the product.

cart_items[].quantity  integer  

Quantity of product added.

cart_items[].delivery_date  date optional  

Delivery date for the product.

cart_items[].attributes  object[] optional  

Attributes selected for a product. 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.

notify_seller  string optional  

Takes value of yes or no. If yes a web push notification will be sent to the respective seller.

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/v1/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/v1/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());

Example response (200):


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

Request   

POST api/v1/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/v1/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/v1/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());

Example response (200):


{
    "message": "Item order cancelled"
}
 

Request   

POST api/v1/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/v1/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/v1/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());

Example response (200):


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

Request   

POST api/v1/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/v1/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/v1/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());

Example response (200):


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

Request   

POST api/v1/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/v1/orders/guest" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"guest_email\": \"fugit\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v1/orders/guest"
);

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

let body = {
    "guest_email": "fugit"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => 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",
               "products": {
                   "product_id": 15,
                   "sku": "SKU123123123",
                  "slug": "Web-app-with-Vue-3-and-Tailwind-CSS",
                   "name": "Web app with Vue 3 and Tailwind CSS",
                   "price": 40,
                   "seller": {
                       "name": "Aditya"
                   }
               }
           },
       ]
   }
]
}
 

Request   

POST api/v1/orders/guest

Body Parameters

guest_email  string  

Email address of the registered 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/v1/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/v1/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());

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",
                    "products": {
                        "product_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,
                        "seller": {
                            "name": "Aditya"
                        }
                    }
                },
                {
                    "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",
                    "products": {
                        "product_id": 16,
                        "external_link": "",
                        "sku": null,
                        "slug": null,
                        "name": "Designing with Canva ",
                        "price": 15.99,
                        "seller": {
                            "name": "Maharani"
                        }
                    }
                }
            ]
        }
    ]
}
 

Request   

GET api/v1/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/v1/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/v1/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());

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",
                    "products": {
                        "product_id": 15,
                        "external_link": "",
                        "name": "Web app with Vue 3 and Tailwind CSS",
                        "slug": "Web-app-with-Vue-3-and-Tailwind-CSS",
                        "seller": {
                            "name": "Aditya"
                        }
                    }
                }
            ]
        }
    ]
}
 

Request   

GET api/v1/order/{invoice_number}

URL Parameters

invoice_number  string  

Invoice number.

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/v1/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/v1/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());

Example response (200):


{
    "message": "Details updated successfully"
}
 

Request   

POST api/v1/orders/guest/update

Body Parameters

guest_email  string  

Email of the user

guest_contact  string optional  

Phone number of the user

Product and Category

Get all Categories for a seller

Returns all the categories of the specified seller.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v1/seller/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/v1/seller/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());

Example response (200):


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

Request   

GET api/v1/seller/{uid}/categories

URL Parameters

uid  string  

Uid of the seller.

List all products for a seller

Returns list of all the products with pagination links for a particular seller

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v1/seller/est/products?size=14" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v1/seller/est/products"
);

const params = {
    "size": "14",
};
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());

Example response (200):


{
"data": [
  {
     "product_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": [],
  "seller": {
      "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
      "name": "Aditya"
  },
  "avg_rating": null
},
{
   "product_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": [],
  "seller": {
      "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
      "name": "Aditya"
  },
  "avg_rating": null,
 "product_meta": [
          {
               "key" : "website",
              "value": "https://adiranids.com",
              "type": "url"
          }
     ]
}
],
"links": {
   "first": "https://garchi.co.uk/api/products?page=1",
   "last": "https://garchi.co.uk/api/products?page=1",
  "prev": null,
 "next": null
},
"meta": {
  "current_page": 1,
  "from": 1,
  "last_page": 1,
  "links": [
      {
         "url": null,
         "label": "« Previous",
         "active": false
     },
     {
         "url": "https://garchi.co.uk/api/products?page=1",
         "label": "1",
         "active": true
     },
     {
         "url": null,
         "label": "Next »",
         "active": false
     }
 ],
"path": "https://garchi.co.uk/api/products",
"per_page": 10,
"to": 3,
"total": 3
}
}
 

Request   

GET api/v1/seller/{uid}/products

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.

Get all Categories

Returns all the categories for all the sellers.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v1/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/v1/categories"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => 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/v1/categories

Get Product Details

Returns details of a single product based on the product_id or slug passed.

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "product_id": 26,
            "sku": "",
            "name": "Webdev courses in depth",
            "stock": 100,
            "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
                        }
                    ]
                }
            ],
            "seller": {
                "uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
                "name": "Web Course Books"
            },
            "avg_rating": null,
            "product_meta": [
                {
                    "key": "website",
                    "value": "https://adiranids.com",
                    "type": "url"
                }
            ]
        }
    ]
}
 

Request   

GET api/v1/product/{product}

URL Parameters

product  string optional  

required. id of the product or slug of the product.

List all products

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

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v1/products?size=10&search_keyword=Web+app+with" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}"
const url = new URL(
    "https://garchi.co.uk/api/v1/products"
);

const params = {
    "size": "10",
    "search_keyword": "Web app with",
};
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());

Example response (200):


{
    "data": [
        {
            "product_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": [],
            "seller": {
                "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
                "name": "Aditya"
            },
            "avg_rating": null,
            "product_meta": [
                {
                    "key": "website",
                    "value": "https://adiranids.com",
                    "type": "url"
                }
            ]
        },
        {
            "product_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": [],
            "seller": {
                "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
                "name": "Aditya"
            },
            "avg_rating": null,
            "product_meta": []
        }
    ],
    "links": {
        "first": "https://garchi.co.uk/api/products?page=1",
        "last": "https://garchi.co.uk/api/products?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/products?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://garchi.co.uk/api/products",
        "per_page": 10,
        "to": 3,
        "total": 3
    }
}
 

Request   

GET api/v1/products

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 product, slug of the product, category name or seller name.

Filter products

Based on the filters passed, does logically and of all filters and returns the list of products with pagination. The response body is similar to list all products api . The accepted filters are sellers, 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/v1/products/filter" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"sellers\": \"[\'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/v1/products/filter"
);

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

let body = {
    "sellers": "['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());

Request   

POST api/v1/products/filter

Body Parameters

sellers  string[]. optional  

Array of uid of sellers.

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.

List products by list of ids

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

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/products/byids" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"product_ids\": [
        15,
        29
    ]
}"
const url = new URL(
    "https://garchi.co.uk/api/v1/products/byids"
);

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

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

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request   

POST api/v1/products/byids

Body Parameters

product_ids  integer[]  

List of product ids.

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

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Filter products by meta value

Based on the filters passed for the meta data and the operation specified, filters the products. Does logical and of the filters. The response body is similar to list all products api .

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/products/filter/bymeta" \
    --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/v1/products/filter/bymeta"
);

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());

Request   

POST api/v1/products/filter/bymeta

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.

Create a category

Creates a new cateogry for a seller

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

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

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

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


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

Request   

POST api/v1/category

Body Parameters

seller_uid  string  

UID of the seller.

category  string  

Category name

Delete a category

Deletes a category and all the associated products of that category for a seller

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/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/v1/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());

Example response (200):


{
    "data": "Category deleted successfully"
}
 

Request   

POST api/v1/delete/category/{seller_uid}/{category_id}

URL Parameters

seller_uid  string  

UID of the seller.

category_id  integer  

Id of the category.

Update a category

Update a cateogry for a seller

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

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

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

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": "Category updated successfully"
}
 

Request   

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

URL Parameters

category_id  integer  

Id of the category.

Body Parameters

seller_uid  string  

UID of the seller.

category  string  

Category name

Create a new product

Adds a new product for a seller

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

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

let body = {
    "seller_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"Product ABC\"",
    "sku": "SKU11111",
    "stock": 5,
    "category_id": 44,
    "price": 10,
    "scratched_price": "5",
    "detail_description": "This is an amazing <b>product<\/b>",
    "external_url": "https:\/\/productabc.com"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


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

Request   

POST api/v1/product

Body Parameters

seller_uid  string optional  

required. UID of the seller.

name  string optional  

required. Name of the product.

sku  string. optional  

SKU of the product if applicable.

stock  integer optional  

required. Quantity/stock of the product.

category_id  integer optional  

required. Cateogory id to which the product should belong.

price  number optional  

required. Price of the product.

scratched_price  float. optional  

Marketing or promotional price of the product.

detail_description  string. optional  

Detail description body of the product.

external_url  string. optional  

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

Delete a product

Deletes a product and it's associated meta data and attributes for a seller

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

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

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

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{

   "data": "Product deleted successfully"

}
}
 

Request   

POST api/v1/delete/product

Body Parameters

product_id  integer optional  

required. Id of the product.

seller_uid  string optional  

required. UID of the seller.

Update a product

Update a product for a seller

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

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

let body = {
    "product_id": 50,
    "seller_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"Product ABC\"",
    "sku": "SKU11111",
    "stock": 5,
    "category_id": 44,
    "price": 10,
    "scratched_price": "5",
    "detail_description": "This is an amazing <b>product<\/b>",
    "external_url": "https:\/\/productabc.com"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{

   "data": "Product updated successfully"

}
}
 

Request   

POST api/v1/update/product

Body Parameters

product_id  integer optional  

required. Id of the product.

seller_uid  string optional  

required. UID of the seller.

name  string optional  

Name of the product.

sku  string optional  

SKU of the product if applicable.

stock  integer optional  

Quantity/stock of the product.

category_id  integer optional  

Cateogory id to which the product should belong.

price  number optional  

Price of the product.

scratched_price  float. optional  

Marketing or promotional price of the product.

detail_description  string. optional  

Detail description body of the product.

external_url  string. optional  

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

Create meta information about a product for a seller

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

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/product_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\",
    \"product_id\": 51,
    \"seller_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v1/product_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",
    "product_id": 51,
    "seller_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


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

Request   

POST api/v1/product_meta

Body Parameters

key  string optional  

required. Key of for the meta information.

type  string optional  

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

value  string optional  

required. Value for the key.

product_id  integer optional  

required. Id of the product.

seller_uid  string optional  

required. UID of the seller.

Delete meta information about a product for a seller

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

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

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

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

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


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

Request   

POST api/v1/delete/product_meta

Body Parameters

meta_id  integer  

Meta id of the product meta info.

product_id  integer optional  

required. Id of the product.

seller_uid  string optional  

required. UID of the seller.

Update meta information about a product for a seller

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

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/update/product_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,
    \"product_id\": 51,
    \"seller_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v1/update/product_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,
    "product_id": 51,
    "seller_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


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

Request   

POST api/v1/update/product_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 product meta info.

product_id  integer optional  

required. Id of the product.

seller_uid  string optional  

required. UID of the seller.

Reviews

Create new review for the seller

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/reviews/seller" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"seller_uid\": \"3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1\",
    \"rating\": 4,
    \"review_body\": \"This is a best seller.\",
    \"review_for\": \"seller\",
    \"customer_uid\": \"73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a\",
    \"guest_email\": \"tenetur\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v1/reviews/seller"
);

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

let body = {
    "seller_uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
    "rating": 4,
    "review_body": "This is a best seller.",
    "review_for": "seller",
    "customer_uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "guest_email": "tenetur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "review_id": 14,
        "review_body": "This is a best seller",
        "rating": 4,
        "guest": null,
        "product_id": null
    }
}
 

Request   

POST api/v1/reviews/seller

Body Parameters

seller_uid  string  

UID of the seller.

rating  integer  

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

review_body  string optional  

Review body. Max 5000 characters.

review_for  string  

Who is this review for label. Allowed values product, seller.

customer_uid  string optional  

Uid of the reviewer if the reviewer is authenticated using login api .

guest_email  string optional  

Email of the reviewer if the reviewer is authenticated using third party services like firebase.

Create new review for the product

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/reviews/product" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"product_id\": 4,
    \"rating\": 4,
    \"review_body\": \"This is a best selling product.\",
    \"review_for\": \"product\",
    \"customer_uid\": \"73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a\",
    \"guest_email\": \"consequatur\"
}"
const url = new URL(
    "https://garchi.co.uk/api/v1/reviews/product"
);

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

let body = {
    "product_id": 4,
    "rating": 4,
    "review_body": "This is a best selling product.",
    "review_for": "product",
    "customer_uid": "73110a91-385c-453a-96b4-a482ff7e1e3b2b2a3289-47be-438a-a102-b07314d619516927b77d-e70a-40d9-8df8-2230621c53d5a5ca4a10-8917-430d-a",
    "guest_email": "consequatur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "review_id": 15,
        "review_body": "This is a best product",
        "rating": 4,
        "guest": null,
        "product_id": 15
    }
}
 

Request   

POST api/v1/reviews/product

Body Parameters

product_id  integer  

id of the product.

rating  integer  

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

review_body  string optional  

Review body. Max 5000 characters.

review_for  string  

Who is this review for label. Allowed values product, seller.

customer_uid  string optional  

Uid of the reviewer if the reviewer is authenticated using login api .

guest_email  string optional  

Email of the reviewer if the reviewer is authenticated using third party services like firebase.

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/v1/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/v1/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());

Example response (200):


{
    "message": "1 reviews updated"
}
 

Request   

POST api/v1/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/v1/reviews/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --data "{
    \"review_id\": 9
}"
const url = new URL(
    "https://garchi.co.uk/api/v1/reviews/delete"
);

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

let body = {
    "review_id": 9
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "1 reviews deleted"
}
 

Request   

POST api/v1/reviews/delete

Body Parameters

review_id  integer  

ID of the review

Get reviews for a seller

Returns the reviews for a seller including their products reviews

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v1/reviews/seller/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1?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/v1/reviews/seller/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1"
);

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());

Example response (200):


{
    "data": [
        {
            "review_id": 12,
            "review_body": "This is a best seller",
            "rating": 5,
            "guest": null,
            "user": {
                "fname": "Adi",
                "lname": "Kadam"
            },
            "product_id": null,
            "reviewed_at": "2022-02-23T23:06:22.000000Z"
        },
        {
            "review_id": 14,
            "review_body": "This is a world class seller",
            "rating": 4,
            "guest": null,
            "user": {
                "fname": "Adi",
                "lname": "Kadam"
            },
            "product_id": null,
            "reviewed_at": "2022-02-23T22:59:57.000000Z"
        },
        {
            "review_id": 15,
            "review_body": "This is a best product",
            "rating": 4,
            "guest": null,
            "user": {
                "fname": "Adi",
                "lname": "Kadam"
            },
            "product_id": 15,
            "reviewed_at": "2022-02-23T23:00:45.000000Z"
        }
    ],
    "links": {
        "first": "https://garchi.co.uk/api/reviews/seller/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1?page=1",
        "last": "https://garchi.co.uk/api/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/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/reviews/seller/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
        "per_page": "10",
        "to": 3,
        "total": 3
    }
}
 

Request   

GET api/v1/reviews/seller/{uid}

URL Parameters

uid  string  

UID of the seller

Query Parameters

size  integer optional  

Number of reviews per page. Default is set to 5.

Get reviews for a product

Returns the reviews for a product

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v1/reviews/product/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/v1/reviews/product/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());

Example response (200):


{
    "data": [
        {
            "review_id": 15,
            "review_body": "This is a best product",
            "rating": 4,
            "guest": null,
            "user": {
                "fname": "Adi",
                "lname": "Kadam"
            },
            "product_id": 15,
            "reviewed_at": "2022-02-23T23:00:45.000000Z"
        }
    ],
    "links": {
        "first": "https://garchi.co.uk/api/reviews/seller/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1?page=1",
        "last": "https://garchi.co.uk/api/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/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/reviews/seller/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
        "per_page": "10",
        "to": 3,
        "total": 3
    }
}
 

Request   

GET api/v1/reviews/product/{product}

URL Parameters

product  string  

ID of the product

Query Parameters

size  integer optional  

Number of reviews per page. Default is set to 5.

Sellers

List all sellers

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v1/sellers?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/v1/sellers"
);

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());

Example response (200):


{
"data": [
   {
       "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
       "name": "Aditya Kadam",
       "business_name": "Aditya",
       "logo_url": "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/SellersLogo/SellerLogo97T-1633021175.jpg",
       "email": "aditya@adiranids.com",
       "phone": "1234567890",
       "number_of_products": 3,
       "average_rating": null,
       "number_of_reviews_for_seller": 0,
       "number_of_reviews_for_products": 0
   },
],
"links": {
   "first": "https://garchi.co.uk/api/sellers?page=1",
   "last": "https://garchi.co.uk/api/sellers?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/sellers?page=1",
          "label": "1",
          "active": true
      },
      {
          "url": null,
         "label": "Next &raquo;",
          "active": false
      }
  ],
  "path": "https://garchi.co.uk/api/sellers",
  "per_page": 10,
  "to": 3,
  "total": 3
}
}
 

Request   

GET api/v1/sellers

Query Parameters

size  integer optional  

Number of records to fetch in one page. By default it is set to 10.

Get seller details

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v1/seller/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/v1/seller/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());

Example response (200):


{
    "data": {
        "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
        "name": null,
        "business_name": "Aditya",
        "logo_url": "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/SellersLogo/SellerLogo97T-1633021175.jpg",
        "email": "aditya@adiranids.com",
        "phone": "1234567890",
        "number_of_products": 3,
        "average_rating": null,
        "number_of_reviews_for_seller": 0,
        "number_of_reviews_for_products": 0,
        "bio": "<p class=\"about-para-1\" style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: 1.6; max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">Howdy friends, I am Aditya. I am an entrepreneur, developer, and IT consultant.&nbsp;</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">&nbsp;</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">Along with managing and developing Garchi's platform and SaaS service, I have been working as a freelance developer and consultant for various SMEs in India and the UK.</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">&nbsp;</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">Being a tech enthusiast I love to code in all the possible languages I can. But, I will be honest here, PHP, Python, and JavaScript are my favourite languages to code in.</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">&nbsp;</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">One thing I like the most is to share my tech knowledge and experience. Being a developer myself I can totally understand it is difficult to assimilate those heavy technical words and concepts. When it comes to programming, it becomes more difficult and frustrating to understand the working/logic of the code.&nbsp;</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">When I was new to the programming world (sometimes in 2010, nice old school days), the first language I learned was C++. I thought \"Cool, that's it, C++ and Java. That's the way forward\". However, that wasn't the case.</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">These days, there are several programming languages that you can learn. The fun fact: almost every language from that pool seems interesting but also scary at the same time. The reason can be anything but the result is mostly one of these things: you either quit programming or you find it boring or you continue using it because, well that's your job.</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">&nbsp;</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">But what if the learning curve becomes interesting and you are able to utilise your knowledge to turn your big idea into reality? If you are working in a 9-5 job, what if the job becomes less frustrating and more exciting? I was almost going to quit coding, even though I studied computer science for my undergrad. But how did I end up being a tech entrepreneur? Well, it's very simple, with just one golden statement, \"Understand the concept rather than mugging upon them\". And that's where I will be helping you guys to break all those complicated concepts into simple, layman's terms. I believe that this will help you all to enjoy the learning curve of programming. Our interactive Boot camp will cover the most key and important concepts.</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">&nbsp;</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">The boot camp aims to make sure that the knowledge and experience I got is transferred effectively to you.</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">&nbsp;</p>\n<p style=\"box-sizing: inherit; padding: 0px; -webkit-font-smoothing: antialiased; line-height: var(--wp--typography--line-height, var(--global--line-height-body)); max-width: var(--responsive--aligndefault-width); min-width: 80%; overflow-wrap: break-word; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 20px; background-color: #ffffff; margin: var(--global--spacing-vertical) auto var(--global--spacing-vertical) auto;\">Check out my&nbsp;<a style=\"box-sizing: inherit; background-color: transparent; text-decoration-thickness: 1px; cursor: pointer; text-underline-offset: 3px; max-width: var(--global--spacing-measure);\" title=\"https://www.linkedin.com/in/aditya-kadam-77a594134/\" href=\"https://www.linkedin.com/in/aditya-kadam-77a594134/\" target=\"_blank\" rel=\"noreferrer noopener\">LinkedIn profile</a>. Feel free to connect with me on LinkedIn and don't forget to send a note :)</p>"
    }
}
 

Request   

GET api/v1/seller/{uid}

URL Parameters

uid  string  

Seller uid

Create a new seller

Creates a new seller. An email is sent to the registered seller with the automatically generated password and further details.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/seller" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {Your_API_Key}" \
    --form "business="Shop XYZ"" \
    --form "name="Aditya Kadam"" \
    --form "email=aditya@example.com" \
    --form "contact=1123123123" \
    --form "website=https://adiranids.com" \
    --form "address_1="Street 1"" \
    --form "address_2="XYZ road"" \
    --form "city=London" \
    --form "postcode=LA1111" \
    --form "about="This seller is amazing. They have wide range of services."" \
    --form "logo=@C:\Users\adity\AppData\Local\Temp\phpBCA9.tmp" 
const url = new URL(
    "https://garchi.co.uk/api/v1/seller"
);

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

const body = new FormData();
body.append('business', '"Shop XYZ"');
body.append('name', '"Aditya Kadam"');
body.append('email', 'aditya@example.com');
body.append('contact', '1123123123');
body.append('website', 'https://adiranids.com');
body.append('address_1', '"Street 1"');
body.append('address_2', '"XYZ road"');
body.append('city', 'London');
body.append('postcode', 'LA1111');
body.append('about', '"This seller is amazing. They have wide range of services."');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Example response (200):


"data": {
"uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
"name": "Aditya Kadam",
"business_name": "Shop XYZ",
"logo_url": "https://garchi.s3.eu-west-2.amazonaws.com/whitelabel_assets/SellersLogo/",
"email": "support@garchi.co.uk",
"phone": "1123123123",
"number_of_products": null,
"average_rating": null,
"number_of_reviews_for_seller": null,
"number_of_reviews_for_products": 0
}
 

Request   

POST api/v1/seller

Body Parameters

business  string  

Seller business name

name  string  

Seller's full name

email  string  

Seller's email address

contact  string  

Seller's contact number

website  string optional  

Seller's website address

address_1  string  

Seller's address line 1

address_2  string optional  

Seller's address line 2

city  string  

Seller's city

postcode  string  

Seller's postcode

logo  file optional  

Seller's logo image file

about  string optional  

Seller's about in 4-5 sentences

Delete a seller record

Deletes seller record and associated records.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/delete/seller/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/v1/delete/seller/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());

Example response (200):


{
    "data": "Seller details deleted successfully"
}
 

Request   

POST api/v1/delete/seller/{uid}

URL Parameters

uid  string  

Seller's uid

Update a seller

Updates seller details.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v1/update/seller/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 "business="Shop XYZ"" \
    --form "name="Aditya Kadam"" \
    --form "email=aditya@example.com" \
    --form "contact=1123123123" \
    --form "website=https://adiranids.com" \
    --form "address_1="Street 1"" \
    --form "address_2="XYZ road"" \
    --form "city=London" \
    --form "postcode=LA1111" \
    --form "about="This seller is amazing. They have wide range of services."" \
    --form "logo=@C:\Users\adity\AppData\Local\Temp\phpBD17.tmp" 
const url = new URL(
    "https://garchi.co.uk/api/v1/update/seller/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('business', '"Shop XYZ"');
body.append('name', '"Aditya Kadam"');
body.append('email', 'aditya@example.com');
body.append('contact', '1123123123');
body.append('website', 'https://adiranids.com');
body.append('address_1', '"Street 1"');
body.append('address_2', '"XYZ road"');
body.append('city', 'London');
body.append('postcode', 'LA1111');
body.append('about', '"This seller is amazing. They have wide range of services."');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Example response (200):


{
    "data": "Seller details updated successfully"
}
 

Request   

POST api/v1/update/seller/{uid}

URL Parameters

uid  string  

Seller's uid

Body Parameters

business  string optional  

Seller business name

name  string optional  

Seller's full name

email  string optional  

Seller's email address

contact  string optional  

Seller's contact number

website  string optional  

Seller's website address

address_1  string optional  

Seller's address line 1

address_2  string optional  

Seller's address line 2

city  string optional  

Seller's city

postcode  string optional  

Seller's postcode

logo  file optional  

Seller's logo image file

about  string optional  

Seller's about in 4-5 sentences