transaction

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2018 License: BSD-2-Clause Imports: 4 Imported by: 12

Documentation

Overview

Package transaction implements transaction entities and services

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bulk

type Bulk struct {
	// TransactionIDs The list of Transaction IDs that were created
	TransactionIDs []string `json:"transaction_ids"`
	// DuplicateImportIDs If any Transactions were not created because they had an
	// import ID matching a transaction already on the same account, the
	// specified import IDs will be included in this list
	DuplicateImportIDs []string `json:"duplicate_import_ids"`
}

Bulk represents the output of transactions being created in bulk mode Deprecated: Use BulkTransactions instead.

type ClearingStatus

type ClearingStatus string

ClearingStatus represents the clearing status of a transaction

const (
	// ClearingStatusUncleared identifies an uncleared transaction
	ClearingStatusUncleared ClearingStatus = "uncleared"
	// ClearingStatusCleared identifies a cleared transaction
	ClearingStatusCleared ClearingStatus = "cleared"
	// ClearingStatusReconciled identifies a reconciled transaction
	ClearingStatusReconciled ClearingStatus = "reconciled"
)

type CreatedTransactions

type CreatedTransactions struct {
	// TransactionIDs The list of Transaction IDs that were created
	TransactionIDs []string `json:"transaction_ids"`
	// DuplicateImportIDs If any Transactions were not created because they had an
	// import ID matching a transaction already on the same account, the
	// specified import IDs will be included in this list
	DuplicateImportIDs []string `json:"duplicate_import_ids"`
	// Transactions If multiple transactions were specified, the transactions that were saved
	Transactions []*Transaction `json:"transactions"`
	// Transactions If a single transaction was specified, the transaction that was saved
	Transaction *Transaction `json:"transaction"`
}

CreatedTransactions represents the output of transactions being created

type Filter

type Filter struct {
	Since *api.Date
	Type  *Status
}

Filter represents the optional filter while fetching transactions

func (*Filter) ToQuery

func (f *Filter) ToQuery() string

ToQuery returns the filters as a HTTP query string

type FlagColor

type FlagColor string

FlagColor represents the flag color of a transaction

const (
	// FlagColorRed identifies a transaction flagged red
	FlagColorRed FlagColor = "red"
	// FlagColorOrange identifies a transaction flagged orange
	FlagColorOrange FlagColor = "orange"
	// FlagColorYellow identifies a transaction flagged yellow
	FlagColorYellow FlagColor = "yellow"
	// FlagColorGreen identifies a transaction flagged green
	FlagColorGreen FlagColor = "green"
	// FlagColorBlue identifies a transaction flagged blue
	FlagColorBlue FlagColor = "blue"
	// FlagColorPurple identifies a transaction flagged purple
	FlagColorPurple FlagColor = "purple"
)

type Hybrid

type Hybrid struct {
	ID   string   `json:"id"`
	Date api.Date `json:"date"`
	// Amount Transaction amount in milliunits format
	Amount      int64          `json:"amount"`
	Cleared     ClearingStatus `json:"cleared"`
	Approved    bool           `json:"approved"`
	AccountID   string         `json:"account_id"`
	AccountName string         `json:"account_name"`
	// Deleted Deleted transactions will only be included in delta requests
	Deleted bool `json:"deleted"`
	Type    Type `json:"type"`

	Memo              *string    `json:"memo"`
	FlagColor         *FlagColor `json:"flag_color"`
	PayeeID           *string    `json:"payee_id"`
	CategoryID        *string    `json:"category_id"`
	TransferAccountID *string    `json:"transfer_account_id"`
	// ImportID If the Transaction was imported, this field is a unique (by account) import
	// identifier. If this transaction was imported through File Based Import or
	// Direct Import and not through the API, the import_id will have the format:
	// 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'. For example, a transaction
	// dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of
	// 'YNAB:-294230:2015-12-30:1’. If a second transaction on the same account
	// was imported and had the same date and same amount, its import_id would
	// be 'YNAB:-294230:2015-12-30:2’.
	ImportID *string `json:"import_id"`
	// ParentTransactionID For subtransaction types, this is the id of the parent transaction
	// For transaction types, this id will be always be null
	ParentTransactionID *string `json:"parent_transaction_id"`
	PayeeName           *string `json:"payee_name"`
	CategoryName        *string `json:"category_name"`
}

