bellhop-partners-typescript
v0.1.4
Published
Client for partner-api
Downloads
1
Maintainers
Readme
Bellhop
Bellhop's Partner API
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 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
first_name: string
last_name: string
lead_type: LeadType
lead_record_type: LeadRecordType
description: string
external_id: string
lead_source: string
email: string
phone: string
origin_postal_code: string
origin_street: string
origin_city: string
origin_state: string
origin_square_feet: number
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: string
🔄 Return
🌐 Endpoint
/leads
POST
bellhop.lead.delete
Cancel Lead
🛠️ Usage
const deleteResponse = await bellhop.lead.delete({
leadId: "leadId_example",
});
⚙️ Parameters
leadId: string
🌐 Endpoint
/leads/{lead_id}
DELETE
bellhop.lead.get
Get Lead
🛠️ Usage
const getResponse = await bellhop.lead.get({
leadId: "leadId_example",
});
⚙️ Parameters
leadId: string
🔄 Return
🌐 Endpoint
/leads/{lead_id}
GET
bellhop.lead.list
List Leads
🛠️ Usage
const listResponse = await bellhop.lead.list({});
⚙️ Parameters
email: string
🔄 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
description: string
leadId: string
close_date: string
load_date: string
🔄 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
line_1: string
city: string
state: string
postal_code: string
property_type: PropertyType
Type of the property.
line_2: string
country: string
rooms: number
Number of rooms in the property.
area: number
Total area of the property in square feet.
garage: boolean
Indicates whether the property has a garage or not.
stories: number
Number of stories or floors in the property.
floor: number
Floor number of the property.
attic: boolean
Indicates whether the property has an attic or not.
basement: boolean
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
quoteId: string
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
originPostalCode: string
destinationPostalCode: string
🔄 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
customer: CreateQuoteRequestCustomer
start_datetime: string
Start date and time of the quote
service_code: string
Services to be quoted
locations: Record<string, LocationRequest
>
Mapping locations and their sequence
inventory: SetQuoteInventoryRequestNullable
🔄 Return
🌐 Endpoint
/quotes
POST
bellhop.quote.deleteInventory
Delete Quote Inventory
🛠️ Usage
const deleteInventoryResponse = await bellhop.quote.deleteInventory({
quoteId: "quoteId_example",
});
⚙️ Parameters
quoteId: string
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
quoteId: string
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
quoteId: string
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
area: number
The area of the property in square feet.
rooms: QuoteInventoryRoom
[]
List of rooms in the property.
access_flags: SetQuoteInventoryRequestAccessFlags
quoteId: string
UUID of the inventory
intent: MovingIntentNullable
The estimated amount of belongings to move.
additional_items: QuoteInventoryItem
[]
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
serviceGroupId: string
UUID of the service group
requestBody: string
[]
🔄 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
quoteId: string
UUID of the quote
service_codes: ServiceType
[]
List of service codes
locations: string
[]
List of location ids
start_datetime: string
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
serviceGroupId: string
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
start_date: string
Date of earliest flexible service quote to generate
end_date: string
Date of latest flexible service quote to generate
quoteId: string
UUID of the source quote
serviceGroupId: string
UUID of the Service Group to use as a template for the flexible service groups
local_hours: number
[]
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
quoteId: string
UUID of the quote
serviceGroupId: string
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
quoteId: string
UUID of the quote
serviceGroupId: string
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
flexible_quote_id: string
quoteId: string
UUID of the quote
serviceGroupId: string
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
service_workers: ServiceWorkers
[]
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.
quoteId: string
UUID of the quote
serviceGroupId: string
UUID of the service group
duration: number
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