Overview
  • Package
  • Class
  • Tree
  • Todo

Packages

  • AddonValue
    • Interfaces
  • AdminHttpViewControllers
  • ApiV2Controllers
  • Authentication
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Strategies
  • Category
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • Customer
    • Address
    • Country
    • CountryZone
    • Interfaces
    • Storages
    • Validation
    • ValueObjects
  • Email
    • Collections
    • Entities
    • Exceptions
    • Interfaces
    • Repository
    • ValueObjects
  • Extensions
    • Customers
    • Emails
    • Geschaeftskundenversand
    • Helpers
    • Invoices
    • Orders
    • ParcelShopFinder
    • QuickEdit
    • Serializers
    • Templates
  • Geschaeftskundenversand
    • Exceptions
  • Http
    • Collections
    • Exceptions
    • Factories
    • Interfaces
    • ValueObjects
  • HttpViewControllers
  • InfoBox
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
  • Invoice
    • Interfaces
    • ValueObjects
  • Loaders
    • CrossCuttingLoader
    • GXCoreLoader
    • Interfaces
  • Modules
    • Collections
    • Controllers
    • Interfaces
  • Order
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
    • ValueObjects
  • OrderStatus
    • Collections
    • Entities
    • Exceptions
    • Factories
    • Interfaces
    • Repositories
  • Precheck
  • Product
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • ProductModule
    • Collections
    • Deleter
    • Entities
    • Factories
    • Interface
    • Interfaces
    • Reader
    • Repositories
    • Writer
  • QuickEdit
    • Interfaces
    • Repositories
  • Shared
    • ClassFinder
    • Exceptions
    • FileSystem
    • Interfaces
    • Storage
    • Types
  • SharedShoppingCart
    • Interfaces
  • Slider
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
  • Statistics
    • Interfaces
  • UserConfiguration
    • Interfaces
    • Repository
  • VersionInfo
    • Factories
    • Reader
    • ValueObjects

Classes

  • AbstractApiV2Controller
  • AbstractImagesApiV2Controller
  • AddressesApiV2Controller
  • AddressFormatsApiV2Controller
  • AttachmentsApiV2Controller
  • CategoriesApiV2Controller
  • CategoryIconsApiV2Controller
  • CategoryImagesApiV2Controller
  • CountriesApiV2Controller
  • CustomersApiV2Controller
  • DefaultApiV2Controller
  • EmailsApiV2Controller
  • HttpApiV2Controller
  • OrdersApiV2Controller
  • OrdersHistoryApiV2Controller
  • OrdersItemsApiV2Controller
  • OrdersItemsAttributesApiV2Controller
  • OrderStatusesApiV2Controller
  • OrdersTotalsApiV2Controller
  • ProductImagesApiV2Controller
  • ProductsApiV2Controller
  • ProductsLinksApiV2Controller
  • ShopInformationApiV2Controller
  • TaxClassesApiV2Controller
  • TaxRatesApiV2Controller
  • TaxZonesApiV2Controller
  • ZonesApiV2Controller

Class CategoriesApiV2Controller

Class CategoriesApiV2Controller

Provides a gateway to the CategoryWriteService and CategoryReadService classes, which handle the shop category resources.

AbstractApiV2Controller
Extended by HttpApiV2Controller
Extended by CategoriesApiV2Controller
Package: ApiV2Controllers
Category: System
Located at Controllers/Api/v2/CategoriesApiV2Controller.inc.php

Methods summary

protected
# __initialize( )

Initialize API Controller

Initialize API Controller

public
# post( )

Api

{post} /categories Create Category

Apidescription

Creates new category in the system. To see an example usage take a look at docs/REST/samples/category-service/create_category.php


Apierror

400-BadRequest Category data were not provided.

Apierrorexample

Error-Response HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Category data were not provided." }


Apigroup

Categories

Apiname

CreateCategory

Apiparam