Hybrid represents a hybrid transaction

type PayloadTransaction

type PayloadTransaction struct {
	AccountID string   `json:"account_id"`
	Date      api.Date `json:"date"`
	// Amount The transaction amount in milliunits format
	Amount   int64          `json:"amount"`
	Cleared  ClearingStatus `json:"cleared"`
	Approved bool           `json:"approved"`

	// PayeeID Transfer payees are not permitted and will be ignored if supplied
	PayeeID *string `json:"payee_id"`
	// PayeeName If the payee name is provided and payee ID has a null value, the
	// payee name value will be used to resolve the payee by either (1) a matching
	// payee rename rule (only if import_id is also specified) or (2) a payee with
	// the same name or (3) creation of a new payee
	PayeeName *string `json:"payee_name"`
	// CategoryID Split and Credit Card Payment categories are not permitted and
	// will be ignored if supplied.
	CategoryID *string    `json:"category_id"`
	Memo       *string    `json:"memo"`
	FlagColor  *FlagColor `json:"flag_color"`
	// ImportID If the Transaction was imported, this field is a unique (by account) import
	// identifier. If this transaction was imported through File Based Import or
	// Direct Import and not through the API, the import_id will have the format:
	// 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'. For example, a transaction
	// dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of
	// 'YNAB:-294230:2015-12-30:1’. If a second transaction on the same account
	// was imported and had the same date and same amount, its import_id would
	// be 'YNAB:-294230:2015-12-30:2’.
	ImportID *string `json:"import_id"`
}

PayloadTransaction is the payload contract for saving a transaction, new or existent

type Scheduled

type Scheduled struct {
	ID        string             `json:"id"`
	DateFirst api.Date           `json:"date_first"`
	DateNext  api.Date           `json:"date_next"`
	Frequency ScheduledFrequency `json:"frequency"`
	// Amount The scheduled transaction amount in milliunits format
	Amount    int64  `json:"amount"`
	AccountID string `json:"account_id"`
	// Deleted Deleted scheduled transactions will only be included in delta requests.
	Deleted         bool                       `json:"deleted"`
	AccountName     string                     `json:"account_name"`
	SubTransactions []*ScheduledSubTransaction `json:"subtransactions"`

	Memo       *string    `json:"memo"`
	FlagColor  *FlagColor `json:"flag_color"`
	PayeeID    *string    `json:"payee_id"`
	CategoryID *string    `json:"category_id"`
	// TransferAccountID If a transfer, the account_id which the scheduled
	// transaction transfers to
	TransferAccountID *string `json:"transfer_account_id"`
	PayeeName         *string `json:"payee_name"`
	CategoryName      *string `json:"category_name"`
}

Scheduled represents a scheduled transaction for a budget

type ScheduledFrequency

type ScheduledFrequency string

ScheduledFrequency represents the frequency of a scheduled transaction or sub-transaction

