Big Commerce Get Taxonomy
Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)
Date | Version | Name | Applied changes |
---|---|---|---|
09/08/2023 | v1.0 | Bogomil Pavlov | First Publish |
15/11/2023 | v1.1 | Bogomil Pavlov | Taxonomy export per account |
03.07.2024 | v1.2 | Bogomil Pavlov | Add pagination and page limit |
All validations, triggers and standardizations are as per Taxonomy General requirements
The taxonomy simply represents brands and categories. Which we want to store, map, validate and export from Hemi.
Get Brands
API Call: GET https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/brands
Docs: https://developer.bigcommerce.com/docs/rest-catalog/brands#get-all-brands
Sample Request:https://api.bigcommerce.com/stores/oduzegjfvn/v3/catalog/brands <v1.2>Parameters: limit - maxi page - used for pagination we can refer to the response current_page and total_pages</v1.2>
Sample Response: Status 200 OK
{
"data": [
{
"id": 35,
"name": "Sagaform",
"page_title": "",
"meta_keywords": [
""
],
"meta_description": "",
"image_url": "",
"search_keywords": "",
"custom_url": {
"url": "/brands/sagaform-overide/",
"is_customized": true
}
},
{
"id": 36,
"name": "OFS",
"page_title": "",
"meta_keywords": [
""
],
"meta_description": "",
"image_url": "",
"search_keywords": "",
"custom_url": {
"url": "/brands/ofs/",
"is_customized": true
}
},
{
"id": 37,
"name": "Common Good",
"page_title": "",
"meta_keywords": [
""
],
"meta_description": "",
"image_url": "",
"search_keywords": "",
"custom_url": {
"url": "/brands/common-good/",
"is_customized": true
}
},
{
"id": 38,
"name": "test",
"page_title": "",
"meta_keywords": [
""
],
"meta_description": "",
"image_url": "",
"search_keywords": "",
"custom_url": {
"url": "/test/",
"is_customized": false
}
}
],
"meta": {
"pagination": {
"total": 4,
"count": 4,
"per_page": 50,
"current_page": 1,
"total_pages": 1,
"links": {
"current": "?page=1&limit=50"
}
}
}
}
We want to store the id
and the name
from the response.
We want to have the name in Product Account > Item Specific or Product > Brand (Product Account > Item Specifics is with priority) push the id based on the mapping.
Before sending the product for creation we want to validate the Product Account > Item Specific or Product > Brand (Product Account > Item Specifics is with priority.) and if the brand is missing from the list to return internal error else we send the id.
<v1.2>We also want to track the current and total pages to make sure we are storing all brands</v1.2>
Brand taxonomy export file
In order to generate the taxonomy file for the brands we will need to create a new record in Taxonomy export with: Marketplace = BigCommerce Status = pending Category for Export = brand Email = email to which the file will be send
Sample exported file:
Brand Id | Brand Name |
---|---|
35 |
Sagaform |
36 |
OFC |
<v1.1>Please note we will have different set of taxonomies for the different BigCommerce accounts thus if we have a case with an instance with more than one BC account and taxonomies we would like to export it in a single email with multiple files for the different accounts</1.1>
Get Categories
There are only category levels however there are no attributes or values we just need to get the category id, the category level and the category name. Please note there is no leaf categories and we can list in any level of category
API Call: GET https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/categories
Docs: https://developer.bigcommerce.com/docs/rest-catalog/categories#get-all-categories
Sample Request: https://api.bigcommerce.com/stores/oduzegjfvn/v3/catalog/categories
<v1.2>Parameters: limit - maximum brands per page we can get is 250 page - used for pagination we can refer to the response current_page and total_pages</v1.2>
Sample Response: Status 200 OK
{
"data": [
{
"id": 18,
"parent_id": 0,
"name": "Bath",
"description": "",
"views": 0,
"sort_order": 1,
"page_title": "",
"meta_keywords": [
""
],
"meta_description": "",
"layout_file": "category_with_facets.html",
"image_url": "",
"is_visible": true,
"search_keywords": "",
"default_product_sort": "use_store_settings",
"custom_url": {
"url": "/bath/",
"is_customized": false
}
},
{
"id": 19,
"parent_id": 0,
"name": "Garden",
"description": "",
"views": 0,
"sort_order": 2,
"page_title": "",
"meta_keywords": [
""
],
"meta_description": "",
"layout_file": "category_with_facets.html",
"image_url": "",
"is_visible": true,
"search_keywords": "",
"default_product_sort": "use_store_settings",
"custom_url": {
"url": "/garden/",
"is_customized": false
}
},
{
"id": 20,
"parent_id": 0,
"name": "Publications",
"description": "",
"views": 0,
"sort_order": 4,
"page_title": "",
"meta_keywords": [
""
],
"meta_description": "",
"layout_file": "category_with_facets.html",
"image_url": "",
"is_visible": true,
"search_keywords": "",
"default_product_sort": "use_store_settings",
"custom_url": {
"url": "/publications/",
"is_customized": false
}
},
{
"id": 21,
"parent_id": 0,
"name": "Kitchen",
"description": "",
"views": 0,
"sort_order": 3,
"page_title": "",
"meta_keywords": [
""
],
"meta_description": "",
"layout_file": "category_with_facets.html",
"image_url": "",
"is_visible": true,
"search_keywords": "",
"default_product_sort": "use_store_settings",
"custom_url": {
"url": "/kitchen/",
"is_customized": false
}
},
{
"id": 22,
"parent_id": 0,
"name": "Utility",
"description": "",
"views": 0,
"sort_order": 5,
"page_title": "",
"meta_keywords": [
""
],
"meta_description": "",
"layout_file": "category_with_facets.html",
"image_url": "",
"is_visible": true,
"search_keywords": "",
"default_product_sort": "use_store_settings",
"custom_url": {
"url": "/utility/",
"is_customized": false
}
},
{
"id": 23,
"parent_id": 0,
"name": "Shop All",
"description": "",
"views": 0,
"sort_order": 0,
"page_title": "",
"meta_keywords": [
""
],
"meta_description": "",
"layout_file": "category_with_facets.html",
"image_url": "",
"is_visible": true,
"search_keywords": "",
"default_product_sort": "use_store_settings",
"custom_url": {
"url": "/shop-all/",
"is_customized": false
}
}
],
"meta": {
"pagination": {
"total": 6,
"count": 6,
"per_page": 50,
"current_page": 1,
"total_pages": 1,
"links": {
"current": "?page=1&limit=50"
}
}
}
}
We want to store the id
, the navigation path which we can get using the parent_id
form the response and the name
.
We want to have the name in Product Account > Primary Category ID push the id based on the mapping.
Before sending the product for creation we want to validate the Product Account > Primary Category ID and if the category is missing from the list to return internal error else we send the id.
<v1.2>We also want to track the current and total pages to make sure we are storing all categories</v1.2>
Category taxonomy export file
In order to generate the taxonomy file for the categories we will need to create a new record in Taxonomy export with: Marketplace = BigCommerce Status = pending Category for Export = all (or we can specify which exact categories) Email = email to which the file will be send
Sample exported file:
Category Id | Category Path | Category Name |
---|---|---|
21 |
Room>Kitchen | Kitchen |
22 |
Room>Bathroom | Bathroom |
<v1.1>Please note we will have different set of taxonomies for the different BigCommerce accounts thus if we have a case with an instance with more than one BC account and taxonomies we would like to export it in a single email with multiple files for the different accounts</1.1>