Expand description
QuickBooks Online type models and helpers for Rust.
This crate defines strongly-typed data models for common QBO entities and reports,
plus helper traits that validate local preconditions (for example, can_create and can_full_update).
It does not make HTTP requests; bring your own client.
Modules and exports:
- Top-level entities:
Account,Attachable,Bill,BillPayment,CompanyInfo,Customer,Employee,Estimate,Invoice,Item,Payment,Preferences,SalesReceipt,Vendor common: supporting types likeNtRef,MetaData, addresses, phones, taxes, etc.reports: report models and strongly-typed parameter builders
Features:
builder: derive builders and add an associatednew()for most entitiespolars: optional helpers for reports + Polars integration
Quick start (entities):
use chrono::NaiveDate;
use crate::{Invoice, Line, LineDetail, SalesItemLineDetail, QBCreatable};
use crate::common::NtRef;
let invoice = Invoice {
customer_ref: Some(NtRef::from(("John Doe", "CUST-123"))),
txn_date: NaiveDate::from_ymd_opt(2024, 10, 1),
line: Some(vec![
Line {
amount: Some(100.0),
line_detail: LineDetail::SalesItemLineDetail(SalesItemLineDetail {
item_ref: Some(NtRef::from(("Widget A", "ITEM-001"))),
qty: Some(1.0),
unit_price: Some(100.0),
..Default::default()
}),
..Default::default()
}
]),
..Default::default()
};
assert!(invoice.can_create());Reports parameters:
use chrono::NaiveDate;
use crate::reports::types::*;
use crate::reports::params::*;
let params = BalanceSheetParams::new()
.accounting_method(AccountingMethod::Cash)
.start_date(NaiveDate::from_ymd_opt(2024, 1, 1).unwrap())
.end_date(NaiveDate::from_ymd_opt(2024, 12, 31).unwrap())
.date_macro(DateMacro::ThisFiscalYear);
let query = params.to_query_string();
assert!(query.contains("accounting_method=Cash"));Modules§
- common
- Common supporting value types used across
QuickBooksentity models. - reports
QuickBooksReports API types
Structs§
- Account
- Account
- Account
Based Expense Line Detail AccountBasedExpenseLineDetail- Accounting
Info Prefs - Accounting Info Preferences
- Attachable
- Attachable
- Attachable
Ref - AttachableRef
- Bill
- Bill
- Bill
Payment BillPayment- Check
Bill Payment CheckBillPayment- Company
Info CompanyInfo- Contact
Info - Contact Information
- Credit
Card Bill Payment CreditCardBillPayment- Currency
Prefs - Currency Preferences
- Customer
- Customer
- Description
Line Detail DescriptionLineDetail- Discount
Line Detail DiscountLineDetail- Email
Message Prefs - Email Message Preferences
- Email
Message Type - Email Message Type
- Employee
- Employee
- Estimate
- Estimate
- Group
Line Detail GroupLineDetail- Invoice
- Invoice
- Item
- Item
- Item
Based Expense Line Detail ItemBasedExpenseLineDetail- Line
- Line
- Other
Prefs - Miscellaneous Other Preferences
- Payment
Payment- Preferences
- Preferences
- Product
AndServices Prefs - Product and Services Preferences
- Report
Prefs - Report Preferences
- Sales
Forms Prefs - Sales Forms Preferences
- Sales
Item Line Detail SalesItemLineDetail- Sales
Receipt SalesReceipt- SubTotal
Line Detail SubTotalLineDetail- TaxLine
Detail TaxLineDetail- TaxPrefs
- Tax Preferences
- Time
Tracking Prefs - Time Tracking Preferences
- Vendor
- Vendor
- Vendor
AndPurchases Prefs - Vendor and Purchases Preferences
- Vendor
Payment Bank Detail - Vendor Payment Bank Detail
Enums§
- Account
Type AccountType- Attachment
Category AttachmentCategory- Billable
Status BillableStatus- Item
Type - Item Type
- Line
Detail LineDetailEnum- PayType
PayType- QBType
Error - Errors for Quickbooks validation / processing
- TaxExempt
Status TaxExemptStatus
Traits§
- QBAttachable
- Trait for all entities that can be attached as files/notes.
- QBCreatable
- Trait for entities that can be created in
QuickBooks. - QBDeletable
- Trait for entities that can be deleted from
QuickBooks. - QBFull
Updatable - Trait for entities that support full update operations.
- QBItem
- Core trait for all
QuickBooksentities. - QBPD
Fable - Trait for entities that can be generated as PDF documents.
- QBQueryable
- Trait for entities that can be queried from
QuickBooks. - QBReadable
- Trait for entities that can be read from
QuickBooksby ID. - QBSendable
- Trait for entities that can be sent via email from
QuickBooks. - QBSparse
Updateable - Trait for entities that support sparse update operations.
- QBTo
Attachable Ref - Trait for entities that can be converted to a reference for an attachment.
- QBToRef
- Trait for entities that can be converted to
QuickBooksentity references. - QBVoidable
- Trait for entities that can be voided in
QuickBooks. - Taxable
Line - Trait for setting a line / line detail as taxable
Functions§
- content_
type_ from_ ext - Derives the content type from a file extension
Type Aliases§
- Line
Field LineField