haufe-ecommerce-api
Install
npm install @acolorbright/haufe-ecommerce-api
Usage
import * as HaufeEcommerceApi from '@acolorbright/haufe-ecommerce-api';
const apiClient = await HaufeEcommerceApi.Client.initialize({
apiKey: 'api_key',
clientId: 'client_id',
clientSecret: 'client_secret',
ecommerceConfig: 'ecommerce_config',
});
Paginated list of products
const response = await apiClient.productList({
filter: {
cat: 'category_id',
},
include: 'referents',
page: {
number: 0,
size: 10,
},
});
Full list of products
const response = await apiClient.fullProductList({
filter: {
cat: 'category_id',
},
include: 'referents',
});
Single product
const response = await apiClient.product('product_id', {
include: 'courseComponents',
});
Product referents
const response = await apiClient.referentList('product_id');
Product course components
This currently results in a 500 error response when a product does not have course components.
const response = await apiClient.courseComponentList('product_id');