Additional properties manipulations
Order contains list of additional properties.
There are several endpoints to manipulate properties in this list:
- Get all additional properties
- Get specific additional property
- Create new additional property
- Update existing additional property
- Remove existing additional property
Warning
Additional properties can be changed only as long the order has not gone over the Delivered state. (Mail not sent and not exported to CRM yet.)
Get all additional properties¶
It is possible to get all additional properties through special endpoint or together with the order response.
GET https://api.discover.swiss/test/b2bmarket/v1/orders/21-102000/additionalproperty
{
"propertyValues": [
{
"name": "Some property name",
"description": "Some description",
"unitCode": "someUnitCode",
"unitText": "someUnitText",
"value": "someValue",
"propertyId": "someProperty1"
}
],
"validationMessages": []
}
Get specific additional property¶
Returns additional property which has property id equals to propertyId from url (in next example someProperty1
)
GET https://api.discover.swiss/test/b2bmarket/v1/orders/21-102000/additionalproperty/someProperty1
{
"propertyValues": [
{
"name": "Some property name",
"description": "Some description",
"unitCode": "someUnitCode",
"unitText": "someUnitText",
"value": "someValue",
"propertyId": "someProperty1"
}
],
"validationMessages": []
}
Create new additional property¶
Add new additional property to the order and return it in the response
{
"propertyId" : "someProperty1",
"name": "Some property name",
"description": "Some description",
"unitCode": "someUnitCode",
"unitText" : "someUnitText",
"value": "someValue"
}
POST https://api.discover.swiss/test/b2bmarket/v1/orders/21-102000/additionalproperty
{
"propertyValues": [
{
"name": "Some property name",
"description": "Some description",
"unitCode": "someUnitCode",
"unitText": "someUnitText",
"value": "someValue",
"propertyId": "someProperty1"
}
],
"validationMessages": []
}
Update existing additional property¶
Update additional property with property id which equals to property id from URL
Information
PropertyId cannot be updated. So any provided propertyId will be ignored
{
"propertyId" : "someProperty1",
"name": "New property name",
"description": "New description",
"unitCode": "someUnitCode",
"unitText" : "someUnitText",
"value": "someValue"
}
PUT https://api.discover.swiss/test/b2bmarket/v1/orders/21-102000/additionalproperty/someProperty1
{
"propertyValues": [
{
"name": "New property name",
"description": "New description",
"unitCode": "someUnitCode",
"unitText": "someUnitText",
"value": "someValue",
"propertyId": "someProperty1"
}
],
"validationMessages": []
}
Remove existing additional property¶
DELETE https://api.discover.swiss/test/b2bmarket/v1/orders/21-102000/additionalproperty/someProperty1