/
Insurance API Guide

This space is deprecated and no longer supported. Please use the latest available version here.

Insurance API Guide

1. API Flows

1.1 Step 1: Agree Insurance Consent

The flow MUST begin with a User who provides consent to a TPP to access their insurance information from a LFI that they already have a relationship.

1.2 Step 2: Authorize Insurance Access Consent

The TPP MUST now request the User to authorize the consent. Please refer to the Authentication and Authorization page to review the supported Authorization Flows.

The TPP MUST construct a Rich Authorization Request (RFC 9396: OAuth 2.0 Rich Authorization Requests) with the authorization_details populated with the User’s consent

The TPP MUST include an insurance consent with all the REQUIRED data permissions that the User intends to provide to the TPP.

The TPP MUST include a UUID v4 as the ConsentId as a unique identifier for the insurance consent.

A TPP MAY be a broker for data to other parties, so it is valid for a User to have multiple consents for the same resource(s), with different consent or authorization parameters agreed upon.

1.2.1 Security and Access Control

Authorization Code Grant

The TPP MUST use an authorization code grant to obtain a token to access all other API resources.

1.3 Step 3: Access Data

1.3.1 Request Data

The TPP MUST have a valid access token (with scope) from the OFP authorization server.

The TPP MUST use the valid access token to retrieve User data from the OFP resource server.

The LFI MUST return an API response when provided with a valid request from the OFP.

The OFP MUST return an API response when provided with a valid access token request from the TPP.

2. Sequence Diagram

All sequence diagrams relating to Insurance are now available in the API Hub Documentation.

3. Examples

The following are non-normative examples of API access and usage of the Insurance Information API.

3.1 The TPP Redirects the User to Authorize Insurance Consent

3.1.1 Request: TPP Uses RAR (Rich Authorization Request) via a PAR (Pushed Authorization Request) Endpoint with the OFP to Obtain a Request URI

Create a RAR Request JWT with these values:

  • kid is a valid signing key ID for the TPP on the Open Finance Directory

  • iss is client id (UUID v4)

  • state is a UUID v4 value

  • response_type MUST be code

  • redirect_uri is the TPP’s redirect URI

The authorization_details contain the User’s insurance consent details, and a UUID v4 which is a unique identifier for the insurance consent.

{ "typ": "JWT", "alg": "PS256", "kid": "e4ce77c498e77000a25aa7b40e4a83f9" } . { "iss": "s6BhdRkqt3", "aud": "https://server.example.com", "response_type": "code", "redirect_uri": "https://openbanking.tpp1.ae/simple-redirect-url", "scope": "insurance", "state": "2616df22-899e-468b-b7af-927145b067cc", "authorization_details": [ { "Type": "urn:openfinanceuae:insurance-consent:v1.0", "Consent": { "ConsentId": "6a6a826f-0930-4eb0-b365-a8eac3032828", "Permissions": [ "ReadMotorInsurancePolicies", "ReadMotorInsuranceCustomerBasic", "ReadMotorInsuranceCustomerPaymentDetails" ], "ExpirationDateTime": "2024-03-28T15:27:13+030", "Purpose": [ "MotorInsuranceQuote" ] } } ] }

Create the RAR Request using the signed JWT, and authenticated using private_key_jwt.

The request parameter JWT includes the ConsentId, a UUID v4 that was originally generated by the TPP.

POST /open-finance/v1/par HTTP/1.1 Host: auth1.openfinanceplatform.ae Content-Type: application/x-www-form-urlencoded Accept: application/json client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &client_assertion=eyJhbGciOiJIUzI1NiJ9.ew0KICAiaXNzIjogImM4NDIyNzg3LTFkZmYtNDI0ZC1iNjIwLTM1NmMwODcwYmVkNCIsDQogICJzdWIiOiAiYzg0MjI3ODctMWRmZi00MjRkLWI2MjAtMzU2YzA4NzBiZWQ0IiwNCiAgImF1ZCI6ICJhdXRoMS5sYWIub3BlbmJhbmtpbmcuc2EiLA0KICJqdGkiOiAiYThmZDQ2ZjctYTNiMy00MGQ5LTk2ZjctNDk1YmEyMGFiMTZmIiwNCiAgImV4cCI6IDE1MTYyMzkwMjINCn0.nvY2tG7D3_ioVI55nRJ7apBzoGbP9sofMLd7Dni4YbI &request=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6ImU0Y2U3N2M0OThlNzcwMDBhMjVhYTdiNDBlNGE4M2Y5In0.eyJpc3MiOiJzNkJoZFJrcXQzIiwiaWF0IjoxNjY5MzkzMTU0LCJleHAiOjE2NjkzOTM0OTYsIm5iZiI6IjE2NjkzOTMxNTQiLCJhdWQiOiJodHRwczovL3NlcnZlci5leGFtcGxlLmNvbSIsInJlc3BvbnNlX3R5cGUiOiJjb2RlIG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OFQxNToyNzoxMyswMzAwIiwiVHJhbnNhY3Rpb25Gcm9tRGF0ZVRpbWUiOiIyMDI0LTAzLTI1VDEyOjE5OjI0KzAzMDAiLCJUcmFuc2FjdGlvblRvRGF0ZVRpbWUiOiIyMDI0LTAzLTI3VDEyOjE5OjI0KzAzMDAiLCJBY2NvdW50VHlwZSI6WyJVQUVPRi5SZXRhaWwiXSwiQWNjb3VudFN1YlR5cGUiOlsiQ3VycmVudEFjY291bnQiXSwiQ29uc2VudFB1cnBvc2UiOlsiQWNjb3VudCBBZ2dyZWdhdGlvbiIsIkUtU3RhdGVtZW50Il19fV19.8T2xivs2zqFdxyrs8h3TWsMxigzk9QcsamU9Dj-2GDs

