Overview
  • Package
  • Class
  • Tree
  • Todo

Packages

  • AddonValue
    • Interfaces
  • ApiV2Controllers
  • Category
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • Customer
    • Address
    • Country
    • CountryZone
    • Interfaces
    • Validation
    • ValueObjects
  • Email
    • Collections
    • Entities
    • Exceptions
    • Interfaces
    • Repository
    • ValueObjects
  • Http
    • Collections
    • Exceptions
    • Factories
    • Interfaces
    • ValueObjects
  • Loaders
    • CrossCuttingLoader
    • GXCoreLoader
    • Interfaces
  • None
  • Order
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
    • ValueObjects
  • Product
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • ProductModule
    • Collections
    • Deleter
    • Entities
    • Factories
    • Interface
    • Interfaces
    • Reader
    • Repositories
    • Writer
  • Shared
    • Exceptions
    • FileSystem
    • Interfaces
    • Storage
    • Types
  • Statistics
    • Interfaces
  • UserConfiguration
    • Interfaces
    • Repository

Classes

  • AbstractApiV2Controller
  • AbstractImagesApiV2Controller
  • AddressesApiV2Controller
  • AttachmentsApiV2Controller
  • CategoriesApiV2Controller
  • CategoryIconsApiV2Controller
  • CategoryImagesApiV2Controller
  • CountriesApiV2Controller
  • CustomersApiV2Controller
  • DefaultApiV2Controller
  • EmailsApiV2Controller
  • HttpApiV2Controller
  • OrdersApiV2Controller
  • OrdersHistoryApiV2Controller
  • OrdersItemsApiV2Controller
  • OrdersItemsAttributesApiV2Controller
  • OrdersTotalsApiV2Controller
  • ProductImagesApiV2Controller
  • ProductsApiV2Controller
  • ProductsLinksApiV2Controller
  • ZonesApiV2Controller

Class ProductsApiV2Controller

Class ProductsApiV2Controller

Provides a gateway to the ProductWriteService and ProductReadService classes, which handle the shop product resources.

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

Methods summary

protected
# __initialize( )

Initializes API Controller

Initializes API Controller

public
# post( )

Api

{post} /products Create Product

Apidescription

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


Apierror

400-BadRequest The body of the request was empty.

Apierrorexample

Error-Response HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "The body of the request was empty." }


Apigroup

Products

Apiname

CreateProduct

Apiparam

{Boolean} isActive Whether the product is active.
{Number} sortOrder The sort order of the product.
{Number} orderedCount How many times the product was ordered.
{String} productModel Product's Model.
{String} ean European Article Number.
{Number} price Product's Price as float value.
{Number} discountAllowed Percentage of the allowed discount as float value.
{Number} taxClassId The tax class ID.
{Number} quantity Quantity in stock as float value.
{Number} weight The weight of the product as float value.
{Number} shippingCosts Additional shipping costs as float value.
{Number} shippingTimeId Must match a record from the shipping time entries.
{Number} productTypeId Must match a record from the product type entries.
{Number} manufacturerId Must match the ID of the manufacturer record.
{Boolean} isFsk18 Whether the product is FSK18.
{Boolean} isVpeActive Whether VPE is active.
{Number} vpeID The VPE ID of the product.
{Number} vpeValue The VPE value of the product as float value.
{Object} name Language specific object with the product's name.
{Object} description Language specific object with the product's description.
{Object} shortDescription Language specific object with the product's short description.
{Object} keywords Language specific object with the product's keywords.
{Object} metaTitle Language specific object with the product's meta title.
{Object} metaDescription Language specific object with the product's meta description.
{Object} metaKeywords Language specific object with the product's meta keywords.
{Object} url Language specific object with the product's url.
{Object} urlKeywords Language specific object with the product's url keywords.
{Object} checkoutInformation Language specific object with the product's checkout information.
{Object} viewedCount Language specific object with the product's viewed count.
{Array} images Contains the product images information.

{String} images.filename The product image file name (provide only the file name and not the whole path).


{Boolean} images.isPrimary Whether the image is the primary one.
{Boolean} images.isVisible Whether the image will be visible.
{Object} images.imageAltText Language specific object with the image alternative text.
{Object} settings Contains various product settings.
{String} settings.detailsTemplate Filename of the details HTML template.
{String} settings.optionsDetailsTemplate Filename of the options details HTML template.
{String} settings.optionsListingTemplate Filename of the options listing HTML template.
{Boolean} settings.showOnStartpage Whether to show the product on startpage.
{Boolean} settings.showQuantityInfo Whether to show quantity information.
{Boolean} settings.showWeight Whether to show the products weight.
{Boolean} settings.showPriceOffer Whether to show price offer.
{Boolean} settings.showAddedDateTime Whether to show the creation date-time of the product.
{Number} settings.priceStatus Must match a record from the price status entries.
{Number} settings.minOrder The minimum order of the product.
{Number} settings.graduatedQuantity Product's graduated quantity.
{Boolean} settings.onSitemap Whether to include the product in the sitemap.
{String} settings.sitemapPriority The sitemap priority (provide a decimal value as a string).

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


{String} settings.propertiesDropdownMode Provide one of the following values: "" >> Default - all values are always selectable, dropdown_mode_1 >> Any order, only possible values are selectable, dropdown_mode_2 >> Specified order, only possible values are selectable.


