Quick-Oxibooks: Rust Client for QuickBooks Online (QBO)
The
quick-oxibooks crate is a small, ergonomic client for the QuickBooks Online API built on top of quickbooks-types. It focuses on a simple, type-safe workflow for CRUD, queries, reports, and batch operations, with rate-limiting and OAuth2 token usage handled by a lightweight context.
QuickBooks API docs: https://developer.intuit.com/app/developer/qbo/docs/get-started
Status and scope
This crate:
- Provides a minimal blocking HTTP client for QBO built on
ureq - Exposes a
QBContextandEnvironmentfor auth/config + rate limiting - Implements high-level traits for:
- CRUD: create, read, delete
- Query: SQL-like QBO queries
- Reports: typed report fetching using
quickbooks-types::reports - Batch: batched create/update/delete/query
- Re-exports QBO data models via
quick_oxibooks::types::*(fromquickbooks-types) - Offers optional features for attachments, PDFs, logging, macros, and Polars (via
quickbooks-types)
This crate does not:
- Implement the OAuth browser flow (you supply tokens)
- Provide an async runtime (it’s synchronous via
ureq) - Hide QBO’s SQL-like query strings behind a DSL
Installation
[]
= "0.1.2"
Optional features:
- attachments: enable file upload/download helpers
- pdf: enable PDF retrieval for supported entities
- macros: enable query-building convenience macros
- logging: enable request/response logging via the
logcrate - polars: pass-through feature that enables Polars helpers in
quickbooks-types
[]
= { = "0.1.2", = ["pdf", "attachments"] }
Modules and re-exports
quick_oxibooks::client:QBContext,RefreshableQBContext,Environment
quick_oxibooks::functions:create::QBCreate,read::QBRead,delete::QBDeletequery::QBQueryreports::QBReportattachment(feature = "attachments"),pdf(feature = "pdf")
quick_oxibooks::batch:QBBatchOperation,BatchIterator
quick_oxibooks::error:APIError,APIErrorInner
quick_oxibooks::types::*:- All re-exports from
quickbooks-types(entities, reports, helpers)
- All re-exports from
Quick start
Create a context, then perform CRUD and queries with typed entities from quickbooks-types.
use ;
use ;
use APIError;
use ;
use Agent;
Tip: You can also build contexts from env vars: QBContext::new_from_env(Environment::..., &client) expects QB_COMPANY_ID and QB_ACCESS_TOKEN.
Reports
Use strongly-typed report kinds and optional typed parameters from quickbooks-types::reports.
use NaiveDate;
use ;
use QBReport;
use ;
use Agent;
Batch
Batch multiple operations (query/create/update/delete) into one request and correlate responses.
use ;
use ;
use ;
use Agent;
Features
- attachments: upload and manage file attachments
- pdf: fetch PDFs for supported types (e.g., invoices)
- logging: enable request/response logs via
log - macros: convenience macros for building queries
- polars: enable
quickbooks-typesPolars helpers (feature passthrough)
Enable one or more:
[]
= { = "0.1.0", = ["attachments", "pdf", "logging"] }
Errors
APIError wraps all errors surfaced by the client, including HTTP, JSON, and QBO faults, with variants in APIErrorInner such as:
- UreqError / HttpError / JsonError
- BadRequest(QBErrorResponse) with QBO fault info
- CreateMissingItems, DeleteMissingItems, NoIdOnRead/Send/GetPDF
- ThrottleLimitReached, BatchLimitExceeded
- EnvVarError, InvalidClient, etc.
use ;
Tips
- Auth: You supply the OAuth2 access token;
RefreshableQBContextcan renew it if you have a refresh token. - Rate limits:
- Regular API: 500 requests/min
- Batch: 40 batches/min (30 ops/batch)
- Field names in queries use QBO PascalCase (e.g.,
DisplayName,TotalAmt). - IDs +
sync_tokenare required for deletion and some updates. - This client is blocking (ureq). For async, consider wrapping calls in a thread pool.
Contributing
Issues and PRs are welcome. If you need additional endpoints, features, or ergonomics, open an issue describing your use case.
Basic workflow:
- Fork and clone
cargo build && cargo test- Make changes with tests
- Open a PR against main with context and examples
Documentation
- API docs: https://docs.rs/quick-oxibooks
- Types crate: https://docs.rs/quickbooks-types
License
This project is licensed under the MIT License. See LICENSE for details.
Documentation
For detailed documentation, visit docs.rs/quick-oxibooks.