### Setup Bank Accounts with Actual Budget (CLI) Source: https://context7.com/infiniteluke/actualplaid/llms.txt Initiates an interactive wizard to link bank accounts via Plaid authentication and map them to Actual Budget accounts. The configuration is saved locally for future imports. Requires environment variables for Actual Budget ID and Plaid API credentials. ```bash # Set required environment variables export ACTUAL_BUDGET_ID="My-Finances-12345" export PLAID_CLIENT_ID="5817346120sd7bfd1691vfh7" export PLAID_SECRET="8f5cd6729h0v5d247vc190ddcs4l2a" # Run the setup wizard actualplaid setup # Output: # WARNING: A Plaid Dev account has a limited number of Links. Proceed? (Y/n) # You are about to setup Plaid Links for the following Actual Budget File: My-Finances-12345. Proceed? (Y/n) # Which accounts do you want to sync with plaid? (checkbox selection) # A browser window will now open. Please link each bank you expect to sync with Actual. Proceed? (Y/n) # Opening http://localhost:3000 to link with Plaid... # Are you done linking banks? (Y/n) # Which Plaid account do you want to sync with "My Checking"? (list selection) # Setup completed successfully. Run `actualplaid import` to sync your setup banks ``` -------------------------------- ### List Synced Accounts (CLI) Source: https://context7.com/infiniteluke/actualplaid/llms.txt Displays a table of all configured account synchronization mappings, including details for both Actual Budget and Plaid accounts. This command helps users visualize their current setup. ```bash actualplaid ls # Output: # ┌─────────┬─────────────────┬──────────────┬────────────────┬────────────────┬─────────────────────┬────────────────┐ # │ (index) │ Actual Account │ Actual Type │ Plaid Bank │ Plaid Account │ Plaid Type │ Plaid Account #│ # ├─────────┼─────────────────┼──────────────┼────────────────┼────────────────┼─────────────────────┼────────────────┤ # │ 0 │ 'My Checking' │ 'checking' │ 'Chase' │ 'Checking' │ 'checking/depository'│ '1234' │ # │ 1 │ 'My Savings' │ 'savings' │ 'Chase' │ 'Savings' │ 'savings/depository' │ '5678' │ # └─────────┴─────────────────┴──────────────┴────────────────┴────────────────┴─────────────────────┴────────────────┘ ``` -------------------------------- ### Generate Plaid Link Token - Bash Source: https://context7.com/infiniteluke/actualplaid/llms.txt Generates a Plaid Link token required for initializing the Plaid Link authentication flow. This is typically called automatically by the web interface during setup. ```bash # Start the server via actualplaid setup, then: curl -X POST http://localhost:3000/create_link_token # Response: { "link_token": "link-sandbox-12345678-abcd-1234-efgh-567890abcdef" } ``` -------------------------------- ### Configure Environment Variables for Actualplaid Source: https://context7.com/infiniteluke/actualplaid/llms.txt Sets up the necessary environment variables required for Actualplaid to function. This includes the Actual Budget file ID and Plaid API credentials, along with optional configurations for Plaid environment, server port, products, and country codes. ```bash # Required: Your Actual Budget file ID (found in Settings -> Advanced) export ACTUAL_BUDGET_ID="My-Finances-12345" # Required: Plaid API credentials from https://dashboard.plaid.com/overview/development export PLAID_CLIENT_ID="5817346120sd7bfd1691vfh7" export PLAID_SECRET="8f5cd6729h0v5d247vc190ddcs4l2a" # Optional: Plaid environment (default: "development") # Use "sandbox" for testing with fake bank accounts export PLAID_ENV="sandbox" # Optional: Server port for Plaid Link (default: 3000) export APP_PORT="3000" # Optional: Plaid products to request (default: "transactions") export PLAID_PRODUCTS="transactions,auth" # Optional: Supported country codes (default: "US") export PLAID_COUNTRY_CODES="US,CA" ``` -------------------------------- ### Show Config File Location (CLI) Source: https://context7.com/infiniteluke/actualplaid/llms.txt Prints the absolute path to the actualplaid configuration file, which stores sensitive Plaid tokens and account mappings. This is useful for manual inspection or backup. ```bash actualplaid config # Output (macOS): # /Users/username/Library/Preferences/actualplaid-cli-nodejs/config.json # Output (Linux): # /home/username/.config/actualplaid-cli-nodejs/config.json # Output (Windows): # C:\Users\username\AppData\Roaming\actualplaid-cli-nodejs\Config\config.json ``` -------------------------------- ### Initialize Plaid Link Flow Source: https://github.com/infiniteluke/actualplaid/blob/master/public/index.html This script initializes the Plaid Link handler by fetching a link token from the server and configuring success and exit callbacks. It attaches an event listener to a button to trigger the Plaid authentication modal. ```javascript (async function () { const fetchLinkToken = async () => { const response = await fetch("/create_link_token", { method: "POST" }); const responseJSON = await response.json(); return responseJSON.link_token; }; const configs = { token: await fetchLinkToken(), onSuccess: async function (public_token, metadata) { await fetch("/get_access_token", { method: "POST", body: JSON.stringify({ public_token: public_token }) }); }, onExit: async function (err, metadata) { if (err != null && err.error_code === "INVALID_LINK_TOKEN") { linkHandler.destroy(); linkHandler = Plaid.create({ ...configs, token: await fetchLinkToken() }); } } }; var linkHandler = Plaid.create(configs); document.getElementById("link-button").onclick = function () { linkHandler.open(); }; })(); ``` -------------------------------- ### Import Transactions to Actual Budget (CLI) Source: https://context7.com/infiniteluke/actualplaid/llms.txt Fetches and imports transactions from linked Plaid accounts into their corresponding Actual Budget accounts. It supports importing all accounts, specific accounts, or transactions since a particular date, utilizing deduplication and tracking the last import date. ```bash # Import all accounts since the beginning of the current month actualplaid import # Import a specific account only actualplaid import --account="My Checking" # Import transactions since a specific date actualplaid import --since="2020-05-28" # Combine flags for specific account and date range actualplaid import --account="My Savings" --since="2020-01-01" # Output: # Import completed ``` -------------------------------- ### POST /create_link_token Source: https://github.com/infiniteluke/actualplaid/blob/master/public/index.html Initializes a new Plaid Link session by generating a unique link token. ```APIDOC ## POST /create_link_token ### Description Generates a link_token required to initialize the Plaid Link UI. ### Method POST ### Endpoint /create_link_token ### Request Example {} ### Response #### Success Response (200) - **link_token** (string) - The token used to initialize Plaid Link. #### Response Example { "link_token": "link-sandbox-12345" } ``` -------------------------------- ### Transform Plaid Transaction Data to Actual Budget Format - JavaScript Source: https://context7.com/infiniteluke/actualplaid/llms.txt Transforms Plaid transaction data into the format expected by Actual Budget's API. Amounts are converted from dollars to cents and inverted, as Plaid uses positive for debits while Actual uses negative. ```javascript // Plaid transaction format: { "transaction_id": "abc123", "date": "2020-06-15", "amount": 25.50, // Positive = money leaving account "merchant_name": "Coffee Shop", "name": "COFFEE SHOP #123", "pending": false } // Transformed to Actual Budget format: { "account_id": "actual-account-uuid", "date": "2020-06-15", "amount": -2550, // Negative = money leaving, in cents "payee": "Coffee Shop", "imported_payee": "Coffee Shop", "imported_id": "abc123", "pending": false } ``` -------------------------------- ### Exchange Public Token for Access Token - Bash Source: https://context7.com/infiniteluke/actualplaid/llms.txt Exchanges a Plaid public token, received after user authentication, for an access token. It stores the account details and access token in the local configuration for future imports. ```bash curl -X POST http://localhost:3000/get_access_token \ -H "Content-Type: application/json" \ -d '{"public_token": "public-sandbox-12345678-abcd-1234-efgh-567890abcdef"}' # Response: { "ok": true } ``` -------------------------------- ### POST /get_access_token Source: https://github.com/infiniteluke/actualplaid/blob/master/public/index.html Exchanges a public token received from Plaid Link for an access token to sync account data. ```APIDOC ## POST /get_access_token ### Description Exchanges the public_token obtained from the Plaid Link onSuccess callback for an access_token. ### Method POST ### Endpoint /get_access_token ### Request Body - **public_token** (string) - Required - The public token returned by Plaid Link. ### Request Example { "public_token": "public-sandbox-abc123" } ### Response #### Success Response (200) - **status** (string) - Confirmation of successful token exchange. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.