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)
| Param | Type | Description |
|---|---|---|
jwt | string | User JWT |
address | array/string | Property address |
fullAddress | string | Concatenated address string |
addressId | string | Huddle address ID |
startDate | string | Tenancy start date |
endDate | string | Tenancy end date |
numberOfTenants | int | Number of tenants |
Flow:
- Validates JWT
- Calls Huddle API
getAddresses()to resolve address - Validates tenancy length (9.5-12 months) and tenant count (1-12)
- Fetches quotes from Huddle
- 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)
| Param | Type | Description |
|---|---|---|
contractId | query string | Optional specific contract ID |
Returns comprehensive bills data for a user’s contract:
payments- Payment history from Huddleschedule- Scheduled payments from Huddlecontract- House contract details from Huddletenancies- Tenant names and imagesservices- 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
| File | Purpose |
|---|---|
utils/billQuoteUtils.php | Quote-related utilities |
utils/billsPriceUtils.php | getBillsIncludedAgents(), getBillsPriceSelectable(), calculateBillsPriceForAgent() |
utils/houseBillPriceUtils.php | House-specific bill price calculation |
utils/billsSignupUtils.php | Bills signup handling |
utils/externalBillsUtils.php | External bills integration |
utils/billsWelcomeEmailUtils.php | Bills welcome email generation |
utils/getBillsPrice.php | Simple bills price lookup |