Loading...
Loading...
Use the `quickbooks-client` mops package whenever the user asks the canister to create/read/update invoices, customers, payments, items, or chart-of-account entries in QuickBooks Online (QBO), email an invoice, or run a QuickBooks query. The package wraps the QuickBooks Online Accounting API v3 at `https://quickbooks.api.intuit.com` via outbound HTTPS calls.
npx skill4agent add caffeinelabs/skills connector-quickbooksApis/DefaultApi.mosaveCustomergetCustomersaveItemgetItemsaveAccountgetAccountsaveInvoicegetInvoicesendInvoicesavePaymentgetPaymentquery_query#Err("auth_expired")realmIdminorversion"75"""is_replicated = ?false.zipcom.intuit.quickbooks.accountingsave<Entity>IdSyncTokenget<Entity>sparse = ?trueIdSyncTokenInvoicePaymentsaveInvoicesavePaymentoperation = ?#deleteIdSyncTokenoperation?SaveInvoiceOperationParameternull?#deleteCustomerItemAccountActive = ?falsesave*operationgetCustomerCustomerResponseCustomertimequery_QueryResponseQueryResponsequery_queryInvoice.Line[Line]DetailTypePayment.Line[PaymentLine]{Amount, LinkedTxn, …}DetailTyperealmIdimport { saveInvoice; getInvoice; sendInvoice; saveCustomer }
"mo:quickbooks-client/Apis/DefaultApi";
import Invoice "mo:quickbooks-client/Models/Invoice";
import { defaultConfig } "mo:quickbooks-client/Config";
let cfg = {
defaultConfig with
auth = ?#bearer "<off-chain OAuth2 access token>";
is_replicated = ?false; // non-replicated: required for writes; reads too
};
let realmId = "<company id from OAuth handshake>";
// Build an invoice: one sales line, $100, item "1", billed to customer "58".
// Invoice has no required fields → init {} then record-update the optionals.
// NOTE: DetailType is REQUIRED on a Line, and its variants are lowercase.
let inv = {
Invoice.init {} with
CustomerRef = ?{ value = "58"; name = null };
Line = ?[ {
DetailType = #salesitemlinedetail; // required; lowercase variant
Amount = ?100.0;
Description = ?"Consulting";
SalesItemLineDetail = ?{ ItemRef = ?{ value = "1"; name = null };
Qty = ?1.0; UnitPrice = ?100.0; TaxCodeRef = null; ServiceDate = null };
Id = null; LineNum = null; LinkedTxn = null;
} ];
};
// saveInvoice(config, realmId, invoice, minorversion, operation)
// `operation` is optional: null omits it — the create/update path.
let created = await* saveInvoice(cfg, realmId, inv, "75", null);
// Email it to the customer (config, realmId, invoiceId, sendTo, minorversion):
// ignore await* sendInvoice(cfg, realmId, "<invoiceId>", "cust@example.com", "75");is_replicated = ?falsesave*sendInvoiceoperation = ?#deleteget*query_?falseSyncTokenget<Entity>SyncTokensave<Entity>minorversion"75"""ErrorResponseFault.Error_ErrorFault.Error_[0].Messagesandbox-quickbooks.api.intuit.comConfigquickbooks.api.intuit.com