const (
	// FrequencyNever identifies a transaction that will never repeat
	FrequencyNever ScheduledFrequency = "never"
	// FrequencyDaily identifies a transaction that will repeat daily
	FrequencyDaily ScheduledFrequency = "daily"
	// FrequencyWeekly identifies a transaction that will repeat weekly
	FrequencyWeekly ScheduledFrequency = "weekly"
	// FrequencyEveryOtherWeek identifies a transaction that will repeat
	// every other week
	FrequencyEveryOtherWeek ScheduledFrequency = "everyOtherWeek"
	// FrequencyTwiceAMonth identifies a transaction that will repeat
	// twice a month
	FrequencyTwiceAMonth ScheduledFrequency = "twiceAMonth"
	// FrequencyEveryFourWeeks identifies a transaction that will repeat
	// every four weeks
	FrequencyEveryFourWeeks ScheduledFrequency = "every4Weeks"
	// FrequencyMonthly identifies a transaction that will repeat monthly
	FrequencyMonthly ScheduledFrequency = "monthly"
	// FrequencyEveryOtherMonth identifies a transaction that will repeat
	// every other month
	FrequencyEveryOtherMonth ScheduledFrequency = "everyOtherMonth"
	// FrequencyEveryThreeMonths identifies a transaction that will repeat
	// every three months
	FrequencyEveryThreeMonths ScheduledFrequency = "every3Months"
	// FrequencyEveryFourMonths identifies a transaction that will repeat
	// every four months
	FrequencyEveryFourMonths ScheduledFrequency = "every4Months"
	// FrequencyTwiceAYear identifies a transaction that will repeat
	// twice a year
	FrequencyTwiceAYear ScheduledFrequency = "twiceAYear"
	// FrequencyYearly identifies a transaction that will repeat yearly
	FrequencyYearly ScheduledFrequency = "yearly"
	// FrequencyEveryOtherYear identifies a transaction that will repeat
	// every other year
	FrequencyEveryOtherYear ScheduledFrequency = "everyOtherYear"
)

type ScheduledSubTransaction

type ScheduledSubTransaction struct {
	ID                     string `json:"id"`
	ScheduledTransactionID string `json:"scheduled_transaction_id"`
	// Amount The scheduled sub-transaction amount in milliunits format
	Amount int64 `json:"amount"`
	// Deleted Deleted scheduled sub-transactions will only be included in delta requests
	Deleted bool `json:"deleted"`

	Memo       *string `json:"memo"`
	PayeeID    *string `json:"payee_id"`
	CategoryID *string `json:"category_id"`
	// TransferAccountID If a transfer, the account_id which the scheduled
	// subtransaction transfers to
	TransferAccountID *string `json:"transfer_account_id"`
}

ScheduledSubTransaction represents a scheduled sub-transaction for a scheduled transaction

type ScheduledSummary

type ScheduledSummary struct {
	ID        string             `json:"id"`
	DateFirst api.Date           `json:"date_first"`
	DateNext  api.Date           `json:"date_next"`
	Frequency ScheduledFrequency `json:"frequency"`
	// Amount The scheduled transaction amount in milliunits format
	Amount    int64  `json:"amount"`
	AccountID string `json:"account_id"`
	// Deleted Deleted scheduled transactions will only be included in delta requests.
	Deleted bool `json:"deleted"`

	Memo       *string    `json:"memo"`
	FlagColor  *FlagColor `json:"flag_color"`
	PayeeID    *string    `json:"payee_id"`
	CategoryID *string    `json:"category_id"`
	// TransferAccountID If a transfer, the account_id which the scheduled
	// transaction transfers to
	TransferAccountID *string `json:"transfer_account_id"`
}

ScheduledSummary represents the summary of a scheduled transaction for a budget

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service wraps YNAB transaction API endpoints

func NewService

func NewService(c api.ClientReaderWriter) *Service

NewService facilitates the creation of a new transaction service instance

func (*Service) BulkCreateTransactions

func (s *Service) BulkCreateTransactions(budgetID string,
	ps []PayloadTransaction) (*Bulk, error)

BulkCreateTransactions creates multiple transactions for a budget https://api.youneedabudget.com/v1#/Transactions/bulkCreateTransactions Deprecated: Use transaction.CreateTransactions instead.

Example
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
	"go.bmvs.io/ynab/api/transaction"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	p := []transaction.PayloadTransaction{
		{
			AccountID: "<valid_account_id>",
			// ...
		},
		{
			AccountID: "<another_valid_account_id>",
			// ...
		},
	}
	bulk, _ := c.Transaction().BulkCreateTransactions("<valid_budget_id>", p)
	fmt.Println(reflect.TypeOf(bulk))

}
Output:

*transaction.Bulk

func (*Service) CreateTransaction

