HTTP API Resource - Premium Schedule Lines API
The purpose of this API is to create, update and delete premium schedules lines. Refer to the "Premium Schedule" page of the Premium and Fee Configuration chapter in the Configuration Guide for more information on the related model.
Premium Schedule Lines
The collection resource for premiumschedulelines can be accessed using POST on:
http://[hostName]:[portNumber]/[api-context-root]/generic/premiumschedulelines/search
The section "Discoverability" in Concepts describes how to discover a collection resource from the root URI. |
POST on the above url will return premium schedule lines for each premium schedule.
Example payload:
{ "items":[ { "name": "premium schedule code", "links": [ { "href": "http://<hostname>:<port>/<contextRoot>/generic/premiumschedulelines/<premium schedule code>", "rel": "canonical" }, { "href": "http://<hostname>:<port>/<contextRoot>/generic/premiumschedulelines/<premium schedule code>/definition", "rel": "oi:definition" } .... Other links like create form, edit form etc. ] }, ... ] }
The payloads presented in this section are just examples. Please use the Swagger metadata to find out what all is possible. |
The "oi:definition" represents the definition of the dimensions of the premium schedule. For example, when a premium schedule is based on schedule definition AGE_MED_COND that has dimensions age (numeric) and medicalCondition (alphanumeric), then the link of type "oi:definition" returns:
{ "AGE_MED_COND": { "type": "object", "properties": { "amount": { "type": "object", "properties": { "value": { "type": "number", "xml": { "attribute": true }, "minimum": 0, "maximum": 9999999999.9999 } } }, "functionDynamicLogic": { "$ref": "http://<hostname>:<port>/<contextRoot>/generic/premiumschedulelines/dynamiclogic/definition#/dynamiclogic" "x-oi-resource-name": "dynamiclogic" }, "premiumTier": { "$ref": "http://<hostname>:<port>/<contextRoot>/generic/premiumschedulelines/premiumtiers/definition#/premiumtier", "x-oi-resource-name": "premiumtiers" }, "age": { "type": "object", "properties": { "valueFrom": { "type": "number", "xml": { "attribute": true }, }, "valueTo": { "type": "number", "xml": { "attribute": true }, } } } "medicalCondition": { "type": "string", "xml": { "attribute": true }, "maxLength": 1000 } } } }
In general, the definition resource is like this:
{
"type": "object",
"properties": {
"amount": {
"type": "object",
"properties": {
"value": {
"type": "number",
"xml": {
"attribute": true
},
"minimum": 0,
"maximum": 9999999999.99
}
}
},
"functionDynamicLogic": {
"$ref": "http://<hostname>:<port>/<contextRoot>/generic/premiumschedulelines/dynamiclogic/definition#/dynamiclogic"
"x-oi-resource-name": "dynamiclogic"
},
"premiumTier": {
"$ref": "http://<hostname>:<port>/<contextRoot>/generic/premiumschedulelines/premiumtiers/definition#/premiumtier",
"x-oi-resource-name": "premiumtiers"
},
"<amountField>": {
"type": "object",
"properties": {
"currency": {
"type": "string",
"xml": {
"attribute": true
}
},
"valueAmount": {
"type": "number",
"xml": {
"attribute": true
},
"minimum": -9999999999.9999,
"maximum": 9999999999.9999
}
}
},
"<charField>": {
"type": "string",
"xml": {
"attribute": true
},
"maxLength": 1000
},
"<charFlexCodeField>": {
"type": "string",
"xml": {
"attribute": true
},
"maxLength": 1000,
"x-oi-dyn-flex-link": "<URL>"
},
"<charRangeField>": {
"type": "object",
"properties": {
"valueFrom": {
"type": "string",
"xml": {
"attribute": true
},
"maxLength": 1000
},
"valueTo": {
"type": "string",
"xml": {
"attribute": true
},
"maxLength": 1000
}
}
},
"<dateField>": {
"type": "string",
"format": "date",
"xml": {
"attribute": true
}
},
"<numberField>": {
"type": "number",
"xml": {
"attribute": true
}
}
}
}
The collection resource for premiumschedulelines for a premium schedule can be accessed using GET on:
http://[hostName]:[portNumber]/[api-context-root]/generic/premiumschedulelines/<premium schedule code>
Get on the above url will return links to maintain premium schedule lines (of the premium schedule) for each default time period.
Example payload
{ "items":[ { "startDate": "<startDate of default time period 1>", "links": [ { "href": "http://<hostname>:<port>/<contextRoot>/generic/premiumschedulelines/[premium schedule code]/defaulttimeperiod/[defaultTimePeriodStartDate 1]", "rel": "canonical" }] }, { "startDate": "<startDate of default time period 2>", "links": [ { "href": "http://<hostname>:<port>/<contextRoot>/generic/premiumscheduleslines/<premium schedule code>/defaulttimeperiod/[defaultTimePeriodStartDate 2]", "rel": "canonical" }] } ] }
The resource representation has links for each defined default time period. Those links can be followed to retrieve, create, update or delete lines for that time period and premium schedule. For more details, see sections below.
Accessing Premium Schedule Lines through Premium Schedule API
Existing premium schedule(s) can be retrieved using the Query API against the collection resource, using the GET operation.
Example URL:
POST http://[hostName]:[portNumber]/[api-context-root]/generic/premiumschedules/search { "resource": { "q": "code.eq('<some code>')" } }
The system will return a resource representation of the premium schedule like this
{ "id": , "code": "<code>", "amountInterpretation": "<amountInterpretation C or Y>", ... more attributes ... "links": [ { "href": "http://<hostname>:<port>/<contextRoot>/generic/premiumschedules/", "rel": "self" } ], "premiumScheduleLineList": [ { "startDate": "<startDate of default time period 1>", "links": [ { "href": "http://<hostname>:<port>/<contextRoot>/generic/premiumscheduleslines/<premium schedule code>/defaulttimeperiod/<defaultTimePeriodStartDate 1>", "rel": "canonical" }] }, { "startDate": "<startDate of default time period 2>", "links": [ { "href": "http://<hostname>:<port>/<contextRoot>/generic/premiumscheduleslines/<premium schedule code>/defaulttimeperiod/<defaultTimePeriodStartDate 2>", "rel": "canonical" }] } ] }
The resource representation has a property "premiumScheduleLineList" with links for each defined default time period. Those links can be followed to retrieve, create, update or delete lines for that time period and premium schedule. For more details, see sections below.
Retrieve Premium Schedule Lines
Existing lines can be retrieved using the GET operation against the URL found within the context of the premium schedule and the applicable default time period.
{ "items": [{ "amount": { "value": 15, "currency":"USD" }, "age": { "valueFrom": 18, "valueTo": 99 }, "medicalCondition": "N" .... Other attributes .... "links": [ { "href": "http://<hostname>:<port>/<contextRoot>/generic/premiumscheduleslines/<premium schedule code>/defaulttimeperiod/<defaultTimePeriodStartDate 1>",, "rel": "self" } ] } { "amount": { "value": 20", "currency: "USD" }, "age": { "valueFrom": 18, "valueTo": 99 }, "medicalCondition": "Y" .... Other attributes .... "links": [ { "href": "http://<hostname>:<port>/<contextRoot>/generic/premiumscheduleslines/<premium schedule code>/defaulttimeperiod/<defaultTimePeriodStartDate 2>", "rel": "self" } ] } ] }
Add, Update, and Delete Premium Schedule Lines
Use the GET operation to retrieve the URL of the premium schedule lines for a premium schedule and a default time period.
Use the entry with the startDate
matching the default time period.
-
POST operation adds a premium schedule line to the premium schedule for a default time period.
-
Collection PATCH adds, updates, and deletes multiple lines that belong to a premium schedule and default time period.
-
PUT and PATCH operations update a premium schedule line.
-
DELETE operation deletes a premium schedule line.
This is the message format for POST/PUT/PATCH
{ "amount": { "value": "", "currency":"" }, "functionDynamicLogic": { "code": "" }, "premierTier": { "id": "" } "<field name of schedule dimension with type value and datatype other than amount>": "", "<field name of schedule dimension with type value and datatype amount>": { "valueAmount" : { "value": "", "currency": "" } }, "<field name of schedule dimension with type range and datatype other than amount>": { "valueFrom": "", "valueTo": "" }, "<field name of schedule dimension with type range and datatype amount>": { "valueFromAmount": { "value": "", "currency": "" }, "valueToAmount": { "value": "", "currency": "" } }
Create a Premium Schedule Line
Adds a premium schedule line to a premium schedule.
- URL
-
http://[hostName]:[portNumber]/[api-context-root]/generic/premiumschedulelines/[premium schedule code]/defaulttimeperiod/[period]
where [hostName] is the hostname of the device accessing the API.
[portNumber] is the port number.
[api-context-root] is the top level.
[premium schedule code] is the Code of the fee schedule.
[period] is the default time period.
Example payload for creating a premium schedule line using an Amount:
{ "amount":{ "currency": "USD", "value": 50 }, “testfield” : “def” }
Example payload for creating a premium schedule line using a Dynamic Logic function:
{ "functionDynamicLogic": { "code": "new_premium_schedule" } }
Collection PATCH Payload
Example payload for inserting two premium schedule lines :
{ "items": [{ "op": "add" "amount": { "value": 15 "currency":"USD" }, "age": { "valueFrom": 18, "valueTo": 99 }, "medicalCondition": "N" } { "op": "add" "amount": { "value": 20" "currency: "USD" }, "age": { "valueFrom": 18, "valueTo": 99 }, "medicalCondition": "Y" } ] }
See HTTP API PATCH for more details about "op".
Collection PATCH uses the technical id of the adjustment rule to match the payload with existing data.
For details on how values in the request messages are handled, refer to Property Representation and Handling (PUT, POST, PATCH). |
This API uses HTTP status codes as defined in Response Messages. |