{Number} settings.startpageSortOrder The sort order in the startpage.
{Boolean} settings.showPropertiesPrice Whether to show properties price.
{Boolean} settings.usePropertiesCombisQuantity Whether to use properties combis quantitity.
{Boolean} settings.usePropertiesCombisShippingTime Whether to use properties combis shipping time.
{Boolean} settings.usePropertiesCombisWeight Whether to use properties combis weight.
{Object} addonValues Contains some extra addon values.
{String} addonValues.productsImageWidth The CSS product image width (might contain size metrics).
{String} addonValues.productsImageHeight The CSS product image height (might contain size metrics).

Apiparamexample

{json} Request-Body { "isActive": false, "sortOrder": 0, "orderedCount": 1, "productModel": "ABC123", "ean": "", "price": 16.7983, "discountAllowed": 0, "taxClassId": 1, "quantity": 998, "weight": 0, "shippingCosts": 0, "shippingTimeId": 1, "productTypeId": 1, "manufacturerId": 0, "isFsk18": false, "isVpeActive": false, "vpeID": 0, "vpeValue": 0, "name": { "en": "test article", "de": "Testartikel" }, "description": { "en": "[TAB:Page 1] Test Product Description (Page 1) [TAB: Page 2] Test Product Description (Page 2)", "de": "[TAB:Seite 1] Testartikel Beschreibung (Seite 1) [TAB:Seite 2] Testartikel Beschreibung (Seite 2)" }, "shortDescription": { "en": "

Test product short description.

", "de": "

Testartikel Kurzbeschreibung

" }, "keywords": { "en": "", "de": "" }, "metaTitle": { "en": "", "de": "" }, "metaDescription": { "en": "", "de": "" }, "metaKeywords": { "en": "", "de": "" }, "url": { "en": "", "de": "" }, "urlKeywords": { "en": "test-article", "de": "Testartikel" }, "checkoutInformation": { "en": "", "de": "" }, "viewedCount": { "en": 0, "de": 32 }, "images": [ { "filename": "artikelbild_1_1.jpg", "isPrimary": false, "isVisible": true, "imageAltText": { "en": "", "de": "" } }, { "filename": "artikelbild_1_2.jpg", "isPrimary": false, "isVisible": true, "imageAltText": { "en": "", "de": "" } }, { "filename": "artikelbild_1_3.jpg", "isPrimary": false, "isVisible": true, "imageAltText": { "en": "", "de": "" } } ], "settings": { "detailsTemplate": "standard.html", "optionsDetailsTemplate": "product_options_dropdown.html", "optionsListingTemplate": "product_options_dropdown.html", "showOnStartpage": false, "showQuantityInfo": true, "showWeight": false, "showPriceOffer": true, "showAddedDateTime": false, "priceStatus": 0, "minOrder": 1, "graduatedQuantity": 1, "onSitemap": true, "sitemapPriority": "0.5", "sitemapChangeFrequency": "daily", "propertiesDropdownMode": "dropdown_mode_1", "startpageSortOrder": 0, "showPropertiesPrice": true, "usePropertiesCombisQuantity": false, "usePropertiesCombisShippingTime": true, "usePropertiesCombisWeight": false }, "addonValues": { "productsImageWidth": "0", "productsImageHeight": "0" } }


Apisuccess

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


Apiversion

2.1.0
public
# put( )

Todo

Error status code on not found entries should be 404 and not 400.

Api

{put} /products/:id Update Product

Apidescription

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


Apierror

400-BadRequest Product data were not provided.

Apierrorexample

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


Apigroup

Products

Apiname

ProductCategory

Apisuccess

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

Apiversion

2.1.0
public
# delete( )

Api

{delete} /products/:id Delete Product

Apidescription

Removes a product record from the database. To see an example usage take a look at docs/REST/samples/product-service/remove_product.php


Apierror

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

Apierrorexample

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


Apiexample

{curl} Delete Product With ID = 24 curl -X DELETE --user admin@shop.de:12345 http://shop.de/api.php/v2/products/24


Apigroup

Products

Apiname

DeleteProduct

Apisuccessexample

{json} Success-Response { "code": 200, "status": "success", "action": "delete", "resource": "Product", "productId": 24 }


Apiversion

2.1.0
public
# get( )

Api

{get} /products/:id Get Products

Apidescription

Get multiple or a single product records through a GET request. 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/product-service/remove_product.php


Apierror

404-NotFound Product does not exist.

Apierrorexample

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


Apiexample

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


{curl} Get Product With ID = 24 curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/products/24


Apigroup

Products

Apiname

GetProduct

Apiversion

2.1.0

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 ProductWriteService $productWriteService

Product write service.

Product write service.

#
protected ProductReadService $productReadService

Product read service.

Product read service.

#
protected ProductJsonSerializer $productJsonSerializer

Product JSON serializer.

Product JSON serializer.

#
protected ProductListItemJsonSerializer $productListItemJsonSerializer

Product list item JSON serializer.

Product list item JSON serializer.

#
protected array $subresource

Sub resources.

Sub resources.

#

Properties inherited from AbstractApiV2Controller

$api, $uri

API documentation generated by ApiGen