Skip to content

Latest commit

 

History

History
365 lines (282 loc) · 127 KB

File metadata and controls

365 lines (282 loc) · 127 KB

BankAccounts

(accounting.bank_accounts)

Overview

Available Operations

  • list - List Bank Accounts
  • create - Create Bank Account
  • get - Get Bank Account
  • update - Update Bank Account
  • delete - Delete Bank Account

list

List Bank Accounts

Example Usage

import apideck_unify
from apideck_unify import Apideck
import os


with Apideck(
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:

    res = apideck.accounting.bank_accounts.list(raw=False, service_id="salesforce", company_id="12345", limit=20, filter_={
        "name": "Main Operating",
        "account_type": apideck_unify.BankAccountsFilterAccountType.CHECKING,
        "status": apideck_unify.BankAccountsFilterStatus.ACTIVE,
    }, sort={}, pass_through={
        "search": "San Francisco",
    }, fields="id,updated_at")

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description Example
raw Optional[bool] Include raw response. Mostly used for debugging purposes
consumer_id Optional[str] ID of the consumer which you want to get or push data from test-consumer
app_id Optional[str] The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
company_id Optional[str] The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. 12345
cursor OptionalNullable[str] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response.
limit Optional[int] Number of results to return. Minimum 1, Maximum 200, Default 20
filter_ Optional[models.BankAccountsFilter] Apply filters
sort Optional[models.BankAccountsSort] Apply sorting
pass_through Dict[str, Any] Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads {
"search": "San Francisco"
}
fields OptionalNullable[str] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: fields=name,email,addresses.city

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
id,updated_at
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AccountingBankAccountsAllResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*

create

Create Bank Account

Example Usage

import apideck_unify
from apideck_unify import Apideck
import os


with Apideck(
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:

    res = apideck.accounting.bank_accounts.create(raw=False, service_id="salesforce", display_id="BA-001", name="Main Operating Account", account_number="123465", account_type=apideck_unify.AccountingBankAccountAccountType.CHECKING, ledger_account={
        "id": "123456",
        "name": "Bank account",
        "nominal_code": "N091",
        "code": "453",
        "parent_id": "123456",
        "display_id": "123456",
    }, bank_name="Chase Bank", currency=apideck_unify.Currency.USD, balance=25000, available_balance=24500, overdraft_limit=5000, routing_number="021000021", iban="GB33BUKB20201555555555", bic="CHASUS33", bsb_number="062-001", branch_identifier="001", bank_code="BNH", country="US", status=apideck_unify.AccountingBankAccountStatus.ACTIVE, description="Primary operating account for daily transactions", custom_fields=[
        {
            "id": "2389328923893298",
            "name": "employee_level",
            "description": "Employee Level",
            "value": "Uses Salesforce and Marketo",
        },
    ])

    assert res.create_bank_account_response is not None

    # Handle response
    print(res.create_bank_account_response)

Parameters

Parameter Type Required Description Example
raw Optional[bool] Include raw response. Mostly used for debugging purposes
consumer_id Optional[str] ID of the consumer which you want to get or push data from test-consumer
app_id Optional[str] The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
display_id OptionalNullable[str] Display ID for the bank account BA-001
name OptionalNullable[str] The name of the bank account Main Operating Account
account_number OptionalNullable[str] The bank account number 123465
account_type Optional[models.AccountingBankAccountAccountType] The type of bank account checking
ledger_account OptionalNullable[models.LinkedLedgerAccount] N/A
bank_name OptionalNullable[str] The name of the bank or financial institution Chase Bank
currency OptionalNullable[models.Currency] Indicates the associated currency for an amount of money. Values correspond to ISO 4217. USD
balance OptionalNullable[float] The current balance of the bank account 25000
available_balance OptionalNullable[float] The available balance (considering pending transactions and overdraft) 24500
overdraft_limit OptionalNullable[float] The overdraft limit for the account 5000
routing_number OptionalNullable[str] Bank routing number (US) 021000021
iban OptionalNullable[str] International Bank Account Number GB33BUKB20201555555555
bic OptionalNullable[str] Bank Identifier Code / SWIFT Code CHASUS33
bsb_number OptionalNullable[str] Bank State Branch number (Australia/New Zealand) 062-001
branch_identifier OptionalNullable[str] Bank branch identifier 001
bank_code OptionalNullable[str] Bank code assigned by central bank BNH
country OptionalNullable[str] Country code according to ISO 3166-1 alpha-2. US
status OptionalNullable[models.AccountingBankAccountStatus] The status of the bank account active
description OptionalNullable[str] Description or notes about the bank account Primary operating account for daily transactions
custom_fields List[models.CustomField] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AccountingBankAccountsAddResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*

get

Get Bank Account

Example Usage

import apideck_unify
from apideck_unify import Apideck
import os


with Apideck(
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:

    res = apideck.accounting.bank_accounts.get(id="<id>", filter_={
        "account_type": apideck_unify.BankAccountFilterAccountType.CHECKING,
    }, service_id="salesforce", company_id="12345", raw=False, fields="id,updated_at")

    assert res.get_bank_account_response is not None

    # Handle response
    print(res.get_bank_account_response)

Parameters

Parameter Type Required Description Example
id str ✔️ ID of the record you are acting upon.
filter_ Optional[models.BankAccountFilter] Apply filters
consumer_id Optional[str] ID of the consumer which you want to get or push data from test-consumer
app_id Optional[str] The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
company_id Optional[str] The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. 12345
raw Optional[bool] Include raw response. Mostly used for debugging purposes
fields OptionalNullable[str] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: fields=name,email,addresses.city

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
id,updated_at
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AccountingBankAccountsOneResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*

update

Update Bank Account

Example Usage

import apideck_unify
from apideck_unify import Apideck
import os


with Apideck(
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:

    res = apideck.accounting.bank_accounts.update(id="<id>", service_id="salesforce", raw=False, display_id="BA-001", name="Main Operating Account", account_number="123465", account_type=apideck_unify.AccountingBankAccountAccountType.CHECKING, ledger_account={
        "id": "123456",
        "name": "Bank account",
        "nominal_code": "N091",
        "code": "453",
        "parent_id": "123456",
        "display_id": "123456",
    }, bank_name="Chase Bank", currency=apideck_unify.Currency.USD, balance=25000, available_balance=24500, overdraft_limit=5000, routing_number="021000021", iban="GB33BUKB20201555555555", bic="CHASUS33", bsb_number="062-001", branch_identifier="001", bank_code="BNH", country="US", status=apideck_unify.AccountingBankAccountStatus.ACTIVE, description="Primary operating account for daily transactions", custom_fields=[
        {
            "id": "2389328923893298",
            "name": "employee_level",
            "description": "Employee Level",
            "value": "Uses Salesforce and Marketo",
        },
    ])

    assert res.update_bank_account_response is not None

    # Handle response
    print(res.update_bank_account_response)

Parameters

Parameter Type Required Description Example
id str ✔️ ID of the record you are acting upon.
consumer_id Optional[str] ID of the consumer which you want to get or push data from test-consumer
app_id Optional[str] The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
raw Optional[bool] Include raw response. Mostly used for debugging purposes
display_id OptionalNullable[str] Display ID for the bank account BA-001
name OptionalNullable[str] The name of the bank account Main Operating Account
account_number OptionalNullable[str] The bank account number 123465
account_type Optional[models.AccountingBankAccountAccountType] The type of bank account checking
ledger_account OptionalNullable[models.LinkedLedgerAccount] N/A
bank_name OptionalNullable[str] The name of the bank or financial institution Chase Bank
currency OptionalNullable[models.Currency] Indicates the associated currency for an amount of money. Values correspond to ISO 4217. USD
balance OptionalNullable[float] The current balance of the bank account 25000
available_balance OptionalNullable[float] The available balance (considering pending transactions and overdraft) 24500
overdraft_limit OptionalNullable[float] The overdraft limit for the account 5000
routing_number OptionalNullable[str] Bank routing number (US) 021000021
iban OptionalNullable[str] International Bank Account Number GB33BUKB20201555555555
bic OptionalNullable[str] Bank Identifier Code / SWIFT Code CHASUS33
bsb_number OptionalNullable[str] Bank State Branch number (Australia/New Zealand) 062-001
branch_identifier OptionalNullable[str] Bank branch identifier 001
bank_code OptionalNullable[str] Bank code assigned by central bank BNH
country OptionalNullable[str] Country code according to ISO 3166-1 alpha-2. US
status OptionalNullable[models.AccountingBankAccountStatus] The status of the bank account active
description OptionalNullable[str] Description or notes about the bank account Primary operating account for daily transactions
custom_fields List[models.CustomField] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AccountingBankAccountsUpdateResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*

delete

Delete Bank Account

Example Usage

from apideck_unify import Apideck
import os


with Apideck(
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:

    res = apideck.accounting.bank_accounts.delete(id="<id>", service_id="salesforce", raw=False)

    assert res.delete_bank_account_response is not None

    # Handle response
    print(res.delete_bank_account_response)

Parameters

Parameter Type Required Description Example
id str ✔️ ID of the record you are acting upon.
consumer_id Optional[str] ID of the consumer which you want to get or push data from test-consumer
app_id Optional[str] The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
raw Optional[bool] Include raw response. Mostly used for debugging purposes
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AccountingBankAccountsDeleteResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*