(Quick Reference)
Service: Create a payment type
Description: Returns the created payment type in JSON format when successful. Returns a JSON response, describing the failure condition when unsuccessful.
URL:
https://BASE_URL/api/VERSION/paymentTypes
Method: POST
Request content type: application/json
Parameters:
Name | Description | Type | Required | Example values |
---|
reference | | String | yes | |
name | | String | yes | |
isActive | By default, it is set to true | Boolean | no | true, false |
Success Output
Success case: response.status=201
{
"id": 7,
"name": "cash on delivery",
"reference": "cod",
"isActive": true,
"organization": "entity1",
"dateCreated": "2016-01-04T13:51:54Z",
"lastUpdated": "2016-01-04T13:51:54Z"
}
Failure Output
Failure case:response.status = 400
{
"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 = 500
{
"error": "server_error",
"error_description": "Oops! Something went wrong..."
}