Introduction
# BASE URL
https://gcommerce.glass/api
# BASE URL
https://gcommerce.glass/api
The G-Commerce Marketplace API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
Authentication
#In the request header
curl -X GET "https://gcommerce.glass/api/categories" \
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/categories',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
Each request must be authenticated with the vendor's admin area email and API key.
Query Parameters
| Parameter | Description |
|---|---|
| Email used by vendor to login to vendor area | |
| API_KEY | API key generated on vendor area |
Authentication to the API is performed via HTTP Basic Auth. Provide your email as the basic auth username value and API key as the basic auth password.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Activate API Access
Marketplace API access is activated / disabled on a per-user basis.
Your API key will be activated upon request. Please send your activation request to tech@gcommerce.glass.
To change API access for a user:
- Log in to the Marketplace vendor panel
- Go to
Account→Administrators - Open the admin account you want to generate API key access to (e.g. vendor-admin@domain.com)
- Switch to the API access tab and click on Yes, allow this user to use the API box
- Securely save API key for futures usage, once you save the changes, this key won't appear here again. If the key is lost, the only way to regain API access will be to generate a new key on this page.
- Click Save.
Categories
Product categorisation, otherwise known as taxonomy, describes the way that your products are classified and organised on G-Commerce marketplace.
List all categories
curl -X GET "https://gcommerce.glass/api/categories" \
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/categories',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"categories": [
{
"category_id": "123456",
"category": "Printers",
"status": "A"
},
...
]
}
This endpoint retrieves all categories.
HTTP Request
GET https://gcommerce.glass/api/categories
Query Parameters
| Parameter | Default | Description |
|---|---|---|
| page | 1 | Shows categories on a page with the defined number |
| items_per_page | 10 | Shows N categories, where N - is a number defined in the parameter |
Fields
A category has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| category_id | Category ID |
| category | Category name |
| status | Product status: A for Active, D for Disabled, H for Hidden |
Retrive a category
curl -X GET "https://gcommerce.glass/api/categories/123456" \
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/categories/123456',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"category_id": "123456",
"parent_id": "0",
"id_path": "",
"level": "4",
"status": "A",
"lang_code": "en",
"category": "Printers",
"description": null
}
This endpoint retrieves a specific category details.
HTTP Request
GET https://gcommerce.glass/api/categories/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the category to retrieve |
Fields
A category has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| category_id | Category ID |
| parent_id | Category Parent ID |
| id_path | Category ID path |
| level | Category level |
| category | Category name |
| status | Product status: A for Active, D for Disabled, H for Hidden |
| description | Category description |
| lang_code | Language code |
Products
Products describe the specific goods or services you offer to your customers.
List all products
curl -X GET "https://gcommerce.glass/api/products?pfull=Y&price_from=10&sort_by=product&sort_order=asc&q=3D" \
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/products?pfull=Y&price_from=10&sort_by=product&sort_order=asc&q=3D',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"products": [
{
"product_id": "123456",
"product": "3D Printer",
"min_qty": "1",
"product_code": "",
"product_upc_code": "",
"status": "A",
"amount": "144",
"weight": "0.000",
"timestamp": "1612975405",
"price": "10.000000",
"category_ids": [
123456
],
"main_category": 123456
},
...
],
"params": {
"pfull": "Y",
"price_from": 10,
sort_by": "product",
sort_order": "asc",
q": "3D",
"total_items": "1"
}
}
This endpoint retrieves the list of all products.
HTTP Request
GET https://gcommerce.glass/api/products
Filters
In order to get products based on a filter, you can use one of the available filters. Product filtering is similar to the advanced search performed in the admin panel.
| Filter | Additional Params |
|---|---|
| pname | Product name |
| pshort | Short description |
| pfull | Full description |
| pcode | Product code |
| cid | Category ID |
| amount_from | In stock lower range |
| amount_to | In stock higher range |
| price_from | Price lower range |
| price_to | Price higher range |
Additional Params
| Param | Description | Supported values |
|---|---|---|
| subcats | Include subcategories of the given category (the cid filter must be used) in the search scope | Y, N |
| order_ids | IDs of the orders to search the products in Comma-separated list of order IDs | 1,13,24 |
| free_shipping | Free shipping | Y, N |
| status | Product status: A for Active, D for Disabled, H for Hidden |
A, D, H |
Sorting
| Sort param | Description |
|---|---|
| status | Product status |
| product | Product name |
| price | Price |
| code | Product code |
| amount | In stock amount |
| sort_by | Determines the parameter by which the orders are sorted in the response |
| sort_order | Determines the sorting order: asc - ascending, desc - descending |
curl -X GET "https://gcommerce.glass/api/products?page=2" \
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/products?page=2',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Pagination
To get a specific number of products or list of products from a concrete page in a response, use pagination parameters:
| Pagination param | Description |
|---|---|
| page | Shows products on a page with the defined number |
| items_per_page | Shows N products, where N - is a number defined in the parameter |
Fields
A product has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| product_id | Product ID |
| product | Product name |
| min_qty | Minimum order quantity |
| product_code | Code |
| product_upc_code | UPC code |
| status | Product status |
| amount | In stock |
| weight | Wight |
| timestamp | Created date |
| price | Product Price |
| category_ids | Additional product categories IDs |
| main_category | Main product category ID |
Create a product
curl --location --request POST "https://gcommerce.glass/api/products" \
--header "Content-Type: application/json" \
--data-raw '{
"product": "New product",
"product_code": "PRD_9345",
"price": 125.55,
"category_ids": [ 8219 ],
"main_category": 8219,
"amount": 1000,
"main_pair": {
"detailed": { "image_path": "https://store.com/images/products/PRD_9345.jpg" }
},
"image_pairs" : [
{
"position": 1,
"detailed": { "image_path": "https://store.com/images/products/PRD_9345_1.jpg" }
},
{
"position": 2,
"detailed": { "image_path": "https://store.com/images/products/PRD_9345_2.jpg" }
}
]
}'
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/products',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"product": "New product",
"product_code": "PRD_9345",
"price": 125.55,
"category_ids": [ 123456 ],
"main_category": 123456,
"amount": 1000,
"main_pair": {
"detailed": { "image_path": "https://store.com/images/products/PRD_9345.jpg" }
},
"image_pairs" : [
{
"position": 1,
"detailed": { "image_path": "https://store.com/images/products/PRD_9345_1.jpg" }
},
{
"position": 2,
"detailed": { "image_path": "https://store.com/images/products/PRD_9345_2.jpg" }
}
]
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token,
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"product_id": 123456
}
This endpoint create a new product.
HTTP Request
POST https://gcommerce.glass/api/products
Fields
A product has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| product | Product name |
| product_id | Product ID |
| timestamp | Creation timestamp |
| product_code | Product code |
| product_upc_code | UPC code |
| lang_code | Language code |
| category_ids | IDs of the categories to which the product belongs |
| main_category | ID of the main category |
| price | Price |
| list_price | Manufacturer suggested price |
| status | Product status: A for Active, D for Disabled, H for Hidden |
| amount | Product amount in stock |
| min_qty | Minimal order quantity |
| full_description | Full product description |
| page_title | Product page title |
| meta_description | Meta description |
| main_pair | Full image and thumbnail pair (see main pair) |
| image_pairs | Additional image pairs (see main pair) |
| avail_since | Date from which the product is available |
| free_shipping | Allow free shipping: Y for Yes , N for No |
| weight | Weight |
Main Pair
A pair of the full product image and (optionally) a thumbnail.
| Field name | Description |
|---|---|
| detailed | Full image data |
| image_path | Actual image path (HTTP or HTTPS; may be the same as http_image_path ) |
Image Pairs
A pair of the additional product image and (optionally) a thumbnail.
| Field name | Description |
|---|---|
| position | Image position |
| detailed | Full image data |
| image_path | Actual image path (HTTP or HTTPS; may be the same as http_image_path ) |
Retrive a product
curl -X GET "https://gcommerce.glass/api/products/12345" \
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/products/123456',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"min_items_in_box": 0,
"max_items_in_box": 0,
"box_length": 0,
"box_width": 0,
"box_height": 0,
"product_id": 123456,
"product_code": "",
"product_upc_code": "",
"status": "D",
"amount": "1",
"weight": "0.000",
"shipping_freight": "0.00",
"timestamp": "1656441343",
"free_shipping": "N",
"min_qty": "0",
"list_qty_count": "0",
"average_rating": "0.00",
"featured": "0",
"external_product_id": null,
"inventory_location": "US",
"lang_code": "en",
"product": "3D Printer",
"shortname": "",
"short_description": "",
"full_description": "<p>Product html description</p>",
"meta_keywords": "",
"meta_description": "",
"search_words": "",
"page_title": "",
"age_warning_message": null,
"promo_text": "",
"ebay_title": null,
"ebay_description": null,
"override": null,
"product_notice": "",
"price": "12.000000",
"category_ids": [
123456
],
"main_category": 123456,
"image_pairs": [],
"main_pair": [],
"product_features": [],
"premoderation_reason": ""
}
This endpoint retrieves a specific product details.
HTTP Request
GET https://gcommerce.glass/api/products/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the product to retrieve |
Fields
A product has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| product | Product name |
| product_id | Product ID |
| timestamp | Creation timestamp |
| product_code | Product code |
| product_upc_code | UPC code |
| lang_code | Language code |
| category_ids | IDs of the categories to which the product belongs |
| main_category | ID of the main category |
| price | Price |
| list_price | Manufacturer suggested price |
| status | Product status: A for Active, D for Disabled, H for Hidden |
| amount | Product amount in stock |
| min_qty | Minimal order quantity |
| full_description | Full product description |
| page_title | Product page title |
| meta_description | Meta description |
| main_pair | Full image and thumbnail pair (see main pair) |
| image_pairs | Additional image pairs (see main pair) |
| avail_since | Date from which the product is available |
| free_shipping | Allow free shipping: Y for Yes , N for No |
| weight | Weight |
Main Pair
A pair of the full product image and (optionally) a thumbnail.
| Field name | Description |
|---|---|
| detailed_id | ID of the full image |
| image_id | ID of the thumbnail |
| position | Position of the image pair among others |
| icon | Thumbnail data |
| detailed | Full image data |
| absolute_path | Absolute filesystem path to the image |
| alt | Alternative text |
| image_path | Actual image path (HTTP or HTTPS; may be the same as http_image_path ) |
| image_x | Image width in pixels |
| image_y | Image height |
Update a product
curl --location --request PUT 'https://gcommerce.glass/api/products/123456' \
--header 'Content-Type: application/json' \
--data-raw '{
"product": "New product title",
"price": 125.55,
"amount": 1234
}'
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/products/262875',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"product": "New product title",
"price": 125.55,
"amount": 1234
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token,
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"product_id": 123456
}
This endpoint update an existing product.
HTTP Request
PUT https://gcommerce.glass/api/products/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the product to update |
Fields
A product has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| product | Product name |
| product_id | Product ID |
| timestamp | Creation timestamp |
| product_code | Product code |
| product_upc_code | UPC code |
| lang_code | Language code |
| category_ids | IDs of the categories to which the product belongs |
| main_category | ID of the main category |
| price | Price |
| list_price | Manufacturer suggested price |
| status | Product status: A for Active, D for Disabled, H for Hidden |
| amount | Product amount in stock |
| min_qty | Minimal order quantity |
| full_description | Full product description |
| page_title | Product page title |
| meta_description | Meta description |
| main_pair | Full image and thumbnail pair (see main pair) |
| image_pairs | Additional image pairs (see main pair) |
| avail_since | Date from which the product is available |
| free_shipping | Allow free shipping: Y for Yes , N for No |
| weight | Weight |
Main Pair
A pair of the full product image and (optionally) a thumbnail.
| Field name | Description |
|---|---|
| detailed | Full image data |
| image_path | Actual image path (HTTP or HTTPS; may be the same as http_image_path ) |
Image Pairs
A pair of the additional product image and (optionally) a thumbnail.
| Field name | Description |
|---|---|
| position | Image position |
| detailed | Full image data |
| image_path | Actual image path (HTTP or HTTPS; may be the same as http_image_path ) |
Delete a product
curl --location --request DELETE 'https://gcommerce.glass/api/products/123456' \
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/products/123456',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns response for successful action
HTTP/1.1 204 OK
This endpoint delete an existing product.
HTTP Request
DELETE https://gcommerce.glass/api/products/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the product to delete |
Bulk update
Bulk update allows you to update multiple products at once, including various datapoints such as price, description, availability, and more.
When updating a product via the G-Commerce API, the system first checks for the product ID to identify the item to be updated. If a product ID is provided, it will be used as the primary reference.
However, if no product ID is included in the update request, the system can still process the update using the product code instead. In this case, the product code must uniquely identify the product, and you may include any other fields you wish to update.
HTTP Request
POST https://gcommerce.glass/api/products_bulk
Fields
curl --location --request POST 'https://gcommerce.glass/api/products_bulk' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"product_id" : 219222,
"code" : "234234",
"vendor_price" : 159.54,
"amount" : 2600,
"abilityone" : "Y",
"unit_of_measure" : "EA",
"manufacturer_name" : "Adidas",
"manufacturer_part_number" : "AAA3545",
"country_of_origin" : "US",
"upc" : 123234432424,
"unspsc" : 53120000,
"eccn" : 33343
},
{
"code" : "B1224059",
"amount" : 1235,
"vendor_price" : 1234.55
}
]'
--user EMAIL:API_KEY
The above command returns JSON structured like this:
[
{
"product_id": 219222,
"code": "234234",
"updates": {
"prices": true,
"amount": true,
"abilityone": true,
"unit_of_measure": true,
"manufacturer_name": true,
"manufacturer_part_number": true,
"country_of_origin": true,
"upc": true,
"unspsc": true,
"eccn": true
}
},
{
"product_id": 219221,
"code": "B1224059",
"updates": {
"prices": true,
"amount": true
}
}
]
A product has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| product_id | Product ID |
| code | Supplier code |
| vendor_price | Vendor Price (USD) |
| amount | Product amount in stock: 0 for out of stock is accepted |
| abilityone | AbilityOne : Y for Yes , N for No |
| unit_of_measure | Unit of measure |
| manufacturer_name | Manufacturer name |
| manufacturer_part_number | Manufacturer part number |
| country_of_origin | Country of origin |
| upc | Universal Product Code (UPC) |
| unspsc | United Nations Standard Products and Services Code (UNSPSC) |
| eccn | Export Control Classification Number (ECCN) |
Limitations
- Only 1,000 products can be updated at a time.
- The request should have a product_id or code for each product.
- The product must exist in the database.
Bulk upload
Bulk upload allows you to create multiple products at once. You can upload multiple datapoints of the products.
HTTP Request
POST https://gcommerce.glass/api/products_feed
Fields
curl --location --request POST 'https://gcommerce.glass/api/products_feed' \
--header 'Content-Type: application/json' \
--data-raw '{
"items": [
{
"product" : "3D Printer",
"full_description": "<p>Product html description</p>",
"code" : "B1224059",
"price" : 132.33,
"amount" : 150,
"unit_of_measure": "EA",
"manufacturer_name" : "Dell",
"manufacturer_part_number" : "AS3456",
"country_of_origin" : "USA",
"upc": "98765432345432",
"unspsc": 12323,
"eccn": 123213,
"category_ids": 1144,
"images": "https://store.com/images/products/PRD_9345_1.jpg///https://store.com/images/products/PRD_9345_2.jpg",
"weight": 13,
"free_shipping": "N",
"brand" : "Dell",
"abilityone": "Y",
"made_in_usa": "Y",
"green_product": "Y"
},
...
]
}'
--user EMAIL:API_KEY
The above command returns JSON structured like this:
{
"queue_id": "6772968756425294"
}
A product has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| product | Product name |
| full_description | Full product description |
| code | Supplier code |
| price | Vendor Price (USD) |
| amount | Product amount in stock |
| unit_of_measure | Unit of measure |
| manufacturer_name | Manufacturer name |
| manufacturer_part_number | Manufacturer part number |
| country_of_origin | Country of origin |
| upc | Universal Product Code (UPC) |
| unspsc | United Nations Standard Products and Services Code (UNSPSC) |
| eccn | Export Control Classification Number (ECCN) |
| category_ids | IDs of the categories to which the product belongs (comma separated) |
| images | Images public urls (separated by ///) |
| weight | Weight |
| free_shipping | Free shipping : Y for Yes , N for No |
| brand | Brand name |
| abilityone | AbilityOne : Y for Yes , N for No |
| made_in_usa | Made in USA : Y for Yes , N for No |
| green_product | Green product : Y for Yes , N for No |
Limitations
- Only 10,000 items can be uploaded at a time.
Notifications
- You will receive a notification email when the products feed upload is received.
- You will receive a notification email when the products feed upload is processing.
- You will receive a notification email when the products feed upload is completed.
Orders
An order is a customer's request to purchase one or more products from your online catalog.
List all orders
curl -X GET "https://gcommerce.glass/api/orders" </span>
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/orders',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"orders": [
{
"order_id": "123456",
"timestamp": "1656359693",
"user_id": "123",
"firstname": "John",
"lastname": "Doe",
"email": "john.doe@domain.com",
"phone": "",
"status": "C",
"total": "10000.00"
},
...
],
"params": {
"page": 1,
"items_per_page": 10,
"sort_order": "desc",
"sort_by": "date",
"total_items": "100"
}
}
This endpoint retrieves all orders.
HTTP Request
GET https://gcommerce.glass/api/orders
Pagination
To get a specific number of orders or list of orders from a concrete page in a response, use pagination parameters:
| Pagination param | Description |
|---|---|
| page | Shows orders on a page with the defined number |
| items_per_page | Shows N orders, where N - is a number defined in the parameter |
Filters
In order to get orders based on a filter, you can use one of the available filters. Product filtering is similar to the advanced search performed in the admin panel.
| Filter | Additional Params |
|---|---|
| status | Searches only for the orders with the specified status. |
| Searches only for the orders placed by the customer with the specified email. | |
| user_id | Searches only for the orders placed by the customer with the specified ID. |
Sorting
| Sort param | Description |
|---|---|
| sort_by | Determines the parameter by which the orders are sorted in the responses |
| sort_order | Determines the sorting order: asc - ascending, desc - descending |
Fields
A order has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| order_id | Order ID |
| timestamp | Creation timestamp |
| firstname | Customer firstname |
| lastname | Customer lastname |
| Customer email | |
| phone | Customer phone |
| status | Status of the order |
| total | Order total |
Retrive an order
curl -X GET "https://gcommerce.glass/api/orders/123456" </span>
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/orders/123456',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"order_id": "123456",
"user_id": "123",
"total": "10000.00",
"subtotal": 9950.00,
"discount": 0,
"subtotal_discount": 0,
"payment_surcharge": 0,
"shipping_ids": "44",
"shipping_cost": "50.00",
"timestamp": "1652398308",
"status": "C",
"notes": null,
"details": null,
"promotions": [],
"promotion_ids": "",
"firstname": "John",
"lastname": "Doe",
"b_firstname": "John",
"b_lastname": "Doe",
"b_address": "19 Belfast Ave",
"b_address_2": "",
"b_city": "Mandeville",
"b_county": "",
"b_state": "LA",
"b_country": "US",
"b_zipcode": "70191",
"b_phone": "(000)-000-0000",
"s_firstname": "",
"s_lastname": "",
"s_address": "19 Belfast Ave",
"s_address_2": "",
"s_city": "Mandeville",
"s_county": "",
"s_state": "LA",
"s_country": "US",
"s_zipcode": "70191",
"s_phone": "(000)-000-0000",
"s_address_type": "",
"phone": "(000)-000-0000",
"fax": "",
"url": "",
"email": "john.doe@domain.com",
"payment_id": "32",
"lang_code": "en",
"repaid": "0",
"validation_code": "",
"po_number": "",
"payment_terms": "",
"updated_at": "1652401503",
"payment_method": {
"payment_id": "32",
"payment": "PO",
"description": "",
"instructions": ""
},
"products": {
"424186180": {
"item_id": "424186180",
"order_id": "123456",
"product_id": "123456",
"product_code": "LM1",
"price": "1.13",
"amount": "1200",
"product": "Certified KN95 FDA EUA Approved",
"product_status": "A"
}
},
"taxes": [],
"tax_subtotal": 0,
"display_shipping_cost": "50.00",
"b_country_descr": "United States",
"s_country_descr": "United States",
"b_state_descr": "Louisiana",
"s_state_descr": "Louisiana",
"need_shipping": true,
"shipping": [
{
"shipping_id": "44",
"shipping": "Standard Shipping",
"delivery_time": "1-3 business days",
"description": ""
}
],
"shipment_ids": [],
"secondary_currency": "USD",
"display_subtotal": 9950.00,
"payment_info": []
"total_weight": 0
}
This endpoint retrieves an order details.
HTTP Request
GET https://gcommerce.glass/api/orders/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the order to retrieve |
Fields
An order has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| order_id | Order ID |
| user_id | Customer ID |
| total | Order total |
| subtotal | Order total |
| discount | Order discount |
| shipping_ids | Shipping IDs |
| shipping_cost | Shipping cost |
| timestamp | Creation timestamp |
| status | Order status |
| notes | Customer note |
| firstname | Customer firstname |
| lastname | Customer lastname |
| Customer email | |
| phone | Customer phone |
| status | Status of the order |
| b_firstname | Customer billing firstname |
| b_lastname | Customer billing lastname |
| b_address | Customer billing address |
| b_address_2 | Customer billing address 2 |
| b_city | Customer billing city |
| b_county | Customer billing county |
| b_state | Customer billing state |
| b_country | Customer billing country code |
| b_zipcode | Customer billing zipcode |
| b_phone | Customer billing phone |
| s_firstname | Customer shipping firstname |
| s_lastname | Customer shipping lastname |
| s_address | Customer shipping address |
| s_address_2 | Customer shipping address 2 |
| s_city | Customer shipping city |
| s_county | Customer shipping county |
| s_state | Customer shipping state |
| s_country | Customer shipping country code |
| s_zipcode | Customer shipping zipcode |
| s_phone | Customer shipping phone |
| payment_id | Payment ID |
| products | Order products |
| total_weight | Order products total weight |
Accept an order
curl --location --request PUT 'https://gcommerce.glass/api/order_status/123456' </span>
--header 'Content-Type: application/json' </span>
--data-raw '{
"status": "K"
}'
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/order_status/123456',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"status": "K"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token,
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"order_id": 123456
}
This endpoint update an existing order status.
HTTP Request
PUT https://gcommerce.glass/api/order_status/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the order to update |
Fields
A order has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| status | Order status: K for Accepted |
Purchase Orders
A purchase order is a customer's official request to buy one or more products from your online catalog.
List all purchase orders
curl -X GET "https://gcommerce.glass/api/purchase_orders" </span>
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/purchase_orders',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"purchase_orders": [
{
"purchase_order_id": "123456",
"timestamp": "1656359693",
"status": "O",
"subtotal": "15.00",
"total": "15.00",
"firstname": "John",
"lastname": "Doe",
"email": "john.doe@domain.com",
"phone": ""
},
...
],
"params": {
"page": 1,
"items_per_page": 10,
"sort_order": "desc",
"sort_by": "date",
"total_items": "100"
}
}
This endpoint retrieves all purchase orders.
HTTP Request
GET https://gcommerce.glass/api/purchase_orders
Pagination
To get a specific number of orders or list of purchase orders from a concrete page in a response, use pagination parameters:
| Pagination param | Description |
|---|---|
| page | Shows purchase orders on a page with the defined number |
| items_per_page | Shows N purchase orders, where N - is a number defined in the parameter |
Filters
In order to get purchase orders based on a filter, you can use one of the available filters. Product filtering is similar to the advanced search performed in the admin panel.
| Filter | Additional Params |
|---|---|
| status | Searches only for the purchase orders with the specified status. |
| Searches only for the purchase orders placed by the customer with the specified email. | |
| user_id | Searches only for the purchase orders placed by the customer with the specified ID. |
Sorting
| Sort param | Description |
|---|---|
| sort_by | Determines the parameter by which the purchase orders are sorted in the responses |
| sort_order | Determines the sorting order: asc - ascending, desc - descending |
Fields
A purchase order has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| purchase_order_id | Purchase Order ID |
| timestamp | Creation timestamp |
| status | Status of the purchase order |
| firstname | Customer firstname |
| lastname | Customer lastname |
| Customer email | |
| phone | Customer phone |
| subtotal | Purchase order subtotal |
| total | Purchase order total |
Retrive a purchase order
curl -X GET "https://gcommerce.glass/api/purchase_orders/123456" </span>
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/purchase_orders/123456',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"purchase_order_id": "123456",
"timestamp": "1741004749",
"status": "O",
"subtotal": "15.00",
"total": "15.00",
"firstname": "John",
"lastname": "Doe",
"email": "john.doe@domain.com",
"phone": "(000)-000-0000",
"notes": "",
"shipping": [
{
"shipping_id": "44",
"shipping": "Standard Shipping",
"delivery_time": "1-3 business days",
"description": ""
}
],
"products": [
{
"item_id": "2756919659",
"product_code": "HCODE-0001",
"product_id": "217005",
"product": "Disposable Safety Clothing Isolation Hazmat Suit",
"amount": "1",
"price": "15.00",
"subtotal": "15.00",
"image_url": "https://gcommerce.glass/images/detailed/221/HCODE-0001.jpg",
"product_url": "https://gcommerce.glass/disposable-safety-clothing-isolation-suit.html"
}
],
"b_company": "SOCIAL GLASS INC",
"b_firstname": "John",
"b_lastname": "Doe",
"b_address": "415 Mission Street",
"b_address_2": "Floor 37",
"b_city": "San Francisco",
"b_state": "CA",
"b_country": "US",
"b_zipcode": "94105",
"b_phone": "341-333-6532",
"b_email": "operations@gcommerce.glass",
"s_company": "",
"s_firstname": "John",
"s_lastname": "Doe",
"s_address": "19 Belfast Ave",
"s_address_2": "",
"s_city": "Mandeville",
"s_county": "",
"s_state": "LA",
"s_country": "US",
"s_zipcode": "70191",
"s_phone": "(000)-000-0000"
}
This endpoint retrieves an purchase order details.
HTTP Request
GET https://gcommerce.glass/api/purchase_orders/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the order to retrieve |
Fields
An order has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| purchase_order_id | Purchase order ID |
| timestamp | Creation timestamp |
| status | Purchase order status |
| total | Purchase order total |
| subtotal | Purchase order total |
| shipping | Shipping details |
| notes | Customer note |
| firstname | Customer firstname |
| lastname | Customer lastname |
| Customer email | |
| phone | Customer phone |
| b_company | Customer billing company |
| b_firstname | Customer billing firstname |
| b_lastname | Customer billing lastname |
| b_address | Customer billing address |
| b_address_2 | Customer billing address 2 |
| b_city | Customer billing city |
| b_county | Customer billing county |
| b_state | Customer billing state |
| b_country | Customer billing country code |
| b_zipcode | Customer billing zipcode |
| b_phone | Customer billing phone |
| s_company | Customer shipping company |
| s_firstname | Customer shipping firstname |
| s_lastname | Customer shipping lastname |
| s_address | Customer shipping address |
| s_address_2 | Customer shipping address 2 |
| s_city | Customer shipping city |
| s_county | Customer shipping county |
| s_state | Customer shipping state |
| s_country | Customer shipping country code |
| s_zipcode | Customer shipping zipcode |
| s_phone | Customer shipping phone |
| products | Purchase order products |
Shipments
Shipments streamlines logistics by automating tracking, updating delivery statuses, and integrating with supply chain systems.
List all shipments
curl -X GET "https://gcommerce.glass/api/shipments" </span>
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/shipments',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"shipments": [
{
"shipment_id": "123456",
"shipment_timestamp": "1741006740",
"comments": null,
"status": "P",
"order_id": "123456",
"order_timestamp": "1738318797",
"s_firstname": "John",
"s_lastname": "Doe",
"firstname": "John",
"lastname": "Doe",
"company": "",
"shipping_id": "32",
"shipping": "Shipping Name",
"tracking_number": "345353454354534",
"carrier": "usps",
"products": {
"2756919659": "2"
},
"group_key": 0,
"carrier_info": {
"name": "USPS",
"tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=345353454354534"
},
"one_full": true
},
...
],
"params": {
"page": 1,
"items_per_page": 10,
"advanced_info": true,
"sort_order": "desc",
"sort_by": "id",
"sort_order_rev": "asc",
"total_items": "1"
}
}
This endpoint retrieves the list of all shipments.
HTTP Request
GET https://gcommerce.glass/api/shipments
Filters
In order to get shipments based on a filter, you can use one of the available filters. Shipment filtering is similar to the advanced search performed in the admin panel.
| Filter | Additional Params |
|---|---|
| order_id | Order ID |
Additional Params
| Param | Description | Supported values |
|---|---|---|
| status | Product status: P for Picked up, A for Packed, S for Shipped |
P, A, S |
Sorting
| Sort param | Description |
|---|---|
| status | Product status |
| sort_by | Determines the parameter by which the orders are sorted in the response |
| sort_order | Determines the sorting order: asc - ascending, desc - descending |
curl -X GET "https://gcommerce.glass/api/shipments?page=2" \
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/shipments?page=2',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Pagination
To get a specific number of shipments or list of shipments from a concrete page in a response, use pagination parameters:
| Pagination param | Description |
|---|---|
| page | Shows products on a page with the defined number |
| items_per_page | Shows N products, where N - is a number defined in the parameter |
Fields
A shipment has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| shipment_id | Shipment ID |
| shipment_timestamp | Created date |
| comments | Comments |
| status | Shipment status |
| order_id | Order ID |
| order_timestamp | Order created date |
| s_firstname | Sender firstname |
| s_lastname | Sender lastname |
| firstname | Recipient firstname |
| lastname | Recipient lastname |
| company | Company name |
| shipping_id | Shipping ID |
| shipping | Shipping name |
| tracking_number | Tracking number |
| carrier | Carrier name |
| products | Products in shipment |
| group_key | Group key |
| carrier_info | Carrier info |
Create a shipment
curl --location --request POST "https://gcommerce.glass/api/shipments" \
--header "Content-Type: application/json" \
--data-raw '{
"carrier": "ups",
"order_id": 123456,
"products": {
"2756919659": 1
},
"shipping_id": 1,
"tracking_number": "2432423423",
"comments": "",
"status": "S",
"order_status": "J"
}'
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/shipments',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"carrier": "ups",
"order_id": 123456,
"products": {
"2756919659": 1
},
"shipping_id": 1,
"tracking_number": "2432423423",
"comments": "",
"status": "S",
"order_status": "J"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token,
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"shipment_id": 1234
}
This endpoint create a new shipment.
HTTP Request
POST https://gcommerce.glass/api/shipments
Fields
A shipment has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| carrier | Carrier name |
| order_id | Order ID |
| products | Products in shipment where key is order product item ID and value is quantity |
| shipping_id | Shipping ID |
| tracking_number | Tracking number |
| comments | Comments |
| status | Shipment status 'S' for Shipped |
| order_status | Order status 'J' for Shipped |
Retrive a shipment
curl -X GET "https://gcommerce.glass/api/shipments/1234" </span>
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/shipments/1234',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"shipment_id": "1234",
"shipment_timestamp": "1680690487",
"comments": "",
"status": "P",
"order_id": "657",
"order_timestamp": "1678984546",
"s_firstname": "adsdsadsa",
"s_lastname": "dasdsadsa",
"firstname": "asdasda",
"lastname": "gfghfghjhgjhg",
"company": "",
"user_id": "1",
"shipping_id": "4",
"shipping": "USPS",
"tracking_number": "123213",
"carrier": "usps",
"products": {
"2905461962": "1"
},
"group_key": 0,
"carrier_info": {
"name": "USPS",
"tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=123213"
},
"one_full": true
}
This endpoint retrieves a specific shipment details.
HTTP Request
GET https://gcommerce.glass/api/shipments/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the product to retrieve |
Fields
A product has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| shipment_id | Shipment ID |
| shipment_timestamp | Created date |
| comments | Comments |
| status | Shipment status |
| order_id | Order ID |
| order_timestamp | Order created date |
| s_firstname | Recipient firstname |
| s_lastname | Recipient lastname |
| firstname | Recipient firstname |
| lastname | Recipient lastname |
| company | Recipient company name |
| shipping_id | Shipping ID |
| shipping | Shipping name |
| tracking_number | Tracking number |
| carrier | Carrier name |
| products | Products in shipment |
| group_key | Group key |
| carrier_info | Carrier info |
Update a shipment
curl --location --request PUT 'https://gcommerce.glass/api/shipments/1234' </span>
--header 'Content-Type: application/json' </span>
--data-raw '{
"status": "S"
}'
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/shipments/1234',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"status": "S"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token,
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns JSON structured like this:
HTTP/1.1 200 OK
{
"shipment_id": 1234
}
This endpoint update an existing shipment.
HTTP Request
PUT https://gcommerce.glass/api/shipments/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the shipment to update |
Fields
A product has a number of properties, represented by fields.
| Field name | Description |
|---|---|
| status | Shipment status 'S' for Shipped |
Delete a shipment
curl --location --request DELETE 'https://gcommerce.glass/api/shipments/1234' </span>
--user EMAIL:API_KEY
$token = base64_encode("EMAIL:API_KEY");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://gcommerce.glass/api/products/1234',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$token
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
The above command returns response for successful action
HTTP/1.1 204 OK
This endpoint delete an existing shipment.
HTTP Request
DELETE https://gcommerce.glass/api/shipments/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the shipment to delete |
Rate limits
The Marketplace API supports a limit of 10 requests per minute.
If you exceed this limit, you will receive a 429 error.
If you need to increase this limit, please contact us.
Errors
Marketplace API uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with G-Commerce's servers (these are rare).
| Error Code | Meaning |
|---|---|
| 400 | Bad Request -- The request is invalid. For example, something is missing in it or there is a syntax error. |
| 401 | Unauthorized -- Authorisation data are not valid or missing. |
| 403 | Forbidden -- Access is not allowed. For example, there are no permissions for the request. |
| 404 | Not Found -- The requested object does not exist. |
| 405 | Method Not Allowed -- Initialized method is not supported for the request-URI. |
| 406 | Not Acceptable -- The resource cannot generate a response in the format specified in the request (the accept header has an invalid type). |
| 409 | Conflict -- The change is being rejected due to a condition imposed by the server. The reasons for that may vary and may be described in the response. |
| 413 | Request Entity Too Large -- The client requests more objects than the allowed maximum is. |
| 415 | Unsupported Media Type -- Invalid content-type header. |
| 500 | Internal Server Error -- Server-side error. The request cannot be processed. |
| 501 | Not Implemented -- The request method is not supported by the API. |
| 503 | Service Unavailable -- The store is closed or is being upgraded to a new version. |
| 507 | Insufficient Storage -- The server is unable to store the representation needed to successfully complete the request. |
| 509 | Bandwidth Limit Exceeded -- The requests-per-hour limitations for the API have been reached. |