Skip to main content

layers

List

To view all discount layers, just call ListDiscountLayers with an empty request message. EVA will return the appropriate list, which will be sorted on sequence by default. [block:code] { "codes": [ { "code": "{}", "language": "json", "name": "ListDiscountLayers" }, { "code": "{\n \"Result\": {\n \"PageConfig\": {\n \"Filter\": {},\n \"Start\": 0,\n \"Limit\": 2147483647,\n \"SortProperty\": \"Sequence\",\n \"SortDirection\": 0\n },\n \"Page\": [\n {\n \"ID\": 1,\n \"Name\": \"System\",\n \"Sequence\": 0,\n \"IsExclusive\": false,\n \"IsSystem\": true\n },\n {\n \"ID\": 2,\n \"Name\": \"System+1\",\n \"Description\": \"Highest non-system layer\",\n \"Sequence\": 1,\n \"IsExclusive\": false,\n \"IsSystem\": false\n }\n ],\n \"Offset\": 0,\n \"Limit\": 2147483647,\n \"Total\": 2,\n \"SortProperty\": \"Sequence\",\n \"SortDirection\": 0,\n \"Filters\": {},\n \"NumberOfPages\": 1,\n \"CurrentPage\": 1\n }\n}", "language": "json", "name": "Response" } ] } [/block]

Create

Now, if we want to create a new discount layer, we use CreateDiscountLayer: [block:code] { "codes": [ { "code": "{\n \"Name\": \"System+2\",\n \"Description\": \"Second highest non-system layer\",\n \"Sequence\": 2,\n \"IsExclusive\": false\n}", "language": "json", "name": "CreateDiscountLayer" }, { "code": "{\n \"ID\": 3\n}", "language": "json", "name": "Response" } ] } [/block] This service returns the ID for your newly created discount layer.

Get

We can fetch al information on our newly created layer by calling GetDiscountLayerByID using the ID that was returned to us in the last request. [block:code] { "codes": [ { "code": "{\n \"ID\": 3\n}", "language": "json", "name": "GetDiscountLayerByID" }, { "code": "{\n \"ID\": 3,\n \"Name\": \"System+2\",\n \"Description\": \"Second highest non-system layer\",\n \"Sequence\": 2,\n \"IsExclusive\": false,\n \"IsSystem\": false\n}", "language": "json", "name": "Response" } ] } [/block]

Move

Now let's say, we want our new discount layer to be hierarchically situated in-between our first two layers. We could have specified the correct sequence in the original creation request, but we can also move the layer now using MoveDiscountLayer. We simply specify the layer ID and the ID of the layer after which we want to place it: [block:code] { "codes": [ { "code": "{\n \"ID\": 3,\n \"AfterDiscountLayerID\": 1\n}", "language": "json", "name": "MoveDiscountLayer" }, { "code": "{}", "language": "json", "name": "Response" } ] } [/block] This service will return an empty response when successful. Now, if we call ListDiscountLayers again, we will see the layers has moved to the correct place in the hierarchy: [block:code] { "codes": [ { "code": "{\n \"Result\": {\n \"PageConfig\": {\n \"Filter\": {},\n \"Start\": 0,\n \"Limit\": 2147483647,\n \"SortProperty\": \"Sequence\",\n \"SortDirection\": 0\n },\n \"Page\": [\n {\n \"ID\": 1,\n \"Name\": \"System\",\n \"Sequence\": 0,\n \"IsExclusive\": false,\n \"IsSystem\": true\n },\n {\n \"ID\": 3,\n \"Name\": \"System+2\",\n \"Description\": \"Second highest non-system layer\",\n \"Sequence\": 1,\n \"IsExclusive\": false,\n \"IsSystem\": false\n },\n {\n \"ID\": 2,\n \"Name\": \"System+1\",\n \"Description\": \"Highest non-system layer\",\n \"Sequence\": 2,\n \"IsExclusive\": false,\n \"IsSystem\": false\n }\n ],\n \"Offset\": 0,\n \"Limit\": 2147483647,\n \"Total\": 3,\n \"SortProperty\": \"Sequence\",\n \"SortDirection\": 0,\n \"Filters\": {},\n \"NumberOfPages\": 1,\n \"CurrentPage\": 1\n }\n}", "language": "json", "name": "ListDiscountLayers" } ] } [/block]

Update

To update a discount layer, call UpdateDiscountLayer. If you only want to change one field, it's easy to first use GetDiscountLayerByID and copy the layer's information into your new request: [block:code] { "codes": [ { "code": "{\n \"ID\": 3,\n \"Name\": \"System+0.5\",\n \"Description\": \"Highest highest non-system layer\",\n \"Sequence\": 1,\n \"IsExclusive\": false,\n \"IsSystem\": false\n}", "language": "json", "name": "UpdateDiscountLayer" }, { "code": "{}", "language": "json", "name": "Response" } ] } [/block] This service returns an empty response message if successful.

Delete

To delete a discount layer, use DeleteDiscountLayer: [block:code] { "codes": [ { "code": "{\n \"ID\": 3\n}", "language": "json", "name": "DeleteDiscountLayer" }, { "code": "{}", "language": "json", "name": "Response" } ] } [/block] This service returns an empty response message if successful. [block:callout] { "type": "info", "title": "Please note", "body": "Even though we deleted the layer that held sequence number 1, the sequence won't be adjusted accordingly. Two layers will now remain;\n- Sequence: 0\n- Sequence: 2" } [/block]