func (s *Service) CreateTransaction(budgetID string,
	p PayloadTransaction) (*CreatedTransactions, error)

CreateTransaction creates a new transaction for a budget https://api.youneedabudget.com/v1#/Transactions/createTransaction

Example
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
	"go.bmvs.io/ynab/api/transaction"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	p := transaction.PayloadTransaction{
		AccountID: "<valid_account_id>",
		// ...
	}
	tx, _ := c.Transaction().CreateTransaction("<valid_budget_id>", p)
	fmt.Println(reflect.TypeOf(tx))

}
Output:

*transaction.CreatedTransactions

func (*Service) CreateTransactions

func (s *Service) CreateTransactions(budgetID string,
	p []PayloadTransaction) (*CreatedTransactions, error)

CreateTransactions creates one or more new transactions for a budget https://api.youneedabudget.com/v1#/Transactions/createTransaction

Example
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
	"go.bmvs.io/ynab/api/transaction"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	p := []transaction.PayloadTransaction{
		{
			AccountID: "<valid_account_id>",
			// ...
		},
	}
	tx, _ := c.Transaction().CreateTransactions("<valid_budget_id>", p)
	fmt.Println(reflect.TypeOf(tx))

}
Output:

*transaction.CreatedTransactions

func (*Service) GetScheduledTransaction

func (s *Service) GetScheduledTransaction(budgetID, scheduledTransactionID string) (*Scheduled, error)

GetScheduledTransaction fetches a specific scheduled transaction from a budget https://api.youneedabudget.com/v1#/Scheduled_Transactions/getScheduledTransactionById

Example
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	tx, _ := c.Transaction().GetScheduledTransaction("<valid_budget_id>",
		"<valid_scheduled_transaction_id>")
	fmt.Println(reflect.TypeOf(tx))

}
Output:

*transaction.Scheduled

func (*Service) GetScheduledTransactions

func (s *Service) GetScheduledTransactions(budgetID string) ([]*Scheduled, error)

GetScheduledTransactions fetches the list of scheduled transactions from a budget https://api.youneedabudget.com/v1#/Scheduled_Transactions/getScheduledTransactions

Example
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	transactions, _ := c.Transaction().GetScheduledTransactions("<valid_budget_id>")
	fmt.Println(reflect.TypeOf(transactions))

}
Output:

[]*transaction.Scheduled

func (*Service) GetTransaction

func (s *Service) GetTransaction(budgetID, transactionID string) (*Transaction, error)

GetTransaction fetches a specific transaction from a budget https://api.youneedabudget.com/v1#/Transactions/getTransactionsById

Example
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	tx, _ := c.Transaction().GetTransaction("<valid_budget_id>",
		"<valid_transaction_id>")
	fmt.Println(reflect.TypeOf(tx))

}
Output:

*transaction.Transaction

func (*Service) GetTransactions

func (s *Service) GetTransactions(budgetID string, f *Filter) ([]*Transaction, error)

GetTransactions fetches the list of transactions from a budget with filtering capabilities https://api.youneedabudget.com/v1#/Transactions/getTransactions

Example
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	transactions, _ := c.Transaction().GetTransactions("<valid_budget_id>", nil)
	fmt.Println(reflect.TypeOf(transactions))

}
Output:

[]*transaction.Transaction
Example (Filtered)
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
	"go.bmvs.io/ynab/api"
	"go.bmvs.io/ynab/api/transaction"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	date, _ := api.DateFromString("2010-09-09")
	f := &transaction.Filter{
		Since: &date,
		Type:  transaction.StatusUnapproved.Pointer(),
	}
	transactions, _ := c.Transaction().GetTransactions("<valid_budget_id>", f)
	fmt.Println(reflect.TypeOf(transactions))

}
Output:

[]*transaction.Transaction

func (*Service) GetTransactionsByAccount

func (s *Service) GetTransactionsByAccount(budgetID, accountID string,
	f *Filter) ([]*Transaction, error)

