MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

Authenticating requests

To authenticate requests, include a x-api-key header with the value "{YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

Your API key and channel will be provided to you by TTB.

Quote endpoints

Endpoints for generating quotes

POST Full Quote

requires authentication

The request is made to one of the following URLS:

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://{Product & region specific url}';
$response = $client->post(
    $url,
    [
        'headers' => [
            'x-api-key' => '{YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'customer' => [
                'brand' => 'Sundays UK',
                'dateOfBirth' => '1999-12-31',
                'firstName' => 'John',
                'lastName' => 'Smith',
                'contactNumber' => '2124561234',
                'email' => '[email protected]',
                'personalInfoUse' => false,
                'address' => [
                    'line1' => 'Flat 7',
                    'line2' => 'quo',
                    'town' => 'London',
                    'province' => 'London',
                    'postal_code' => 'NW10 9BA',
                ],
            ],
            'policy' => [
                'product' => 'Sundays UK',
                'policyType' => 'BC',
                'channel' => '{{YOUR_CHANNEL}',
                'policyStartDate' => '2023-02-14',
                'excess' => 200,
                'Insurable' => [
                    [
                        'value' => '2000',
                        'type' => 'Bike',
                        'bikeType' => 'Road Bike',
                        'bikeMake' => 'Specialized',
                        'storage' => 'Other',
                        'bikeModel' => 'S-Works SL7',
                        'bikeYear' => '2018',
                    ],
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://{Product & region specific url}" \
    --header "x-api-key: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer\": {
        \"brand\": \"Sundays UK\",
        \"dateOfBirth\": \"1999-12-31\",
        \"firstName\": \"John\",
        \"lastName\": \"Smith\",
        \"contactNumber\": \"2124561234\",
        \"email\": \"[email protected]\",
        \"personalInfoUse\": false,
        \"address\": {
            \"line1\": \"Flat 7\",
            \"line2\": \"quo\",
            \"town\": \"London\",
            \"province\": \"London\",
            \"postal_code\": \"NW10 9BA\"
        }
    },
    \"policy\": {
        \"product\": \"Sundays UK\",
        \"policyType\": \"BC\",
        \"channel\": \"{{YOUR_CHANNEL}\",
        \"policyStartDate\": \"2023-02-14\",
        \"excess\": 200,
        \"Insurable\": [
            {
                \"value\": \"2000\",
                \"type\": \"Bike\",
                \"bikeType\": \"Road Bike\",
                \"bikeMake\": \"Specialized\",
                \"storage\": \"Other\",
                \"bikeModel\": \"S-Works SL7\",
                \"bikeYear\": \"2018\"
            }
        ]
    }
}"
import requests
import json

url = 'http://{Product & region specific url}'
payload = {
    "customer": {
        "brand": "Sundays UK",
        "dateOfBirth": "1999-12-31",
        "firstName": "John",
        "lastName": "Smith",
        "contactNumber": "2124561234",
        "email": "[email protected]",
        "personalInfoUse": false,
        "address": {
            "line1": "Flat 7",
            "line2": "quo",
            "town": "London",
            "province": "London",
            "postal_code": "NW10 9BA"
        }
    },
    "policy": {
        "product": "Sundays UK",
        "policyType": "BC",
        "channel": "{{YOUR_CHANNEL}",
        "policyStartDate": "2023-02-14",
        "excess": 200,
        "Insurable": [
            {
                "value": "2000",
                "type": "Bike",
                "bikeType": "Road Bike",
                "bikeMake": "Specialized",
                "storage": "Other",
                "bikeModel": "S-Works SL7",
                "bikeYear": "2018"
            }
        ]
    }
}
headers = {
  'x-api-key': '{YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "http://{Product & region specific url}"
);

