@openpets/quickfile
v1.0.3
Published
OpenPets plugin for QuickFile UK accounting software. Manage invoices, clients, suppliers, bank transactions, and generate financial reports.
Maintainers
Readme
QuickFile Pet
OpenPets plugin for QuickFile - UK accounting software. Manage invoices, clients, suppliers, bank transactions, and generate financial reports.
Features
- Client Management - Search, create, update, and delete clients
- Invoice Management - Create, search, send, and manage invoices and estimates
- Supplier Management - Search and manage suppliers
- Bank Transactions - View bank accounts and transactions
- Financial Reports - Profit & Loss, Balance Sheet, Aged Debtors/Creditors
- Purchases - Track and manage purchase records
- Journal Entries - Search and create journal entries
Setup
1. Get Your QuickFile API Credentials
QuickFile uses a unique authentication system with three required credentials:
Step 1: Get Your Account Number
- Log into QuickFile
- Your Account Number is displayed in the top-right corner of the dashboard
- It's a numeric ID (e.g.,
6131400000)
Step 2: Get Your API Key
- Go to Account Settings (click your name in the top-right)
- Navigate to 3rd Party App Integrations > API Key
- If you don't have an API key, click Generate New Key
- Copy the API key (format:
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)
Step 3: Register Your Application
- Go to Account Settings > 3rd Party App Integrations
- Click Register New Application
- Fill in:
- Application Name: Your app name (e.g., "OpenCode Integration")
- Application Description: Brief description
- Developer Email: Your email
- After registration, you'll receive an Application ID
- Copy the Application ID (format:
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)
2. Configure Environment Variables
Create a .env file or set these environment variables:
QUICKFILE_ACCOUNT_NUMBER=6131400000
QUICKFILE_API_KEY=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
QUICKFILE_APPLICATION_ID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXOr configure via CLI:
opencode run "set-plugin-env plugin=quickfile key=QUICKFILE_ACCOUNT_NUMBER value=YOUR_ACCOUNT_NUMBER"
opencode run "set-plugin-env plugin=quickfile key=QUICKFILE_API_KEY value=YOUR_API_KEY"
opencode run "set-plugin-env plugin=quickfile key=QUICKFILE_APPLICATION_ID value=YOUR_APP_ID"3. Generate the Client (Development Only)
If you're modifying the API methods, regenerate the client:
cd pets/quickfile
# Generate quickfile-client.ts from generator.ts
bun run generator.ts
# Or with options
bun run generator.ts --verbose # Show detailed output
bun run generator.ts --dry-run # Preview without writing
# Or via CLI from project root
pets generate-custom --pet quickfileThe generator creates quickfile-client.ts from the method definitions in generator.ts.
Quick Start
# Test connection
opencode run "test quickfile connection"
# Search clients
opencode run "search for clients in quickfile"
# List recent invoices
opencode run "list recent invoices"
# Get financial reports
opencode run "get profit and loss report for 2024"Available Tools (29 total)
Client Tools
| Tool | Description |
|------|-------------|
| quickfile-client-search | Search for clients with filters |
| quickfile-client-get | Get details for a specific client |
| quickfile-client-create | Create a new client |
| quickfile-client-delete | Delete a client |
Invoice Tools
| Tool | Description |
|------|-------------|
| quickfile-invoice-search | Search invoices with filters |
| quickfile-invoice-get | Get a specific invoice |
| quickfile-invoice-create | Create a new invoice |
| quickfile-invoice-send | Send invoice by email |
| quickfile-invoice-getpdf | Get PDF URL for invoice |
| quickfile-invoice-delete | Delete an invoice |
Supplier Tools
| Tool | Description |
|------|-------------|
| quickfile-supplier-search | Search suppliers |
| quickfile-supplier-get | Get supplier details |
| quickfile-supplier-create | Create a new supplier |
Bank Tools
| Tool | Description |
|------|-------------|
| quickfile-bank-search | List bank accounts |
| quickfile-bank-gettransactions | Get transactions for an account |
| quickfile-bank-createtransaction | Create a bank transaction |
Report Tools
| Tool | Description |
|------|-------------|
| quickfile-report-profitandloss | Generate P&L report |
| quickfile-report-balancesheet | Generate balance sheet |
| quickfile-report-chartofaccounts | Get chart of accounts |
| quickfile-report-ageddebtors | Aged debtors report |
| quickfile-report-agedcreditors | Aged creditors report |
Payment & Purchase Tools
| Tool | Description |
|------|-------------|
| quickfile-payment-create | Record a payment |
| quickfile-purchase-search | Search purchases |
| quickfile-purchase-get | Get purchase details |
| quickfile-purchase-create | Create a purchase |
Journal Tools
| Tool | Description |
|------|-------------|
| quickfile-journal-search | Search journal entries |
| quickfile-journal-create | Create a journal entry |
System Tools
| Tool | Description |
|------|-------------|
| quickfile-test-connection | Test API connection |
| quickfile-system-getaccountdetails | Get account details |
Project Structure
pets/quickfile/
├── index.ts # Plugin entry point (imports from generated client)
├── generator.ts # API method definitions & code generator
├── quickfile-client.ts # Auto-generated tools (DO NOT EDIT)
├── package.json # Pet configuration
└── README.md # This fileHow QuickFile Authentication Works
QuickFile uses MD5-based authentication. Each API request includes:
- Account Number - Your QuickFile account ID
- Application ID - Your registered application ID
- Submission Number - A unique ID for each request (auto-generated)
- MD5 Hash -
MD5(AccountNumber + APIKey + SubmissionNumber)
The plugin handles all of this automatically - you just need to provide the three credentials.
API Limits
- Daily Limit: 1,000 API calls per day (resets at midnight)
- Max Results: 200 records per search request
- Contact QuickFile support to increase limits for production applications
Example Workflows
Create and Send an Invoice
# 1. Find the client
opencode run "search for client named Acme Corp in quickfile"
# 2. Create the invoice
opencode run "create invoice for client ID 123456 with item 'Consulting Services' quantity 10 at £100 each"
# 3. Send the invoice
opencode run "send quickfile invoice 789012 by email"Monthly Financial Review
# Get P&L for the month
opencode run "get quickfile profit and loss from 2024-01-01 to 2024-01-31"
# Check outstanding invoices
opencode run "get aged debtors report from quickfile"
# Review bank transactions
opencode run "get bank transactions for account 1200 from 2024-01-01"Read-Only Mode
Enable read-only mode to prevent write operations:
# Enable for this pet
pets read-only quickfile on
# Or via environment variable
export QUICKFILE_READ_ONLY=trueWhen enabled, write tools (create, update, delete, send) are disabled.
Troubleshooting
"API not configured" Error
Ensure all three environment variables are set:
QUICKFILE_ACCOUNT_NUMBERQUICKFILE_API_KEYQUICKFILE_APPLICATION_ID
"Invalid MD5 Hash" Error
- Check your API Key is correct (copy directly from QuickFile)
- Ensure there are no extra spaces in your credentials
"Submission Number Already Used" Error
This is handled automatically - each request uses a unique submission number.
"Application Not Registered" Error
Register your application in QuickFile:
- Account Settings > 3rd Party App Integrations
- Register New Application
- Use the provided Application ID
Rate Limit Exceeded
You've hit the 1,000 daily call limit. Wait until midnight or contact QuickFile for a higher limit.
Adding New API Methods
- Edit
generator.tsand add new methods to theQUICKFILE_METHODSarray - Run
bun run generator.tsto regeneratequickfile-client.ts - Test with
opencode run "test quickfile connection"
