API Reference

This section provides detailed documentation for using ABConnect API endpoints.

API Access Methods

Raw API Access

Direct access to any API endpoint:

# Basic GET request
ab api raw get /api/companies/{id} id=123e4567-e89b-12d3-a456-426614174000

# GET with query parameters
ab api raw get /api/companies/search page=1 per_page=20 name=ABC

# POST with data
ab api raw post /api/jobs data=@job.json

# PUT with inline data
ab api raw put /api/contacts/{id} id=123 data='{"name":"John Doe"}'

# DELETE request
ab api raw delete /api/jobs/{id} id=JOB-2024-001

Python Usage

from ABConnect import ABConnectAPI

api = ABConnectAPI()

# Raw API access
result = api.raw.get('/api/companies/search', page=1, per_page=20)

# Tagged resource access
companies = api.companies.search(name='ABC', active=True)

# Friendly method access
company = api.companies.get_by_code('ABC123')

Authentication

class ABConnect.api.auth.TokenStorage[source]

Bases: ABC

property identity_url
property expired: bool
abstractmethod get_token()[source]

Return the current bearer token.

abstractmethod set_token(token)[source]

Store a new token.

abstractmethod refresh_token()[source]

Refresh the token if needed and return the updated token.

class ABConnect.api.auth.FileTokenStorage(*args, **kwargs)[source]

Bases: TokenStorage

__init__(*args, **kwargs)[source]
get_token()[source]

Return the current bearer token.

set_token(token)[source]

Store a new token.

refresh_token()[source]

Refresh the token if needed and return the updated token.

class ABConnect.api.auth.SessionTokenStorage(*args, **kwargs)[source]

Bases: TokenStorage

__init__(*args, **kwargs)[source]
get_token()[source]

Return the current bearer token.

set_token(token)[source]

Store a new token.

refresh_token()[source]

Refresh the token if needed and return the updated token.

API Client

class ABConnect.api.client.ABConnectAPI(*args, **kwargs)[source]

Bases: object

API client for ABConnect

example usage: >>> from ABConnect import ABConnectAPI >>> abapi = ABConnectAPI(env=’staging’) >>> companies = abapi.companies.list() >>> print(companies)

property models

Access to all API models and enums.

Usage:

abapi = ABConnectAPI() m = abapi.models m.ForgotType.USERNAME m.ServiceBaseResponse

property env: str

Current environment type (‘staging’ or ‘production’).

property env_file: str

Current environment file path.

__init__(*args, **kwargs)[source]

Initialize the API client.

Parameters:
  • env – Environment name (‘staging’, ‘production’, or None for default)

  • username – Optional username override

  • request – Django request object for session-based auth

Generic Endpoints

Query Builder

Swagger Parser

class ABConnect.api.swagger.SwaggerParser(swagger_path=None)[source]

Bases: object

Parser for OpenAPI/Swagger specifications.

__init__(swagger_path=None)[source]

Initialize parser with swagger specification.

Parameters:

swagger_path (Optional[str]) – Path to swagger.json file. If None, uses the bundled swagger.json

parse()[source]

Parse all endpoints and group by resource.

Return type:

Dict[str, List[EndpointDefinition]]

Returns:

Dictionary mapping resource names to their endpoint definitions

resolve_ref(ref)[source]

Resolve a $ref reference.

Parameters:

ref (str) – Reference string like ‘#/components/schemas/CompanyDetails’

Return type:

Dict[str, Any]

Returns:

The resolved object

get_endpoints()[source]

Get all endpoint definitions as a flat list.

Return type:

List[EndpointDefinition]

parse_by_tags()[source]

Parse all endpoints and group by their tags.

Return type:

Dict[str, List[EndpointDefinition]]

Returns:

Dictionary mapping tag names to their endpoint definitions

get_schemas()[source]

Get all schema definitions.

Return type:

Dict[str, Dict[str, Any]]

get_endpoint_by_operation_id(operation_id)[source]

Find an endpoint by its operation ID.

Return type:

Optional[EndpointDefinition]

class ABConnect.api.swagger.EndpointDefinition(path, method, operation_id=None, summary=None, description=None, tags=<factory>, parameters=<factory>, request_body=None, responses=<factory>, deprecated=False)[source]

Bases: object

Represents a single API endpoint definition.

path: str
method: str
operation_id: Optional[str] = None
summary: Optional[str] = None
description: Optional[str] = None
tags: List[str]
parameters: List[Parameter]
request_body: Optional[RequestBody] = None
responses: Dict[str, Dict[str, Any]]
deprecated: bool = False
property resource_name: str

Extract resource name from path or tags.

property method_name: str

Generate a Python method name for this endpoint.

get_path_parameters()[source]

Get only path parameters.

Return type:

List[Parameter]

