Migration Guide
Migrating to 2025-01-01
Summary
This guide covers migrating from Insurance API version 2023-03-15 to 2025-01-01, spanning two version jumps (2023-03-15 to 2024-06-01 to 2025-01-01). The major changes are: all collection endpoints have moved from /insurance-collection/ to /insurance/collection/, policyholder fields have been consolidated into a new Holder object, the Premium type has changed from a flat object to a oneOf union, and several monetary fields have changed from plain integers to MonetaryAmount objects. The insuranceCompany field has also changed from a fixed enum to an open string.
Breaking Changes
Endpoint paths restructured
All collection-related endpoints have moved from /insurance-collection/ to /insurance/collection/. The company availability endpoint has also moved.
| Old Endpoint | New Endpoint |
|---|---|
POST /insurance-collection/collect-info | POST /insurance/collection |
GET /insurance-collection/get-data/{collectionId} | GET /insurance/collection/{collectionId}/data |
GET /insurance-collection/status/{collectionId} | GET /insurance/collection/{collectionId}/status |
POST /insurance-collection/supplement-info | POST /insurance/collection/{collectionId}/supplement-info |
GET .../collection/{collectionId}/policy/{policyId}/document/{documentId} | Same path under /insurance/collection/... |
GET /insurance-company/status | GET /companies/availability |
GET /insurance-collection/get-parameters | Removed |
GET /insurance-collection/parameters/{country} | Removed |
Action: Update all API endpoint URLs. The /insurance-collection/get-parameters and /insurance-collection/parameters/{country} endpoints have been removed entirely -- use the new CollectionRequest schema when starting collections.
Policyholder fields moved to Holder object
Across all insurance types (InsuranceCar, InsuranceHome, InsuranceVilla, InsuranceIncome, InsuranceOtherVehicle, and others), the following flat fields have been removed and consolidated into a new holder field of type Holder:
insuranceHolderName→holder.nameinsuranceHolderEmail→holder.emailinsuranceHolderPhoneNumber→holder.phoneNumberinsuranceHolderStreetAddress→holder.streetAddressinsuranceHolderPostalCode→holder.postalCodeinsuranceHolderCity→holder.cityotherInsuranceHolder→holder.otherInsuranceHolder
The following fields have been removed entirely with no equivalent on the Holder:
insuranceHolderDateOfBirthinsuranceHolderGenderinsuranceHolderOccupation
Action: Replace all reads of insurance.insuranceHolderName, insurance.insuranceHolderEmail, etc. with the corresponding fields on insurance.holder. Remove any usage of insuranceHolderDateOfBirth, insuranceHolderGender, and insuranceHolderOccupation — these fields are no longer available.
Premium type changed from object to oneOf
The Premium type has changed from a flat object to a oneOf union type with market-specific variants. This affects all insurance types that include a premium field.
Field changes on the base Premium:
amountis now a MonetaryAmount object (was a plain number)frequency(string enum) has been renamed topaymentFrequency(integer — number of payments per year)period(PremiumPeriod) is a new field describing the billing periodtaxationhas been removed
Action: Update your premium parsing logic to handle the new oneOf structure. Rename premium.frequency to premium.paymentFrequency and update the type from string enum to integer. Read premium.amount as a MonetaryAmount object. Remove any usage of premium.taxation.
MonetaryAmount structure changed
The MonetaryAmount object has changed:
minorUnitAmount(long, minor units) has been replaced byamount(decimal, major units)currencyCodeis nowcurrency(type changed from string enum to string)
Warning: This is a semantic change, not just a rename. The old minorUnitAmount was expressed in minor currency units (e.g., 1032 for 10.32 EUR). The new amount is expressed in major currency units (e.g., 10.32). Simply renaming the field without adjusting the value interpretation will cause ~100x magnitude errors.
Action: Replace monetaryAmount.currencyCode with monetaryAmount.currency. Replace monetaryAmount.minorUnitAmount with monetaryAmount.amount and remove any minor-to-major unit conversion logic (e.g., dividing by 100), since amount is already in major units.
Fields changed from integer to MonetaryAmount
Several fields that were previously plain integers are now MonetaryAmount objects:
discountAmounton all insurance typesinsuredMovablesAmounton InsuranceHome, InsuranceVillainsuredMonthlyAmount,insuredAmounton InsuranceIncome
Note: insuredMovablesAmount on InsuranceCottage and animalPurchasePrice, veterinaryCareAmount, veterinaryCareAmountRemaining on InsuranceAnimal are new MonetaryAmount fields that did not exist in 2023-03-15. insuredMovablesAmount on InsuranceFarm remains an integer.
Action: Update your code to read field.amount and field.currency instead of using the integer value directly.
Removed fields
The following fields have been removed from all insurance types that previously had them:
externalId-- replaced byidon FullInsuranceWrapper and CollectionItempaymentMethod— moved to DanishPremiumpremiumAmountYearRounded-- use the newpremiumobject insteadpremiumFrequency-- now part of thepremiumobject
Additionally, the parameters field has been removed from FullInsuranceWrapper.
Action: Replace externalId references with id. Move paymentMethod reads to premium.paymentMethod on DanishPremium. Remove any usage of premiumAmountYearRounded and parameters. Get frequency information from the new premium object.
CollectionStatus field renames
On CollectionStatus:
insuranceCompanyrenamed tocompanystatusis now a strict enum with many new values (see below)
New status values your polling logic must handle:
ACCOUNT_TEMPORARILY_LOCKED— end user's access temporarily blocked; retry after ~15 minutesAUTHENTICATION_CANCELLED— user cancelled the authentication flowAUTHENTICATION_CONFLICT— another authentication session is already in progressAUTHENTICATION_MISMATCH— authenticated identity does not match the expected userAUTHENTICATION_TIMEOUT— authentication was not completed in timeCOLLECTION_INPUT_PENDING— waiting for additional input via supplement-infoCOLLECTION_INPUT_TIMEOUT— supplement-info input was not provided in timeCONTACT_FORM— a contact form must be completed to proceedCONTACT_FORM_PENDING— waiting for contact form submissionCUSTOMER_ENROLLMENT_REQUIRED— user must enroll with the provider before data can be collectedFAILED_PDF_PARSE— PDF document could not be parsedFAILED_PDF_USER_INPUT— user-provided PDF input was invalidKYC_FORM— a KYC form must be completedTHIRD_PARTY_ERROR— the insurance provider returned an unexpected errorTWO_FACTOR_METHOD_SELECTION_TIMEOUT— two-factor method selection was not completed in timeWAITING_FOR_USER_ACTION— collection is paused until the user takes action
On CollectionStatusInformationMap:
requiredInputTypesrenamed toREQUIRED_INPUT_TYPESDANISH_NEM_ID_CARD_CODE_LOOKUP,SELECTED_TWO_FACTOR_METHODremoved
Action: Rename collectionStatus.insuranceCompany to collectionStatus.company. Rename informationMap.requiredInputTypes to informationMap.REQUIRED_INPUT_TYPES. Handle the new collection status values. At minimum, treat unknown statuses as non-terminal so your polling loop continues. Remove handling for DANISH_NEM_ID_CARD_CODE_LOOKUP and SELECTED_TWO_FACTOR_METHOD information map keys.
CompanyAvailability field renames
insuranceCompanyrenamed tocompanyinsuranceCompanyDisplayNamerenamed tocompanyDisplayName- New field:
companyGroup
Action: Rename insuranceCompany to company and insuranceCompanyDisplayName to companyDisplayName.
InsuranceCar coverage enum updated
On InsuranceCar, the coverage enum has changed:
- Removed:
COMPREHENSIVE - Added:
THIRD_PARTY,THIRD_PARTY_PLUS
The insuranceLevel field has been removed.
Action: Replace any handling of COMPREHENSIVE with the appropriate new value. Remove usage of insuranceLevel.
InsuranceWrapper variants reduced
The InsuranceWrapper oneOf has been reduced from 12 variants to 8: InsuranceAnimal, InsuranceVehicle (oneOf InsuranceCar, InsuranceOtherVehicle), InsurancePerson, InsuranceHouseContent (oneOf InsuranceHome, InsuranceVilla), InsuranceIncome, InsuranceCottage, InsuranceFarm, InsuranceGeneral. The removed top-level types InsuranceAccident, InsuranceChild, InsurancePregnancy, and InsuranceLife are now sub-types of InsurancePerson, along with a new CoreInsurancePerson variant for generic person/health insurance. Market-specific types (e.g., DanishInsuranceCar, DanishInsuranceHome) have been folded into the base types with a @market discriminator field.
Action: If you previously matched on InsuranceAccident, InsuranceChild, InsurancePregnancy, or InsuranceLife as top-level wrapper variants, access them through the InsurancePerson wrapper instead. Handle the new CoreInsurancePerson variant. Use the @market field on insurance objects to determine market-specific behavior.
Item type enum scoped down
The type enum on Item (used for collection input requirements) has been reduced to: EMAIL, LOGIN_METHOD, PASSWORD, TWO_FACTOR_TOKEN, USERNAME.
Action: Remove handling for removed input types such as NORWEGIAN_PERSONAL_NUMBER, ESTONIAN_PERSONAL_NUMBER, UK_DATE_OF_BIRTH, etc.
New Features
Holder object
A new Holder object provides structured policyholder information, replacing the flat insuranceHolder* fields. This is available on all insurance types via the holder field.
Coverage object
A new Coverage object is available on FullInsuranceWrapper, providing structured coverage details.
New collection endpoints
DELETE /insurance/collection/{collectionId}— delete a collection and its associated data
Collection endpoint improvements
- The
CollectionItemnow usesidinstead ofexternalIdfor clearer identification
New insurance object fields
Several insurance types have gained new fields for richer data:
- InsuranceCar:
brand,model,registrationNo - InsuranceOtherVehicle:
brand,model,registrationNo - Property types (InsuranceCottage, InsuranceFarm, InsuranceHome, InsuranceVilla):
insuranceObjectCity,insuranceObjectPostalCode,insuranceObjectPropertyCode,insuranceObjectStreetAddress,livingArea,numberOfResidents,purchaseYear, and more
Migration Checklist
- Update
Insurely-Versionheader to2025-01-01 - Update all endpoint URLs from
/insurance-collection/to/insurance/collection/ - Update company availability endpoint from
/insurance-company/statusto/companies/availability - Replace all
insuranceHolder*field reads with the newholderobject - Update premium parsing: rename
frequencytopaymentFrequency(now integer), readamountas MonetaryAmount, removetaxation - Update
MonetaryAmountreads:minorUnitAmounttoamount,currencyCodetocurrency - Update all integer monetary fields to read from
MonetaryAmountobjects (e.g.,discountAmount.amount) - Replace
externalIdwithidon collection items and insurance wrappers - Rename
insuranceCompanytocompanyonCollectionStatusandCompanyAvailability - Rename
insuranceCompanyDisplayNametocompanyDisplayNameonCompanyAvailability - Rename
requiredInputTypestoREQUIRED_INPUT_TYPESonCollectionStatusInformationMap - Handle new collection status values (see full list above):
ACCOUNT_TEMPORARILY_LOCKED,AUTHENTICATION_TIMEOUT,THIRD_PARTY_ERROR,WAITING_FOR_USER_ACTION, and others - Update
InsuranceCarcoverage enum handling (COMPREHENSIVEremoved,THIRD_PARTY/THIRD_PARTY_PLUSadded) - Move
paymentMethodreads topremium.paymentMethodonDanishPremium - Remove usage of deleted fields:
premiumAmountYearRounded,premiumFrequency,insuranceLevel - Update
InsuranceWrapperhandling:InsuranceAccident,InsuranceChild,InsurancePregnancy,InsuranceLifeare now sub-types ofInsurancePerson - Remove handling for removed
Iteminput types - Test end-to-end collection flow with new endpoints and response shapes
Field Mapping Table
| Object | Old | New | Change |
|---|---|---|---|
| All insurance types | insuranceHolderName (string) | holder.name (Holder) | Moved to Holder |
| All insurance types | insuranceHolderEmail (string) | holder.email (Holder) | Moved to Holder |
| All insurance types | insuranceHolderDateOfBirth (string) | -- | Removed |
| All insurance types | insuranceHolderPhoneNumber (string) | holder.phoneNumber (Holder) | Moved to Holder |
| All insurance types | insuranceHolderStreetAddress (string) | holder.streetAddress (Holder) | Moved to Holder |
| All insurance types | insuranceHolderPostalCode (string) | holder.postalCode (Holder) | Moved to Holder |
| All insurance types | insuranceHolderCity (string) | holder.city (Holder) | Moved to Holder |
| All insurance types | insuranceHolderGender (string) | -- | Removed |
| All insurance types | insuranceHolderOccupation (string) | -- | Removed |
| All insurance types | externalId (string) | id (string) | Renamed |
| All insurance types | premiumAmountYearRounded (integer) | -- | Removed (use premium) |
| All insurance types | premiumFrequency (string) | -- | Removed (use premium) |
| All insurance types | paymentMethod (string) | premium.paymentMethod (DanishPremium) | Moved to DanishPremium |
| Premium | amount (number) | amount (MonetaryAmount) | Type changed |
| Premium | frequency (string enum) | paymentFrequency (integer) | Renamed + type changed |
| Premium | taxation (string) | -- | Removed |
| Premium | -- | period (PremiumPeriod) | New field |
| All insurance types | premium (Premium) | premium (oneOf) | Type changed to oneOf union |
| All insurance types | discountAmount (integer) | discountAmount (MonetaryAmount) | Type changed |
| MonetaryAmount | minorUnitAmount (long, minor units) | amount (decimal, major units) | Replaced — semantic change |
| MonetaryAmount | currencyCode (enum) | currency (string) | Renamed, type relaxed |
| CollectionStatus | insuranceCompany (string) | company (string) | Renamed |
| CollectionStatusInfoMap | requiredInputTypes | REQUIRED_INPUT_TYPES | Renamed |
| CompanyAvailability | insuranceCompany (string) | company (string) | Renamed |
| CompanyAvailability | insuranceCompanyDisplayName (string) | companyDisplayName (string) | Renamed |
| CollectionItem | externalId (string) | id (string) | Renamed |
| InsuranceCar | coverage: COMPREHENSIVE | -- | Enum value removed; THIRD_PARTY, THIRD_PARTY_PLUS added |
| InsuranceCar | insuranceLevel (string) | -- | Removed |
| FullInsuranceWrapper | parameters (object) | -- | Removed |