3.1.2 Response: The OFP Provides the Request URI for the TPP

HTTP/1.1 201 Created Content-Type: application/json Cache-Control: no-cache, no-store { "request_uri": "urn:ietf:params:oauth:request_uri:6esc_11ACC5bwc014ltc14eY22c", "expires_in": 60 }

3.2 The TPP Redirects the User to Their LFI with the Request URI to Authorize the Consent

3.3 The User Logs into Their LFI, Reviews and Authorizes the Consent Request, and Confirms They Wish to Share Insurance Policies with the TPP

The LFI confirms insurance consent properties in the OFP.

The LFI then confirms authorization of insurance consent in the OFP.

3.4 The LFI Returns an Authorization Code to the TPP

3.5 The TPP Exchanges the Authorization Code for an Insurance API Access Token with the OFP

3.6 The OFP Returns an Access Token, Refresh Token, and ID Token to the TPP

The TPP can now request insurance policy information using the access token.

3.7 Get a List of Insurance Policies

3.7.1 Request: Insurance Policies Resource

3.7.2 Response: Insurance Policies Resource

3.8 Get an Insurance Policy

3.8.1 Request: Insurance Policy Resource

3.8.2 Response: Insurance Policy Resource

3.9 Get Customer Payment Details

3.9.1 Request: Customer Payment Details Resource

3.9.2 Response: Customer Payment Details Resource

4. Further Examples

4.1 The TPP Queries the Insurance Resource for the Status after a User has Authorized the Consent

4.1.1 Request: insurance-consents/{ConsentId} resource

4.1.2 Response: insurance-consents/{ConsentId} resource

 

4.2 The TPP Requests the List of Insurance Policies Using an Expired Access Token

4.2.1 Request: insurance-policies collection

4.2.2 Response: 401 Unauthorized

4.3 Webhooks

4.3.1 The TPP Creates an Insurance Consent Request with a Webhook Subscription

4.3.1.1 Request: Insurance Consent and Webhook Subscription

 

4.3.2 The TPP updates a Webhook Subscription preference with the OFP

4.3.2.1 Request: Activate Webhook events

4.3.2.2 Response: Webhook events activated

4.3.3 The TPP unsubscribes their Webhook Subscription with the OFP

4.3.3.1 Request: De-Activate Webhook events

4.3.3.2 Response: Webhook events de-activated

4.3.4 The TPP receives data from the OFP (specific to the consent and permissions) via its Webhook

4.3.4.1 The OFP generates a Self Signed JWT Authorization Token for Client Authentication with the TPP.

This JWT Authorization Token MUST be set in the Authorization Header.

4.3.4.2 Request: OFP publishes signed/encrypted data to the registered Webhook Url provided by the TPP

The example below shows a signed and encrypted payload with the JWT Authorization Token set in the Authorization Header.

Here, <<jwe>> is a signed and encrypted payload. The JWS encapsulated by the JWE has the structure below:

4.3.4.3 Response: TPP validates the Self Signed JWT Authorization Token from LFI, stores data, and acknowledges a successful response to the OFP

 

5. OpenAPI Specification

See the Insurance OpenAPI page.

6. Notes

  • Customer payment details require the ReadMotorInsuranceCustomerPaymentDetails permission and must be specifically requested using the get /insurance-policies/{InsurancePolicyId}/customer-payment-details operation. This is to ensure a separation of concerns between the main body of data and the payment details.

7. Security

A insurance scope is used for accessing the insurance endpoints.