> For the complete documentation index, see [llms.txt](https://travelins.saladin.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://travelins.saladin.vn/embedded-travel-insurance/api-document.md).

# API document

## API Endpoint

| Endpoint (Staging)    | <https://gw-dev.saladin.vn/api/v1/flight-insurance> |
| --------------------- | --------------------------------------------------- |
| Endpoint (Production) | ​<https://gw.saladin.vn/api/v1/flight-insurance>    |

## API Key & Authentication

{% content-ref url="/pages/i8m5azILZB37BSCMZicO" %}
[External Authentication](/external-authentication.md)
{% endcontent-ref %}

## API Versions

The latest version of the API is **`v2`**. Please always use the latest version with every API call

We strongly encourage our longtime customers to upgrade to the current version of the API. Which is qualitatively different from the older versions.

However, you can access the previous versions here.

## API Details

### API #1 - get insurance products

* **Purpose:** This API allows the partner to retrieve available insurance products for the user's current flight booking.
* **Trigger when**: We recommend calling this API when
  * Customers are booking flights to retrieve the insurance premium and advise them accordingly.
  * Recalculate the insurance premium after the booker issues the flight ticket.&#x20;

{% openapi src="/files/mIhLTP6mQvKJNyPPB2U0" path="/vendor/v2/get-insurance-products" method="post" %}
[flight\_v2\_get\_product.json](https://3021727229-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F60NRkF6cJtKNlp1htZfD%2Fuploads%2FNISRXG7IfXNIxGXQgPeF%2Fflight_v2_get_product.json?alt=media\&token=145bfef6-1d3f-428f-b8a3-486da3909cd5)
{% endopenapi %}

### API #2 - update policy

* **Purpose:** his API allows the partner to update certain insurance contract details, such as passenger and flight information. Changes are accepted only up to 3 hours before the departure time.
  * The partner can also call the API [#api-5-check-update-policy](#api-5-check-update-policy "mention") to verify update rules, calculate the new premium, and enable the customer to confirm policy updates.
* **Body:**

{% openapi src="/files/Dfg7VATka53ciF6clh1m" path="/vendor/v2/policies/{policy\_id}" method="put" %}
[flight\_v2\_policies.json](https://3021727229-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F60NRkF6cJtKNlp1htZfD%2Fuploads%2FIJxgSjFmojFjaZmJG2jC%2Fflight_v2_policies.json?alt=media\&token=46ec45b0-1fb9-4968-93f6-c3b2aaed0bfd)
{% endopenapi %}

### API #3 -  Create policy

* **Purpose:** This API enables the partner to send flight information to create a policy in the Saladin system.
* **Body:**

{% openapi src="/files/Dfg7VATka53ciF6clh1m" path="/vendor/v2/policies" method="post" %}
[flight\_v2\_policies.json](https://3021727229-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F60NRkF6cJtKNlp1htZfD%2Fuploads%2FIJxgSjFmojFjaZmJG2jC%2Fflight_v2_policies.json?alt=media\&token=46ec45b0-1fb9-4968-93f6-c3b2aaed0bfd)
{% endopenapi %}

### API #4 -  Get policy info

**Purpose:** This API returns the most up-to-date policy data.&#x20;

{% openapi src="/files/Dfg7VATka53ciF6clh1m" path="/vendor/v2/policies" method="get" %}
[flight\_v2\_policies.json](https://3021727229-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F60NRkF6cJtKNlp1htZfD%2Fuploads%2FIJxgSjFmojFjaZmJG2jC%2Fflight_v2_policies.json?alt=media\&token=46ec45b0-1fb9-4968-93f6-c3b2aaed0bfd)
{% endopenapi %}

### API #5 -  Check Update Policy

**Purpose:** This API is used to validate rules and retrieve the updated insurance premium before policy modification.&#x20;

{% openapi src="/files/0Xto20zN3BT7okrpmeQ9" path="/vendor/v2/check-update-policy/{policy\_id}" method="post" %}
[flight\_check\_update\_policy.json](https://3021727229-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F60NRkF6cJtKNlp1htZfD%2Fuploads%2FafmXbtEUvYKmjdBmh7iI%2Fflight_check_update_policy.json?alt=media\&token=53588857-4c4b-45f3-af5b-79723fe9f624)
{% endopenapi %}
