Skip to content

Client

SonnysClient

SonnysClient(
    api_id: str,
    api_key: str,
    site_code: str | None = None,
    *,
    max_retries: int = 3,
    backoffice_username: str | None = None,
    backoffice_password: str | None = None,
)

Client for the Sonny's Carwash Controls Data API.

Manages authentication and HTTP session lifecycle. Use as a context manager or call :meth:close explicitly when done.

Parameters:

Name Type Description Default
api_id str

Sonny's API ID credential. Also doubles as the BackOffice subdomain (e.g. "washu"washu.sonnyscontrols.com) when the BackOffice resource is used.

required
api_key str

Sonny's API key credential.

required
site_code str | None

Optional site code to scope requests to a specific site. Applies only to the Data API path; ignored by the BackOffice resource (every BackOffice shift already carries its own site code).

None
max_retries int

Maximum number of retries for 429 responses.

3
backoffice_username str | None

Username for a BackOffice (manager portal) user. Required to use :attr:backoffice. Distinct from the API credentials because BackOffice is the web UI, not the programmatic API.

None
backoffice_password str | None

Password for the BackOffice user.

None

customers cached property

customers: Customers

Access the Customers resource.

items cached property

items: Items

Access the Items resource.

employees cached property

employees: Employees

Access the Employees resource.

giftcards cached property

giftcards: Giftcards

Access the Giftcards resource.

sites cached property

sites: Sites

Access the Sites resource.

transactions cached property

transactions: Transactions

Access the Transactions resource.

washbooks cached property

washbooks: Washbooks

Access the Washbooks resource.

recurring cached property

recurring: RecurringAccounts

Access the Recurring Accounts resource.

backoffice cached property

backoffice: BackOfficeResource

Access the BackOffice web-UI scraper.

Requires backoffice_username and backoffice_password at client construction. See :class:BackOfficeResource for the available methods.

close

close() -> None

Close the underlying HTTP sessions (API and BackOffice).

__enter__

__enter__() -> SonnysClient

__exit__

__exit__(*args: object) -> None