← You Need a Budget

New or Updated Transaction from You Need a Budget API

Pipedream makes it easy to connect APIs for You Need a Budget and 1000+ other apps remarkably fast.

Trigger workflow on
New or Updated Transaction from the You Need a Budget API
Next, do this
Connect to 1000+ APIs using code and no-code building blocks
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜

Trusted by 500,000+ developers from startups to Fortune 500 companies

Adyen logo
Brex logo
Carta logo
Checkr logo
Chameleon logo
DevRev logo
LinkedIn logo
Netflix logo
New Relic logo
OnDeck logo
Replicated logo
Scale AI logo
Teamwork logo
Warner Bros. logo
Xendit logo

Developers Pipedream

Getting Started

Trigger a workflow on New or Updated Transaction with You Need a Budget API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the New or Updated Transaction trigger
    1. Connect your You Need a Budget account
    2. Configure timer
    3. Select a Budget ID
    4. Optional- Configure Since Date
  2. Add steps to connect to 1000+ APIs using code and no-code building blocks
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Integrations

Send Message with Discord Webhook API on New or Updated Transaction from You Need a Budget API
You Need a Budget + Discord Webhook
 
Try it
Add Multiple Rows with Google Sheets API on New or Updated Transaction from You Need a Budget API
You Need a Budget + Google Sheets
 
Try it
Get Film with SWAPI - Star Wars API on New or Updated Transaction from You Need a Budget API
You Need a Budget + SWAPI - Star Wars
 
Try it
Create Multiple Records with Airtable API on New or Updated Transaction from You Need a Budget API
You Need a Budget + Airtable
 
Try it
Chat with OpenAI (ChatGPT) API on New or Updated Transaction from You Need a Budget API
You Need a Budget + OpenAI (ChatGPT)
 
Try it

Details

This is a pre-built, source-available component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

New or Updated Transaction on You Need a Budget
Description:Emit new event for every new or updated transaction. [See the docs](https://api.youneedabudget.com/v1#/Transactions/getTransactions)
Version:0.0.2
Key:you_need_a_budget-new-or-updated-transaction

Code

import common from "../common/common.mjs";

export default {
  ...common,
  key: "you_need_a_budget-new-or-updated-transaction",
  name: "New or Updated Transaction",
  description: "Emit new event for every new or updated transaction. [See the docs](https://api.youneedabudget.com/v1#/Transactions/getTransactions)",
  version: "0.0.2",
  type: "source",
  props: {
    ...common.props,
    budgetId: {
      propDefinition: [
        common.props.app,
        "budgetId",
      ],
      withLabel: true,
    },
    sinceDate: {
      propDefinition: [
        common.props.app,
        "date",
      ],
      label: "Since Date",
      optional: true,
    },
  },
  methods: {
    ...common.methods,
    generateMeta(event, isUpdate = false) {
      const {
        id,
        date,
        amount,
      } = event;
      const spent = this.app.convertFromMilliunit(amount);
      const ts = Date.parse(date);
      const summary = isUpdate
        ? `Updated transaction in ${this.budgetId.label}: ${spent}`
        : `New transaction in ${this.budgetId.label}: ${spent}`;
      return {
        id,
        summary,
        ts,
      };
    },
  },
  async run() {
    const lastKnowledgeOfServer = this.getLastKnowledgeOfServer();
    const emittedTransactions = this.getEmittedTransactions();

    const {
      server_knowledge: serverKnowledge,
      transactions = [],
    } = await this.app.getTransactions({
      budgetId: this.budgetId.value,
      sinceDate: this.sinceDate || undefined,
      lastKnowledgeOfServer,
    });

    this.setLastKnowledgeOfServer(serverKnowledge);

    for (const transaction of transactions) {
      let isUpdate;
      if (emittedTransactions[transaction.id]) {
        isUpdate = true;
      } else {
        emittedTransactions[transaction.id] = true;
      }
      const meta = this.generateMeta(transaction, isUpdate);
      this.$emit(transaction, meta);
    }

    this.setEmittedTransactions(emittedTransactions);
  },
};

Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
You Need a BudgetappappThis component uses the You Need a Budget app.
N/Adb$.service.dbThis component uses $.service.db to maintain state between executions.
timer$.interface.timer
Budget IDbudgetIdstringSelect a value from the drop down menu.
Since DatesinceDatestring

E.g. 2021-11-29

Authentication

You Need a Budget uses OAuth authentication. When you connect your You Need a Budget account, Pipedream will open a popup window where you can sign into You Need a Budget and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any You Need a Budget API.

Pipedream requests the following authorization scopes when you connect your account:

About You Need a Budget

Money doesn’t have to be messy. The YNAB budgeting app and its simple four-rule method will help you organize your finances, demolish your debt, save piles of cash, and reach your financial goals faster.

More Ways to Use You Need a Budget

Triggers

Category Overspent from the You Need a Budget API

Emit new event when a category budget is overspent

 
Try it
Low Account Balance from the You Need a Budget API

Emit new event when an account balance drops below a certain amount

 
Try it
Low Category Balance from the You Need a Budget API

Emit new event when a category balance drops below a certain amount

 
Try it
New Spending In Account from the You Need a Budget API

Emit new event for every spending in an account. See the docs

 
Try it
New Spending In Account from the You Need a Budget API

Emit new event for every spending in an account. See the docs

 
Try it

Actions

Create Transaction with the You Need a Budget API

Creates a single transaction. See the docs

 
Try it
Update Category Budget with the You Need a Budget API

Update a category budget for a specific month. See the docs

 
Try it