Hello community !
We are excited to announce the release of our new OpenBoxes adaptor
This new adaptor has get
and post
helper functions and versatile request
function for anything outside that scope. With this new adaptor you can manage you inventory on OpenBoxes and integrate other tools like hubtel for sms notifications on stock changes and movements.
Below are some examples of the adaptor in action.
- Get 10 products from the catalog
get("products", { query: { max: 10 }});
- Add a new product to the catalog
post("products",
{
"id": "ff80818163e2de8d0163eba1b1e90002",
"productCode": null,
"name": "New product",
"category": {
"id": "ff80818163e2de8d0163eb93c5a00001",
"name": "New category"
},
"description": null,
"dateCreated": "2018-06-10T21:37:12Z",
"lastUpdated": "2018-06-10T21:37:12Z"
});
- Update a stock movement with the request function
request("POST", "/stockMovements/ff808181642fc9c101642fcccc420004",
{
body: {
"name": "new stock movement",
"description": "new stock movement",
"origin.id": "1",
"destination.id": "2",
"requestedBy.id": "1",
"dateRequested": "06/23/2018"
}
});
- Update a product with the request function
request('POST', '/products/ff808181812576850182aee36930040b',
{
body: {
name: 'Coffee',
description: 'Arabica coffee from the highlands of Ethiopia'
}
});
Feel free to try this out on on your own project or at demo.openfn.org .