API Reference
Get Product
GET https://localhost:3003/getProduct/:id
Retrieves information about the product.
Path Parameters
id
string
ID of the product to retieve
{
"result": {
"barcode": "1234567890",
"batchQuantity": 1000,
"category": "Fruits",
"componentProductIds": [],
"expirationDate": "2022-06-24T18:25:43.511Z",
"id": "1001",
"locationData": {
"current": {
"arrivalDate": "2021-06-30T18:00:58.511Z",
"location": "Markham Farm, Marham, ON, Canada"
},
"previous": []
},
"misc": "{}",
"name": "Apples",
"placeOfOrigin": "Markham, ON, Canada",
"productionDate": "2021-06-24T18:25:43.511Z",
"unitPrice": "$5.00",
"unitQuantity": 300,
"unitQuantityType": "mg",
"variety": null
}
}Create Product
POST https://localhost:3003/createProduct
Creates a new product.
Request Body
locationData.previous
array
locationData.current
object
variety
string
unitQuantityType
string
E.g., mg, liters etc.
unitQuantity
number
unitPrice
string
Currency symbol formatted amount
productionDate
string
ISO Date
placeOfOrigin
string
name
string
misc
object
Miscellaneous information
expirationDate
string
ISO Date
componentProductIds
array
category
string
batchQuantity
number
barcode
string
id
string
Get Product With History
GET https://localhost:3003/getProductWithHistory/:id
Retrieves the product data together with its history.
Path Parameters
id
string
ID of product to retrieve
Product Exists
GET http://localhost:3003/productExists/:id
Verifies if a product exists or not.
Path Parameters
id
string
Product ID to check
Ship Product
POST http://localhost:3003/shipProduct
Sends the product to a new location.
Request Body
arrivalDate
string
ISO Date
newLocation
string
productId
string
Last updated
Was this helpful?