List categories - celdotro/marketplace GitHub Wiki

About

  • Returns product categories

Class

celmarket\Products\ProductsList

Method

getCategories

API

  • method: import
  • action: getSupplierCategories

Parameters

(none)
Even if there is no parameter being sent to the API wrapper's method, a meaningless parameter will be added to the API call. Be aware of this if you plan on using the API directly!

Response

An object with the following attributes

  • (attribute) = parent category -> object
    • (attribute) = subcategory -> object
      • (object name) = category id
      • (object value) = category name

First category will be named 'parent' by default

Example - PHP

https://github.com/celdotro/marketplace_examples/blob/master/Products/1.getCategories.php

Example - JSON

{
  "request": {
    
  },
  
  "response": {
   "categories": {
    "X" : {
      "X": 1
    }
   } 
  }
}
⚠️ **GitHub.com Fallback** ⚠️