(Quick Reference)
Service: Update a reason
Description: Returns the updated reason in json format when successful. Returns a json response, describing the failure condition when unsuccessful.
URL:
https://BASE_URL/api/VERSION/reasons/{id}
Method: PUT
Request content type: application/json
Parameters:
Name | Description | Type | Required | Example values |
---|
id | The numerical ID of the desired reason | Long | yes | 123 |
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 200 OK
{
"id": 7,
"name": "Closed point of sale",
"type": "1",
"isActive": false,
"organization": "entity1",
"dateCreated": "2016-08-22T11:06:20Z",
"lastUpdated": "2016-08-22T11:21:08Z"
}
Failure Output
Status: HTTP/1.1 404 Not Found
{
"error": "not_found",
"error_description": "The reason with the id 70 doesn't exist."
}
Status: HTTP/1.1 400 Bad Request
{
"error": "save_failed",
"error_description": "Failed to save instance"
}