{Number} parentId The ID of the parent category (use 0 if there is no parent category).
{Boolean} isActive Whether the category is active.
{Number} sortOrder Category's sort order starts from 0.
{Object} name Multi-language object with the category's name.
{Object} headingTitle Multi-language object with the category's title.
{Object} description Multi-language object with the category's description.
{Object} metaTitle Multi-language object with the category's meta title.
{Object} metaDescription Multi-language object with the category's meta description.
{Object} metaKeywords Multi-language object with the category's meta keywords.
{Object} urlKeywords Multi-language object with the category's meta URL keywords.
{String} icon The category icon filename.
{String} image The category image filename.
{Object} imageAltText Multi-language object with image alt text.
{Object} settings Contains the category settings.

{String} settings.categoryListingTemplate Provide a category listing template (categorie_listing.html).


{String} settings.productListingTemplate Provide a product listing template (product_listing_v1.html).


{String} settings.sortColumn The name of the products column that will be used to sort the products.
{String} settings.sortDirection Provide ASC or DESC
{Boolean} settings.onSitemap Whether the category appears on sitemap.
{String} settings.sitemapPriority A numerical string value that defines the priority.

{String} settings.sitemapChangeFrequency Possible values can contain the always, hourly, daily, weekly, monthly, yearly, never.


{Boolean} settings.showAttributes Show attributes flag.
{Boolean} settings.showGraduatedPrice Show graduated price flag.
{Boolean} settings.showQuantity Show quantity flag.
{Boolean} settings.showQuantityInfo Show quantity information flag.
{Boolean} settings.showSubCategories Show sub categories flag.
{Boolean} settings.showSubCategoryImages Show sub category images flag.
{Boolean} settings.showSubCategoryNames Show sub category names flag.
{Boolean} settings.showSubCategoryProducts Show sub category products flag.
{Boolean} settings.isViewModeTiled Whether the category view mode is tiled.
{Boolean} settings.showCategoryFilter Whether to show the category filter.
{Number} settings.filterSelectionMode Filter selection mode value.
{Number} settings.filterValueDeactivation Filter value deactivation mode value.

{Array} settings.groupPermissions Contains objects that have info about the customer group permissions.


{Number} settings.groupPermissions.id The customer group permissions.

{Boolean} settings.groupPermissions.isPermitted Whether the current group is permitted to view the category.


Apiparamexample

