(Quick Reference) Service: Update a payment type

Description: Returns the updated payment type in json format when successful. Returns a json response, describing the failure condition when unsuccessful.

URL:

https://BASE_URL/api/VERSION/paymentTypes/{id}

URL with external_id:

https://BASE_URL/api/VERSION/paymentTypes/reference/{id}

Method: PUT

Request content type: application/json

Parameters:

NameDescriptionTypeRequiredExample values
idThe ID of the desired payment typeLong/Stringyes123
reference Stringyes 
name Stringyes 
isActiveBy default, it is set to trueBooleannotrue, false

World pay payment types are not authorized to be updated!

Payment types with the references CASH, CREDIT_CARD, CHEQUE are only authorized to active, desactivate it, or just change name.

Success Output

Success case: response.status=200

{
  "id": 7,
  "name": "cash on delivery",
  "reference": "cod",
  "isActive": true,
  "organization": "entity1",
  "dateCreated": "2016-01-04T13:51:54Z",
  "lastUpdated": "2016-08-15T10:32:55Z"
}

Failure Output

Failure case:response.status = 400

{
  "error": "update_not_authorized",
  "error_description": "World pay types of payment should not be updated"
}
{
  "error":"invalid_param_type",
  "error_description": "The type of parameter $param you provided is not valid for this request."
}
{
  "error": "missing_param", 
  "error_description": "reference parameter is missing"
}
{
  "error": "not_unique",
  "error_description": "reference already used"
}
{
  "error": "save_failed",
  "error_description": "Failed to save instance"
}

Failure case:response.status = 404

{
  "error": "not_found",
  "error_description": "The payment type with the id 706 doesn't exist."
}

Failure case:response.status = 500
{
  "error": "server_error",
  "error_description": "Oops! Something went wrong..."
}