get_query_parameters()[source]

Get only query parameters.

Return type:

List[Parameter]

__init__(path, method, operation_id=None, summary=None, description=None, tags=<factory>, parameters=<factory>, request_body=None, responses=<factory>, deprecated=False)

Response Models

ABConnect API models package.

Auto-generated from swagger.json specification. Contains Pydantic models for all API schemas.

class ABConnect.api.models.ABConnectBaseModel(**data)[source]

Bases: BaseModel

Base class for all ABConnect API models.

Provides common configuration and utilities.

__repr__()[source]

Return a pretty, indented, one-field-per-line representation.

Return type:

str

classmethod check(data, exclude_unset=True)[source]

Validate data and return as dict(s) with proper aliasing and JSON serialization.

This method validates incoming data against the model schema and returns it as a dict (or list of dicts) suitable for API requests. All special types (datetime, UUID, etc.) are automatically serialized to JSON-compatible formats.

Parameters:
  • data (Union[Dict[str, Any], List[Dict[str, Any]], TypeVar(T, bound= ABConnectBaseModel), List[TypeVar(T, bound= ABConnectBaseModel)]]) – Data to validate - can be: - Single dict - List of dicts - Single model instance - List of model instances

  • exclude_unset (bool) – If True (default), only include fields that were explicitly provided in the input data. If False, include all fields with their default values.

Returns:

  • camelCase field names (by_alias=True)

  • JSON-serializable values (mode=’json’) - datetime as ISO strings, etc.

  • Only fields that were actually provided (exclude_unset=True by default)

Return type:

Validated data as dict(s) with

Raises:

ValidationError – If data doesn’t match the model schema

Example

# Only sends fields that were provided, datetime serialized to ISO string data = {“ratesKey”: “abc”, “shipOutDate”: datetime.now()} SetRateModel.check(data) # {“ratesKey”: “abc”, “shipOutDate”: “2025-10-19T…”} # carrierAccountId and active are NOT included (weren’t provided)

# To include all fields with defaults: SetRateModel.check(data, exclude_unset=False)

json()[source]

Return the model data as a JSON-serializable dict with camelCase keys.

Return type:

Dict[str, Any]

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ABConnect.api.models.IdentifiedModel(**data)[source]

Bases: ABConnectBaseModel

Base for models with ID fields (63 schemas have ‘id’).

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: Union[str, int, None]
class ABConnect.api.models.TimestampedModel(**data)[source]

Bases: ABConnectBaseModel

Base for models with timestamp fields.

Used by models with created/modified tracking: - createdDate: 21 schemas - modifiedDate: 18 schemas - createdBy: 17 schemas - modifiedBy: 10 schemas

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

created_date: Optional[datetime]
modified_date: Optional[datetime]
created_by: Optional[str]
modified_by: Optional[str]
class ABConnect.api.models.ActiveModel(**data)[source]

Bases: ABConnectBaseModel

Base for models with isActive field (30 schemas).

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

is_active: Optional[bool]
class ABConnect.api.models.CompanyRelatedModel(**data)[source]

Bases: ABConnectBaseModel

Base for models related to companies.

Used by models with company associations: - companyId: 23 schemas - companyName: 30 schemas

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

company_id: Optional[str]
company_name: Optional[str]
class ABConnect.api.models.JobRelatedModel(**data)[source]

Bases: ABConnectBaseModel

Base for models related to jobs.

Used by models with job associations: - jobId: 20 schemas - jobID: 13 schemas (legacy)

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

job_id: Optional[str]
class ABConnect.api.models.FullAuditModel(**data)[source]

Bases: IdentifiedModel, TimestampedModel, ActiveModel

Complete audit model with ID, timestamps, and active status.

For models that need full audit trail tracking.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ABConnect.api.models.CompanyAuditModel(**data)[source]

Bases: FullAuditModel, CompanyRelatedModel

Company-related model with full audit trail.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ABConnect.api.models.JobAuditModel(**data)[source]

Bases: FullAuditModel, JobRelatedModel

Job-related model with full audit trail.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ABConnect.api.models.CarrierAPI(value)[source]

Bases: int, Enum

CarrierAPI enumeration

UNK = 0
LMI = 1
FEDEX = 2
UPS = 3
ROADRUNNER = 4
REMOVED = 5
DHL = 6
MAERSK = 7
TEAMWW = 8
ESTES = 9
FORWARDAIR = 10
GLOBALTRANZ = 11
FEDEXFREIGHT = 12
USPS = 20
class ABConnect.api.models.CommercialCapabilities(value)[source]

Bases: IntFlag

CommercialCapabilities flags enumeration - supports combinations like 7 (PARCEL|SOME_COMMERCIAL|FULL_COMMERCIAL)

