Product API
API ini digunakan untuk menambah produk, menambah unit produk, menambah kategori produk, mengedit produk, menghapus produk, dll dalam modul Sales SRM.
Get Product with Pagination
Method
GET
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products?start=0&count=2
Header
Authorization : Bearer [generatedToken]
Body
Status
200
Response
{ “status”: “success”, “data”: [ { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1603099191614, “createdBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”, “modifiedDate”: 1603099258387, “modifiedBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”, “name”: “[name]”, “productCode”: “[product_code]”, “price”: [price], “unitId”: “{\”name\”:\”[name]\”,\”id\”:\”[id]\”}”, “categoryId”: “{\”name\”:\”[name]\”,\”id\”:\”[id]\”}”, “userAccess”: “[everyone, owner, group, selectedGroup]” }, { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1594891612640, “createdBy”: “2e6cb05e5c20f1ffda1a1801128546ef”, “modifiedDate”: 1603101105188, “modifiedBy”: “8e8c2328425057241e808b6abe6881da”, “name”: “[name]”, “price”: [price], “unitId”: “{\”name\”:\”[name]\”,\”id\”:\”[id]\”}”, “categoryId”: “{\”name\”:\”name\”,\”id\”:\”[id]\”}”, “stock”: [stock], “userAccess”: “[everyone, owner, group, selectedGroup]”, “userAccessId”: [ “[userAccessId]” ], “quantityPurchase”: true } ], “hasMore”: true, “nextIndex”: 2, “prevIndex”: 0, “totalResults”: 22 }
Get Product by Product Id
Method
GET
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/[product_id]
Header
Authorization : Bearer [generatedToken] ProductId : [product_id]
Body
Status
200
Response
{ “status”: “success”, “data”: { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1595073751385, “createdBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “modifiedDate”: 1595144418926, “modifiedBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “name”: “[name]”, “productCode”: “[productCode]”, “price”: [price], “unitId”: “ {\”name\”:\”[name]\”,\”id\”:\”[id]\”}”, “categoryId”: “ {\”name\”:\”[name]\”,\”id\”:\”[id]\”}”, “stock”: [stock], “userAccess”: “[everyone, owner, group, selectedGroup]”, “quantityPurchase”: true }, “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 0 }
Get Product by Product Code
Method
GET
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/code/[product_code]
Header
Authorization : Bearer [generatedToken] productCode : [product_code]
Body
Status
200
Response
{ “status”: “success”, “data”: { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1595073751385, “createdBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “modifiedDate”: 1595144418926, “modifiedBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “name”: “[name]”, “productCode”: “[productCode]”, “price”: [price], “unitId”: “ {\”name\”:\”[name]\”,\”id\”:\”[id]\”}”, “categoryId”: “ {\”name\”:\”[name]\”,\”id\”:\”[id]\”}”, “stock”: [stock], “userAccess”: “[everyone, owner, group, selectedGroup]”, “quantityPurchase”: true }, “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 0 }
Add Product
Method
POST
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/add
Header
Authorization : Bearer [generatedToken]
Body
Body Example : { “name”: “Sales CRM”, “productCode”: “123”, “price”: 1000000, “unitId”: “[unitId]”, “categoryId”: “[categoryId]”, “stock”: 10, “userAccess”: “[everyone, owner, owner group, group]”, “quantityPurchase”: true }
Note : If the selected user access is selectedGroup, then you must enter userAccessId.
Status
200
Response
{ “status”: “success”, “data”: { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1603162398941, “createdBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”, “modifiedDate”: 1603162398941, “modifiedBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”, “name”: “Sales CRM”, “productCode”: “123”, “price”: 1000000, “unitId”: “[unitId]”, “categoryId”: “[categoryId]”, “stock”: 10, “userAccess”: “[everyone, owner, group, selectedGroup]”, “quantityPurchase”: true }, “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 0 }
Add Multiple Product
Method
POST
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/add/multiple
Header
Authorization : Bearer [generatedToken]
Body
Body Example : [ { “name”: “Product 1”, “productCode”: “01”, “price”: 1000000, “unitId”: “[unitId]”, “categoryId”: “[categoryId]”, “stock”: 10, “userAccess”: “[everyone, owner, owner group, group]”, “quantityPurchase”: true }, { “name”: “Product 2”, “productCode”: “02”, “price”: 2000000, “unitId”: “[unitId]”, “categoryId”: “[categoryId]”, “stock”: 20, “userAccess”: “[everyone, owner, owner group, group]”, “quantityPurchase”: true } ]
Note : If the selected user access is selectedGroup, then you must enter userAccessId.
Status
200
Response
{ “status”: “success”, “data”: [ { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1603165923106, “createdBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”, “modifiedDate”: 1603165923106, “modifiedBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”, “name”: “Product 1”, “productCode”: “01”, “price”: 1000000, “unitId”: “[unitId]”, “categoryId”: “[catgoryId]”, “stock”: 10, “userAccess”: “[everyone, owner, group, selectedGroup]”, “quantityPurchase”: true }, { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1603165923183, “createdBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”, “modifiedDate”: 1603165923183, “modifiedBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”, “name”: “Product 2”, “productCode”: “02”, “price”: 2000000, “unitId”: “[unitId]”, “categoryId”: “[categoryId]”, “stock”: 20, “userAccess”: “[everyone, owner, group, selectedGroup]”, “quantityPurchase”: true } ], “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 0 }
Edit Product
Method
PUT
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/edit
Header
Authorization : Bearer [generatedToken]
Body
Body Example : { “id” : “[id]”, “name”: “Product 1”, “productCode”: “01”, “price”: 1500000, “unitId”: “[unitId]”, “categoryId”: “[categoryId]”, “stock”: 100, “userAccess”: “[everyone, owner, owner group, group]”, “quantityPurchase”: true }
Note : If you update user access to selectedGroup, then you must enter userAccessId.
Status
200
Response
{ “status”: “success”, “data”: { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1603174958991, “createdBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”, “modifiedDate”: 1603174958991, “modifiedBy”: “ac2c37cf90ee51edf54b2e4bc2298e03”, “name”: “Product 1”, “productCode”: “01”, “price”: 1500000, “unitId”: “[unitId]”, “categoryId”: “[categoryId]”, “stock”: 100, “userAccess”: “[everyone, owner, group, selectedGroup]”, “quantityPurchase”: true }, “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 0 }
Delete Product
Method
PUT
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/delete/[product_id]
Header
Authorization : Bearer [generatedToken] ProductId : [product_id]
Body
Status
200
Response
{ “status”: “success”, “data”: “Product Deleted”, “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 0 }
Search Product
Method
GET
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/search?query=[query]
Header
Authorization : Bearer [generatedToken] Query : [e.g Customer Service]
Body
Status
200
Response
{ “status”: “success”, “data”: [ { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1595073751385, “createdBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “modifiedDate”: 1595144418926, “modifiedBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “name”: “Customer Service”, “productCode”: “[productCode]”, “price”: 1500000, “unitId”: “{\”name\”:\”[name]\”,\”id\”:\”[id]\”}”, “categoryId”: “{\”name\”:\”[name]\”,\”id\”:\”[id]\”}”, “stock”: 100, “userAccess”: “[everyone, owner, group, selectedGroup]”, “quantityPurchase”: true } ], “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 0 }
Get Product Unit with Pagination
Method
GET
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/unit?start=0&count=2
Header
Authorization : Bearer [generatedToken]
Body
Status
200
Response
{ “status”: “success”, “data”: [ { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1594883155056, “createdBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “modifiedDate”: 1594883155056, “modifiedBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “name”: “[name]” }, { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1594883195857, “createdBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “modifiedDate”: 1594883195857, “modifiedBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “name”: “[name]” } ], “hasMore”: true, “nextIndex”: 2, “prevIndex”: 0, “totalResults”: 9 }
Get Product Unit by Product Unit Id
Method
GET
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/unit/[unit_id]
Header
Authorization : Bearer [generatedToken] unitId : [unit_id]
Body
Status
200
Response
{ “status”: “success”, “data”: { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1594883155056, “createdBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “modifiedDate”: 1594883155056, “modifiedBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “name”: “[name]” }, “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 0 }
Add Product Unit
Method
POST
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/unit/add
Header
Authorization : Bearer [generatedToken]
Body
Body Example : { “name”: “LINE” }
Status
200
Response
{ “status”: “success”, “data”: “Product Unit Added”, “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 0 }
Delete Product Unit
Method
PUT
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/unit/delete/[unit_id]
Header
Authorization : Bearer [generatedToken] unitId : [unit_id]
Body
Status
200
Response
{ “status”: “success”, “data”: “Product Unit Deleted”, “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 0 }
Get Product Category with Pagination
Method
GET
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/category?start=0&count=2
Header
Authorization : Bearer [generatedToken]
Body
Status
200
Response
{ “status”: “success”, “data”: [ { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1594883331431, “createdBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “modifiedDate”: 1594883331431, “modifiedBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “name”: “[name]” }, { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1594883346713, “createdBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “modifiedDate”: 1594883346713, “modifiedBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “name”: “[name]” } ], “hasMore”: true, “nextIndex”: 2, “prevIndex”: 0, “totalResults”: 10 }
Get Product Category by Product Category Id
Method
GET
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/category/[category_id]
Header
Authorization : Bearer [generatedToken] categoryId : [category_id]
Body
Status
200
Response
{ “status”: “success”, “data”: { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1594883395633, “createdBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “modifiedDate”: 1594883395633, “modifiedBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “name”: “[name]” }, “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 0 }
Add Product Category
Method
POST
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/category/add
Header
Authorization : Bearer [generatedToken]
Body
Body Example : { “name”: “Omni Channel” }
Status
200
Response
{ “status”: “success”, “data”: “Product Category Added”, “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 0 }
Delete Product Category
Method
PUT
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/category/delete/[category_id]
Header
Authorization : Bearer [generatedToken] categoryId : [category_id]
Body
Status
200
Response
{ “status”: “success”, “data”: “Product Category Deleted”, “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 0 }
Get Product Timelines with Pagination
Method
GET
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/timelines/[product_id]?start=0&count=2
Header
Authorization : Bearer [generatedToken] productId : [product_id]
Body
Status
200
Response
{ “status”: “success”, “data”: [ { “id”: “[id]”, “owner”: “[owner_id]”, “createdDate”: 1595217170619, “createdBy”: “8e8c2328425057241e808b6abe6881da”, “modifiedDate”: 1595217170619, “modifiedBy”: “8e8c2328425057241e808b6abe6881da”, “productId”: “[productId]”, “action”: “add”, “actionType”: “[actionType]”, “payload”: “{\”id\”:\”[id]\”}” } ], “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 1 }
Get Product Changelog with Pagination
Method
GET
Media Type
application/json
URL
http://[server]/dolphin/apiv1/graph/products/changelog/[product_id]?start=0&count=4
Header
Authorization : Bearer [generatedToken] productId : [product_id]
Body
Status
200
Response
{ “status”: “success”, “data”: [ { “id”: “[id]”, “owner”: “[owner]”, “createdDate”: 1595073786872, “createdBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “modifiedDate”: 1595073786872, “modifiedBy”: “c04ca68f4c031e5c7cd6d3675b67e3a5”, “productId”: “[product_id]”, “action”: “edit”, “field”: “price”, “oldValue”: “[oldValue]”, “newValue”: “[newValue]”, “actionType”: “[actionType]” } ], “hasMore”: false, “nextIndex”: 0, “prevIndex”: 0, “totalResults”: 1 }
Last updated