Skip to content

Quable API

As Quable products are represented as Ibexa DXP products, you can use the existing Product APIs to retrieve the product information.

Quable is the source of truth about products and categories and you should only use the Ibexa DXP APIs to read the information coming from Quable, but you can't use them to modify it. To modify the information, use the Quable interface or the dedicated Quable APIs.

REST API Usage

To learn how to work with Ibexa DXP REST API, see REST API reference.

You can use the following endpoints to retrieve product and category information:

PHP API Usage

Retrieve products

To retrieve product information coming from Quable, use the same APIs as described in Product API.

The following example shows how you can retrieve a single product:

1
2
3
$product = $this->productService->getProduct($productCode);

$output->writeln('Product with code ' . $product->getCode() . ' is ' . $product->getName());

Search for products

Use ProductQuery to search for mulitple products:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
$criteria = new Criterion\ProductType([$productType]);
$sortClauses = [new SortClause\ProductName(ProductQuery::SORT_ASC)];

$productQuery = new ProductQuery(null, $criteria, $sortClauses);

$products = $this->productService->findProducts($productQuery);

foreach ($products as $product) {
    $output->writeln($product->getName() . ' of type ' . $product->getProductType()->getName());
}

When working with Quable products, the following search criteria are supported:

Search Criterion Search based on
CreatedAt Date and time when product was created
LogicalAnd Composite criterion combining multiple criteria with AND
LogicalOr Composite criterion combining multiple criteria with OR.
Supports only a pair of criteria: ProductCode followed by ProductName
MatchAll All products
ProductCategory Product category assigned to product
ProductCategorySubtree Product category subtree
ProductCode Product's code
ProductName Product's name
ProductType Product type
UpdatedAt Date and time when product was last updated

The following sort clauses are supported:

Sort Clause Sorting based on
CreatedAt Date and time of the creation of a product
ProductCode Product's code
ProductName Product's name

Manage stock and pricing

For information stored outside of Quable, such as product availability or pricing, you can use the existing services to manage them:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
// Manage availability
$product = $this->productService->getProduct('NEWMODIFIEDPRODUCT');

$productAvailabilityCreateStruct = new ProductAvailabilityCreateStruct($product, true, true);

$this->productAvailabilityService->createProductAvailability($productAvailabilityCreateStruct);

// Manage prices
$newCurrency = $this->currencyService->getCurrencyByCode($newCurrencyCode);

$money = new Money\Money(50000, new Money\Currency($newCurrencyCode));
$priceCreateStruct = new ProductPriceCreateStruct($product, $newCurrency, $money, null, null);

$this->productPriceService->createProductPrice($priceCreateStruct);

For advanced pricing strategies, use the Discounts API to specify prices for Quable's products.