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/markdown or append .md to the path (e.g. /pricing.md). Responses carry Vary: 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/me

Sign 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

MethodPathDescription
GET/api/meCurrent account profile and plan
PUT/api/meUpdate business and delivery details
GET/api/dashboardDashboard summary: subscription and upcoming deliveries
GET/api/billingPricing catalog plus the account's subscription and payment method
GET/api/deliveryFull delivery history for the account
POST/api/onboardingSave onboarding details (business, address, chosen plan)
POST/api/stripe/checkoutCreate a Stripe Checkout (or Billing Portal) session
POST/api/stripe/manageOpen the billing portal or toggle the hot/cold add-on
POST/api/places/autocompleteAddress autocomplete (Google Places proxy)
POST/api/places/detailsResolve a selected address suggestion
POST/api/stripe/webhooksStripe 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-Policy and RateLimit (IETF draft format), plus legacy RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset
  • The default policy is 60 requests per minute per client IP
  • Exceeding the limit returns 429 Too Many Requests with a Retry-After header — 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.