/quotes

Quote API is for creating priced quotes from Swallow pricing projects, and returning quote data at volume.

Create a quote

This is a public API endpoint. You can hit this endpoint for client-side code by just providing client_id_key in the header. View authentication to find out more. Public APIs have /public/ within the endpoint url.

This is a private API endpoint. You have to hit it with both client_id_key and client_secret_key in the header. You should only hit this POST endpoint server-side.

The request body should match the inputs that are defined within your Swallow pricing project. You can see the desired payload by looking at the Try page of any project or project version. For example:

{
        "name": "Smith",
        "date_of_birth": "1990-01-01",
        "country": "UK",
        "duration_days": 5,
        "is_healthy": true
}

The response body will return the priced quote with the outputs that are defined within your Swallow pricing project.

{
	"company_reference": "098ae4f2-3af8-4740-8760-5d312e46742c",
	"project_reference": "1085e088-5501-4cc0-babd-464c6ae04707",
	"version_reference": "862360ff-fe53-40e1-8f11-57bf9a6f7477",
	"quote_reference": "e8733d88-b560-44d4-8c03-b2366dfd2cbb",
	"version": 1,
	"indicators": "bob@smith.com::Smith",
	"output": {
		"commission": 31.46,
		"tax": 23.595,
		"result": 212.36,
		"valid": true
	},
	"input": {
	        "name": "Smith",
	        "date_of_birth": "1990-01-01",
	        "country": "UK",
	        "duration_days": 5,
	        "is_healthy": true
	},
	"created_at": "2023-09-20T09:32:43.865Z",
}

To respond with debugging details, provide ?debug=true as a query parameter within the endpoint. This will return an additional parameter called debug with granular detail of how the quote was created. This will not work on the public quote endpoint.

{
    ...    
    "debug": {
        "timer": [],
        "errors": [],
        "exclusions": [],
        "refers": [],
        "excesses": [],
        "endorsements": [],
        "indicators": {},
        "steps": {}
    }
    ...
}

Retrieve quotes

Quotes can be fetched in bulk or filtered (via a ?search query) on indicators that are defined in the inputs of Swallow pricing models. Indicators are up to 4 defined input parameters that can be searched (e.g. name, password, registration, zip code, postcode).

https://api.llow.io/sw/quotes?search=bob@smith.com

Quotes can also be filtered on a specific version_reference or project_reference.

https://api.llow.io/sw/quotes?version_reference=862360ff-fe53-40e1-8f11-57bf9a6f7477

Retrieve quote detail

Each quote has a unique quote_reference that is used within the quote request.

To respond with debugging details, provide ?debug=true as a query parameter within the endpoint. This will return an additional parameter called debug with granular detail of how the quote was created.

{
	"project_reference": "1085e088-5501-4cc0-babd-464c6ae04707",
	"version_reference": "862360ff-fe53-40e1-8f11-57bf9a6f7477",
	"quote_reference": "e8733d88-b560-44d4-8c03-b2366dfd2cbb",
	"meta": {
		"project_reference": "1085e088-5501-4cc0-babd-464c6ae04707",
		"version_reference": "862360ff-fe53-40e1-8f11-57bf9a6f7477",
		"quote_reference": "2ebc2426-772f-4f10-af63-25110554d35b",
		"company_reference": "098ae4f2-3af8-4740-8760-5d312e46742c",
		"version": 1
	},
	"output": {
		"commission": 31.46,
		"tax": 23.595,
		"result": 212.36,
		"valid": true
	},
	"input": {
	        "name": "smith",
	        "date_of_birth": "1990-01-01",
	        "country": "UK",
	        "duration_days": 5,
	        "is_healthy": true
	},
	"created_at": "2023-09-20T09:32:43.865Z",
	"debug": {}
}

Quote storage period

Different account types will store quotes for different periods of time.

Last updated