canonical: https://jentic.com/apis/hnry.co/hnry

# Hnry Partner API

Hnry is a financial admin platform for self-employed contractors and freelancers in Australia and New Zealand: it handles tax, invoicing, expenses, and statutory deductions automatically. The Partner API is a GraphQL endpoint that lets approved partners register users, raise expenses, and manage invoices on behalf of Hnry-customers. Authentication uses OAuth2 authorization code flow, so end users grant scoped consent before partner agents transact on their behalf.

## For AI agents

Register Hnry users, raise expenses, and manage invoices on behalf of self-employed contractors via the Hnry GraphQL Partner API.

## Scope

Does not handle payment collection, accounting general ledger, or non-AU/NZ tax filing - use for Hnry partner-driven contractor registration, expenses, and invoicing only.

## Capabilities

- Register a new self-employed user into Hnry through the partner flow
- Raise expense entries against a user's Hnry account for tax treatment
- Create and manage invoices for a contractor's clients
- Run any partner-permitted GraphQL query or mutation through a single endpoint
- Use the OAuth2 authorization code flow to obtain scoped user consent

## Use cases

### Partner-Driven Contractor Onboarding

Marketplaces and platforms that pay contractors register those contractors into Hnry so taxes and statutory deductions are handled automatically. The agent calls the Hnry registerUser mutation through the GraphQL endpoint after OAuth consent. Contractors avoid year-end tax stress and platforms reduce compliance friction.

Example prompt: Run the registerUser mutation against POST /graphql with the contractor's name, email, and platform reference id.

### Automated Expense Capture

Bookkeeping or expense tools push expenses into Hnry on the contractor's behalf so deductions are applied to the correct income stream. The agent invokes the raiseExpense mutation against /graphql for each expense receipt or category. This means contractors keep accurate, real-time tax treatment without manual entry.

Example prompt: Invoke the raiseExpense mutation for user_456 with $120 categorised as 'Software Subscription' on today's date.

### Invoicing for Contractor Clients

Platforms that handle work allocation also need invoicing on behalf of contractors. Hnry's GraphQL surface supports invoice creation and management, so an agent can mint invoices linked to platform-side jobs and read back their status. This avoids contractors maintaining a separate invoicing tool.

Example prompt: Run a createInvoice mutation for user_456 against client 'Acme' for $1,500 and return the new invoice id.

### Agent-Run Contractor Operations

An AI ops agent connected via Jentic handles end-to-end contractor administration: register, raise expenses, mint invoices, and read state. OAuth2 tokens are stored in your Jentic One instance and refreshed at execution time, so the agent never holds the raw access_token. End-to-end setup is under an hour because the agent loads the GraphQL operation on demand.

Example prompt: Onboard a new contractor into Hnry, raise their first expense from a receipt, and create their opening invoice for client 'Acme'.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/graphql` | Execute any GraphQL query or mutation |

## Key resources

- **GraphQL Endpoint** — Single POST /graphql entry point for all partner queries and mutations
- **Users** — Self-employed contractor registrations
- **Expenses** — Expense entries with category and amount
- **Invoices** — Invoices issued on behalf of a contractor

## Why Jentic

- **Setup:** Wiring the Hnry Partner API by hand means completing an OAuth2 flow, refreshing the access token, and composing GraphQL queries and mutations against a single /graphql endpoint. Through Jentic you install once, import the Hnry Partner API from the API Directory, store the OAuth2 credential once, and your agent calls it.
- **Permission scoping:** Hnry exposes a single GraphQL endpoint where the operation and target travel in the request body, so scoping stays at the operation level: limit the agent to the operations it needs, such as registering a contractor or filing an expense. You choose that set, and the spec's OAuth2 scopes such as expense:create back it, so a broader mutation is only available if you include it.
- **Credential handling:** Your Hnry OAuth2 token is stored once, encrypted, by your own Jentic One instance, refreshed and injected at execution time. The raw access_token never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'register a contractor in Hnry', and Jentic returns the GraphQL operation with the corresponding mutation schema so the agent sends the right body without reading the GraphQL schema directly.

## Related APIs

- **Xero Accounting API** — Xero is a full accounting platform widely used in AU and NZ
- **Stripe API** — Stripe handles payment collection that flows into Hnry-managed contractor income
- **Quaderno API** — Tax compliance API used alongside invoicing for global tax handling

## FAQ

### What authentication does the Hnry Partner API use?

Hnry uses OAuth2 authorization code flow: end users grant consent and the partner receives scoped access tokens. Through Jentic, OAuth tokens are stored encrypted in your Jentic One instance and refreshed at execution time, so the agent never holds the raw token.

### Can I register users through the Hnry Partner API?

Yes. The Partner API exposes a registerUser-style mutation through POST /graphql so partners can onboard contractors after OAuth consent. The mutation typically returns the new user reference for use in subsequent expense and invoice operations.

### Why does the Hnry API only show one endpoint?

Hnry is a GraphQL API: all queries and mutations are sent to the single POST /graphql endpoint, with the actual operation expressed in the request body. The OpenAPI spec captures this single entry point; the operation surface is described in the GraphQL schema itself.

### How do I raise an expense for a contractor through Jentic?

Search Jentic for 'raise hnry expense', load the GraphQL POST operation, and execute with the raiseExpense mutation body containing user id, amount, and category. Use pip install jentic with the async SearchRequest, LoadRequest, ExecutionRequest pattern.

### What countries does the Hnry API support?

Hnry primarily serves self-employed contractors in Australia and New Zealand, where the platform handles statutory deductions and tax filing. The Partner API is intended for platforms operating in those markets that need to wire contractor tax handling into their flow.

### Can I limit what my agent is allowed to do with the Hnry Partner API?

Yes. Because you run Jentic One yourself, your own rules decide which Hnry operations the agent may call, so you can allow just registerUser while withholding raiseExpense or createInvoice even though they all travel to the single POST /graphql endpoint. Since the operation and target ride in the GraphQL request body, scoping stays at the operation level, and the OAuth2 scopes you grant, such as expense:create, back that boundary so a broader mutation is only reachable if you include it. Your Hnry OAuth2 credential is held by your own instance and injected at execution time, so the agent never sees the raw token.
