Glocher API

Glocher API allows you to update your stock data and retreive purchase informations of your shops through HTTPS protocol. All you have to do is connecting your management applications to Glocher using the API calls below.
You are allowed to send data in GET and/or POST parameters, or as raw JSON data in request body. The API will automatically detect the way you are communicating with it. Please do not mix raw data with GET/POST data. The response is always a JSON object with at least a 'status' property.

How do I get my API credentials?

It's simple. Just start the Glocher app on your device and create a new user or use an existing one. Add your user to the shop you want to access via the API and set the proper access level. The API user (like any other user) will get an invitation to the shop which has to be accepted.

API call examples

GET https://api-v1.glocher.com/api/[email protected]&pwd=Password123
or

POST https://api-v1.glocher.com/api/auth
with request body of
{
  "email": "[email protected]",
  "pwd": "Password123"
}
This call will give you a response of

{ "status": "OK", "data": { "token": "KXzhoel3rczHMFmyJ17V5BMQZajxXGW0", "id": 732 } }
if successful, or

{ "status": "ERR", "data": [ [ "login", "Wrong email or password" ] ] }
if not succesful.

API calls


auth

https://api-v1.glocher.com/api/auth

Authorizes the API user. Returns the user's ID and auth token.

Input
Parameter Format Required
email email address, eg. [email protected] required
pwd password, raw text required
Response
Property Format Example
ID number 732
token text KXzhoel3rczHMFmyJ17V5BMQZajxXGW0

getShop

https://api-v1.glocher.com/api/getShop

Retrieves the public shop data.

Input
Parameter Format Required
token auth token required
id ID of shop required
Response
Property Format Example
status OK or ERR
data JSON object
Content of "data" object:

Property Description Example
name name of shop Joe's Bakery
user_id ID of owner user 732
lat latitude of shop location 43.234234
lng longitude of shop location 18.234234
description description of shop Coolest bakery in the area!
zip ZIP/Postal code 98765
city city Los Angeles
address street, apt.no., etc. 100 S. Main Street
country country United States
fulladdress full textual representation of address District 7 100 S. Main Street Los Angeles, United States
published 1 or 0
shop_category_id
currency_id
open_from_1 start of opening at monday 8:00
open_until_1 end of opening at monday 20:00
open_from_2 start of opening at tuesday 8:00
open_until_2 end of opening at tuesday 20:00
open_from_3 start of opening at wednesday 8:00
open_until_3 end of opening at wednesday 20:00
open_from_4 start of opening at thursday 8:00
open_until_4 end of opening at thursday 20:00
open_from_5 start of opening at friday 8:00
open_until_5 end of opening at friday 20:00
open_from_6 start of opening at saturday 8:00
open_until_6 end of opening at saturday 20:00
open_from_7 start of opening at sunday 8:00
open_until_7 end of opening at sunday 20:00
open_1 is the shop open at monday? 1 or 0
open_2 is the shop open at tuesday? 1 or 0
open_3 is the shop open at wednesday? 1 or 0
open_4 is the shop open at thursday? 1 or 0
open_5 is the shop open at friday? 1 or 0
open_6 is the shop open at saturday? 1 or 0
open_7 is the shop open at sunday? 1 or 0
shipping_enabled buyer can choose the option of shipping 1 or 0
shipping_free_from if the subtotal of the purchase reaches this amount, the shipping is free. 0 if disabled. number
shipping_rate_base the cost of shipping is calculated on distance or weight or prize
shipping_rates available shipping rates array of JSON objects
paypal_email the email registered in PayPal for receiving payments
user_ratings_sum the sum of user ratings
user_ratings_count the number of user ratings
shipping_required if 1, the buyer MUST set a shipping address 0 or 1
pickup_time_required if 1, the buyer MUST set a pickup time 0 or 1

getCategories

https://api-v1.glocher.com/api/getCategories

Retrieves the array of product categories defined for the given shop.

Input
Parameter Format Required
id ID of shop required
token auth token required
Response
Property Format Example
status OK or ERR
data array of JSON objects
Content of items in "data" array:

Property Format Example
id ID of category
shop_id ID of shop
name name of category Shoes
description description of category Coolest shoes

getStock

https://api-v1.glocher.com/api/getStock

Retrieves the full stock of the given shop (1000 per page).

Input
Parameter Format Required
id ID of shop required
token auth token required
page number of page in list optional (defaults to 1)
Response
Property Format Example
status OK or ERR
data array of JSON objects
page number
count number of products in the list
Content of items in "data" array:

