(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:

NameDescriptionTypeRequiredExample values
idThe numerical ID of the desired reasonLongyes123
name Stringyes 
typeShould be equal to 1 for no sale or 2 for free invoice or 3 for warehouse transactionIntegeryes1,2,3
isActiveBy default, it is set to trueBooleannotrue, 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"
}