...
...
General Information
...
Service | API | Method | Data Model | Workflow | Group |
---|---|---|---|---|---|
multitenant | /product | POST | Products | N/A | Product |
Description
This API adds a product record to the tenant that has the external key sent in the request headers.Add product
Input
...
Type: application/json
Name | Source | Mandatory | Type | Special Format | Description |
---|---|---|---|---|---|
code | Body | YES | String | The length is between 4 - 5 | Product code |
name | Body | YES | String | N/A | Product name |
description | Body | NO | String | N/A | Product description |
scope | Body | NO | Object | Scope Schema | Product Scope - Check the Example below |
Scope Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
"scope": { "acl": { "dashboard": { "multitenant": { "1": { "access": false, "get": [ { "/product": { "access": false }, "group": 'Product' } ] }, "2.1" : { "access": false, "get": [ { "/product": { "access": false }, "group": 'Product' } ] } } } } } |
Output
...
Response
SOAJS has a unified response. Check out this link to understand more the schema of SOAJS response
Valid Response
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
{ "result": true, "data": [ { "name": "Fadi2", "code": "FADI2", "description": "Some Description", "scope": { "acl": { "dashboard": { "multitenant": { "1": { "access": false, "get": [ { "/product": { "access": false }, "group": 'Product' } ] }, "2.1" : { "access": false, "get": [ { "/product": { "access": false }, "group": 'Product' } ] } } } } }, "packages": [], "_id": "5d6fedabbed68d11b6f54636" } ] } |
Invalid Response
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
{ "result":false, "errors":{ "codes":[468], "details":[ { "code":468, "message":"Product already exists" } ] } } |
Code | Description |
---|---|
400 | Business logic required data are missing |
468 | Product already exists |
602 | Model error: + %model_error% |
...