const headers = {
    "x-api-key": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer": {
        "brand": "Sundays UK",
        "dateOfBirth": "1999-12-31",
        "firstName": "John",
        "lastName": "Smith",
        "contactNumber": "2124561234",
        "email": "[email protected]",
        "personalInfoUse": false,
        "address": {
            "line1": "Flat 7",
            "line2": "quo",
            "town": "London",
            "province": "London",
            "postal_code": "NW10 9BA"
        }
    },
    "policy": {
        "product": "Sundays UK",
        "policyType": "BC",
        "channel": "{{YOUR_CHANNEL}",
        "policyStartDate": "2023-02-14",
        "excess": 200,
        "Insurable": [
            {
                "value": "2000",
                "type": "Bike",
                "bikeType": "Road Bike",
                "bikeMake": "Specialized",
                "storage": "Other",
                "bikeModel": "S-Works SL7",
                "bikeYear": "2018"
            }
        ]
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
 

{
    "data": {
        "type": "Policy",
        "attributes": {
            "annualPremium": 98.64,
            "monthlyPremium": 8.22,
            "tpq": "9abc28f7a9ecb9e195487d70be34f49472c74621d659"
        }
    }
}
 

Request   

POST full-quote

Headers

x-api-key      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

customer   object   
brand   string   

The Brand to which the customer belongs. Available options:

  • Sundays US
  • Sundays UK
  • Churchill
Example: Sundays UK

dateOfBirth   string   

The customer date of birth in YYYY-MM-DD format. Age must be equal or greater than 18. Example: 1999-12-31

firstName   string   

The customer's first name. Example: John

lastName   string   

The customer's last name. Example: Smith

contactNumber   string   

The customer's contact number. Example: 2124561234

email   email   

The customer's email address. Example: [email protected]

personalInfoUse   boolean  optional  

Whether the customer has agreed that personal info may be used to contact them regarding their quote. Example: false

state   string  optional  

The customer's 2 letter state
Required when creating quotes for Sundays US.

address   object   
line1   string   

The first line of the customer's address. Example: Flat 7

line2   string  optional  

The second line of the customer's address. 25 Church Road Example: quo

town   string   

The town of the customer's address. Example: London

province   string   

The province/county/state of the customer's address. Example: London

postal_code   string   

The postal code of the customer's address. Example: NW10 9BA

policy   object   
product   string   

The Product to which the policy will belong.
Available options:

  • Sundays US
  • Sundays UK
  • Churchill
Example: Sundays UK

policyType   in:BC,C,B,V,I,T   

The policy type (BC: Bicycle & Cyclist, B: Bicycle, C: Cyclist, V: Vehicle, I: Insurer, T: Theft Only). Example: BC

channel   string   

Your channel name (provided by TTB). Example: {{YOUR_CHANNEL}

policyStartDate   string   

The proposed start date for the policy in YYYY-MM-DD format. Example: 2023-02-14

excess   integer   

The excess for the policy.
Available options:

  • Sundays US
    • 150
    • 250
    • 350
  • Sundays UK:
    • 50
    • 100
    • 200
Example: 200

theftOnly   boolean   

True if the policy only covers theft of bike(s)

Insurable   object[]   
value   numeric   

The value of the insurable.

  • Bike:
    • Sundays UK
      • Minimum: 250
      • Maximum: 15000
    • Sundays US
      • Minimum: 300
      • Maximum: 21500
    • Churchill
      • Minimum: 250
      • Maximum: 15000
  • Accessories:
    • Sundays UK
      • Minimum: 10
      • Maximum: 5000
    • Sundays US
      • Minimum: 150
      • Maximum: 1000
    • Churchill
      • Minimum: 250
      • Maximum: 1000
  • Wheelset:
    • Sundays UK
      • Minimum: 10
      • Maximum: 5000
    • Sundays US
      • Minimum: 150
      • Maximum: 5000

Required when specifying "Accessories", "Bike" or "Wheelset" as type being created. Example: 2000

type   string   

The type of insurable being added to the policy.
Standard options:

  • Accessories
  • Bike
  • Cyclist Legal Cover
  • Racing
  • Worldwide travel

Sundays UK additional options:
  • Cyclist Racing Cover
  • Cyclist Personal Liability
  • Wheelset

Sundays US additional options:
  • Cyclist Personal Injury
  • New for Old
  • Wheelset

Churchill additional options:
  • Cyclist Personal Injury
Example: Bike

bikeType   string  optional  

The bike type.
Required when specifying "Bike" as type being created.
Standard Options

  • Road Bike
  • Mountain Bike
  • Gravel Bike
  • Cargo Bike
  • Folding Bike
  • BMX
  • Track Bike
  • Other
Sundays UK Additional Options:
  • City Bike
  • Triathlon/Time Trial
  • Hybrid Bike
  • CycloCross
  • Touring Bike
Sundays US Additional Options:
  • Commuter Bike
  • Hybrid Bike
Churchill Additional Options:
  • Bespoke
  • Commuter Bike
  • Cyclocross
  • Downhill
  • Electric Bike
  • Electric Cargo Bike
  • Hybrid/City Bike
  • Single Speed
  • Triathlon/Time Trial
Example: Road Bike

bikeMake   string  optional  

The bike make. Example: Specialized

isElectric   boolean  optional  

Whether the bike is electric or not.

storage   string  optional  

Where the bike is stored.
Required when specifying "Bike" as type being created and Product is "Churchill" or "Sundays UK".
Available options:

  • Inside my property
  • Inside my garage
  • An outbuilding on my property
  • A communal area in my property
  • Inside my wooden shed on my property
  • Inside my metal shed on my property
  • In an off-site bicycle hanger
  • Other
Example: Other

bikeModel   string  optional  

The bike model. Example: S-Works SL7

bikeYear   string  optional  

The bike year model.
Required when specifying "Bike" as type being created. Example: 2018

POST Abbreviated Quote

requires authentication

The response provides estimated monthly and annual premiums.

The request is made to one of the following URLS:

The response provides estimated monthly and annual premiums. The response also contains a "tpq" value which is used to generate the customer redirect URL. This TPQ is used to generate the redirect URL for the customer. Replace {TPQ} with the received TPQ for the following environments.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://{Product & region specific url}';
$response = $client->post(
    $url,
    [
        'headers' => [
            'x-api-key' => '{YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'policy' => [
                'product' => 'Sundays US',
                'channel' => '{{YOUR_CHANNEL}',
                'bike' => [
                    'value' => '2000',
                    'type' => 'Road Bike',
                    'make' => 'Specialized',
                    'year' => '2023',
                    'serial' => 'XYZ-123',
                    'model' => 'S-Works SL7',
                    'isElectric' => false,
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://{Product & region specific url}" \
    --header "x-api-key: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"policy\": {
        \"product\": \"Sundays US\",
        \"channel\": \"{{YOUR_CHANNEL}\",
        \"bike\": {
            \"value\": \"2000\",
            \"type\": \"Road Bike\",
            \"make\": \"Specialized\",
            \"year\": \"2023\",
            \"serial\": \"XYZ-123\",
            \"model\": \"S-Works SL7\",
            \"isElectric\": false
        }
    }
}"
import requests
import json

url = 'http://{Product & region specific url}'
payload = {
    "policy": {
        "product": "Sundays US",
        "channel": "{{YOUR_CHANNEL}",
        "bike": {
            "value": "2000",
            "type": "Road Bike",
            "make": "Specialized",
            "year": "2023",
            "serial": "XYZ-123",
            "model": "S-Works SL7",
            "isElectric": false
        }
    }
}
headers = {
  'x-api-key': '{YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "http://{Product & region specific url}"
);

const headers = {
    "x-api-key": "{YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "policy": {
        "product": "Sundays US",
        "channel": "{{YOUR_CHANNEL}",
        "bike": {
            "value": "2000",
            "type": "Road Bike",
            "make": "Specialized",
            "year": "2023",
            "serial": "XYZ-123",
            "model": "S-Works SL7",
            "isElectric": false
        }
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
 

{
    "data": {
        "type": "Policy",
        "attributes": {
            "annualPremium": 132,
            "monthlyPremium": 11,
            "tpq": "157bb4bfb68ddb5b2ec838db3e329f7781eff02461dc"
        }
    }
}
 

Request   

POST abbreviated-quote

Headers

x-api-key      

Example: {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

policy   object   

Policy object.

product   string   

The Product for which you want to generate a quote. Example: Sundays US

channel   string   

Your channel name (provided by TTB). Example: {{YOUR_CHANNEL}

bike   object   

Bike object for which you want to generate a quote.

value   numeric   

The value of the insurable.

  • Bike:
    • Minimum: 300
    • Maximum: 21500
Example: 2000

type   string   

The bike type of the insurable.
Available options:

  • Road Bike
  • Mountain Bike
  • Electric Bicycle
  • Cargo E-bike
  • Gravel Bike
  • Folding Bike
  • Hybrid Bike
  • BMX
  • Track Bike
Example: Road Bike

make   string   

The bike make of the insurable. Must be at least 2 characters. Must not be greater than 50 characters. Example: Specialized

year   string   

The bike year model of the insurable. Example: 2023

serial   string  optional  

The serial number of the insurable. Must be at least 2 characters. Must not be greater than 50 characters. Example: XYZ-123

model   string  optional  

The bike model of the insurable. Example: S-Works SL7

isElectric   boolean  optional  

Whether the bike is electric or not. Example: false