ValueList Attributes
In the Integration API, handling of required ValueList attributes varies depending on the POST payload.
The following scenarios describe the persistence behavior for required valueList attributes. The examples assume the paymentMethod valueList attribute is mandatory, not multivalue, and not nullable. Existing values for the valueList include Mastercard and Visa.
| POST Scenario | Value provided in payload | Example payload | Result | Response code |
|---|---|---|---|---|
| Create a Product using a null value for a required valueList | null |
{
"code": "test_article10a",
"catalogVersion": {
"catalog": {
"id": "Default"
},
"version": "Staged"
},
"paymentMethod": null
}
|
The API cannot persist a new valueList without values and returns a missing navigation property error | 400 |
| Create a Product without providing a value for a required ValueList | not provided |
{
"code": "test_article10b",
"catalogVersion": {
"catalog": {
"id": "Default"
},
"version": "Staged"
}
}
|
Returns a missing navigation property error | 400 |
| Create Product using existing values for a required ValueList | provided with existing values |
{
"code": "test_article10c",
"catalogVersion": {
"catalog": {
"id": "Default"
},
"version": "Staged"
},
"paymentMethod": "visa"
}
|
Persists the provided values | 201 |
| Create a Product, providing nonexistent values for a required ValueList | provided with nonexistent values |
{
"code": "test_article10d",
"catalogVersion": {
"catalog": {
"id": "Default"
},
"version": "Staged"
},
"paymentMethod": "paypal"
}
|
Autocreates and persists the new, additional value | 201 |