(Quick Reference)
Service: Create a reason
Description: Returns the created reason in json format when successful. Returns a json response, describing the failure condition when unsuccessful.
URL:
https://BASE_URL/api/VERSION/reasons
Method: POST
Request content type: application/json
Parameters:
Name | Description | Type | Required | Example values |
---|
name | | String | yes | |
type | Should be equal to 1 for no sale or 2 for free invoice or 3 for warehouse transaction | Integer | yes | 1,2,3 |
isActive | By default, it is set to true | Boolean | no | true, false |
Success Output
Status: HTTP/1.1 201 Created
{
"id": 7,
"name": "Closed point of sale",
"type": "1",
"isActive": true,
"organization": "entity1",
"dateCreated": "2016-08-22T11:06:20Z",
"lastUpdated": "2016-08-22T11:06:20Z"
}
Failure Output
Status: HTTP/1.1 400 Bad Request
{
"error": "missing_param",
"error_description": "name parameter is missing"
}