Table of Contents
- Installation
- Getting Started
-
Reference
bellhop.lead.create
bellhop.lead.delete
bellhop.lead.get
bellhop.lead.list
bellhop.lead.update
bellhop.location.create
bellhop.order.create
bellhop.postalCode.serviceability
bellhop.quote.create
bellhop.quote.deleteInventory
bellhop.quote.get
bellhop.quote.getInventory
bellhop.quote.updateInventory
bellhop.quoteServiceGroup.changeLocations
bellhop.quoteServiceGroup.create
bellhop.quoteServiceGroup.createEstimate
bellhop.quoteServiceGroup.createFlexible
bellhop.quoteServiceGroup.delete
bellhop.quoteServiceGroup.get
bellhop.quoteServiceGroup.update
bellhop.quoteServiceGroup.updateServices
Installation
npm |
pnpm |
yarn |
---|---|---|
npm i bellhop-partners-typescript |
pnpm i bellhop-partners-typescript |
yarn add bellhop-partners-typescript |
Getting Started
import { Bellhop } from "bellhop-partners-typescript";
const bellhop = new Bellhop({
// Defining the base path is optional and defaults to https://partners.bellhops.dev/v5
// basePath: "https://partners.bellhops.dev/v5",
oauthClientId: "CLIENT_ID",
oauthClientSecret: "CLIENT_SECRET",
});
const createResponse = await bellhop.lead.create({
first_name: "first_name_example",
last_name: "last_name_example",
lead_type: "string_example",
lead_record_type: "string_example",
origin_postal_code: "85001",
origin_state: "AZ",
destination_postal_code: "85001",
destination_state: "AZ",
load_date: "2021-01-01",
close_date: "2021-01-01",
});
console.log(createResponse);
Reference
bellhop.lead.create
Create Lead
🛠️ Usage
const createResponse = await bellhop.lead.create({
first_name: "first_name_example",
last_name: "last_name_example",
lead_type: "string_example",
lead_record_type: "string_example",
origin_postal_code: "85001",
origin_state: "AZ",
destination_postal_code: "85001",
destination_state: "AZ",
load_date: "2021-01-01",
close_date: "2021-01-01",
});
⚙️ Parameters
string
first_name: string
last_name: LeadType
lead_type: LeadRecordType
lead_record_type: string
description: string
external_id: string
lead_source: string
email: string
phone: string
origin_postal_code: string
origin_street: string
origin_city: string
origin_state: number
origin_square_feet: string
destination_postal_code: string
destination_street: string
destination_city: string
destination_state: string
clickid: string
gclid: string
utm_medium: string
utm_source: string
utm_campaign: string
msclkid: string
load_date: string
close_date: 🔄 Return
🌐 Endpoint
/leads
POST
bellhop.lead.delete
Cancel Lead
🛠️ Usage
const deleteResponse = await bellhop.lead.delete({
leadId: "leadId_example",
});
⚙️ Parameters
string
leadId: 🌐 Endpoint
/leads/{lead_id}
DELETE
bellhop.lead.get
Get Lead
🛠️ Usage
const getResponse = await bellhop.lead.get({
leadId: "leadId_example",
});
⚙️ Parameters
string
leadId: 🔄 Return
🌐 Endpoint
/leads/{lead_id}
GET
bellhop.lead.list
List Leads
🛠️ Usage
const listResponse = await bellhop.lead.list({});
⚙️ Parameters
string
email: 🔄 Return
🌐 Endpoint
/leads
GET
bellhop.lead.update
Update attributes of a lead.
:lead_id: The ID of the lead to update. This can be either the bellhop id or the external_id.
🛠️ Usage
const updateResponse = await bellhop.lead.update({
leadId: "leadId_example",
description: "description_example",
});
⚙️ Parameters
string
description: string
leadId: string
close_date: string
load_date: 🔄 Return
🌐 Endpoint
/leads/{lead_id}
PATCH
bellhop.location.create
Create quoting location object from address
Create Quoting Location standardizes input address via USPS and generates geo-location details Google Maps APIs. The location id is a hash of the required fields on the location object.
🛠️ Usage
const createResponse = await bellhop.location.create({
line_1: "line_1_example",
city: "city_example",
state: "state_example",
postal_code: "postal_code_example",
country: "US",
property_type: "string_example",
});
⚙️ Parameters
string
line_1: string
city: string
state: string
postal_code: PropertyType
property_type: Type of the property.
string
line_2: string
country: number
rooms: Number of rooms in the property.
number
area: Total area of the property in square feet.
boolean
garage: Indicates whether the property has a garage or not.
number
stories: Number of stories or floors in the property.
number
floor: Floor number of the property.
boolean
attic: Indicates whether the property has an attic or not.
boolean
basement: Indicates whether the property has a basement or not.
🔄 Return
🌐 Endpoint
/locations
POST
bellhop.order.create
Creates an order from a quote
🛠️ Usage
const createResponse = await bellhop.order.create({
quoteId: "quoteId_example",
});
⚙️ Parameters
string
quoteId: Quote ID to generate order from
🔄 Return
🌐 Endpoint
/orders/{quote_id}
POST
bellhop.postalCode.serviceability
Get Postal Codes Serviceability V5
🛠️ Usage
const serviceabilityResponse = await bellhop.postalCode.serviceability({
originPostalCode: "originPostalCode_example",
});
⚙️ Parameters
string
originPostalCode: string
destinationPostalCode: 🔄 Return
PostalCodesServiceabilityResponse
🌐 Endpoint
/postal-codes/serviceability
GET
bellhop.quote.create
Creates a quote
Creates a quote for a given customer using the provided locations and service code. The LOCALFULLSERVICE service code will generate a service group with LOADINGUNLOADING and TRANSIT services. All other service codes generate service groups with a single service.
🛠️ Usage
const createResponse = await bellhop.quote.create({
customer: {
first_name: "first_name_example",
last_name: "last_name_example",
phone: "phone_example",
email: "email_example",
},
start_datetime: "2024-02-06T20:20:06.515155",
service_code: "LOCALFULLSERVICE",
locations: {
key: {
line_1: "line_1_example",
city: "city_example",
state: "state_example",
postal_code: "postal_code_example",
country: "US",
},
},
});
⚙️ Parameters
CreateQuoteRequestCustomer
customer: string
start_datetime: Start date and time of the quote
string
service_code: Services to be quoted
LocationRequest
>
locations: Record<string, Mapping locations and their sequence
SetQuoteInventoryRequestNullable
inventory: 🔄 Return
🌐 Endpoint
/quotes
POST
bellhop.quote.deleteInventory
Delete Quote Inventory
🛠️ Usage
const deleteInventoryResponse = await bellhop.quote.deleteInventory({
quoteId: "quoteId_example",
});
⚙️ Parameters
string
quoteId: UUID of the inventory
🌐 Endpoint
/quotes/{quote_id}/inventory
DELETE
bellhop.quote.get
Fetch a quote by ID
🛠️ Usage
const getResponse = await bellhop.quote.get({
quoteId: "quoteId_example",
});
⚙️ Parameters
string
quoteId: UUID of the quote
🔄 Return
🌐 Endpoint
/quotes/{quote_id}
GET
bellhop.quote.getInventory
Get Quote Inventory
🛠️ Usage
const getInventoryResponse = await bellhop.quote.getInventory({
quoteId: "quoteId_example",
});
⚙️ Parameters
string
quoteId: UUID of the source quote
🔄 Return
🌐 Endpoint
/quotes/{quote_id}/inventory
GET
bellhop.quote.updateInventory
Update Quote Inventory
🛠️ Usage
const updateInventoryResponse = await bellhop.quote.updateInventory({
quoteId: "quoteId_example",
area: 1000,
rooms: [
{
slug: "string_example",
count: 1,
},
],
access_flags: {
elevator: true,
elevator_reserved: true,
long_walk_to_truck: true,
stair_flights: 1,
},
additional_items: [
{
slug: "string_example",
count: 1,
},
],
});
⚙️ Parameters
number
area: The area of the property in square feet.
QuoteInventoryRoom
[]
rooms: List of rooms in the property.
SetQuoteInventoryRequestAccessFlags
access_flags: string
quoteId: UUID of the inventory
MovingIntentNullable
intent: The estimated amount of belongings to move.
QuoteInventoryItem
[]
additional_items: List of additional bulky items in the property.
🔄 Return
🌐 Endpoint
/quotes/{quote_id}/inventory
PUT
bellhop.quoteServiceGroup.changeLocations
Overwrite the locations on a service group
The locations included in the request are overwritten as the locations on the service group maintaining the sequence in the request. This action triggers a re-estimation of the service group using the new locations.
🛠️ Usage
const changeLocationsResponse = await bellhop.quoteServiceGroup.changeLocations(
{
serviceGroupId: "service_group_id_example",
requestBody: [
"7fec6c0eeb4a44f290b24edb3abe4b9b",
"1b6664f3d42b4edea302a4c2dc18dbd9",
],
}
);
⚙️ Parameters
string
serviceGroupId: UUID of the service group
string
[]
requestBody: 🔄 Return
🌐 Endpoint
/quotes/service_groups/{service_group_id}/locations
PUT
bellhop.quoteServiceGroup.create
Creates a new service group
A service group is a collection of services that are performed at the same time and location. The created service group will be created with the provided services, locations, and start date time. The workers, duration, and end date time will be estimated based on the locations and inventory attached to the quote.
🛠️ Usage
const createResponse = await bellhop.quoteServiceGroup.create({
quoteId: "quoteId_example",
service_codes: ["LOADINGUNLOADING"],
locations: [
"a4cef656c2a04ca4aa6d19cee4eb9b7e",
"b4cef656c2a04ca4aa6d19cee4eb9b7e",
],
start_datetime: "2021-01-01T12:00:00",
});
⚙️ Parameters
string
quoteId: UUID of the quote
ServiceType
[]
service_codes: List of service codes
string
[]
locations: List of location ids
string
start_datetime: Start datetime of service group
🔄 Return
🌐 Endpoint
/quotes/{quote_id}/service-groups
POST
bellhop.quoteServiceGroup.createEstimate
Get Service Group Estimate
🛠️ Usage
const createEstimateResponse = await bellhop.quoteServiceGroup.createEstimate({
serviceGroupId: "serviceGroupId_example",
});
⚙️ Parameters
string
serviceGroupId: UUID of the service group
🔄 Return
🌐 Endpoint
/quotes/service-groups/{service_group_id}/estimate
POST
bellhop.quoteServiceGroup.createFlexible
Creates an array of flexible service groups from a service group
Generate an array of flexible service groups. The services and locations will be copied from the source service group. One flexible service group will be created for each day and hour combination in the input.
🛠️ Usage
const createFlexibleResponse = await bellhop.quoteServiceGroup.createFlexible({
quoteId: "quoteId_example",
serviceGroupId: "serviceGroupId_example",
start_date: "1970-01-01",
end_date: "1970-01-01",
local_hours: [8, 9, 10, 11, 12],
});
⚙️ Parameters
string
start_date: Date of earliest flexible service quote to generate
string
end_date: Date of latest flexible service quote to generate
string
quoteId: UUID of the source quote
string
serviceGroupId: UUID of the Service Group to use as a template for the flexible service groups
number
[]
local_hours: List of hours in local time to generate quotes for: [8, 9, 10, 11, 12]
🔄 Return
🌐 Endpoint
/quotes/{quote_id}/service-groups/{service_group_id}/flexible
POST
bellhop.quoteServiceGroup.delete
Delete a service group by quote ID and service group ID
🛠️ Usage
const deleteResponse = await bellhop.quoteServiceGroup.delete({
quoteId: "quoteId_example",
serviceGroupId: "serviceGroupId_example",
});
⚙️ Parameters
string
quoteId: UUID of the quote
string
serviceGroupId: UUID of the service group to be deleted
🌐 Endpoint
/quotes/{quote_id}/service-group/{service_group_id}
DELETE
bellhop.quoteServiceGroup.get
Fetch a service group by quote ID and service group ID
🛠️ Usage
const getResponse = await bellhop.quoteServiceGroup.get({
quoteId: "quoteId_example",
serviceGroupId: "serviceGroupId_example",
});
⚙️ Parameters
string
quoteId: UUID of the quote
string
serviceGroupId: UUID of the service group
🔄 Return
🌐 Endpoint
/quotes/{quote_id}/service-group/{service_group_id}
GET
bellhop.quoteServiceGroup.update
Replaces a service group with a flexible service group
Replaces the existing service group with the selected flexible service group.
🛠️ Usage
const updateResponse = await bellhop.quoteServiceGroup.update({
quoteId: "quoteId_example",
serviceGroupId: "serviceGroupId_example",
flexible_quote_id: "flexible_quote_id_example",
});
⚙️ Parameters
string
flexible_quote_id: string
quoteId: UUID of the quote
string
serviceGroupId: UUID of the service group
🔄 Return
🌐 Endpoint
/quotes/{quote_id}/service-groups/{service_group_id}
PATCH
bellhop.quoteServiceGroup.updateServices
Update the service configuration on a service group
Update services, workers and duration on a service group. the service_workers object is a mapping of service code and number of workers.
Only the included service codes will be retained on the service group.
Any excluded services will be removed.
🛠️ Usage
const updateServicesResponse = await bellhop.quoteServiceGroup.updateServices({
quoteId: "quoteId_example",
serviceGroupId: "serviceGroupId_example",
service_workers: [
{
service_code: "string_example",
workers: 1,
},
],
});
⚙️ Parameters
ServiceWorkers
[]
service_workers: Mapping of service code and number of workers. Only the included service codes will be retained on the service group. Any excluded services will be removed.
string
quoteId: UUID of the quote
string
serviceGroupId: UUID of the service group
number
duration: Duration for all services in group
🔄 Return
🌐 Endpoint
/quotes/{quote_id}/service-groups/{service_group_id}/services
PUT
Author
This TypeScript package is automatically generated by Konfig