Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

General Information

...

ServiceAPIMethodData ModelWorkflowGroup
multitenant/productPOST

...

...

N/AProduct

Description

Add product

Input

...

Type: application/json

...

NameSourceMandatoryTypeSpecial FormatDescription
codeBodyYESStringThe length is between 4 - 5Product code
nameBodyYESStringN/AProduct name
descriptionBodyNOStringN/A

Product description

Output

scopeBodyNOObjectScope Schema Product Scope - Check the Example below

Scope Example

Code Block
languagejs
titleValid Response SampleScope Input example
linenumberstrue
collapsetrue
"scope": {
  "acl": {
     "resultdashboard": {
true,       "datamultitenant": {
  [        "1": {
            "nameaccess": false,
            "Fadi2",get": [
               {
                   "code/product": {
                 "FADI2",      "access": false
                   },
                   "descriptiongroup": 'Product'
           "Some Description"    }
            ]
          },
          "2.1" : {
             "access": false,
             "scopeget": [
               {
                     "acl/product": {}
            },             "packagesaccess": [] false
                     },
            "_id": "5d6fedabbed68d11b6f54636"         "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
languagejs
titleError Valid Response Sample
linenumberstrue
collapsetrue
{
    "result":false true,
    "errorsdata": [
        {
            "name": "Fadi2",
            "code": "FADI2",
            "codesdescription":[468], "Some Description",
            "details":["scope": {
                "acl": {
					"dashboard": {
						"multitenant": {
                                "1": {
                                    "access": false,
                                    "get": [
                                        {
                                            "/product": {
                          "code":468,                      "access": false
                                            },
                                            "messagegroup":"Product already exists" 'Product'
                                        }
                                    ]
                                }
}

...

Code

...

Description

...

468

...

Product already exists

...

469

...

Unable to add the product record

...

474

...

Missing required field: either id or code

...

602

...

Request

Code Block
languagebash
titleCalling List Products API
 > CURL -X POST http://127.0.0.1:4004/product -d {
    "code": "silver",
    "name": "Silver",
    "description": "product description"
}
,
                                "2.1" : {
                                    "access": false,
                                    "get": [
                                        {
                                            "/product": {
                                                "access": false
                                            },
                                            "group": 'Product'
                                        }
                                    ]
                                }
                            }
					}
				}
            },
            "packages": [],
            "_id": "5d6fedabbed68d11b6f54636"
        }
    ]
}

Invalid Response

Code Block
List Products API response
languagejs
titleError Response Sample
linenumberstrue
collapsetrue
{
    "result":false,
    "errors": true,{
        "codes":[468],
        "datadetails":[
     [       {
                "code":468,
                "message":"Product already exists"
            }
        ]
    }
}

Response schema

Follow this link to check out the response JSON Schema

SOAJS Error Codes



Code
Description
400

Business logic required data are missing

468

Product already exists

602
Model error: + %model_error%