Crate quick_oxibooks

Crate quick_oxibooks 

Source
Expand description

§Quick Oxibooks Library

Quick Oxibooks is a comprehensive Rust library for interacting with the QuickBooks Online API. It provides a strongly-typed, rate-limited, and feature-rich interface for performing CRUD operations, batch processing, and generating reports with QuickBooks data.

§Key Features

  • Complete CRUD Operations: Create, read, update, delete, and query QuickBooks entities
  • Batch Processing: Execute multiple operations in a single API call for improved performance
  • Rate Limiting: Built-in rate limiting to respect QuickBooks API limits
  • Strong Typing: All QuickBooks entities are strongly typed with validation
  • PDF Generation: Generate PDFs for supported entities (invoices, estimates, etc.)
  • Attachment Support: Upload and manage file attachments
  • Report Generation: Access QuickBooks financial reports (P&L, Balance Sheet, etc.)
  • Macro Support: Convenient macros for building queries

§Quick Start

use quick_oxibooks::{QBContext, Environment};
use quickbooks_types::{Customer, Invoice};
use quick_oxibooks::functions::{create::QBCreate, query::QBQuery, read::QBRead};
use ureq::Agent;

// Create a QuickBooks context
let client = Agent::new_with_defaults();
let qb_context = QBContext::new(
    Environment::SANDBOX,
    "your_company_id".to_string(),
    "your_access_token".to_string(),
    &client
).unwrap();

// Create a new customer
let mut customer = Customer::default();
customer.display_name = Some("John Doe".to_string());
let created_customer = customer.create(&qb_context, &client).unwrap();

// Query for invoices
let invoices = Invoice::query("WHERE TotalAmt > '100.00'", Some(10), &qb_context, &client).unwrap();

// Read a specific invoice by ID
let invoice = Invoice::query_single("WHERE Id = '123'", &qb_context, &client).unwrap();

§Features

  • attachments: Enables file attachment upload and management functions
  • pdf: Enables PDF generation for supported QuickBooks entities
  • macros: Enables convenient query-building macros
  • polars: Enables integration with the polars DataFrame library for data analysis
  • logging: Enables detailed logging of API requests and responses

For more detailed usage examples, refer to the documentation for each module and type.

Re-exports§

pub use client::QBContext;

Modules§

batch
QuickBooks Online Batch Request Module
client
QuickBooks Online API Client
error
Error types for QuickBooks API operations.
functions
Module for QuickBooks API functions
types
Re-exports of all types from the quickbooks_types crate.

Structs§

DiscoveryDoc
OAuth 2.0 discovery document for QuickBooks API.

Enums§

Environment
Represents the QuickBooks API environment.

Type Aliases§

APIResult
The result type used throughout the library for operations that may fail.