PARCEL = 1
SOME_COMMERCIAL = 2
FULL_COMMERCIAL = 4
CAN_GET_API_LEADS = 8
CARD_PAYMENTS = 16
ACH_PAYMENTS = 32
PREFER_STOCK_BOXES = 64
DONT_SUPPORT_CUSTOM_BOXES = 128
ELABEL_ONLY = 256
class ABConnect.api.models.CopyMaterialsFrom(value)[source]

Bases: int, Enum

CopyMaterialsFrom enumeration

NONE = 0
PARENT = 1
CORPORATE = 2
class ABConnect.api.models.DashboardType(value)[source]

Bases: int, Enum

DashboardType enumeration

INBOUND = 1
RECENTESTIMATES = 11
INHOUSE = 12
OUTBOUND = 13
LOCALDELIVERIES = 14
class ABConnect.api.models.DocumentSource(value)[source]

Bases: int, Enum

DocumentSource enumeration

JOB = 1
SHIPMENT = 4
COMPANY = 8
class ABConnect.api.models.DocumentType(value)[source]

Bases: int, Enum

DocumentType enumeration for document uploads and management.

LABEL = 1
USAR = 2
CREDIT_CARD_AUTH = 3
BOL = 4
ELECTRONIC_INVOICE = 5
ITEM_PHOTO = 6
OTHER = 7
MANIFEST = 8
COMMERCIAL_INVOICE = 9
PRO_FORMA_INVOICE = 10
PACKING_LIST = 11
INTERNATIONAL_FORMS = 12
AIR_WAYBILL = 13
TERMS_AND_CONDITIONS = 14
CUSTOMER_QUOTE = 15
PICKUP_RECEIPT = 16
EMAIL_CONTENT = 17
UPS_CONTROL_LOG = 18
DELETED_LABEL = 19
class ABConnect.api.models.ForgotType(value)[source]

Bases: int, Enum

ForgotType enumeration

PASSWORD = 0
USERNAME = 1
class ABConnect.api.models.FormType(value)[source]

Bases: int, Enum

FormType enumeration for job forms

NOBREAKDOWN = 0
BREAKDOWN = 1
BLANK = 2
CUSTOMIZED = 3
class ABConnect.api.models.GeometryType(value)[source]

Bases: int, Enum

GeometryType enumeration

UNKNOWN = 0
POLYGON = 1
CIRCLE = 2
class ABConnect.api.models.HistoryCodeABCState(value)[source]

Bases: int, Enum

HistoryCodeABCState enumeration

ITR = 1
DLY = 2
EXC = 3
DEC = 4
class ABConnect.api.models.InheritSettingFrom(value)[source]

Bases: int, Enum

InheritSettingFrom enumeration

NONE = 0
PARENT = 1
CORPORATE = 2
class ABConnect.api.models.JobAccessLevel(value)[source]

Bases: int, Enum

JobAccessLevel enumeration

NONE = 0
OWNER = 1
CUSTOMER = 2
PICKUP_AGENT = 4
PACKAGING_AGENT = 8
DELIVERY_AGENT = 16
ALL_AGENTS = 28
AGENTS = 29
class ABConnect.api.models.JobContactType(value)[source]

Bases: int, Enum

JobContactType enumeration

CUSTOMER = 0
PICKUPS = 1
DELIVERY = 2
class ABConnect.api.models.JobType(value)[source]

Bases: int, Enum

JobType enumeration

NONE = 0
PICKPACK = 1
REGULAR = 2
DELIVERY = 3
class ABConnect.api.models.KnownFormId(value)[source]

Bases: int, Enum

KnownFormId enumeration

QUICKSALERECEIPT = 0
CUSTOMERQUOTE = 1
CREDITCARDAUTHORIZATION = 2
UNIVERSALSHIPPINGAGREEMENT = 3
INVOICE = 4
BILLOFLADING = 5
OPERATIONS = 6
ADDRESSLABEL = 7
PACKAGINGSPECIFICATIONS = 8
PACKAGINGLABELS = 9
PACKINGSLIP = 10
ITEMLABELS = 11
VALUE_12 = 12
class ABConnect.api.models.LabelImageType(value)[source]

Bases: int, Enum

LabelImageType enumeration

PDF = 0
ZPL = 1
IMAGE = 2
class ABConnect.api.models.LabelType(value)[source]

Bases: int, Enum

LabelType enumeration

LABEL2X4 = 0
LABEL4X6 = 1
LABEL4X6DOCTAB = 2
LABEL8X11 = 3
LABEL8X11MIRAMAR = 4
LABEL8X11TTC = 5
class ABConnect.api.models.ListSortDirection(value)[source]

Bases: int, Enum

ListSortDirection enumeration

ASC = 0
DESC = 1
class ABConnect.api.models.OperationsFormType(value)[source]