GetTransactionsByAccount fetches the list of transactions of a specific account from a budget with filtering capabilities https://api.youneedabudget.com/v1#/Transactions/getTransactionsByAccount

Example
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	transactions, _ := c.Transaction().GetTransactionsByAccount(
		"<valid_budget_id>", "<valid_account_id>", nil)
	fmt.Println(reflect.TypeOf(transactions))

}
Output:

[]*transaction.Transaction
Example (Filtered)
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
	"go.bmvs.io/ynab/api"
	"go.bmvs.io/ynab/api/transaction"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	date, _ := api.DateFromString("2010-09-09")
	f := &transaction.Filter{
		Since: &date,
		Type:  transaction.StatusUnapproved.Pointer(),
	}
	transactions, _ := c.Transaction().GetTransactionsByAccount(
		"<valid_budget_id>", "<valid_account_id>", f)
	fmt.Println(reflect.TypeOf(transactions))

}
Output:

[]*transaction.Transaction

func (*Service) GetTransactionsByCategory

func (s *Service) GetTransactionsByCategory(budgetID, categoryID string,
	f *Filter) ([]*Hybrid, error)

GetTransactionsByCategory fetches the list of transactions of a specific category from a budget with filtering capabilities https://api.youneedabudget.com/v1#/Transactions/getTransactionsByCategory

Example
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	transactions, _ := c.Transaction().GetTransactionsByCategory(
		"<valid_budget_id>", "<valid_category_id>", nil)
	fmt.Println(reflect.TypeOf(transactions))

}
Output:

[]*transaction.Hybrid
Example (Filtered)
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
	"go.bmvs.io/ynab/api"
	"go.bmvs.io/ynab/api/transaction"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	date, _ := api.DateFromString("2010-09-09")
	f := &transaction.Filter{
		Since: &date,
		Type:  transaction.StatusUnapproved.Pointer(),
	}
	transactions, _ := c.Transaction().GetTransactionsByCategory(
		"<valid_budget_id>", "<valid_category_id>", f)
	fmt.Println(reflect.TypeOf(transactions))

}
Output:

[]*transaction.Hybrid

func (*Service) GetTransactionsByPayee

func (s *Service) GetTransactionsByPayee(budgetID, payeeID string,
	f *Filter) ([]*Hybrid, error)

GetTransactionsByPayee fetches the list of transactions of a specific payee from a budget with filtering capabilities https://api.youneedabudget.com/v1#/Transactions/getTransactionsByPayee

Example
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	transactions, _ := c.Transaction().GetTransactionsByPayee(
		"<valid_budget_id>", "<valid_payee_id>", nil)
	fmt.Println(reflect.TypeOf(transactions))

}
Output:

[]*transaction.Hybrid
Example (Filtered)
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
	"go.bmvs.io/ynab/api"
	"go.bmvs.io/ynab/api/transaction"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	date, _ := api.DateFromString("2010-09-09")
	f := &transaction.Filter{
		Since: &date,
		Type:  transaction.StatusUnapproved.Pointer(),
	}
	transactions, _ := c.Transaction().GetTransactionsByPayee(
		"<valid_budget_id>", "<valid_payee_id>", f)
	fmt.Println(reflect.TypeOf(transactions))

}
Output:

[]*transaction.Hybrid

func (*Service) UpdateTransaction

func (s *Service) UpdateTransaction(budgetID, transactionID string,
	p PayloadTransaction) (*Transaction, error)

UpdateTransaction updates a whole transaction for a replacement https://api.youneedabudget.com/v1#/Transactions/updateTransaction

Example
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
	"go.bmvs.io/ynab/api/transaction"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	p := transaction.PayloadTransaction{
		AccountID: "<valid_account_id>",
		// ...
	}
	tx, _ := c.Transaction().UpdateTransaction("<valid_budget_id>",
		"<valid_transaction_id>", p)
	fmt.Println(reflect.TypeOf(tx))

}
Output:

*transaction.Transaction

type Status

type Status string

Status represents the type of a transaction

