Skip to content

Debit & Credit

Debit & Credit is a personal finance app. Protocol Launcher allows you to generate Debit & Credit URLs for creating expense, income, and transfer transactions.

Usage

There are two ways to use this library:

  • On-Demand import from subpaths enables tree-shaking and keeps bundles small.
  • Full Import from the root package is convenient but includes all app modules.

Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.

Select Installation Method

On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.

URL Methods

The helpers below mirror Debit & Credit's official URL Schemes documentation. Only the documented expense, income, and transfer actions are exposed. The official query parameters must be URL-encoded; qs() handles that for generated links.

Expense

Create an expense with required amount and account. Debit & Credit documents optional description, category, payee, tag, and notes fields for this action.

On-Demand
ts
import { expense } from 'protocol-launcher/debit-credit'

const url = expense({
  amount: '500.34',
  account: 'Amex',
  category: 'Computers',
  payee: 'Apple Store',
})

Income

Create income with the same arguments documented for the expense action.

On-Demand
ts
import { income } from 'protocol-launcher/debit-credit'

const url = income({
  amount: '1200',
  account: 'Citibank',
  category: 'Salary',
  payee: 'Work',
})

Transfer

Create a transfer with required amount, source_account, and destination_account.

On-Demand
ts
import { transfer } from 'protocol-launcher/debit-credit'

const url = transfer({
  amount: '2000',
  source_account: 'Citibank',
  destination_account: 'Amex',
})

Official Documentation