Swallow
  • YOUR FIRST MODEL
    • Setting up your first project
    • Manual setup of a new product
    • Excel Model Upload
    • Create your team
    • Essential concepts
      • Syntax
      • Steps
      • Collections
      • Try Model
      • Spotlight
  • PROCESS
    • Team Management
    • Governance & Collaboration
  • BUILD
    • Building with AI
    • Step builder
      • Understanding step types
      • Ordering step blocks
      • Placeholder mode
      • Up/Downloading models
      • Sharing your model
      • Running tests
    • Inputs
    • Enriching Raw Data
      • Transform Data
      • Enrich via API
      • Data Set
      • Collection
      • Custom Code
    • Setting Up Decisions
      • Exclusions
      • Excesses
      • Endorsements
      • Refer
    • Making Calculations
      • Factors
      • Calculation
    • Outputs
  • TEST
    • Creating New Tests
    • Running Tests
    • Editing Tests
    • Reading & Interpreting Tests
    • Impact Testing
  • DATA
    • Working with real-time data
    • Data Views
    • Data Quotas
    • Troubleshooting
    • API Webhooks
    • Data Downloads
  • ADMIN & SETTINGS
    • Project Management
    • Account Management
  • INTEGRATIONS
    • Introduction
    • Payments
      • Stripe
      • GoCardless
      • Adyen
    • Alerting
      • Slack
      • Zapier
    • Data
      • AWS S3
      • Google Sheets
    • Admin
      • Socotra
      • Guidewire
      • Hubspot
      • Salesforce
  • Developer API
    • Introduction
    • Authentication
    • Errors codes
    • Endpoints
      • /quotes
      • /projects
      • /tests
      • /process
Powered by GitBook
On this page
  1. Developer API
  2. Endpoints

/quotes

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

PreviousEndpointsNext/projects

Last updated 1 year ago

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 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.

Account Type
Period

Free

3 Months

Pay-as-you-go

12 Months

Professional

indefinitely

Enterprise

indefinitely

authentication

Return all priced quotes

get
Query parameters
project_referencestringOptional

Project reference. It is a UUID.

Example: 56c575d2-b6b9-44ed-9c75-5d705b987ec1
version_referencestringOptional

Project version reference. It is a UUID.

Example: 46c575d2-b6b9-44ed-9c75-5d705b987ec1
searchstringOptional

This is a search term use to find a quote. It searches all defined input indictors.

Example: 56c575d2-b6b9-44ed-9c75-5d705b987ec1
Responses
200
/sw/quotes response
application/json
get
GET /sw/quotes HTTP/1.1
Host: api.llow.io
Accept: */*
200

/sw/quotes response

{
  "quote_reference": "56c575d2-b6b9-44ed-9c75-5d705b987ec1",
  "project_reference": "56c575d2-b6b9-44ed-9c75-5d705b987ec1",
  "version_reference": "46c575d2-b6b9-44ed-9c75-5d705b987ec1",
  "company_reference": "86c575d2-b6b9-44ed-9c75-8d705b987ec1",
  "version": 1,
  "result": 400,
  "valid": true,
  "refers": [
    {}
  ],
  "exclusions": [
    {}
  ],
  "excesses": [
    {}
  ],
  "endorsements": [
    {}
  ],
  "indicators": "indicator_value_1::indicator_value_2::indicator_value_3",
  "execution_time": 125,
  "output": {
    "result": 100,
    "valid": true,
    "tax": 15,
    "commission": 21
  },
  "input": {
    "age": 23,
    "name": "Rimmer",
    "email": "cal@cal.com",
    "postcode": "PO343TR"
  },
  "created_at": "2021-03-22T14:29:22.000Z"
}

Return a price quoted details

get
Path parameters
quote_referencestringRequired

Quote reference. It is a UUID.

Example: 56c575d2-b6b9-44ed-9c75-5d705b987ec1
Query parameters
debugstringOptional

Return the detailed quote response

Example: true
Responses
200
/sw/quotes/{quote_reference} response
application/json
get
GET /sw/quotes/{quote_reference} HTTP/1.1
Host: api.llow.io
Accept: */*
200

/sw/quotes/{quote_reference} response