Property Format, description Example
id ID of product
shop_id ID of shop
shop_has_product_category_id ID of category
name name of product Hand Made Shoe
description description of product Cool leather hand made shoe
price number (double precision) 19.99
weight weight of products in kilograms 0.4
size size of product M
color color of products yellow
published 1 or 0
qty quantity in stock. -1 if void.
_imageUrl full URL of product image

getStockByProduct

https://api-v1.glocher.com/api/getStockByProduct

Retrieves the stock data of 1 product.

Input
Parameter Format Required
id ID of product required
shop_id ID of shop required
token auth token required
Response
Property Format Example
status OK or ERR
data JSON object
Content of "data" object:

Property Format, description Example
id ID of product
shop_id ID of shop
shop_has_product_category_id ID of category
name name of product Hand Made Shoe
description description of product Cool leather hand made shoe
price number (double precision) 19.99
weight weight of products in kilograms 0.4
size size of product M
color color of products yellow
published 1 or 0
qty quantity in stock. -1 if void.
_imageUrl full URL of product image

getPendingCarts

https://api-v1.glocher.com/api/getPendingCarts

Retrieves carts in 'pending' status. (1000 per page)

Input
Parameter Format Required
id ID of shop required
token auth token required
Response
Property Format Example
status OK or ERR
data array of JSON objects
page number
count number
Content of "data" object:

Property Format, description Example
id ID of cart
user_id ID of user
shop_id ID of shop
products array of JSON objects
createdate timestamp of cart in YYYY-MM-DD HH:mm:ss format
status status of cart
subtotal number (double precision) 99.99
currency_id ID of currency
token unique token of cart
comment buyer's comment
shipping buyer wants shipping? 0 or 1
shipping_cost shipping cost calculated based on shipping rates
shipping_data JSON object. the data of shipping rate that fits on the purchase conditions
package_status status of package in a pending cart, package_status can only be pending
package_id unique identifier of the package ABC-123456
pickup_time date and time when the buyer want to pick up the package (or wants it to be shipped)
pickup buyer wants to define pickup time? 0 or 1
pickup_address address of shipping
pickup_lat latitude of shipping location
pickup_lng longitude of shipping location
total total cost of purchase (subtotal + shipping cost)
user_rating rating of the given purchase by the buyer 1 to 5
billing_name name should be written on the bill
billing_address address should be written on the bill

getPaidCarts

https://api-v1.glocher.com/api/getPaidCarts

Retrieves carts in 'paid' or 'cash' status. (1000 per page)
Purchases with 'cash' status will be paid onsite.

Input
Parameter Format Required
id ID of shop required
token auth token required
Response
Property Format Example
status OK or ERR
data array of JSON objects
page number
count number
Content of "data" object:

Property Format, description Example
id ID of cart
user_id ID of user
shop_id ID of shop
products array of JSON objects
createdate timestamp of cart in YYYY-MM-DD HH:mm:ss format
status status of cart
subtotal number (double precision) 99.99
currency_id ID of currency
token unique token of cart
comment buyer's comment
shipping buyer wants shipping? 0 or 1
shipping_cost shipping cost calculated based on shipping rates
shipping_data JSON object. the data of shipping rate that fits on the purchase conditions
package_status status of package pending or ready
package_id unique identifier of the package ABC-123456
pickup_time date and time when the buyer want to pick up the package (or wants it to be shipped)
pickup buyer wants to define pickup time? 0 or 1
pickup_address address of shipping
pickup_lat latitude of shipping location
pickup_lng longitude of shipping location
total total cost of purchase (subtotal + shipping cost)
user_rating rating of the given purchase by the buyer 1 to 5
billing_name name should be written on the bill
billing_address address should be written on the bill

getCompletedCarts

https://api-v1.glocher.com/api/getCompletedCarts

Retrieves carts in 'completed' status. (1000 per page)

Input
Parameter Format Required
id ID of shop required
token auth token required
Response
Property Format Example
status OK or ERR
data array of JSON objects
page number
count number
Content of "data" object:

Property Format, description Example
id ID of cart
user_id ID of user
shop_id ID of shop
products array of JSON objects
createdate timestamp of cart in YYYY-MM-DD HH:mm:ss format
status status of cart
subtotal number (double precision) 99.99
currency_id ID of currency
token unique token of cart
comment buyer's comment
shipping buyer wants shipping? 0 or 1
shipping_cost shipping cost calculated based on shipping rates
shipping_data JSON object. the data of shipping rate that fits on the purchase conditions
package_status status of package pending or ready
package_id unique identifier of the package ABC-123456
pickup_time date and time when the buyer want to pick up the package (or wants it to be shipped)
pickup buyer wants to define pickup time? 0 or 1
pickup_address address of shipping
pickup_lat latitude of shipping location
pickup_lng longitude of shipping location
total total cost of purchase (subtotal + shipping cost)
user_rating rating of the given purchase by the buyer 1 to 5
billing_name name should be written on the bill
billing_address address should be written on the bill

