Category management

BFG categories help you organize products into meaningful groups, simplify inventory management, and improve product discoverability. Using the categories API, you can create, update, retrieve, or delete categories efficiently. You can also define hierarchical relationships among categories, set thresholds for stock alerts, and use powerful filtering and sorting options to quickly find the categories you need.


List categories

Use this endpoint to get a list of manufacturer categories.

Endpoint: GET /api/manufacturers/categories

Query parameters

NameRequiredDescription
sortNoSorts by the specified field.
filter[name]NoFilters categories by name.
filter[parent.name]NoFilters categories by parent category name.
filter[exclude_id]NoExcludes a category by ID.
filter[trashed]NoIncludes trashed categories. Values: with, only, or without.
filter[all]NoRetrieves all categories matching criteria.
pageNoPage number for pagination.
per_pageNoNumber of categories per page.

Example request

curl --request GET \
  --get "https://api-sandbox.buyingfreedom.app/api/manufacturers/categories?sort=name&filter%5Bname%5D=Lighting&filter%5Bexclude_id%5D=10&filter%5Btrashed%5D=with&filter%5Ball%5D=Lighting&page=1&per_page=10" \
  --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json"

Example response

{
  "data": [
    {
      "id": 10,
      "name": "Lighting Equipment",
      "description": "Lighting tools and electrical accessories",
      "parent_id": null,
      "manufacturer": {
        "id": 25,
        "account_id": "ab1829dd-12ef-4abc-a122-92345e2cc8ee",
        "name": "Lumina Tech Co.",
        "logo_url": "",
        "phone": "555-123-4567",
        "email": "[email protected]",
        "website": "https://www.luminatech.co/",
        "address_1": "8912 Beacon Hill Drive",
        "address_2": "Suite 300",
        "address_3": null,
        "city": "Fairfield",
        "state": "CA",
        "postal_code": "94533",
        "country": "US",
        "longitude": "-122.040397",
        "latitude": "38.245846",
        "full_address": "8912 Beacon Hill Drive, Suite 300, Fairfield, CA, 94533, US",
        "uses_store_locator": false,
        "uses_corestore": true,
        "uses_ffl": 0,
        "created_at": "2025-03-05T09:11:08.000000Z",
        "updated_at": "2025-03-09T04:36:19.000000Z",
        "deleted_at": null
      },
      "parent": null,
      "children": [],
      "created_at": "2025-04-28T08:12:56.000000Z",
      "updated_at": "2025-04-28T08:12:56.000000Z",
      "deleted_at": null
    }
  ],
  "links": {
    "first": "http://sandbox.api/coreware/manufacturer-categories?page=1",
    "last": "http://sandbox.api/coreware/manufacturer-categories?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "path": "http://sandbox.api/coreware/manufacturer-categories",
    "per_page": 15,
    "to": 1,
    "total": 1
  }
}

Create a category

Use this endpoint to create a new category.

Endpoint: POST api/manufacturers/categories

Body parameters

NameRequiredDescription
nameYesThe name of the category.
descriptionNoA brief description of the category.
parent_idNoThe ID of the parent category.
low_stock_thresholdNoThreshold for triggering low stock alerts.

Example request

curl --request POST \
  "https://api-sandbox.buyingfreedom.app/api/manufacturers/categories" \
  --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --data '{
    "name": "Power Tools",
    "description": "Cordless and electric tools for construction and maintenance",
    "parent_id": 12,
    "low_stock_threshold": 5
}'

Example response

{
  "data": {
    "id": 12,
    "name": "Power Tools",
    "description": "Cordless and electric tools for construction and maintenance",
    "parent_id": null,
    "manufacturer": {
      "id": 42,
      "account_id": "f93d1a2e-55aa-482f-bb2a-4f82a6a1c101",
      "name": "ForgeWorks Industries",
      "logo_url": "",
      "phone": "555-814-2213",
      "email": "[email protected]",
      "website": "https://www.forgeworks.io/",
      "address_1": "402 Industrial Parkway",
      "address_2": "Building B",
      "address_3": null,
      "city": "Greystone",
      "state": "TX",
      "postal_code": "78250",
      "country": "US",
      "longitude": "-98.645345",
      "latitude": "29.512123",
      "full_address": "402 Industrial Parkway, Building B, Greystone, TX, 78250, US",
      "uses_store_locator": true,
      "uses_corestore": false,
      "uses_ffl": 0,
      "created_at": "2025-03-10T14:33:45.000000Z",
      "updated_at": "2025-03-11T08:15:02.000000Z",
      "deleted_at": null
    },
    "parent": null,
    "children": [],
    "created_at": "2025-04-28T10:05:27.000000Z",
    "updated_at": "2025-04-28T10:05:27.000000Z",
    "deleted_at": null
  }
}