const (
	// StatusUncategorized identifies an uncategorized transaction
	StatusUncategorized Status = "uncategorized"
	// StatusUnapproved identifies an unapproved transaction
	StatusUnapproved Status = "unapproved"
)

func (Status) Pointer

func (s Status) Pointer() *Status

Pointer returns the pointer of a Status

type SubTransaction

type SubTransaction struct {
	ID            string `json:"id"`
	TransactionID string `json:"transaction_id"`
	// Amount sub-transaction amount in milliunits format
	Amount int64 `json:"amount"`
	// Deleted Deleted sub-transactions will only be included in delta requests.
	Deleted bool `json:"deleted"`

	Memo       *string `json:"memo"`
	PayeeID    *string `json:"payee_id"`
	CategoryID *string `json:"category_id"`
	// TransferAccountID If a transfer, the account_id which the
	// sub-transaction transfers to
	TransferAccountID *string `json:"transfer_account_id"`
}

SubTransaction represents a sub-transaction for a transaction

type Summary

type Summary struct {
	ID   string   `json:"id"`
	Date api.Date `json:"date"`
	// Amount Transaction amount in milliunits format
	Amount    int64          `json:"amount"`
	Cleared   ClearingStatus `json:"cleared"`
	Approved  bool           `json:"approved"`
	AccountID string         `json:"account_id"`
	// Deleted Deleted transactions will only be included in delta requests
	Deleted bool `json:"deleted"`

	Memo              *string    `json:"memo"`
	FlagColor         *FlagColor `json:"flag_color"`
	PayeeID           *string    `json:"payee_id"`
	CategoryID        *string    `json:"category_id"`
	TransferAccountID *string    `json:"transfer_account_id"`

	// ImportID If the Transaction was imported, this field is a unique (by account) import
	// identifier. If this transaction was imported through File Based Import or
	// Direct Import and not through the API, the import_id will have the format:
	// 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'. For example, a transaction
	// dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of
	// 'YNAB:-294230:2015-12-30:1’. If a second transaction on the same account
	// was imported and had the same date and same amount, its import_id would
	// be 'YNAB:-294230:2015-12-30:2’.
	ImportID *string `json:"import_id"`
}

Summary represents the summary of a transaction for a budget

type Transaction

type Transaction struct {
	ID   string   `json:"id"`
	Date api.Date `json:"date"`
	// Amount Transaction amount in milliunits format
	Amount    int64          `json:"amount"`
	Cleared   ClearingStatus `json:"cleared"`
	Approved  bool           `json:"approved"`
	AccountID string         `json:"account_id"`
	// Deleted Deleted transactions will only be included in delta requests
	Deleted         bool              `json:"deleted"`
	AccountName     string            `json:"account_name"`
	SubTransactions []*SubTransaction `json:"subtransactions"`

	Memo              *string    `json:"memo"`
	FlagColor         *FlagColor `json:"flag_color"`
	PayeeID           *string    `json:"payee_id"`
	CategoryID        *string    `json:"category_id"`
	TransferAccountID *string    `json:"transfer_account_id"`
	// ImportID If the Transaction was imported, this field is a unique (by account) import
	// identifier. If this transaction was imported through File Based Import or
	// Direct Import and not through the API, the import_id will have the format:
	// 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'. For example, a transaction
	// dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of
	// 'YNAB:-294230:2015-12-30:1’. If a second transaction on the same account
	// was imported and had the same date and same amount, its import_id would
	// be 'YNAB:-294230:2015-12-30:2’.
	ImportID     *string `json:"import_id"`
	PayeeName    *string `json:"payee_name"`
	CategoryName *string `json:"category_name"`
}

Transaction represents a full transaction for a budget

type Type

type Type string

Type represents the type of a hybrid transaction

const (
	// TypeTransaction identifies a hybrid transaction as transaction
	TypeTransaction Type = "transaction"
	// TypeSubTransaction identifies a hybrid transaction as sub-transaction
	TypeSubTransaction Type = "subtransaction"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL