Skip to Content
API v1EndpointsBills Endpoints

Bills Endpoints

Bills functionality is UK-only. The bills system integrates with Huddle (third-party bills provider) and uses a separate housr_bills database.

Get Quotes

File: api/getQuotes.php Method: POST Auth: Required JWT (POST body)

ParamTypeDescription
jwtstringUser JWT
addressarray/stringProperty address
fullAddressstringConcatenated address string
addressIdstringHuddle address ID
startDatestringTenancy start date
endDatestringTenancy end date
numberOfTenantsintNumber of tenants

Flow:

  1. Validates JWT
  2. Calls Huddle API getAddresses() to resolve address
  3. Validates tenancy length (9.5-12 months) and tenant count (1-12)
  4. Fetches quotes from Huddle
  5. Updates HubSpot with bills quote stage

Accept Quote

File: api/acceptQuote.php Method: POST Auth: Required JWT

Accepts a bills quote. Triggers HubSpot deal creation.

Past Quotes

File: api/pastQuotes.php Method: POST Auth: Required JWT

Returns previous bills quotes for the user.

Save Bills Quote

File: api/saveBillsQuote.php Method: POST Auth: Required JWT

Saves a bills quote for later.

Get Bills Data

File: api/getBillsData.php Method: GET Auth: Required JWT (Authorization header)

ParamTypeDescription
contractIdquery stringOptional specific contract ID

Returns comprehensive bills data for a user’s contract:

  • payments - Payment history from Huddle
  • schedule - Scheduled payments from Huddle
  • contract - House contract details from Huddle
  • tenancies - Tenant names and images
  • services - Active services from Huddle

Get Bills Prices

File: api/getBillsPrices.php Method: POST

Returns bills pricing data.

Get User Bills Info

File: api/getUserBillsInfo.php Method: POST Auth: Required JWT

Returns the user’s bills signup information.

Get House Bills Details

File: api/getHouseBillsDetails.php Method: POST

Returns bills details for a specific house.

Add Bill Order

File: api/add_bill_order.php Method: POST Auth: Required JWT

Creates a new bills order.

Add Bill Order to Housemates

File: api/add_bill_order_to_housemates.php Method: POST Auth: Required JWT

Extends a bills order to other housemates.

Add Bills Housemates

File: api/addBillsHousemates.php Method: POST Auth: Required JWT

Adds housemates to a bills account.

Add to Bills List

File: api/addToBillsList.php Method: POST

Adds a property to the bills list.

Bills Lead Email

File: api/billsLeadEmail.php Method: POST

Sends a bills lead email.

Get Bill Order ID

File: api/get_bills_order_id.php Method: POST Auth: Required JWT

Retrieves the bills order ID for a user.

Get Direct Debit Form

File: api/getDirectDebitForm.php Method: POST Auth: Required JWT

Returns the direct debit setup form/link.

Remove Self from Order

File: api/remove_self_from_order.php Method: POST Auth: Required JWT

Removes the user from a bills order.

Meter Readings

Get House Meters

File: api/getHouseMeters.php Method: POST Auth: Required JWT

Returns meter information for the user’s house.

Get Meter Readings

File: api/getMeterReadings.php Method: POST Auth: Required JWT

Returns meter reading history.

Get Meter Readings Data

File: api/getMeterReadingsData.php Method: POST Auth: Required JWT

Returns detailed meter readings data.

Submit Meter Reading

File: api/submitMeterReading.php Method: POST Auth: Required JWT

Submits a new meter reading.

Request Smart Meter

File: api/requestSmartMeter.php Method: POST Auth: Required JWT

Requests a smart meter installation.

Broadband

Book Broadband Slot

File: api/bookBroadbandSlot.php Method: POST Auth: Required JWT

Books a broadband installation slot.

Upgrade Broadband

File: api/upgradeBroadband.php Method: POST Auth: Required JWT

Upgrades the broadband package. Also updates the HubSpot deal with new speed and price.

Broadband Help

File: api/broadbandHelp.php Method: POST Auth: Required JWT

Submits a broadband help request.

Website Bills Submissions

File: api/websiteBillSubmissions.php Method: POST

Handles bills submissions from the website.

Huddle API Integration

File: api/huddleApi.php

Core integration with the Huddle bills provider API. Provides functions for:

  • Address lookup
  • Quote generation
  • Contract management
  • Payment tracking
  • Service management

Uses HMAC signature-based authentication with the Huddle API. Signature requirements are defined in api/include/signatureStringRequirements.json.

Bills Utility Files

FilePurpose
utils/billQuoteUtils.phpQuote-related utilities
utils/billsPriceUtils.phpgetBillsIncludedAgents(), getBillsPriceSelectable(), calculateBillsPriceForAgent()
utils/houseBillPriceUtils.phpHouse-specific bill price calculation
utils/billsSignupUtils.phpBills signup handling
utils/externalBillsUtils.phpExternal bills integration
utils/billsWelcomeEmailUtils.phpBills welcome email generation
utils/getBillsPrice.phpSimple bills price lookup
Last updated on