Bases: int, Enum

OperationsFormType enumeration for operations forms

DEFAULT = 0
WITHNOTES = 1
class ABConnect.api.models.PaymentType(value)[source]

Bases: int, Enum

PaymentType enumeration

PREPAID = 0
THIRDPARTY = 1
COLLECT = 2
class ABConnect.api.models.PropertyType(value)[source]

Bases: int, Enum

PropertyType enumeration

RESIDENCE = 1
LIMITED_ACCESS = 2
COMMERCIAL = 3
class ABConnect.api.models.QuoteRequestStatus(value)[source]

Bases: int, Enum

QuoteRequestStatus enumeration

DRAFT = 0
REQUESTED = 1
RESPONSERECEIVED = 2
BIDRECEIVED = 3
DECLINED = 4
SELECTED = 5
CANCELLED = 6
INSTAQUOTED = 7
class ABConnect.api.models.RangeDateEnum(value)[source]

Bases: int, Enum

RangeDateEnum enumeration

DAY = 0
WEEK = 1
MONTH = 2
QUARTER = 3
YEAR = 4
class ABConnect.api.models.RetransTimeZoneEnum(value)[source]

Bases: int, Enum

RetransTimeZoneEnum enumeration

ET = 0
CT = 1
MT = 2
PT = 3
class ABConnect.api.models.SelectedOption(value)[source]

Bases: int, Enum

SelectedOption enumeration

NONE = 0
OPTION100 = 1
OPTION500 = 2
OPTION750 = 3
OPTION1500 = 4
class ABConnect.api.models.SendEmailStatus(value)[source]

Bases: int, Enum

SendEmailStatus enumeration

UNKNOWN = 0
SENT = 1
QUEUED = 2
REJECTED = 4
INVALID = 8
SCHEDULED = 16
BOUNCED = 32
DEFFERED = 64
SOFTBOUNCED = 128
SPAM = 256
UNSUB = 512
class ABConnect.api.models.ServiceType(value)[source]

Bases: int, Enum

ServiceType enumeration

UNDEFINED = 0
PICK = 1
PACK = 2
PICKANDPACK = 3
DELIVERY = 4
class ABConnect.api.models.SortByField(value)[source]

Bases: int, Enum

SortByField enumeration

JobDisplayID = 0
JobMgmtId = 1
CompletedDate = 2
ContactFirstName = 3
ContactFullName = 4
EstimateDate = 5
QuoteDate = 6
PUAddress1 = 7
DelAddress1 = 8
ContactLastName = 9
Name = 10
CreateDate = 11
NoteImportant = 12
NoteCategory = 13
NoteDate = 14
NoteDueDate = 15
NoteComment = 16
NoteAuthor = 17
NoteCompleted = 18
NoteGlobal = 19
NoteShared = 20
CompanyName = 21
City = 22
IndustryType = 23
ContactPhone = 24
ContactEmail = 25
JobNumber = 26
Franchisee = 27
InsuranceType = 28
NoOfPiece = 29
TotalValue = 30
JobDate = 31
INSURANCECOST = 32
CARRIER = 33
INACCTDATE = 34
JobID = 35
Company = 36
BookedDate = 37
Revenue = 38
Profit = 39
GrossMargin = 40
Status = 41
Industry = 42
CustomerZipCode = 43
ReferredBy = 44
ReferredName = 45
ReferedByCategory = 46
Type = 47
IntactStatus = 48
LeadDate = 49
ReferrerPage = 50
EntryURL = 51
SubmissionPage = 52
HowHeard = 53
Email = 54
Phone = 55
ShipFrom = 56
ShipTo = 57
CustomerComments = 58
CurrentBookPrice = 59
CurrentBookProfit = 60
FranchiseeID = 61
IntacctDate = 62
Jobtype = 63
CreatedByUserName = 64
class ABConnect.api.models.StatusEnum(value)[source]

Bases: int, Enum

StatusEnum enumeration

Estimate = 0
Booked = 1
Quoted = 2
Completed = 3
TemplateJob = 4
Cancelled = 5
NotViewed = 6
ABConnect.api.models.rebuild_models()[source]

Rebuild all Pydantic models to resolve forward references.

ABConnect.api.models.__getattr__(name)[source]

Lazy load models to avoid circular imports.

Automatically rebuilds all models on first access to resolve forward references.

Endpoints

The endpoint classes provide specific functionality for different API resources. For detailed documentation of each endpoint, see the API module documentation.

Companies

class ABConnect.api.endpoints.companies.CompaniesEndpoint[source]

Bases: BaseEndpoint

Companies API endpoint operations.

