API Reference
This section contains the API documentation for integrating with AnyBiz.
Overview
Odeljak pod nazivom „Overview“AnyBiz provides a RESTful API built with oRPC (OpenAPI-compatible RPC). The API supports:
- Authentication - Session-based authentication via Better Auth
- Organization Context - All API calls operate within an organization context
- Type-Safe Contracts - Full TypeScript support with Valibot validation
API Categories
Odeljak pod nazivom „API Categories“Authentication
Odeljak pod nazivom „Authentication“- Login/Logout
- Registration
- Session management
Organization
Odeljak pod nazivom „Organization“- Organization management
- Member management
- Subscription management
Features
Odeljak pod nazivom „Features“- Point of Sale (POS)
- Invoices (list, get, create, finalize, send to eFaktura)
- Business Partners
- Settings (organization, eFaktura, fiscalization)
- Events SDK (
/api/events/sdk/*) for external map embedding and checkout flow - Internal:
POST /api/internal/sef-subscribe(cron; requiresX-Cron-SecretorAuthorization: BearerwithSEF_CRON_SECRET)
Getting Started
Odeljak pod nazivom „Getting Started“To use the AnyBiz API:
- Authenticate - Obtain a session by logging in
- Select Organization - Set the active organization context
- Make API Calls - Use the documented endpoints
OpenAPI Specification
Odeljak pod nazivom „OpenAPI Specification“The full OpenAPI specification can be generated from the oRPC contracts. Run pnpm docs:generate-api from the repository to regenerate it.
Base URL
Odeljak pod nazivom „Base URL“https://api.anybiz.com/apiFor local development:
http://localhost:3000/apiAuthentication
Odeljak pod nazivom „Authentication“All API requests require authentication. Include the session cookie in your requests:
curl -X GET "https://api.anybiz.com/api/organization/current" \ -H "Cookie: session=your-session-token"Rate Limiting
Odeljak pod nazivom „Rate Limiting“API calls are subject to rate limiting. Please ensure your integration handles rate limit responses appropriately.
Error Handling
Odeljak pod nazivom „Error Handling“All API errors follow a consistent format:
{ "error": { "code": "ERROR_CODE", "message": "Human-readable error message" }}Common error codes:
UNAUTHORIZED- Authentication requiredFORBIDDEN- Insufficient permissionsNOT_FOUND- Resource not foundVALIDATION_ERROR- Invalid request data