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 chapter of the Premium and Fee Configuration implementation guide for more information on the related model.

Premium Schedule Lines

The collection resource for premiumschedulelines can be accessed using get on:

http://[hostName]:[portNumber]/[api-context-root]/generic/premiumschedulelines
The section "Discoverability" in Concepts describes how to discover a collection resource from the root URI.

GET 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:

http://<hostname>:<port>/<contextRoot>/generic/premiumschedules?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

One has to retrieve the URL of the premium schedule lines within the context of premium schedule and default time period, for example using a GET operation. Use the entry with the "startDate" matching the default time period to be processed.

  • With POST operation a premium schedule line can be added to the premium schedule within the context of default time period

  • With Collection PATCH, one can do operations (add, update, delete) on multiple lines that belong to a premium schedule and default time period

  • With PUT and PATCH operations a premium schedule line can be updated

  • With DELETE operation a premium schedule line can be deleted

This is the message format for POST/PUT/PATCH

{
  "amount": {
    "value": "",
    "currency":""
  },
  "functionDynamicLogic": {
    "id": ""
  },
  "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": ""
    }
}

Collection PATCH payload

Example payload for inserting 2 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, Property Representation and Handling (PUT, POST, PATCH).
This API uses HTTP status codes as defined in Response Messages.