(Quick Reference)
Service: Save
Description: This web service is used to add a new price list object into the database
URL:
https://BASE_URL/api/VERSION/priceLists
Method: POST
Request content type: application/json
Parameters:
Name | Description | Type | Required | Example values |
---|
reference | the reference of the new price list | String | Yes | |
name | the name of the new price list | String | Yes | |
cumulateWithPromotion | Set to true by default | Boolean | No | true, false |
cumulateWithDiscount | Set to true by default | Boolean | No | true, false |
isDefaultInOtherMobileOperation | Set to false by default | Boolean | No | true, false |
reference must be unique
Success Output
Success case: response.status=201
{
"id": 8,
"name": "AddedPriceLIst",
"reference": "PL-007",
"cumulateWithPromotion": false,
"cumulateWithDiscount": true,
"isDefaultInOtherMobileOperation": false,
"organization": "Lyon",
"dateCreated": "2016-08-18T15:19:10Z",
"lastUpdated": "2016-08-18T15:19:10Z"
}
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": "invalid_param_type",
"error_description": "An invalid value was specified for parameter: cumulateWithDiscount (must be Boolean)"
}
{
"error": "save_failed",
"error_description": "Failed to save instance"
}
Failure case:response.status = 500
{
"error": "server_error",
"error_description": "Oops! Something went wrong..."
}