Skip to content

Latest commit

 

History

History
474 lines (342 loc) · 16 KB

TransactionsApi.md

File metadata and controls

474 lines (342 loc) · 16 KB

ynab.TransactionsApi

All URIs are relative to https://api.youneedabudget.com/v1

Method HTTP request Description
bulk_create_transactions POST /budgets/{budget_id}/transactions/bulk Bulk create transactions
create_transaction POST /budgets/{budget_id}/transactions Create new transaction
get_transactions GET /budgets/{budget_id}/transactions List transactions
get_transactions_by_account GET /budgets/{budget_id}/accounts/{account_id}/transactions List account transactions
get_transactions_by_category GET /budgets/{budget_id}/categories/{category_id}/transactions List category transactions
get_transactions_by_id GET /budgets/{budget_id}/transactions/{transaction_id} Single transaction
get_transactions_by_payee GET /budgets/{budget_id}/payees/{payee_id}/transactions List payee transactions
update_transaction PUT /budgets/{budget_id}/transactions/{transaction_id} Updates an existing transaction

bulk_create_transactions

BulkResponse bulk_create_transactions(budget_id, transactions)

Bulk create transactions

Creates multiple transactions

Example

from __future__ import print_function
import time
import ynab
from ynab.rest import ApiException
from pprint import pprint

# Configure API key authorization: bearer
configuration = ynab.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration))
budget_id = 'budget_id_example' # str | The ID of the Budget.
transactions = ynab.BulkTransactions() # BulkTransactions | The list of Transactions to create.

try:
    # Bulk create transactions
    api_response = api_instance.bulk_create_transactions(budget_id, transactions)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TransactionsApi->bulk_create_transactions: %s\n" % e)

Parameters

Name Type Description Notes
budget_id str The ID of the Budget.
transactions BulkTransactions The list of Transactions to create.

Return type

BulkResponse

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_transaction

TransactionResponse create_transaction(budget_id, transaction)

Create new transaction

Creates a transaction

Example

from __future__ import print_function
import time
import ynab
from ynab.rest import ApiException
from pprint import pprint

# Configure API key authorization: bearer
configuration = ynab.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration))
budget_id = 'budget_id_example' # str | The ID of the Budget.
transaction = ynab.SaveTransactionWrapper() # SaveTransactionWrapper | The Transaction to create.

try:
    # Create new transaction
    api_response = api_instance.create_transaction(budget_id, transaction)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TransactionsApi->create_transaction: %s\n" % e)

Parameters

Name Type Description Notes
budget_id str The ID of the Budget.
transaction SaveTransactionWrapper The Transaction to create.

Return type

TransactionResponse

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_transactions

TransactionsResponse get_transactions(budget_id, since_date=since_date, type=type)

List transactions

Returns budget transactions

Example

from __future__ import print_function
import time
import ynab
from ynab.rest import ApiException
from pprint import pprint

# Configure API key authorization: bearer
configuration = ynab.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration))
budget_id = 'budget_id_example' # str | The ID of the Budget.
since_date = '2013-10-20' # date | Only return transactions on or after this date. (optional)
type = 'type_example' # str | Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved') (optional)

try:
    # List transactions
    api_response = api_instance.get_transactions(budget_id, since_date=since_date, type=type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TransactionsApi->get_transactions: %s\n" % e)

Parameters

Name Type Description Notes
budget_id str The ID of the Budget.
since_date date Only return transactions on or after this date. [optional]
type str Only return transactions of a certain type (i.e. 'uncategorized', 'unapproved') [optional]

Return type

TransactionsResponse

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_transactions_by_account

TransactionsResponse get_transactions_by_account(budget_id, account_id, since_date=since_date)

List account transactions

Returns all transactions for a specified account

Example

from __future__ import print_function
import time
import ynab
from ynab.rest import ApiException
from pprint import pprint

# Configure API key authorization: bearer
configuration = ynab.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration))
budget_id = 'budget_id_example' # str | The ID of the Budget.
account_id = 'account_id_example' # str | The ID of the Account.
since_date = '2013-10-20' # date | Only return transactions on or after this date. (optional)

try:
    # List account transactions
    api_response = api_instance.get_transactions_by_account(budget_id, account_id, since_date=since_date)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TransactionsApi->get_transactions_by_account: %s\n" % e)

Parameters

Name Type Description Notes
budget_id str The ID of the Budget.
account_id str The ID of the Account.
since_date date Only return transactions on or after this date. [optional]

Return type

TransactionsResponse

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_transactions_by_category

HybridTransactionsResponse get_transactions_by_category(budget_id, category_id, since_date=since_date)

List category transactions

Returns all transactions for a specified category

Example

from __future__ import print_function
import time
import ynab
from ynab.rest import ApiException
from pprint import pprint

# Configure API key authorization: bearer
configuration = ynab.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration))
budget_id = 'budget_id_example' # str | The ID of the Budget.
category_id = 'category_id_example' # str | The ID of the Category.
since_date = '2013-10-20' # date | Only return transactions on or after this date. (optional)

try:
    # List category transactions
    api_response = api_instance.get_transactions_by_category(budget_id, category_id, since_date=since_date)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TransactionsApi->get_transactions_by_category: %s\n" % e)

Parameters

Name Type Description Notes
budget_id str The ID of the Budget.
category_id str The ID of the Category.
since_date date Only return transactions on or after this date. [optional]

Return type

HybridTransactionsResponse

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_transactions_by_id

TransactionResponse get_transactions_by_id(budget_id, transaction_id)

Single transaction

Returns a single transaction

Example

from __future__ import print_function
import time
import ynab
from ynab.rest import ApiException
from pprint import pprint

# Configure API key authorization: bearer
configuration = ynab.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration))
budget_id = 'budget_id_example' # str | The ID of the Budget.
transaction_id = 'transaction_id_example' # str | The ID of the Transaction.

try:
    # Single transaction
    api_response = api_instance.get_transactions_by_id(budget_id, transaction_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TransactionsApi->get_transactions_by_id: %s\n" % e)

Parameters

Name Type Description Notes
budget_id str The ID of the Budget.
transaction_id str The ID of the Transaction.

Return type

TransactionResponse

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_transactions_by_payee

HybridTransactionsResponse get_transactions_by_payee(budget_id, payee_id, since_date=since_date)

List payee transactions

Returns all transactions for a specified payee

Example

from __future__ import print_function
import time
import ynab
from ynab.rest import ApiException
from pprint import pprint

# Configure API key authorization: bearer
configuration = ynab.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration))
budget_id = 'budget_id_example' # str | The ID of the Budget.
payee_id = 'payee_id_example' # str | The ID of the Payee.
since_date = '2013-10-20' # date | Only return transactions on or after this date. (optional)

try:
    # List payee transactions
    api_response = api_instance.get_transactions_by_payee(budget_id, payee_id, since_date=since_date)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TransactionsApi->get_transactions_by_payee: %s\n" % e)

Parameters

Name Type Description Notes
budget_id str The ID of the Budget.
payee_id str The ID of the Payee.
since_date date Only return transactions on or after this date. [optional]

Return type

HybridTransactionsResponse

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_transaction

TransactionResponse update_transaction(budget_id, transaction_id, transaction)

Updates an existing transaction

Updates a transaction

Example

from __future__ import print_function
import time
import ynab
from ynab.rest import ApiException
from pprint import pprint

# Configure API key authorization: bearer
configuration = ynab.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = ynab.TransactionsApi(ynab.ApiClient(configuration))
budget_id = 'budget_id_example' # str | The ID of the Budget.
transaction_id = 'transaction_id_example' # str | The ID of the Transaction.
transaction = ynab.SaveTransactionWrapper() # SaveTransactionWrapper | The Transaction to update.

try:
    # Updates an existing transaction
    api_response = api_instance.update_transaction(budget_id, transaction_id, transaction)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TransactionsApi->update_transaction: %s\n" % e)

Parameters

Name Type Description Notes
budget_id str The ID of the Budget.
transaction_id str The ID of the Transaction.
transaction SaveTransactionWrapper The Transaction to update.

Return type

TransactionResponse

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]