getCart

https://api-v1.glocher.com/api/getCart

Retrieves 1 cart.

Input
Parameter Format Required
id ID of cart required
shop_id ID of shop required
token auth token required
Response
Property Format Example
status OK or ERR
data JSON object
Content of "data" object:

Property Format, description Example
id ID of cart
user_id ID of user
shop_id ID of shop
products array of JSON objects
createdate timestamp of cart in YYYY-MM-DD HH:mm:ss format
status status of cart
subtotal number (double precision) 99.99
currency_id ID of currency
token unique token of cart
comment buyer's comment
shipping buyer wants shipping? 0 or 1
shipping_cost shipping cost calculated based on shipping rates
shipping_data JSON object. the data of shipping rate that fits on the purchase conditions
package_status status of package pending or ready
package_id unique identifier of the package ABC-123456
pickup_time date and time when the buyer want to pick up the package (or wants it to be shipped)
pickup buyer wants to define pickup time? 0 or 1
pickup_address address of shipping
pickup_lat latitude of shipping location
pickup_lng longitude of shipping location
total total cost of purchase (subtotal + shipping cost)
user_rating rating of the given purchase by the buyer 1 to 5
billing_name name should be written on the bill
billing_address address should be written on the bill

updateStock

https://api-v1.glocher.com/api/updateStock

Updates the provided products in the stock

Input
Parameter Format Required
id ID of shop required
data array of JSON objects required
token auth token required
Content of 'data' array:

Parameter Format Required
id ID of product optional. If valid ID providet, the product will be updated, else it will be inserted.
name name of product optional on update only
description auth token optional on update only
shop_has_product_category_id category id optional
price price of product (double precision) required
weight weight of product in kilograms (double precision) required
size size of product M
color color of products yellow
published product is published? (1 or 0)
stock_qty quantity in stock (-1 if avoided)
_imageData Base64 URL-encoded data of product image (.jpg) starting with data:image/jpg;base64, optional
_deleteImage if set to true, the existing product image will be deleted optional
_tags array of strings with product tags optional
_external_id the ID stored in your management system. in the response we will return it to help you identifying new and updated products optional
Response
Property Format Example
status OK or ERR
data JSON object
Content of "data" array:

Property Format, description Example
id ID of product
shop_id ID of shop
shop_has_product_category_id ID of category
name name of product Hand Made Shoe
description description of product Cool leather hand made shoe
price number (double precision) 19.99
weight weight of products in kilograms 0.4
size size of product M
color color of products yellow
published 1 or 0
stock_qty quantity in stock. -1 if void.
_imageUrl full URL of product image
_tags array of strings with product tags optional
_external_id the ID of the product in your management system

updateStockByProduct

https://api-v1.glocher.com/api/updateStockByProduct

Updates or inserts 1 product in the stock

Input
Parameter Format Required
id ID of shop required
data JSON object required
token auth token required
Content of 'data' object:

Parameter Format Required
id ID of product optional. If valid ID providet, the product will be updated, else it will be inserted.
name name of product optional on update only
description auth token optional on update only
shop_has_product_category_id category id optional
price price of product (double precision) required
weight weight of product in kilograms (double precision) required
published product is published? (1 or 0)
stock_qty quantity in stock (-1 if avoided)
_imageData Base64 URL-encoded data of product image (.jpg) data:image/jpg;base64, optional
_deleteImage if set to true, the existing product image will be deleted optional
_tags array of strings with product tags optional
_external_id the ID stored in your management system. in the response we will return it to help you identifying new and updated products optional
Response
Property Format Example
status OK or ERR
data JSON object
Content of "data" object:

Property Format, description Example
id ID of product
shop_id ID of shop
shop_has_product_category_id ID of category
name name of product Hand Made Shoe
description description of product Cool leather hand made shoe
price number (double precision) 19.99
weight weight of products in kilograms 0.4
published 1 or 0
stock_qty quantity in stock. -1 if void.
_imageUrl full URL of product image
_tags array of strings with product tags optional
_external_id the ID of the product in your management system

updateCartStatus

https://api-v1.glocher.com/api/updateCartStatus

Sets cart status to 'completed'.

Input
Parameter Format Required
id ID of cart required
shop_id id of shop required
token auth token required
Response

Same as getCart

updateCartPackageStatus

https://api-v1.glocher.com/api/updateCartPackageStatus

Sets package status to 'ready'.

Input
Parameter Format Required
id ID of cart required
shop_id id of shop required
token auth token required
Response

Same as getCart