API

Endpoints exposed by this deployment. Every endpoint below accepts an API key, so it can be called from a script or another app without a logged-in browser session — generate one from Settings.

Authenticating

Send your key as a bearer token:

curl -H "Authorization: Bearer dk_..." https://duitduit.vercel.app/api/export

Keys are shown once at creation and can be revoked any time from Settings. Treat a key like a password — anyone holding it can read your data.

Endpoints marked Planned aren't callable yet — they're the roadmap for an upcoming mobile app. Only endpoints marked Live work today.

Dashboard

  • GET/api/exportLive

    Exports the authenticated user's transactions as a CSV file. Optional ?from=YYYY-MM-DD&to=YYYY-MM-DD query params filter by date (inclusive on both ends); omit either or both for an unfiltered export.

    Auth: Browser session cookie, or an API key via Authorization: Bearer <key>.

    Response: text/csv

  • GET/api/transactionsLive

    List transactions, most recent first. Optional ?from=YYYY-MM-DD&to=YYYY-MM-DD filters by date (inclusive), ?category_id filters by category, ?limit (default 100, max 500) and ?offset paginate.

    Auth: Browser session cookie, or an API key via Authorization: Bearer <key>.

    Response: application/json

  • POST/api/transactionsPlanned

    Log a new transaction.

  • PATCH/api/transactions/{id}Planned

    Edit a transaction.

  • DELETE/api/transactions/{id}Planned

    Delete a transaction.

  • POST/api/transactions/importPlanned

    Bulk-import transactions from a CSV file.

Budgets

  • GET/api/categoriesPlanned

    List categories.

  • POST/api/categoriesPlanned

    Create a category.

  • PATCH/api/categories/{id}Planned

    Rename a category or change its LHDN relief link.

  • DELETE/api/categories/{id}Planned

    Delete a category.

  • GET/api/budgetsPlanned

    Get budget amounts for a given month.

  • PUT/api/budgetsPlanned

    Set a category's budget for one month.

  • PUT/api/budgets/defaultPlanned

    Set a category's default budget (all months).

Installments

  • GET/api/installments/providersPlanned

    List installment providers.

  • POST/api/installments/providersPlanned

    Add an installment provider.

  • PATCH/api/installments/providers/{id}Planned

    Rename an installment provider.

  • DELETE/api/installments/providers/{id}Planned

    Delete an installment provider.

  • GET/api/installments/plansPlanned

    List installment plans and their payment schedules.

  • POST/api/installments/plansPlanned

    Add an installment plan.

  • DELETE/api/installments/plans/{id}Planned

    Delete an installment plan.

  • PATCH/api/installments/payments/{id}Planned

    Mark a payment paid or unpaid.

  • POST/api/installments/providers/{provider}/pay-this-monthPlanned

    Mark every unpaid payment due this month for a provider as paid, in one call.

Recurring

  • GET/api/recurringPlanned

    List recurring bills.

  • POST/api/recurringPlanned

    Add a recurring bill.

  • PATCH/api/recurring/{id}Planned

    Edit a recurring bill.

  • DELETE/api/recurring/{id}Planned

    Delete a recurring bill.

  • POST/api/recurring/{id}/logPlanned

    Log this month's occurrence as a transaction and roll the due date forward.

  • PATCH/api/recurring/{id}/activePlanned

    Pause or resume a recurring bill.

Salary

  • GET/api/payslipsPlanned

    List payslips.

  • POST/api/payslipsPlanned

    Add a payslip.

  • PATCH/api/payslips/{id}Planned

    Edit a payslip.

  • DELETE/api/payslips/{id}Planned

    Delete a payslip.

Tax

  • GET/api/tax/relief-typesPlanned

    List LHDN relief types for a given assessment year.

  • POST/api/tax/relief-typesPlanned

    Add a relief type.

  • PATCH/api/tax/relief-types/{id}Planned

    Edit a relief type.

  • DELETE/api/tax/relief-types/{id}Planned

    Delete a relief type.

  • POST/api/tax/relief-types/starter-setPlanned

    Add LHDN's standard relief types for the year.

Receipts

  • GET/api/receiptsPlanned

    List scanned receipts.

  • POST/api/receipts/scanPlanned

    OCR-scan a receipt image or PDF.

  • POST/api/receipts/scan-textPlanned

    Extract structured data from pasted receipt text.

  • PATCH/api/receipts/{id}Planned

    Edit a receipt's extracted details.

  • DELETE/api/receipts/{id}Planned

    Delete a receipt.

  • POST/api/receipts/{id}/attachPlanned

    Attach a receipt to a transaction.

Settings

  • GET/api/accountsPlanned

    List accounts (bank, e-wallet, cash, ...).

  • POST/api/accountsPlanned

    Add an account.

  • PATCH/api/accounts/{id}Planned

    Edit an account.

  • DELETE/api/accounts/{id}Planned

    Delete an account.

  • GET/api/keysPlanned

    List your API keys (without their secret values).

  • POST/api/keysPlanned

    Create a new API key.

  • DELETE/api/keys/{id}Planned

    Revoke an API key.

  • DELETE/api/dataPlanned

    Permanently delete all of your data.

Auth

  • POST/api/auth/loginPlanned

    Log in with email and password.

  • POST/api/auth/signupPlanned

    Create an account.

  • POST/api/auth/logoutPlanned

    End the current session.

  • PATCH/api/auth/passwordPlanned

    Change your password.