{"info":{"_postman_id":"e489efaa-b898-4a6a-a38d-055c34e13f19","name":"Affiliate API","description":"<html><head></head><body><p>The Affiliate API provides all the tools you need to programmatically:</p>\n<ul>\n<li>Generate a quote for <a href=\"https://fusedbills.co.uk\">Fused Bills</a>, an all-in-one bills service for students from <a href=\"https://oneutilitybill.co\">One Utility Bill</a></li>\n<li>Submit tenant data to our platform</li>\n</ul>\n<h2 id=\"who-do-i-contact-about-this-api\">Who do I contact about this API?</h2>\n<p>To get in touch with our development team, please email <code>partnerships-dev@oneutilitybill.co</code></p>\n<h2 id=\"what-does-the-quote-include\">What does the quote include?</h2>\n<p>Using the postcode and bed-size of the property you submit to us, we bundle together gas, electric, water and broadband bills into\none simple monthly payment. As many tenants in the student market split the bills and rent properties on a per person, per week basis,\nwe provide all pricing information on a per person per week, per person per month, as well as a total per month basis.</p>\n<p>Quotes are based on:</p>\n<ul>\n<li>a 12-month fixed term tenancy</li>\n<li>an unlimited electricity, gas, water and generic broadband service including all fees and taxes. Unless the property is based in Scotland, where water is paid for\ndifferently and therefore, will <strong>not</strong> be included as a service in the quote</li>\n<li>unlimited energy which means the amount of electric and/or gas used does not affect the price paid by the tenant</li>\n<li>our Fused product which is aimed at students</li>\n</ul>\n<p> <strong>All quotes are representative. The services can be changed by the tenant once they engage with us and create a personalised\nquote.</strong></p>\n<h2 id=\"what-is-the-minimum-required-information-to-generate-a-quote\">What is the minimum required information to generate a quote?</h2>\n<p>Create a Quote, (<code>POST /quotes</code>) by supplying:</p>\n<ul>\n<li><code>postcode</code> (of the property the quote is for)</li>\n<li><code>bed_size</code></li>\n<li><code>tenancy_start_date</code></li>\n</ul>\n<h2 id=\"what-is-the-minimum-required-information-for-a-lead-to-be-captured\">What is the minimum required information for a lead to be captured?</h2>\n<p>Create a Lead, (<code>POST /leads</code>) by supplying:</p>\n<ul>\n<li>the property information (specifically <code>address_line_1</code>, <code>city</code> and <code>postcode</code>)</li>\n<li>the tenant's personal details (specifically <code>first_name</code>, <code>last_name</code>, <code>email_address</code>, <code>phone_number</code>)</li>\n</ul>\n<p>The following may also be supplied, but are not required:</p>\n<ul>\n<li><code>quote_id</code> (this is obtained by generating a quote, as detailed above, before submitting the lead. The response will contain a <code>quote_id</code>)</li>\n<li><code>tenancy_start_date</code> (this may be the proposed move in date)</li>\n<li><code>metadata</code> (this is an array of key-value pairs of additional information about the lead. Allowed keys are <code>enquiry_id</code>, <code>lead_source</code>, <code>original_source_agent</code>, <code>is_homebuyer</code>)</li>\n</ul>\n<p>The inclusion of this additional information will help us to provide an improved service to prospective tenants.</p>\n<h2 id=\"environments\">Environments</h2>\n<p>We have the following two environments:</p>\n<h3 id=\"sandbox\">Sandbox</h3>\n<p>The sandbox environment is located at <a href=\"https://partnerships-sandbox.oneutilitybill.co\">https://partnerships-sandbox.oneutilitybill.co</a>\nand the base URL for this is <a href=\"https://partnerships-sandbox.oneutilitybill.co/api/v1\">https://partnerships-sandbox.oneutilitybill.co/api/v1</a></p>\n<p>The sandbox environment is a mirror of the production environment, with the following differences:</p>\n<ul>\n<li>Leads captured will not be passed to One Utility Bill's internal departments and processed</li>\n<li>Quotes generated do not contain real-world data, i.e. costs are not accurate and descriptions are lorem ipsum</li>\n</ul>\n<p>However, it would still be prudent not to use any real customer data in this sandbox environment.</p>\n<h3 id=\"production\">Production</h3>\n<p>The production environment is located at <a href=\"https://partnerships-api.oneutilitybill.co\">https://partnerships-api.oneutilitybill.co</a>\nand the base URL for this is <a href=\"https://partnerships-api.oneutilitybill.co/api/v1\">https://partnerships-api.oneutilitybill.co/api/v1</a></p>\n<p>All production data is completely separate to sandbox data, anything done on the production environment will not affect the sandbox\nenvironment and vice versa.</p>\n<h2 id=\"openapi-specification\">OpenAPI Specification</h2>\n<p>An up-to-date OpenAPI 3.0 specification file can be found <a href=\"https://partnerships-sandbox.oneutilitybill.co/docs\">here</a>, ready to be consumed by your own OpenAPI tooling.</p>\n<h2 id=\"getting-started\">Getting Started</h2>\n<p>To get started using the Affiliate API please get in touch with Amie Henzell at <code>amie.henzell@oneutilitybill.co</code> who will take you through the onboarding process.</p>\n<p>When it is time for you to integrate with our Sandbox Environment, our development team will help get you started. We can always be reached at <code>partnerships-dev@oneutilitybill.co</code>.</p>\n<p> <strong>We will create for you</strong>:</p>\n<ul>\n<li>The necessary OAuth 2.0 credentials, consisting of a Client ID &amp; Client Secret, which is required to complete the OAuth 2.0 Client Credentials flow.</li>\n</ul>\n<p>Once we are both happy with your integration in the sandbox environment, we will create the necessary production OAuth 2.0 credentials.</p>\n<h2 id=\"authentication\">Authentication</h2>\n<p>The Affiliate API uses the standard OAuth 2.0 protocol for authentication and authorization.</p>\n<p>It supports the <a href=\"https://oauth.net/2/grant-types/client-credentials/\">Client Credentials grant type</a>.\nYou use a Client ID &amp; Client Secret to acquire a short-lived Access Token.</p>\n<p>We will provide you with the Client ID &amp; Client Secret, which you should store securely.\nWe only support server to server API communication, you <strong>should not</strong> store these in the browser or make calls directly to the Affiliate API from a browser.</p>\n<p> <strong>We recommend using <a href=\"https://oauth.net/code/\">popular maintained OAuth 2.0 libraries</a> to help you complete the authentication process.</strong></p>\n<h3 id=\"scopes\">Scopes</h3>\n<p>The Affiliate API currently supports the following <a href=\"https://oauth.net/2/scope/\">scopes</a> to define what access your Access Token will be granted:</p>\n<ul>\n<li><code>leads</code> - Read &amp; write access to the Leads resource</li>\n<li><code>quotes</code> - Read &amp; write access to the Quotes resource</li>\n</ul>\n<h3 id=\"authentication-retrieving-an-access-token\">Authentication (retrieving an Access Token)</h3>\n<p>To perform authentication, issue a <code>POST</code> request as shown below to the <code>/oauth/token</code> endpoint</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST https://partnerships-sandbox.oneutilitybill.co/oauth/token HTTP/1.1\nContent-Type: application/x-www-form-urlencoded\n...\ngrant_type=client_credentials\n&amp;client_id=xxxxxxxxxxxxxxxxxx\n&amp;client_secret=xxxxxxxxxxxxxx\n&amp;scope=leads+quotes\n</code></pre><p>Here's each request body parameter explained (remember to URL encode them):</p>\n<ul>\n<li><code>grant_type=client_credentials</code> - This tells the token endpoint it is using the Client Credentials flow</li>\n<li><code>client_id</code> - This is your <code>client_id</code></li>\n<li><code>client_secret</code> - This is your <code>client_secret</code></li>\n<li><code>scope</code> - This is a space separated list of scopes you are requesting (see the Scopes section above)</li>\n</ul>\n<p>If everything checks out, you will receive a response like the following:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>HTTP/1.1 200 OK\nContent-Type: application/json\nCache-Control: no-store\nPragma: no-cache\n...\n{\n\"access_token\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n\"token_type\":\"Bearer\",\n\"expires_in\":3600\n}\n</code></pre><p> <strong>Access Tokens issued by the Affiliate API are valid for 3600 seconds (1 hour).</strong></p>\n<p>You <strong>will not</strong> receive a Refresh Token as part of this response because the Client Credentials grant type does not use Refresh Tokens.</p>\n<h3 id=\"access-token-expiry\">Access Token Expiry</h3>\n<p>Once your Access Token expires, you will begin to receive <code>401 Unauthorized</code> errors from your API requests.</p>\n<p>To acquire a new Access Token, simply repeat the same call described above to the <code>/oauth/token</code> endpoint to acquire a new Access Token.</p>\n<p>Acquiring a new Access Token <strong>does not</strong> revoke previously issued Access Tokens.</p>\n<h3 id=\"using-your-access-token\">Using your access token</h3>\n<p>When you have an access token, you can use it in the request's HTTP header in the format <code>Authorization: Bearer &lt;access_token&gt;</code>, for example: <code>Authorization: Bearer xxxxxxxxxxxxxxxxxxx</code></p>\n<h2 id=\"error-structures\">Error Structures</h2>\n<h2 id=\"errors\">Errors</h2>\n<p>All errors returned by the API follow the same structure. We do not list every possible error response for each endpoint.\nInstead, the common error responses are listed below. Fields which will always be present will be <code>message</code> and <code>meta</code>\ncontaining at least one field named <code>request_id</code>.</p>\n<h3 id=\"422-unprocessable-entity\">422 Unprocessable Entity</h3>\n<p>This error is returned when the request body you have provided contains validation errors.\nIf there are multiple validation errors, an errors object will be returned and keyed by the violating field, and it's value\nbeing a string array of errors relating to that field.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"The postcode must be at least 5 characters. (and 3 more errors)\",\n    \"errors\": {\n        \"postcode\": [\n            \"The postcode must be at least 5 characters.\",\n            \"Postcode is malformed.\",\n            \"Postcode is not within England, Scotland or Wales.\"\n        ],\n        \"bed_size\": [\n            \"The bed size must be at least 1.\"\n        ]\n    },\n    \"meta\": {\n        \"request_id\": \"c36460cbd8f5ed91198066a9e870f0c5dfb11e3b\"\n    }\n}\n</code></pre>\n<h3 id=\"401-unauthorized\">401 Unauthorized</h3>\n<p>This error is returned when the OAuth 2.0 authorization credentials provided are invalid. This may be due to no\ncredentials being provided, invalid credentials, the wrong header being used, or an invalid / expired access token.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Unauthenticated.\",\n    \"meta\": {\n        \"request_id\": \"61da55be459854e09e8e4dad0574af85fb089239\"\n    }\n}\n</code></pre>\n<h2 id=\"rate-limiting\">Rate Limiting</h2>\n<p>The Affiliate API features rate limiting to ensure a quality experience for all consumers of the API.</p>\n<p>The rate limits described below apply to you as a consumer (as identified by a Client ID / Secret).</p>\n<h3 id=\"sandbox-rate-limits\">Sandbox Rate Limits</h3>\n<p>To allow you to more easily encounter and test rate limits when building your integration, we have set the limits to a lower value.</p>\n<p>They are currently: <strong>25 requests per 10 seconds.</strong></p>\n<p>These are subject to change.</p>\n<h3 id=\"production-rate-limits\">Production Rate Limits</h3>\n<p>For production, we'll never plan to decrease these limits but they could be increased in the future.</p>\n<p>They are currently: <strong>50 requests per 10 seconds.</strong></p>\n<p>These are subject to change.</p>\n<h3 id=\"rate-limiting-headers\">Rate Limiting Headers</h3>\n<p>The following headers are present on <strong>every</strong> API response:</p>\n<ul>\n<li><code>X-RateLimit-Limit</code>: This is an integer representing the total limit for the current timeframe</li>\n<li><code>X-RateLimit-Remaining</code>: This is an integer representing how many requests you have left for the current timeframe</li>\n</ul>\n<p>For example, after making 3 requests in a row on the Sandbox environment you would see:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>X-RateLimit-Limit: 60\nX-RateLimit-Remaining: 57\n</code></pre><h3 id=\"rate-limiting-error-responses\">Rate Limiting Error Responses</h3>\n<p>Once you hit the rate limit you will receive a 429 Too Many Requests error like the following:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>HTTP/1.1 429 Too Many Requests\nContent-Type: application/json\nX-RateLimit-Limit: 60\nX-RateLimit-Remaining: 0\nRetry-After: 5\nX-RateLimit-Reset: 1665523508\n...\n{\n\"message\": \"Too Many Attempts.\"\n}\n</code></pre><p>Two new headers are included in 429 error responses:</p>\n<ul>\n<li><code>Retry-After</code>: This is an integer representing the total number of seconds you should wait before making another request</li>\n<li><code>X-RateLimit-Reset</code>: This is an integer representing the Unix time in UTC when the rate limit will reset, and you can make another request</li>\n</ul>\n<h1 id=\"api-features\">API Features</h1>\n<h2 id=\"dates\">Dates</h2>\n<p>We handle both Dates &amp; Timestamps consistently across all of our requests and responses.</p>\n<p>Dates are accepted &amp; provided in <code>Y-m-d</code> format. For example, <code>2020-05-02</code>.</p>\n<p>Timestamps are returned in <a href=\"https://en.wikipedia.org/wiki/ISO_8601\">ISO8601</a> Zulu Time format, unless stated otherwise. For example, <code>2020-05-02T09:52:36Z</code>.</p>\n<h2 id=\"versioning\">Versioning</h2>\n<p>We use API wide versioning, specified in the URL. The version number is specified in the base URL, following <code>/api/</code> and preceding the resource name.</p>\n<h3 id=\"breaking-changes\">Breaking changes</h3>\n<p>A breaking change refers to any change that would require you to update your application in order to continue working with the Affiliate API as originally intended.</p>\n<p>We consider the following to be breaking changes:</p>\n<ul>\n<li>Renaming an API field or resource</li>\n<li>Removing an API field or resource</li>\n<li>Changes to the required fields for an endpoint</li>\n</ul>\n<p>If we are intending to make a breaking change, we will communicate this ahead of time to ensure you are able to make the changes in your integration.</p>\n<p>We may from time to time make additive changes to our API without incrementing the version number.</p>\n<p>We may add new resources and fields to an existing version of the API, and these will not be considered breaking changes. Our API documentation\nexplaining the purpose of the changes will be updated.</p>\n<p> <strong>As such, you should design your integration to be flexible enough to not break when new fields are added to resources.</strong></p>\n<h2 id=\"uuids\">UUIDs</h2>\n<p>For all of our resource IDs, we use UUIDs following the UUID version 7 format.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"API Features","slug":"api-features"}],"owner":"12606501","collectionId":"e489efaa-b898-4a6a-a38d-055c34e13f19","publishedId":"2s8Z76wUiZ","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"3D3D3D","highlight":"FE963D"},"publishDate":"2023-02-02T12:51:11.000Z"},"item":[{"name":"leads","item":[{"name":"leads.store","id":"794e25f7-a7f1-4374-a765-2789b3639e21","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n  \"property\": {\r\n    \"address_line_1\": \"5 Media Exchange\",\r\n    \"city\": \"Newcastle upon Tyne\",\r\n    \"postcode\": \"NE1 2QB\",\r\n    \"address_line_2\": \"Coquet Street\",\r\n    \"county\": \"Tyne and Wear\",\r\n    \"uprn\": \"100110971828\",\r\n    \"umprn\": \"12345678\",\r\n    \"udprn\": \"12345678\"\r\n  },\r\n  \"contact\": {\r\n    \"first_name\": \"John\",\r\n    \"last_name\": \"Smith\",\r\n    \"email_address\": \"john.smith@oneutilitybill.co\",\r\n    \"phone_number\": \"07700964836\",\r\n    \"country_code\": \"GB\"\r\n  },\r\n  \"quote_id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n  \"tenancy_start_date\": \"2022-09-30\",\r\n  \"metadata\": [\r\n    {\r\n      \"meta_key\": \"enquiry_id\",\r\n      \"meta_value\": \"123\"\r\n    }\r\n  ]\r\n}"},"url":"https://partnerships-sandbox.oneutilitybill.co/api/v1/leads","description":"<p>Create a new lead resource.</p>\n<p>When a tenancy start date is provided, it must be in <code>Y-m-d</code> format.</p>\n<p>The provided address must be in either England, Scotland or Wales.</p>\n<p>To the provided email, we will apply RFC Validation, a DNS Check and a Spoof Check.</p>\n<p>A phone number is required, but can be provided in national or E.164 format.</p>\n<p>For example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>\"phone_number\" : \"01916220102\"\n\"phone_number\" : \"+441916220102\"\n</code></pre><p>A country code may also be provided. If it is, it must be in <a href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\">ISO 3166-1 alpha-2</a> format.</p>\n<p>For example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>\"country_code\" : \"GB\",\n\"phone_number\" : \"07700900500\"\n</code></pre><p>If a valid country code is provided, we will transform the phone number into the E.164 format by default before it is stored in our database. The above example would become <code>+447700900500</code>.</p>\n<p>If no country code is provided, we will use the Google Phone Number library to try to determine where the phone number originates from.</p>\n<p>If successful, we will store the country code and transform the phone number as above. If unsuccessful, we will simply store the value you provide.</p>\n<p>You may also optionally provide any of the following national address identifiers to help us canonicalise the property:</p>\n<ul>\n<li><code>property.uprn</code> — Unique Property Reference Number (UPRN)</li>\n<li><code>property.umprn</code> — Unique Multiple Residence Premise Reference Number (UMPRN)</li>\n<li><code>property.udprn</code> — Unique Delivery Point Reference Number (UDPRN)</li>\n</ul>\n<p>If any of these identifiers are provided, we will use the corresponding address as formatted in the Royal Mail database (PAF) instead of the raw <code>property.address_line_*</code>, <code>city</code>, <code>county</code>, and <code>postcode</code> values you pass.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Attribute</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>quote_id</code></td>\n<td>string</td>\n<td>A valid quote_id returned from the Quote endpoint - optional</td>\n</tr>\n<tr>\n<td><code>tenancy_start_date</code></td>\n<td>string</td>\n<td>The start date of the tenancy, provided in <code>Y-m-d</code> format (this could be when the property is available to rent) - optional</td>\n</tr>\n<tr>\n<td><code>property.address_line_1</code><strong>*</strong></td>\n<td>string</td>\n<td>The first line of the address - required. Min length of 1. Max length of 191</td>\n</tr>\n<tr>\n<td><code>property.address_line_2</code></td>\n<td>string</td>\n<td>The second line of the address - optional. Min length of 1. Max length of 191</td>\n</tr>\n<tr>\n<td><code>property.city</code> <strong>*</strong></td>\n<td>string</td>\n<td>The city where the property is located - required. Min length of 1. Max length of 60</td>\n</tr>\n<tr>\n<td><code>property.county</code></td>\n<td>string</td>\n<td>The county where the property is located - optional. Min length of 1. Max length of 191</td>\n</tr>\n<tr>\n<td><code>property.postcode</code><strong>*</strong></td>\n<td>string</td>\n<td>A valid postcode within England, Scotland or Wales - required. Min length of 5. Max length of 8</td>\n</tr>\n<tr>\n<td><code>property.uprn</code></td>\n<td>string</td>\n<td>Optional Unique Property Reference Number. Max length of 12. If supplied, we will use the Royal Mail formatted address that matches this identifier.</td>\n</tr>\n<tr>\n<td><code>property.umprn</code></td>\n<td>string</td>\n<td>Optional Unique Multiple Residence Premise Reference Number (Royal Mail). Max length of 10. If supplied, we will use the Royal Mail formatted address that matches this identifier.</td>\n</tr>\n<tr>\n<td><code>property.udprn</code></td>\n<td>string</td>\n<td>Optional Unique Delivery Point Reference Number (Royal Mail). Max length of 8. If supplied, we will use the Royal Mail formatted address that matches this identifier.</td>\n</tr>\n<tr>\n<td><code>contact.first_name</code> <strong>*</strong></td>\n<td>string</td>\n<td>A tenant's first name - required. Min length of 2. Max length of 191</td>\n</tr>\n<tr>\n<td><code>contact.last_name</code> <strong>*</strong></td>\n<td>string</td>\n<td>A tenant's last name - required. Min length of 2. Max length of 191</td>\n</tr>\n<tr>\n<td><code>contact.email_address</code> <strong>*</strong></td>\n<td>string</td>\n<td>A tenant's valid email address - required. We will check the domain is able to process emails. Max length of 191</td>\n</tr>\n<tr>\n<td><code>contact.phone_number</code> <strong>*</strong></td>\n<td>string</td>\n<td>A tenant's phone number - required. We will try to transform it into E.164 format, but store as provided if not able to. Min length of 7. Max length of 15</td>\n</tr>\n<tr>\n<td><code>contact.country_code</code></td>\n<td>string</td>\n<td>The country code associated with the tenant's phone number in ISO 3166-1 alpha-2 format - optional. Min length of 2. Max length of 2</td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"scope","value":"<scope>"},{"key":"grant_type","value":"<grant_type>"}]},"isInherited":true,"source":{"_postman_id":"e489efaa-b898-4a6a-a38d-055c34e13f19","id":"e489efaa-b898-4a6a-a38d-055c34e13f19","name":"Affiliate API","type":"collection"}},"urlObject":{"path":["leads"],"host":["https://partnerships-sandbox.oneutilitybill.co/api/v1"],"query":[],"variable":[]}},"response":[{"id":"3c796e2e-ab8e-4add-8a5d-d162a432e684","name":"Response_201","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n  \"property\": {\r\n    \"address_line_1\": \"5 Media Exchange\",\r\n    \"city\": \"Newcastle upon Tyne\",\r\n    \"postcode\": \"NE1 2QB\",\r\n    \"address_line_2\": \"Coquet Street\",\r\n    \"county\": \"Tyne and Wear\",\r\n    \"uprn\": \"100110971828\",\r\n    \"umprn\": \"12345678\",\r\n    \"udprn\": \"12345678\"\r\n  },\r\n  \"contact\": {\r\n    \"first_name\": \"John\",\r\n    \"last_name\": \"Smith\",\r\n    \"email_address\": \"john.smith@oneutilitybill.co\",\r\n    \"phone_number\": \"07700964836\",\r\n    \"country_code\": \"GB\"\r\n  },\r\n  \"quote_id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n  \"tenancy_start_date\": \"2022-09-30\",\r\n  \"metadata\": [\r\n    {\r\n      \"meta_key\": \"enquiry_id\",\r\n      \"meta_value\": \"123\"\r\n    }\r\n  ]\r\n}"},"url":"https://partnerships-sandbox.oneutilitybill.co/api/v1/leads","description":"Create a new lead resource.\n\nWhen a tenancy start date is provided, it must be in `Y-m-d` format.\n\nThe provided address must be in either England, Scotland or Wales.\n\nTo the provided email, we will apply RFC Validation, a DNS Check and a Spoof Check.\n\nA phone number is required, but can be provided in national or E.164 format.\n\nFor example:\n```\n\"phone_number\" : \"01916220102\"\n\"phone_number\" : \"+441916220102\"\n```\n\nA country code may also be provided. If it is, it must be in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.\n\nFor example:\n```\n\"country_code\" : \"GB\",\n\"phone_number\" : \"07700900500\"\n```\nIf a valid country code is provided, we will transform the phone number into the E.164 format by default before it is stored in our database. The above example would become `+447700900500`.\n\nIf no country code is provided, we will use the Google Phone Number library to try to determine where the phone number originates from.\n\nIf successful, we will store the country code and transform the phone number as above. If unsuccessful, we will simply store the value you provide.\n\nYou may also optionally provide any of the following national address identifiers to help us canonicalise the property:\n\n- `property.uprn` — Unique Property Reference Number (UPRN)\n- `property.umprn` — Unique Multiple Residence Premise Reference Number (UMPRN)\n- `property.udprn` — Unique Delivery Point Reference Number (UDPRN)\n\nIf any of these identifiers are provided, we will use the corresponding address as formatted in the Royal Mail database (PAF) instead of the raw `property.address_line_*`, `city`, `county`, and `postcode` values you pass.\n\nAttribute                           | Type      | Description\n----------------------------------- | --------- | -----------\n`quote_id`                          | string    | A valid quote_id returned from the Quote endpoint - optional\n`tenancy_start_date`                | string    | The start date of the tenancy, provided in `Y-m-d` format (this could be when the property is available to rent) - optional\n`property.address_line_1`**\\***     | string    | The first line of the address - required. Min length of 1. Max length of 191\n`property.address_line_2`           | string    | The second line of the address - optional. Min length of 1. Max length of 191\n`property.city` **\\***              | string    | The city where the property is located - required. Min length of 1. Max length of 60\n`property.county`                   | string    | The county where the property is located - optional. Min length of 1. Max length of 191\n`property.postcode`**\\***           | string    | A valid postcode within England, Scotland or Wales - required. Min length of 5. Max length of 8\n`property.uprn`                     | string    | Optional Unique Property Reference Number. Max length of 12. If supplied, we will use the Royal Mail formatted address that matches this identifier.\n`property.umprn`                    | string    | Optional Unique Multiple Residence Premise Reference Number (Royal Mail). Max length of 10. If supplied, we will use the Royal Mail formatted address that matches this identifier.\n`property.udprn`                    | string    | Optional Unique Delivery Point Reference Number (Royal Mail). Max length of 8. If supplied, we will use the Royal Mail formatted address that matches this identifier.\n`contact.first_name` **\\***         | string    | A tenant's first name - required. Min length of 2. Max length of 191\n`contact.last_name` **\\***          | string    | A tenant's last name - required. Min length of 2. Max length of 191\n`contact.email_address` **\\***      | string    | A tenant's valid email address - required. We will check the domain is able to process emails. Max length of 191\n`contact.phone_number` **\\***       | string    | A tenant's phone number - required. We will try to transform it into E.164 format, but store as provided if not able to. Min length of 7. Max length of 15\n`contact.country_code`              | string    | The country code associated with the tenant's phone number in ISO 3166-1 alpha-2 format - optional. Min length of 2. Max length of 2\n"},"status":"Returns the created lead","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json","disabled":false}],"cookie":[],"responseTime":null,"body":"{\r\n  \"data\": {\r\n    \"id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n    \"quote_id\": \"01838de9-a331-7343-bd7a-e653ad9c3423\",\r\n    \"tenancy_start_date\": \"2022-09-30\",\r\n    \"property\": {\r\n      \"id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n      \"address_line_1\": \"5 Media Exchange\",\r\n      \"address_line_2\": \"Coquet Street\",\r\n      \"city\": \"Newcastle upon Tyne\",\r\n      \"county\": \"Tyne and Wear\",\r\n      \"postcode\": \"NE1 2QB\",\r\n      \"uprn\": \"100110971828\",\r\n      \"umprn\": \"1234567890\",\r\n      \"udprn\": \"12345678\",\r\n      \"created_at\": \"2022-09-30T09:13:36Z\",\r\n      \"updated_at\": \"2022-09-30T09:13:36Z\"\r\n    },\r\n    \"contact\": {\r\n      \"id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n      \"first_name\": \"John\",\r\n      \"last_name\": \"Smith\",\r\n      \"email_address\": \"john.smith@oneutilitybill.co\",\r\n      \"phone_number\": \"+447700964836\",\r\n      \"country_code\": \"GB\",\r\n      \"created_at\": \"2022-09-30T09:13:36Z\",\r\n      \"updated_at\": \"2022-09-30T09:13:36Z\"\r\n    },\r\n    \"metadata\": [\r\n      {\r\n        \"id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n        \"meta_key\": \"enquiry_id\",\r\n        \"meta_value\": \"123\",\r\n        \"created_at\": \"2022-09-30T09:13:36Z\",\r\n        \"updated_at\": \"2022-09-30T09:13:36Z\"\r\n      }\r\n    ],\r\n    \"created_at\": \"2022-09-30T09:13:36Z\",\r\n    \"updated_at\": \"2022-09-30T09:13:36Z\"\r\n  }\r\n}"}],"_postman_id":"794e25f7-a7f1-4374-a765-2789b3639e21"},{"name":"leads.show","id":"f7469233-53e9-44d3-ad45-787a8d28f3b2","request":{"method":"GET","header":[{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"https://partnerships-sandbox.oneutilitybill.co/api/v1/leads/:leadId","description":"<p>Fetches a single lead resource.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Response Attribute</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>quote_id</code></td>\n<td>string</td>\n<td>The quote_id related to this lead. May be null</td>\n</tr>\n<tr>\n<td><code>tenancy_start_date</code></td>\n<td>string</td>\n<td>The start date of the tenancy, provided in <code>Y-m-d</code> format. May be null</td>\n</tr>\n<tr>\n<td><code>property.address_line_1</code></td>\n<td>string</td>\n<td>The first line of the address</td>\n</tr>\n<tr>\n<td><code>property.address_line_2</code></td>\n<td>string</td>\n<td>The second line of the address. May be null</td>\n</tr>\n<tr>\n<td><code>property.city</code></td>\n<td>string</td>\n<td>The city where the property is located</td>\n</tr>\n<tr>\n<td><code>property.county</code></td>\n<td>string</td>\n<td>The county where the property is located. May be null</td>\n</tr>\n<tr>\n<td><code>property.postcode</code></td>\n<td>string</td>\n<td>A valid postcode within England, Scotland or Wales</td>\n</tr>\n<tr>\n<td><code>contact.first_name</code></td>\n<td>string</td>\n<td>A tenant's first name</td>\n</tr>\n<tr>\n<td><code>contact.last_name</code></td>\n<td>string</td>\n<td>A tenant's last name</td>\n</tr>\n<tr>\n<td><code>contact.email_address</code></td>\n<td>string</td>\n<td>A tenant's valid email address</td>\n</tr>\n<tr>\n<td><code>contact.phone_number</code></td>\n<td>string</td>\n<td>A tenant's phone number, usually in international format (see validation rules)</td>\n</tr>\n<tr>\n<td><code>contact.country_code</code></td>\n<td>string</td>\n<td>The country code associated with the tenant's phone number. May be null</td>\n</tr>\n<tr>\n<td><code>created_at</code></td>\n<td>string</td>\n<td>The datetime (UTC) when the lead was submitted to the Affiliate API</td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"scope","value":"<scope>"},{"key":"grant_type","value":"<grant_type>"}]},"isInherited":true,"source":{"_postman_id":"e489efaa-b898-4a6a-a38d-055c34e13f19","id":"e489efaa-b898-4a6a-a38d-055c34e13f19","name":"Affiliate API","type":"collection"}},"urlObject":{"path":["leads",":leadId"],"host":["https://partnerships-sandbox.oneutilitybill.co/api/v1"],"query":[],"variable":[{"id":"612aa7b2-d1ef-4e95-921f-ec9e5b7b3c9f","description":{"content":"<p>ID of the Lead</p>\n","type":"text/plain"},"type":"any","value":"01838daa-eb24-7c54-bac5-ca4eedab22f3","key":"leadId"}]}},"response":[{"id":"a3babb88-1848-4613-876e-9809e1c670a8","name":"Response_200","originalRequest":{"method":"GET","header":[{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":{"raw":"https://partnerships-sandbox.oneutilitybill.co/api/v1/leads/:leadId","host":["https://partnerships-sandbox.oneutilitybill.co/api/v1"],"path":["leads",":leadId"],"variable":[{"id":"612aa7b2-d1ef-4e95-921f-ec9e5b7b3c9f","key":"leadId","value":"01838daa-eb24-7c54-bac5-ca4eedab22f3","description":"ID of the Lead"}]},"description":"Fetches a single lead resource.\n\n\nResponse Attribute             | Type      | Description\n------------------------------ | --------- | -----------\n`quote_id`                     | string    | The quote_id related to this lead. May be null\n`tenancy_start_date`           | string    | The start date of the tenancy, provided in `Y-m-d` format. May be null\n`property.address_line_1`      | string    | The first line of the address\n`property.address_line_2`      | string    | The second line of the address. May be null\n`property.city`                | string    | The city where the property is located\n`property.county`              | string    | The county where the property is located. May be null\n`property.postcode`            | string    | A valid postcode within England, Scotland or Wales\n`contact.first_name`           | string    | A tenant's first name\n`contact.last_name`            | string    | A tenant's last name\n`contact.email_address`        | string    | A tenant's valid email address\n`contact.phone_number`         | string    | A tenant's phone number, usually in international format (see validation rules)\n`contact.country_code`         | string    | The country code associated with the tenant's phone number. May be null\n`created_at`                   | string    | The datetime (UTC) when the lead was submitted to the Affiliate API\n"},"status":"Returns a single lead with the related contact and property data.","code":200,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json","disabled":false}],"cookie":[],"responseTime":null,"body":"{\r\n  \"data\": {\r\n    \"id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n    \"quote_id\": \"01838de9-a331-7343-bd7a-e653ad9c3423\",\r\n    \"tenancy_start_date\": \"2022-09-30\",\r\n    \"property\": {\r\n      \"id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n      \"address_line_1\": \"5 Media Exchange\",\r\n      \"address_line_2\": \"Coquet Street\",\r\n      \"city\": \"Newcastle upon Tyne\",\r\n      \"county\": \"Tyne and Wear\",\r\n      \"postcode\": \"NE1 2QB\",\r\n      \"uprn\": \"100110971828\",\r\n      \"umprn\": \"1234567890\",\r\n      \"udprn\": \"12345678\",\r\n      \"created_at\": \"2022-09-30T09:13:36Z\",\r\n      \"updated_at\": \"2022-09-30T09:13:36Z\"\r\n    },\r\n    \"contact\": {\r\n      \"id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n      \"first_name\": \"John\",\r\n      \"last_name\": \"Smith\",\r\n      \"email_address\": \"john.smith@oneutilitybill.co\",\r\n      \"phone_number\": \"+447700964836\",\r\n      \"country_code\": \"GB\",\r\n      \"created_at\": \"2022-09-30T09:13:36Z\",\r\n      \"updated_at\": \"2022-09-30T09:13:36Z\"\r\n    },\r\n    \"metadata\": [\r\n      {\r\n        \"id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n        \"meta_key\": \"enquiry_id\",\r\n        \"meta_value\": \"123\",\r\n        \"created_at\": \"2022-09-30T09:13:36Z\",\r\n        \"updated_at\": \"2022-09-30T09:13:36Z\"\r\n      }\r\n    ],\r\n    \"created_at\": \"2022-09-30T09:13:36Z\",\r\n    \"updated_at\": \"2022-09-30T09:13:36Z\"\r\n  }\r\n}"}],"_postman_id":"f7469233-53e9-44d3-ad45-787a8d28f3b2"}],"id":"250bc64b-aad3-4a72-bba2-92558c82ab54","description":"<p>Lead entities represent property data (ie a UK address), personal tenant data and, if provided,\na valid quote id, tenancy start date and metadata.</p>\n","_postman_id":"250bc64b-aad3-4a72-bba2-92558c82ab54","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"scope","value":"<scope>"},{"key":"grant_type","value":"<grant_type>"}]},"isInherited":true,"source":{"_postman_id":"e489efaa-b898-4a6a-a38d-055c34e13f19","id":"e489efaa-b898-4a6a-a38d-055c34e13f19","name":"Affiliate API","type":"collection"}}},{"name":"quotes","item":[{"name":"quotes.store","id":"3c32f52e-ccfe-42b0-ad1d-d213aecb8d74","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n  \"postcode\": \"NE1 2QB\",\r\n  \"bed_size\": 4,\r\n  \"tenancy_start_date\": \"2022-09-30\"\r\n}"},"url":"https://partnerships-sandbox.oneutilitybill.co/api/v1/quotes","description":"<p>Create a new quote resource.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Attribute</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>postcode</code> <strong>*</strong></td>\n<td>string</td>\n<td>A valid postcode within England, Scotland and Wales for the property the quote is to be linked to - required</td>\n</tr>\n<tr>\n<td><code>bed_size</code> <strong>*</strong></td>\n<td>integer</td>\n<td>Number of tenants the property can accommodate - required. Min of 1. Max of 14</td>\n</tr>\n<tr>\n<td><code>tenancy_start_date</code> <strong>*</strong></td>\n<td>string</td>\n<td>The start date of the tenancy, provided in <code>Y-m-d</code> format (this could be when the property is available to rent) - required</td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"scope","value":"<scope>"},{"key":"grant_type","value":"<grant_type>"}]},"isInherited":true,"source":{"_postman_id":"e489efaa-b898-4a6a-a38d-055c34e13f19","id":"e489efaa-b898-4a6a-a38d-055c34e13f19","name":"Affiliate API","type":"collection"}},"urlObject":{"path":["quotes"],"host":["https://partnerships-sandbox.oneutilitybill.co/api/v1"],"query":[],"variable":[]}},"response":[{"id":"e1786feb-49c4-4715-a50b-593399e747ad","name":"Response_201","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n  \"postcode\": \"NE1 2QB\",\r\n  \"bed_size\": 4,\r\n  \"tenancy_start_date\": \"2022-09-30\"\r\n}"},"url":"https://partnerships-sandbox.oneutilitybill.co/api/v1/quotes","description":"Create a new quote resource.\n\nAttribute                    | Type      | Description\n---------------------------- | --------- | -----------\n`postcode` **\\***            | string    | A valid postcode within England, Scotland and Wales for the property the quote is to be linked to - required\n`bed_size` **\\***            | integer   | Number of tenants the property can accommodate - required. Min of 1. Max of 14\n`tenancy_start_date` **\\***   | string    | The start date of the tenancy, provided in `Y-m-d` format (this could be when the property is available to rent) - required\n"},"status":"Returns the created quote","code":201,"_postman_previewlanguage":"Text","header":[{"key":"Content-Type","value":"application/json","disabled":false}],"cookie":[],"responseTime":null,"body":"{\r\n  \"data\": {\r\n    \"id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n    \"total_costs\": {\r\n      \"id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n      \"per_month\": \"200.00\",\r\n      \"per_person_per_month\": \"100.00\",\r\n      \"per_person_per_week\": \"25.00\",\r\n      \"created_at\": \"2022-09-30T09:13:36Z\",\r\n      \"updated_at\": \"2022-09-30T09:13:36Z\"\r\n    },\r\n    \"items\": [\r\n      {\r\n        \"id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n        \"priority\": 0,\r\n        \"type\": \"energy\",\r\n        \"name\": \"Unlimited energy\",\r\n        \"description\": \"100% unlimited energy! Use as much as you need without any over-usage fees, ever.\",\r\n        \"available\": true,\r\n        \"cost\": {\r\n          \"id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n          \"per_month\": \"200.00\",\r\n          \"per_person_per_month\": \"100.00\",\r\n          \"per_person_per_week\": \"25.00\",\r\n          \"created_at\": \"2022-09-30T09:13:36Z\",\r\n          \"updated_at\": \"2022-09-30T09:13:36Z\"\r\n        },\r\n        \"created_at\": \"2022-09-30T09:13:36Z\",\r\n        \"updated_at\": \"2022-09-30T09:13:36Z\",\r\n        \"metadata\": [\r\n          {\r\n            \"id\": \"01838daa-eb24-7c54-bac5-ca4eedab22f3\",\r\n            \"meta_key\": \"available_description\",\r\n            \"meta_value\": \"water included in council tax\",\r\n            \"created_at\": \"2022-09-30T09:13:36Z\",\r\n            \"updated_at\": \"2022-09-30T09:13:36Z\"\r\n          }\r\n        ]\r\n      }\r\n    ],\r\n    \"created_at\": \"2022-09-30T09:13:36Z\",\r\n    \"updated_at\": \"2022-09-30T09:13:36Z\"\r\n  }\r\n}"}],"_postman_id":"3c32f52e-ccfe-42b0-ad1d-d213aecb8d74"}],"id":"d0d06e83-cc27-4880-b849-b88037ddfb90","description":"<p>Quote entities represent a total monthly cost, quote items with costs and metadata.</p>\n","_postman_id":"d0d06e83-cc27-4880-b849-b88037ddfb90","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"scope","value":"<scope>"},{"key":"grant_type","value":"<grant_type>"}]},"isInherited":true,"source":{"_postman_id":"e489efaa-b898-4a6a-a38d-055c34e13f19","id":"e489efaa-b898-4a6a-a38d-055c34e13f19","name":"Affiliate API","type":"collection"}}}],"auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"scope","value":"<scope>"},{"key":"grant_type","value":"<grant_type>"}]}},"variable":[{"id":"588d57bc-4a31-4e9b-b056-b9a70e722764","key":"baseUrl","value":"https://partnerships-sandbox.oneutilitybill.co/api/v1"}]}