H2Office API Documentation
The H2Office API powers the customer dashboard. It is a JSON REST API served from https://www.h2office.io/api, described in full by the OpenAPI 3.1 specification.
Machine-readable resources
- OpenAPI spec: /openapi.json
- Agent guidance: /llms.txt
- Sitemap: /sitemap.xml
- Markdown variants: every public page is also served as markdown — request it with
Accept: text/markdownor append.mdto the path (e.g. /pricing.md). Responses carryVary: Accept.
Authentication
Authentication is session-cookie based (better-auth). Create a session with email/password, then send the returned cookie on subsequent requests:
curl -c cookies.txt -X POST https://www.h2office.io/api/auth/sign-in/email \
-H 'Content-Type: application/json' \
-d '{"email":"you@example.com","password":"..."}'
curl -b cookies.txt https://www.h2office.io/api/meSign up via POST /api/auth/sign-up/email, inspect the current session via GET /api/auth/get-session. There are no long-lived API keys today; all endpoints except the auth endpoints and the Stripe webhook require a signed-in session and return 401 without one.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/me | Current account profile and plan |
| PUT | /api/me | Update business and delivery details |
| GET | /api/dashboard | Dashboard summary: subscription and upcoming deliveries |
| GET | /api/billing | Pricing catalog plus the account's subscription and payment method |
| GET | /api/delivery | Full delivery history for the account |
| POST | /api/onboarding | Save onboarding details (business, address, chosen plan) |
| POST | /api/stripe/checkout | Create a Stripe Checkout (or Billing Portal) session |
| POST | /api/stripe/manage | Open the billing portal or toggle the hot/cold add-on |
| POST | /api/places/autocomplete | Address autocomplete (Google Places proxy) |
| POST | /api/places/details | Resolve a selected address suggestion |
| POST | /api/stripe/webhooks | Stripe webhook receiver (Stripe signatures only) |
Request and response schemas, operation IDs, and example payloads for every endpoint are in the OpenAPI spec.
Rate limits
API responses include standard rate-limit headers so clients can self-throttle:
RateLimit-PolicyandRateLimit(IETF draft format), plus legacyRateLimit-Limit,RateLimit-Remaining,RateLimit-Reset- The default policy is 60 requests per minute per client IP
- Exceeding the limit returns
429 Too Many Requestswith aRetry-Afterheader — wait that many seconds before retrying
Errors
Errors are JSON objects of the form {"error": "message"} with conventional status codes: 400 invalid input, 401 no session, 429 rate limited, 500 server error, 503 temporary configuration issue (retry later).
Questions or a use case that needs more than the current API offers? Email support@h2office.io.