Sonny's Backoffice Wrapper¶
Programmatic user management for Sonny's Carwash Controls Backoffice — create, link, and disable employees and Backoffice users from Python.
Why this exists¶
Sonny's Controls offers a read-only Data API for reporting, but no API for user management. Every change to an employee or Backoffice user has to be made by hand in the web UI. That's fine for a handful of users, but painful at scale — especially for bulk onboarding, HRIS sync, and offboarding former employees.
This library closes the gap by driving Backoffice's HTTP endpoints directly with a pure requests session. No headless browser at runtime, no manual clicking.
Install¶
Ten-second quickstart¶
from datetime import datetime
from decimal import Decimal
from sonnys_backoffice import SonnysBackofficeClient
with SonnysBackofficeClient(
subdomain="washu",
username="your-bot-user",
password="your-bot-password",
) as client:
result = client.create_employee(
first_name="Jane",
last_name="Doe",
phone="6155551234",
email="jane.doe@example.com",
pos_user_id=12345,
wage_rate=Decimal("15.50"),
start_date=datetime(2026, 5, 1),
available_sites=["Wash 37135"],
permission="General User",
)
print(f"created employee {result.employee_id}, POS PIN: {result.pos_pin}")
What's in the box¶
create_employee— with or without a linked Backoffice userdisable_employee— looked up by POS User ID or emailcreate_backoffice_user— standalone or linked to an existing employeelist_sites,list_departments,list_permissions— discovery helpersis_pos_user_id_available,is_email_available,is_phone_available— pre-flight uniqueness checks- Pydantic v2 input validation and typed result objects
- Automatic site/region/district hierarchy detection
- Case-insensitive permission name matching with a "General User" fallback
- Transparent session re-authentication on cookie expiration
Status¶
Alpha. The public API is stable for Milestone 1.
Milestone 1 limitations
modify_employeeis deliberately not included — different fields live behind different Backoffice URLs and deserve targeted functions. Deferred to a later release.- Backoffice user permission template assignment is deferred to Milestone 2.
create_backoffice_user(and the linked path ofcreate_employee) creates the account successfully, but the caller must assign the template manually via the Backoffice UI (shield icon on the user list). See Creating a Backoffice user.