Get a category

Use this endpoint to get details of a single category by ID.

Endpoint: GET api/manufacturers/categories/{manufacturer_category_id}

URL parameters

  • manufacturer_category_id: Required. Unique ID of the manufacturer category.

Example request

curl --request GET \
  --get "https://api-sandbox.buyingfreedom.app/api/manufacturers/categories/fusebox" \
  --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json"

Note: The fusebox segment in the URL represents the category identifier or slug. Replace it with the appropriate category ID or key from your system.

Example response

{
  "data": {
    "id": 42,
    "name": "Portable Lighting",
    "description": "Battery-powered lighting products and accessories",
    "parent_id": null,
    "manufacturer": {
      "id": 77,
      "account_id": "d1a3b2c9-8fd2-4f62-a09f-2c493cb13b79",
      "name": "AuroraTech Solutions",
      "logo_url": "",
      "phone": "555-431-7820",
      "email": "[email protected]",
      "website": "https://www.auroratech.co/",
      "address_1": "1258 Horizon View Drive",
      "address_2": "Suite 400",
      "address_3": null,
      "city": "Summit Hills",
      "state": "CO",
      "postal_code": "80435",
      "country": "US",
      "longitude": "-106.064423",
      "latitude": "39.605088",
      "full_address": "1258 Horizon View Drive, Suite 400, Summit Hills, CO, 80435, US",
      "uses_store_locator": true,
      "uses_corestore": false,
      "uses_ffl": 0,
      "created_at": "2025-03-01T10:45:33.000000Z",
      "updated_at": "2025-03-06T14:10:22.000000Z",
      "deleted_at": null
    },
    "parent": null,
    "children": [],
    "created_at": "2025-04-28T08:12:56.000000Z",
    "updated_at": "2025-04-28T08:12:56.000000Z",
    "deleted_at": null
  }
}

Update a category

Use this endpoint to update a category's details.

Endpoint: PUT api/manufacturers/categories/{manufacturer_category_id}

URL parameters

  • manufacturer_category_id: Required. Unique ID of the manufacturer category.

Body parameters

NameRequiredDescription
nameYesThe name of the category.
descriptionNoA brief description of the category.
parent_idNoThe ID of the parent category.
low_stock_thresholdNoThreshold for triggering low stock alerts.

Example request

curl --request PUT \
  "https://api-sandbox.buyingfreedom.app/api/manufacturers/categories/lumina" \
  --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --data '{
    "name": "Smart Lighting",
    "description": "Connected lighting systems and IoT-compatible fixtures",
    "parent_id": 7,
    "low_stock_threshold": 5
}'

Example response

{
  "data": {
    "id": 7,
    "name": "Smart Lighting",
    "description": "Connected lighting systems and IoT-compatible fixtures",
    "parent_id": null,
    "manufacturer": {
      "id": 33,
      "account_id": "9b8d2a3f-e177-42aa-9c03-f4e25a53ec66",
      "name": "LuminoTech Inc.",
      "logo_url": "",
      "phone": "555-201-7722",
      "email": "[email protected]",
      "website": "https://www.luminotech.io/",
      "address_1": "488 Circuit Avenue",
      "address_2": "Unit 9A",
      "address_3": null,
      "city": "Edgefield",
      "state": "CA",
      "postal_code": "90210",
      "country": "US",
      "longitude": "-118.400356",
      "latitude": "34.073620",
      "full_address": "488 Circuit Avenue, Unit 9A, Edgefield, CA, 90210, US",
      "uses_store_locator": false,
      "uses_corestore": true,
      "uses_ffl": 0,
      "created_at": "2025-02-15T10:24:30.000000Z",
      "updated_at": "2025-03-01T13:45:12.000000Z",
      "deleted_at": null
    },
    "parent": null,
    "children": [],
    "created_at": "2025-04-28T08:12:56.000000Z",
    "updated_at": "2025-04-28T08:12:56.000000Z",
    "deleted_at": null
  }
}

Delete a category

Use this endpoint to delete a category by ID.

Endpoint: DELETE api/manufacturers/categories/{manufacturer_category_id}

URL parameters

  • manufacturer_category_id: Required. Unique ID of the manufacturer category.

Example request

curl --request DELETE \
    "https://api-sandbox.buyingfreedom.app/api/manufacturers/categories/aperiam" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response

An empty response body indicates successful deletion.