Handles all API operations for /api/companies/* endpoints. Total endpoints: 30

api_path: str = 'companies'
routes = {'GET': Route(method='GET', path='/companies/{id}', request_model=None, response_model='CompanySimple', params={}, _path_param_names={'id'}), 'GET_AVAILABLE_BY_CURRENT_USER': Route(method='GET', path='/companies/availableByCurrentUser', request_model=None, response_model='List[CompanySimple]', params={}, _path_param_names=set()), 'GET_BRANDS': Route(method='GET', path='/companies/brands', request_model=None, response_model='List[CompanyBrandTreeNode]', params={}, _path_param_names=set()), 'GET_BRANDSTREE': Route(method='GET', path='/companies/brandstree', request_model=None, response_model='List[CompanyBrandTreeNode]', params={}, _path_param_names=set()), 'GET_CAPABILITIES': Route(method='GET', path='/companies/{companyId}/capabilities', request_model=None, response_model='CommercialCapabilities', params={}, _path_param_names={'companyId'}), 'GET_CARRIER_ACOUNTS': Route(method='GET', path='/companies/{companyId}/carrierAcounts', request_model=None, response_model='FranchiseeCarrierAccounts', params={}, _path_param_names={'companyId'}), 'GET_DETAILS': Route(method='GET', path='/companies/{companyId}/details', request_model=None, response_model='CompanyDetails', params={}, _path_param_names={'companyId'}), 'GET_FRANCHISEE_ADDRESSES': Route(method='GET', path='/companies/{companyId}/franchiseeAddresses', request_model=None, response_model='List[CompanyAddressInfo]', params={}, _path_param_names={'companyId'}), 'GET_FULLDETAILS': Route(method='GET', path='/companies/{companyId}/fulldetails', request_model=None, response_model='CompanyDetails', params={}, _path_param_names={'companyId'}), 'GET_GEOSETTINGS': Route(method='GET', path='/companies/geosettings', request_model=None, response_model='List[SaveGeoSettingModel]', params={}, _path_param_names=set()), 'GET_GEO_AREA_COMPANIES': Route(method='GET', path='/companies/geoAreaCompanies', request_model=None, response_model='List[CompanyGeoAreaCompanies]', params={}, _path_param_names=set()), 'GET_INFO_FROM_KEY': Route(method='GET', path='/companies/infoFromKey', request_model=None, response_model='CompanyInfo', params={}, _path_param_names=set()), 'GET_INHERITEDPACKAGINGLABOR': Route(method='GET', path='/companies/{companyId}/inheritedpackaginglabor', request_model=None, response_model='PackagingLaborSettings', params={}, _path_param_names={'companyId'}), 'GET_INHERITED_PACKAGING_TARIFFS': Route(method='GET', path='/companies/{companyId}/inheritedPackagingTariffs', request_model=None, response_model='PackagingTariffSettings', params={}, _path_param_names={'companyId'}), 'GET_PACKAGINGLABOR': Route(method='GET', path='/companies/{companyId}/packaginglabor', request_model=None, response_model='PackagingLaborSettings', params={}, _path_param_names={'companyId'}), 'GET_PACKAGINGSETTINGS': Route(method='GET', path='/companies/{companyId}/packagingsettings', request_model=None, response_model='PackagingTariffSettings', params={}, _path_param_names={'companyId'}), 'GET_SEARCH': Route(method='GET', path='/companies/search', request_model=None, response_model='List[SearchCompanyResponse]', params={}, _path_param_names=set()), 'GET_SEARCH_CARRIER_ACCOUNTS': Route(method='GET', path='/companies/search/carrier-accounts', request_model=None, response_model='List[CarrierAccountInfo]', params={}, _path_param_names=set()), 'GET_SUGGEST_CARRIERS': Route(method='GET', path='/companies/suggest-carriers', request_model=None, response_model='List[CarrierCompanyInfo]', params={}, _path_param_names=set()), 'POST_CAPABILITIES': Route(method='POST', path='/companies/{companyId}/capabilities', request_model='CommercialCapabilities', response_model='ServiceBaseResponse', params={}, _path_param_names={'companyId'}), 'POST_CARRIER_ACOUNTS': Route(method='POST', path='/companies/{companyId}/carrierAcounts', request_model='UpdateCarrierAccountsModel', response_model='ServiceBaseResponse', params={}, _path_param_names={'companyId'}), 'POST_FILTERED_CUSTOMERS': Route(method='POST', path='/companies/filteredCustomers', request_model='WebApiDataSourceLoadOptions', response_model='ServiceBaseResponse', params={}, _path_param_names=set()), 'POST_FULLDETAILS': Route(method='POST', path='/companies/fulldetails', request_model='CompanyDetails', response_model='ServiceBaseResponse', params={}, _path_param_names=set()), 'POST_GEOSETTINGS': Route(method='POST', path='/companies/{companyId}/geosettings', request_model='SaveGeoSettingModel', response_model='ServiceBaseResponse', params={}, _path_param_names={'companyId'}), 'POST_LIST': Route(method='POST', path='/companies/list', request_model='TagBoxDataSourceLoadOptions', response_model='ServiceBaseResponse', params={}, _path_param_names=set()), 'POST_PACKAGINGLABOR': Route(method='POST', path='/companies/{companyId}/packaginglabor', request_model='PackagingLaborSettings', response_model='ServiceBaseResponse', params={}, _path_param_names={'companyId'}), 'POST_PACKAGINGSETTINGS': Route(method='POST', path='/companies/{companyId}/packagingsettings', request_model='PackagingTariffSettings', response_model='ServiceBaseResponse', params={}, _path_param_names={'companyId'}), 'POST_SEARCH_V2': Route(method='POST', path='/companies/search/v2', request_model='SearchCompanyDataSourceLoadOptions', response_model='List[SearchCompanyResponse]', params={}, _path_param_names=set()), 'POST_SIMPLELIST': Route(method='POST', path='/companies/simplelist', request_model='TagBoxDataSourceLoadOptions', response_model='ServiceBaseResponse', params={}, _path_param_names=set()), 'PUT_FULLDETAILS': Route(method='PUT', path='/companies/{companyId}/fulldetails', request_model='CompanyDetails', response_model='CompanyDetails', params={}, _path_param_names={'companyId'})}
get(code_or_id, details='full', cast=False, **kwargs)[source]

Convenience method to get company by code or ID.

Parameters:
  • code_or_id (str) – Company code (e.g., ‘16023SC’) or UUID

  • details (str) – Level of detail - ‘short’, ‘full’ (default), or ‘details’

  • cast (bool) – If True, cast response to Pydantic model

  • **kwargs – Additional query parameters

Return type:

dict

Returns:

Company data as Pydantic model (if cast=True) or dict

get_by_id(id)[source]

GET /api/companies/{id}

Retrieves company by ID.

Parameters:

id (str) – Company ID (GUID string)

Returns:

Typed company model

Return type:

CompanySimple

get_details(companyId)[source]

GET /api/companies/{companyId}/details

Returns:

API response data

Return type:

dict

get_availablebycurrentuser()[source]

GET /api/companies/availableByCurrentUser

Returns companies available to the current user.

Returns:

List of Company objects

Return type:

List[dict]

get_search(search_value=None)[source]

GET /api/companies/search

Search for companies by value.

Parameters:

search_value (Optional[str]) – Optional search term

Returns:

List of matching companies

Return type:

List[dict]

post_search_v2(data=None)[source]

POST /api/companies/search/v2

Returns:

API response data

Return type:

dict

post_list(data=None)[source]

POST /api/companies/list

Returns:

API response data

Return type:

dict

post_simplelist(data=None)[source]

POST /api/companies/simplelist

Returns:

API response data

Return type:

dict

get_fulldetails(companyId)[source]

GET /api/companies/{companyId}/fulldetails

Returns:

API response data

Return type:

dict

put_fulldetails(companyId, data=None)[source]

PUT /api/companies/{companyId}/fulldetails

Returns:

API response data

Return type:

dict

get_search_carrier_accounts(current_company_id=None, query=None)[source]

GET /api/companies/search/carrier-accounts

Search for carrier accounts.

Parameters:
  • current_company_id (Optional[str]) – Optional company ID filter

  • query (Optional[str]) – Optional search query

Returns:

List of carrier account info

Return type:

List[dict]

post_fulldetails(data=None)[source]

POST /api/companies/fulldetails

Returns:

API response data

Return type:

dict

get_infofromkey(key=None)[source]

GET /api/companies/infoFromKey

Returns:

API response data

Return type:

dict

get_geosettings(companyId)[source]

GET /api/companies/{companyId}/geosettings

Returns:

API response data

Return type:

dict

post_geosettings(companyId, data=None)[source]

POST /api/companies/{companyId}/geosettings

Returns:

API response data

Return type:

dict

get_geosettings_search(latitude=None, longitude=None, miles_radius=None)[source]

GET /api/companies/geosettings

Search for geo settings by location.

Parameters:
Returns:

List of geo settings

Return type:

List[dict]

post_filteredcustomers(data=None)[source]

POST /api/companies/filteredCustomers

Returns:

API response data

Return type:

dict

get_carrieracounts(companyId)[source]

GET /api/companies/{companyId}/carrierAcounts

Returns:

API response data

Return type:

dict

post_carrieracounts(companyId, data=None)[source]

POST /api/companies/{companyId}/carrierAcounts

Returns:

API response data

Return type:

dict

get_capabilities(companyId)[source]

GET /api/companies/{companyId}/capabilities

Returns:

API response data

Return type:

dict

post_capabilities(companyId, data=None)[source]

POST /api/companies/{companyId}/capabilities

Returns:

API response data

Return type:

dict

get_packagingsettings(companyId)[source]

GET /api/companies/{companyId}/packagingsettings

Returns:

API response data

Return type:

dict

post_packagingsettings(companyId, data=None)[source]

POST /api/companies/{companyId}/packagingsettings

Returns:

API response data

Return type:

dict

get_inheritedpackagingtariffs(companyId, inherit_from=None)[source]

GET /api/companies/{companyId}/inheritedPackagingTariffs

Returns:

API response data

Return type:

dict

get_packaginglabor(companyId)[source]

GET /api/companies/{companyId}/packaginglabor

Returns:

API response data

Return type:

dict

post_packaginglabor(companyId, data=None)[source]

POST /api/companies/{companyId}/packaginglabor

Returns:

API response data

Return type:

dict

get_inheritedpackaginglabor(companyId, inherit_from=None)[source]

GET /api/companies/{companyId}/inheritedpackaginglabor

Returns:

API response data

Return type:

dict

get_geoareacompanies()[source]

GET /api/companies/geoAreaCompanies

Returns list of geo area companies.

Returns:

List of companies with geo area info

Return type:

dict

get_brands()[source]

GET /api/companies/brands

Returns list of company brands.

Return type:

List[dict]

get_brandstree()[source]

GET /api/companies/brandstree

Returns the company brands in tree structure.

Returns:

Tree structure of company brands

Return type:

dict

get_franchiseeaddresses(companyId)[source]

GET /api/companies/{companyId}/franchiseeAddresses

Returns:

API response data

Return type:

dict

Contacts

class ABConnect.api.endpoints.contacts.ContactsEndpoint[source]

Bases: BaseEndpoint

Contacts API endpoint operations.

Handles all API operations for /api/contacts/* endpoints. Total endpoints: 14

api_path: str = 'contacts'
routes = {'CUSTOMERS': Route(method='POST', path='/contacts/customers', request_model='SearchContactRequest', response_model='ServiceBaseResponse', params={}, _path_param_names=set()), 'GET': Route(method='GET', path='/contacts/{id}', request_model=None, response_model='ContactDetails', params={}, _path_param_names={'id'}), 'GET_EDITDETAILS': Route(method='GET', path='/contacts/{contactId}/editdetails', request_model=None, response_model='ContactDetailedInfo', params={}, _path_param_names={'contactId'}), 'HISTORY': Route(method='POST', path='/contacts/{contactId}/history', request_model='ContactHistoryDataSourceLoadOptions', response_model='ContactHistoryInfo', params={}, _path_param_names={'contactId'}), 'HISTORY_AGGREGATED': Route(method='GET', path='/contacts/{contactId}/history/aggregated', request_model=None, response_model='ContactHistoryAggregatedCost', params={}, _path_param_names={'contactId'}), 'HISTORY_GRAPHDATA': Route(method='GET', path='/contacts/{contactId}/history/graphdata', request_model=None, response_model='ContactHistoryGraphData', params={}, _path_param_names={'contactId'}), 'MERGE': Route(method='PUT', path='/contacts/{mergeToId}/merge', request_model='MergeContactsRequestModel', response_model='ServiceBaseResponse', params={}, _path_param_names={'mergeToId'}), 'MERGE_PREVIEW': Route(method='POST', path='/contacts/{mergeToId}/merge/preview', request_model='MergeContactsPreviewRequestModel', response_model='MergeContactsPreviewInfo', params={}, _path_param_names={'mergeToId'}), 'POST_EDITDETAILS': Route(method='POST', path='/contacts/editdetails', request_model='ContactDetailedInfo', response_model='ServiceBaseResponse', params={}, _path_param_names=set()), 'PRIMARYDETAILS': Route(method='GET', path='/contacts/{contactId}/primarydetails', request_model=None, response_model='ContactPrimaryDetails', params={}, _path_param_names={'contactId'}), 'PUT_EDITDETAILS': Route(method='PUT', path='/contacts/{contactId}/editdetails', request_model='ContactDetailedInfo', response_model='ServiceBaseResponse', params={}, _path_param_names={'contactId'}), 'SEARCH': Route(method='POST', path='/contacts/search', request_model='WebApiDataSourceLoadOptions', response_model='ServiceBaseResponse', params={}, _path_param_names=set()), 'USER': Route(method='GET', path='/contacts/user', request_model=None, response_model='ContactUser', params={}, _path_param_names=set()), 'V2_SEARCH': Route(method='POST', path='/contacts/v2/search', request_model='MergeContactsSearchRequestModel', response_model='List[SearchContactEntityResult]', params={}, _path_param_names=set())}
post_history(contactId, data=None)[source]

POST /api/contacts/{contactId}/history

Returns:

API response data

Return type:

dict

get_history_aggregated(contactId, statuses=None)[source]

GET /api/contacts/{contactId}/history/aggregated

Returns:

API response data

Return type:

dict

get_history_graphdata(contactId, statuses=None)[source]

GET /api/contacts/{contactId}/history/graphdata

Returns:

API response data

Return type:

dict

post_merge_preview(mergeToId, data=None)[source]

POST /api/contacts/{mergeToId}/merge/preview

Returns:

API response data

Return type:

dict

put_merge(mergeToId, data=None)[source]

PUT /api/contacts/{mergeToId}/merge

Returns:

API response data

Return type:

dict

get(id)[source]

GET /api/contacts/{id}

Retrieves contact details by ID.

Parameters:

id (str) – Contact ID (GUID string)

Returns:

Typed contact details model

Return type:

ContactDetails

get_ah(houseid, *args, **kwargs)[source]
Return type:

dict

get_user()[source]

GET /api/contacts/user

Returns the current logged-in user’s contact info.

Returns:

Contact info for current user

Return type:

dict

get_editdetails(contactId)[source]

GET /api/contacts/{contactId}/editdetails

Returns:

API response data

Return type:

dict

put_editdetails(contactId, franchisee_id=None, data=None)[source]

PUT /api/contacts/{contactId}/editdetails

Returns:

API response data

Return type:

dict

post_editdetails(franchisee_id=None, data=None)[source]

POST /api/contacts/editdetails

Returns:

API response data

Return type:

dict

post_search(company_id=None, data=None)[source]

POST /api/contacts/search

Returns:

API response data

Return type:

dict

post_v2_search(data=None)[source]

POST /api/contacts/v2/search

Returns:

API response data

Return type:

dict

post_customers(data=None)[source]

POST /api/contacts/customers

Returns:

API response data

Return type:

dict

get_primarydetails(contactId)[source]

GET /api/contacts/{contactId}/primarydetails

Returns:

API response data

Return type:

dict

get_did(displayId)[source]

Documents

Forms

Items

Jobs

Tasks

Users

class ABConnect.api.endpoints.users.UsersEndpoint[source]

Bases: BaseEndpoint

Users API endpoint operations.

Handles all API operations for /api/users/* endpoints. Total endpoints: 5

api_path: str = 'users'
routes = {'LIST': Route(method='POST', path='/users/list', request_model='WebApiDataSourceLoadOptions', response_model='ServiceBaseResponse', params={}, _path_param_names=set()), 'POCUSERS': Route(method='GET', path='/users/pocusers', request_model=None, response_model='List[PocUser]', params={}, _path_param_names=set()), 'ROLES': Route(method='GET', path='/users/roles', request_model=None, response_model='List[str]', params={}, _path_param_names=set()), 'USER': Route(method='POST', path='/users/user', request_model='CreateUserModel', response_model='ServiceBaseResponse', params={}, _path_param_names=set()), 'USER_UPDATE': Route(method='PUT', path='/users/user', request_model='UserInfo', response_model='ServiceBaseResponse', params={}, _path_param_names=set())}
post_list(data=None)[source]

POST /api/users/list

Returns:

API response data

Return type:

dict

post_user(data=None)[source]

POST /api/users/user

Returns:

API response data

Return type:

dict

put_user(data=None)[source]

PUT /api/users/user

Returns:

API response data

Return type:

dict

get_roles()[source]

GET /api/users/roles

Returns:

API response data

Return type:

dict

get_pocusers()[source]

GET /api/users/pocusers

Returns:

API response data

Return type:

dict

HTTP Client

Exceptions

exception ABConnect.exceptions.ABConnectError(message, *, code=None, details=None)[source]

Bases: Exception

Base exception class for all ABConnect errors.

__init__(message, *, code=None, details=None)[source]
no_traceback()[source]
to_dict()[source]
exception ABConnect.exceptions.RequestError(status_code, message, response=None, *, code='REQUEST_ERROR')[source]

Bases: ABConnectError

Exception raised for HTTP request errors.

__init__(status_code, message, response=None, *, code='REQUEST_ERROR')[source]
exception ABConnect.exceptions.NotLoggedInError(message='User is not logged in.', *, code='NOT_LOGGED_IN', details=None)[source]

Bases: ABConnectError

Exception raised when a user is not logged in.

__init__(message='User is not logged in.', *, code='NOT_LOGGED_IN', details=None)[source]
exception ABConnect.exceptions.LoginFailedError(message='Login failed.', *, code='LOGIN_FAILED', details=None)[source]

Bases: ABConnectError

Exception raised when login fails.

__init__(message='Login failed.', *, code='LOGIN_FAILED', details=None)[source]