{
  "quote_reference": "56c575d2-b6b9-44ed-9c75-5d705b987ec1",
  "version_reference": "46c575d2-b6b9-44ed-9c75-5d705b987ec1",
  "project_reference": "56c575d2-b6b9-44ed-9c75-5d705b987ec1",
  "meta": {
    "name": "Monthly motor insurance product",
    "project_reference": "56c575d2-b6b9-44ed-9c75-5d705b987ec1",
    "version_reference": "46c575d2-b6b9-44ed-9c75-5d705b987ec1",
    "version": 1
  },
  "input": {
    "age": 23,
    "name": "Rimmer",
    "email": "cal@cal.com",
    "postcode": "PO343TR"
  },
  "output": {
    "result": 100,
    "valid": true,
    "tax": 15,
    "commission": 21
  },
  "debug": {
    "endorsements": [],
    "errors": [],
    "excesses": [],
    "exclusions": [],
    "indicators": {},
    "meta": {},
    "refers": [],
    "steps": {},
    "timer": []
  },
  "created_at": "2021-03-22T14:29:22.000Z"
}
  • POSTCreate a price from a quote (public)
  • POSTCreate a price from a quote
  • GETReturn all priced quotes
  • GETReturn a price quoted details

Create a price from a quote (public)

post
Path parameters
project_referencestringRequired

Project reference. It is a UUID.

Example: 56c575d2-b6b9-44ed-9c75-5d705b987ec1
Query parameters
version_referencestringOptional

Project version reference. It is a UUID.

Example: 46c575d2-b6b9-44ed-9c75-5d705b987ec1
Body
ageintegerOptional

Example age input

Example: 23
namestringOptional

Example name input

Example: Smith
postcodestringOptional

Example postcode input

Example: SW1A1AA
emailstringOptional

Example email input

Example: bob@smith.com
Responses
200
/sw/public/quotes/{project_reference} response
application/json
post
POST /sw/public/quotes/{project_reference} HTTP/1.1
Host: api.llow.io
Content-Type: application/json
Accept: */*
Content-Length: 70

{
  "age": 23,
  "name": "Smith",
  "postcode": "SW1A1AA",
  "email": "bob@smith.com"
}
200

/sw/public/quotes/{project_reference} response

{
  "quote_reference": "56c575d2-b6b9-44ed-9c75-5d705b987ec1",
  "project_reference": "56c575d2-b6b9-44ed-9c75-5d705b987ec1",
  "version_reference": "46c575d2-b6b9-44ed-9c75-5d705b987ec1",
  "company_reference": "86c575d2-b6b9-44ed-9c75-8d705b987ec1",
  "version": 1,
  "result": 400,
  "valid": true,
  "refers": [
    {}
  ],
  "exclusions": [
    {}
  ],
  "excesses": [
    {}
  ],
  "endorsements": [
    {}
  ],
  "indicators": "indicator_value_1::indicator_value_2::indicator_value_3",
  "execution_time": 125,
  "output": {
    "result": 100,
    "valid": true,
    "tax": 15,
    "commission": 21
  },
  "input": {
    "age": 23,
    "name": "Rimmer",
    "email": "cal@cal.com",
    "postcode": "PO343TR"
  },
  "created_at": "2021-03-22T14:29:22.000Z"
}

Create a price from a quote

post
Path parameters
project_referencestringRequired

Project reference. It is a UUID.

Example: 56c575d2-b6b9-44ed-9c75-5d705b987ec1
Query parameters
debugstringOptional

Return the detailed quote response

Example: true
version_referencestringOptional

Project version reference. It is a UUID.

Example: 46c575d2-b6b9-44ed-9c75-5d705b987ec1
Body
ageintegerOptional

Example age input

Example: 23
namestringOptional

Example name input

Example: Smith
postcodestringOptional

Example postcode input

Example: SW1A1AA
emailstringOptional

Example email input

Example: bob@smith.com
Responses
200
/sw/quotes/{project_reference} response
application/json
post
POST /sw/quotes/{project_reference} HTTP/1.1
Host: api.llow.io
Content-Type: application/json
Accept: */*
Content-Length: 70

{
  "age": 23,
  "name": "Smith",
  "postcode": "SW1A1AA",
  "email": "bob@smith.com"
}
200

/sw/quotes/{project_reference} response

{
  "quote_reference": "56c575d2-b6b9-44ed-9c75-5d705b987ec1",
  "project_reference": "56c575d2-b6b9-44ed-9c75-5d705b987ec1",
  "version_reference": "46c575d2-b6b9-44ed-9c75-5d705b987ec1",
  "company_reference": "86c575d2-b6b9-44ed-9c75-8d705b987ec1",
  "version": 1,
  "result": 400,
  "valid": true,
  "refers": [
    {}
  ],
  "exclusions": [
    {}
  ],
  "excesses": [
    {}
  ],
  "endorsements": [
    {}
  ],
  "indicators": "indicator_value_1::indicator_value_2::indicator_value_3",
  "execution_time": 125,
  "output": {
    "result": 100,
    "valid": true,
    "tax": 15,
    "commission": 21
  },
  "input": {
    "age": 23,
    "name": "Rimmer",
    "email": "cal@cal.com",
    "postcode": "PO343TR"
  },
  "created_at": "2021-03-22T14:29:22.000Z"
}