README
This fast furniture azure project contains api functions interacting with products data
Setup locally
clone
git clone git@bitbucket.org:engin_cetinkaya/cekaso-fast-furniture-api-layer.git
install dependencies
npm install
run
npm run start
List of api
Get Product List
Returns a list of products filtered by merchant id and supplier id
Request Information
Category | Value |
---|---|
Http request | GET |
URL | /api/product/list |
Headers
None are specified.
Parameters
Parameter | Definition |
---|---|
supplierId | the supplier id |
merchantId | the merchant id (optional) |
allProducts | default: false, if true, returns all products of the specified supplier, else only merchant specific products (if merchent id is set) |
###Output Schema of request
Field | Definition |
---|---|
_id | unique system id |
productId | product id |
productNameBySupplier | product name by supplier |
productNameByMerchant | product name by merchant (if merchant id is set) |
productNameByVme | product name by vme |
Response
{
"request": {
"supplierId": "1484",
"merchantId": "1234",
"allProducts": false
},
"products": [
{
"_id": "5f62df0d8e3238b91c0d767b",
"productId": "1528",
"productNameBySupplier": "Marseille1",
"productNameByMerchant": "Marseille1",
"productNameByVme": "Marseille1"
},
{
"_id": "5f62df0e8e3238b91c0d767c",
"productId": "1571",
"productNameBySupplier": "Lana",
"productNameByMerchant": "Lana",
"productNameByVme": "Lana"
}
]
}
Get Product Data
Returns descriptive information for a specific product. The request should contain the system id or the product id and the supplier id.
Response
{
"_id": "5f62df0d8e3238b91c0d767b",
"productId": "1528",
"supplierId": "polipol",
"merchantId": "1234",
"description": "Betonoptiken bei Möbeln werden immer beliebter. Der Kleiderschrank Leek greift sie am Korpus auf und kombiniert sie mit einer weißen Front. Leek verfügt über ein praktisch unterteiltes Schrankinneres hinter den vier großen Drehtüren. Sieben große Fächer und eine Kleiderstange bieten viel Platz für Kleidung – zusammengelegt und auf einen Bügel aufgehängt. Darüber hinaus stehen Ihnen sechs große Schubladen zur Verfügung.",
"url": "https://cekaso-shareme.s3.eu-central-1.amazonaws.com/fastfurniture/1.jpg",
"productNameBySupplier": "Marseille1",
"productNameByMerchant": "Marseille1",
"productNameByVme": "Marseille1",
"created": "2020-09-22 10:15:24",
"updated": "2020-09-25 14:11:32"
}
Request Information
Category | Value |
---|---|
Http request | GET |
URL | /api/product |
Headers
None are specified.
Parameters
Parameter | Definition |
---|---|
_id | unique system id (required if productId + supplierId is missing) |
productId | get product id (required if _id is missing) |
supplierId | supplier id (required if _id is missing) |
merchantId | merchant id (optional) |
Output Schema of request
Field | Definition |
---|---|
_id | unique generated id |
productId | product id |
description | product description |
url | product picture url |
productNameBySupplier | product name by supplier |
productNameByMerchant | product name by merchant (if merchant id is set) |
productNameByVme | product name by vme |
Get Product Delivery Week
Returns delivery week of a specific product
Response
{
"_id": "5f62df0d8e3238b91c0d767b",
"deliveryWeek": "34",
"shippingTime": "4"
}
Request Information
Category | Value |
---|---|
Http request | GET |
URL | /api/product/delivery-week |
Headers
None are specified.
Parameters
Parameter | Definition |
---|---|
_id | unique system id (required if productId + supplierId is missing) |
productId | get product id (required if _id is missing) |
supplierId | supplier id (required if _id is missing) |
Output Schema of request
Field | Definition |
---|---|
_id | unique system id |
deliveryWeek | delivery week of the product |
shippingTime | additional weeks until the product arrives at the customer |
Get Product Warehouse Stock
Returns warehouse stock of a specific product
Response (in stock)
{
"_id": "5f62df0d8e3238b91c0d767b",
"amount": "42"
}
Response (available from)
{
"_id": "5f62df0d8e3238b91c0d767b",
"amount": "0",
"availableFromDate": "2021-06-11"
}
Request Information
Category | Value |
---|---|
Http request | GET |
URL | /api/product/warehouse-stock |
Headers
None are specified.
Parameters
Parameter | Definition |
---|---|
_id | unique system id (required if productId + supplierId is missing) |
productId | get product id (required if _id is missing) |
supplierId | supplier id (required if _id is missing) |
Output Schema of request
Field | Definition |
---|---|
_id | unique system id |
amount | amount of products in stock (0 if stock is empty) |
availableFromDate | date (YYYY-MM-DD) when the product is available again if stock is empty (amount == 0) |