{json} Request-Body { "parentId": 0, "isActive": true, "sortOrder": 0, "name": { "en": "test category", "de": "Testkategorie" }, "headingTitle": { "en": "test category", "de": "Testkategorie" }, "description": { "en": "

test category description

", "de": "

Testkategorie Beschreibung

" }, "metaTitle": { "en": "", "de": "" }, "metaDescription": { "en": "", "de": "" }, "metaKeywords": { "en": "", "de": "" }, "urlKeywords": { "en": "test-category", "de": "Testkategorie" }, "icon": "item_ltr.gif", "image": "", "imageAltText": { "en": "", "de": "" }, "settings": { "categoryListingTemplate": "categorie_listing.html", "productListingTemplate": "product_listing_v1.html", "sortColumn": "p.products_price", "sortDirection": "ASC", "onSitemap": true, "sitemapPriority": "0.5", "sitemapChangeFrequency": "daily", "showAttributes": false, "showGraduatedPrice": false, "showQuantity": true, "showQuantityInfo": false, "showSubCategories": true, "showSubCategoryImages": true, "showSubCategoryNames": true, "showSubCategoryProducts": false, "isViewModeTiled": false, "showCategoryFilter": false, "filterSelectionMode": 0, "filterValueDeactivation": 0, "groupPermissions": [ { "id": "0", "isPermitted": false }, { "id": "1", "isPermitted": false }, { "id": "2", "isPermitted": false }, { "id": "3", "isPermitted": false } ] } }


Apisuccess

(Success 201) Response-Body If successful, this method returns a complete Category resource in the response body.


Apiversion

2.1.0
public
# put( )

Api

{put} /categories/:id Update Category

Apidescription

Use this method to update an existing category record. Take a look in the POST method for more detailed explanation on every resource property. To see an example usage take a look at docs/REST/samples/category-service/update_category.php


Apierror

400-BadRequest Category record ID was not provided or is invalid.
400-BadRequest Category data were not provided.

Apierrorexample

Error-Response (Missing or invalid ID) HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Category record ID was not provided or is invalid." }


Error-Response (Empty request body) HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Category data were not provided." }


Apigroup

Categories

Apiname

UpdateCategory

Apisuccess

Response-Body If successful, this method returns the updated Category resource in the response body.

Apiversion

2.1.0
public
# delete( )

Api

{delete} /categories/:id Delete Category

Apidescription

Removes a category record from the database. The products that are assigned to this category will not be removed. To see an example usage take a look at docs/REST/samples/category-service/remove_category.php


Apierror

400-BadRequest Category record ID was not provided in the resource URL.

Apierrorexample

Error-Response HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Category record ID was not provided in the resource URL." }


Apiexample

{curl} Delete Category With ID = 57 curl -X DELETE --user admin@shop.de:12345 http://shop.de/api.php/v2/categories/57


Apigroup

Categories

Apiname

DeleteCategory

Apisuccessexample

{json} Success-Response { "code": 200, "status": "success", "action": "delete", "resource": "Category", "categoryId": 57 }


Apiversion

2.1.0
public
# get( )

Api

{get} /categories/:id Get Categories

Apidescription

Get multiple or a single category records through a GET request. Use recursive GET-parameter flag to include all child categories. All categories in the result will be amound themselves, so there is no nesting. This method supports all the GET parameters that are mentioned in the "Introduction" section of this documentation. To see an example usage take a look at docs/REST/samples/category-service/fetch_category.php


Apierror

404-NotFound Category does not exist.

Apierrorexample

Error-Response HTTP/1.1 404 Not Found { "code": 404, "status": "error", "message": "Category does not exist." }


Apiexample

{curl} Get All Toplevel Categories curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/categories


{curl} Get All Categories Recursively curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/categories?recursive


{curl} Get Category With ID = 57 curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/categories/57


{curl} Get Children of Category With ID = 23 curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/categories/23/children


{curl} Get Children of Category With ID = 23 Recursively curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/categories/23/children?recursive


Apigroup

Categories

Apiname

GetCategory

Apiversion

2.4.0
protected array
# _getCategories( LanguageCode $languageCode, IdType $id = null, IdType $customerStatusLimit = null, $recursive = false )

Parameters

$languageCode
$id
$customerStatusLimit
$recursive

Returns

array

Methods inherited from HttpApiV2Controller

_linkResponse(), _locateResource(), _mapResponse(), _minimizeResponse(), _paginateResponse(), _searchResponse(), _setJsonValue(), _sortResponse(), _writeResponse()

Methods inherited from AbstractApiV2Controller

__construct()

Constants summary

Constants inherited from AbstractApiV2Controller

DEFAULT_CONTROLLER_NAME, DEFAULT_PAGE_ITEMS, DEFAULT_RATE_LIMIT, DEFAULT_RATE_RESET_PERIOD

Properties summary

protected CategoryWriteService $categoryWriteService

Category write service.

Category write service.

#
protected CategoryReadService $categoryReadService

Category read service.

Category read service.

#
protected CategoryJsonSerializer $categoryJsonSerializer

Category JSON serializer.

Category JSON serializer.

#
protected CategoryListItemJsonSerializer $categoryListItemJsonSerializer

Category list item JSON serializer.

Category list item JSON serializer.

#
protected array $categories

List of CategoryListItem objects

List of CategoryListItem objects

# []

Properties inherited from AbstractApiV2Controller

$api, $uri

API documentation generated by ApiGen