Skip to content

Latest commit

 

History

History
419 lines (339 loc) · 99 KB

README.md

File metadata and controls

419 lines (339 loc) · 99 KB

TaxRates

(accounting.tax_rates)

Overview

Available Operations

list

List Tax Rates. Note: Not all connectors return the actual rate/percentage value. In this case, only the tax code or reference is returned. Connectors Affected: Quickbooks

Example Usage

from apideck_unify import Apideck
import os

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

    res = apideck.accounting.tax_rates.list(service_id="salesforce", filter_={
        "assets": True,
        "equity": True,
        "expenses": True,
        "liabilities": True,
        "revenue": True,
    }, 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
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
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.TaxRatesFilter] Apply filters {
"assets": true,
"equity": true,
"expenses": true,
"liabilities": true,
"revenue": true
}
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.AccountingTaxRatesAllResponse

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 Tax Rate

Example Usage

import apideck_unify
from apideck_unify import Apideck
import os

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

    res = apideck.accounting.tax_rates.create(service_id="salesforce", id="1234", name="GST on Purchases", code="ABN", description="Reduced rate GST Purchases", effective_tax_rate=10, total_tax_rate=10, tax_payable_account_id="123456", tax_remitted_account_id="123456", components=[
        {
            "id": "10",
            "name": "GST",
            "rate": 10,
            "compound": True,
        },
    ], type_="NONE", report_tax_type="NONE", original_tax_rate_id="12345", status=apideck_unify.TaxRateStatus.ACTIVE, row_version="1-12345", pass_through=[
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
    ], custom_fields=[
        {
            "id": "2389328923893298",
            "name": "employee_level",
            "description": "Employee Level",
            "value": True,
        },
    ])

    assert res.create_tax_rate_response is not None

    # Handle response
    print(res.create_tax_rate_response)

Parameters

Parameter Type Required Description Example
raw Optional[bool] Include raw response. Mostly used for debugging purposes
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
id OptionalNullable[str] ID assigned to identify this tax rate. 1234
name Optional[str] Name assigned to identify this tax rate. GST on Purchases
code OptionalNullable[str] Tax code assigned to identify this tax rate. ABN
description OptionalNullable[str] Description of tax rate Reduced rate GST Purchases
effective_tax_rate OptionalNullable[float] Effective tax rate 10
total_tax_rate OptionalNullable[float] Not compounded sum of the components of a tax rate 10
tax_payable_account_id OptionalNullable[str] Unique identifier for the account for tax collected. 123456
tax_remitted_account_id OptionalNullable[str] Unique identifier for the account for tax remitted. 123456
components List[models.Components] N/A
type OptionalNullable[str] Tax type used to indicate the source of tax collected or paid NONE
report_tax_type OptionalNullable[str] Report Tax type to aggregate tax collected or paid for reporting purposes NONE
original_tax_rate_id OptionalNullable[str] ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. 12345
status OptionalNullable[models.TaxRateStatus] Tax rate status active
row_version OptionalNullable[str] A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. 1-12345
pass_through List[models.PassThroughBody] The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.
subsidiaries List[models.SubsidiariesModel] The subsidiaries this belongs to.
custom_fields List[models.CustomField] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AccountingTaxRatesAddResponse

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 Tax Rate. Note: Not all connectors return the actual rate/percentage value. In this case, only the tax code or reference is returned. Support will soon be added to return the actual rate/percentage by doing additional calls in the background to provide the full view of a given tax rate. Connectors Affected: Quickbooks

Example Usage

from apideck_unify import Apideck
import os

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

    res = apideck.accounting.tax_rates.get(id="<id>", service_id="salesforce", fields="id,updated_at")

    assert res.get_tax_rate_response is not None

    # Handle response
    print(res.get_tax_rate_response)

Parameters

Parameter Type Required Description Example
id str ✔️ ID of the record you are acting upon.
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
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.AccountingTaxRatesOneResponse

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 Tax Rate

Example Usage

import apideck_unify
from apideck_unify import Apideck
import os

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

    res = apideck.accounting.tax_rates.update(id_param="<id>", service_id="salesforce", id="1234", name="GST on Purchases", code="ABN", description="Reduced rate GST Purchases", effective_tax_rate=10, total_tax_rate=10, tax_payable_account_id="123456", tax_remitted_account_id="123456", components=[
        {
            "id": "10",
            "name": "GST",
            "rate": 10,
            "compound": True,
        },
        {
            "id": "10",
            "name": "GST",
            "rate": 10,
            "compound": True,
        },
        {
            "id": "10",
            "name": "GST",
            "rate": 10,
            "compound": True,
        },
    ], type_="NONE", report_tax_type="NONE", original_tax_rate_id="12345", status=apideck_unify.TaxRateStatus.ACTIVE, row_version="1-12345", pass_through=[
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
    ], custom_fields=[
        {
            "id": "2389328923893298",
            "name": "employee_level",
            "description": "Employee Level",
            "value": [
                {},
            ],
        },
    ])

    assert res.update_tax_rate_response is not None

    # Handle response
    print(res.update_tax_rate_response)

Parameters

Parameter Type Required Description Example
id_param str ✔️ ID of the record you are acting upon.
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
id OptionalNullable[str] ID assigned to identify this tax rate. 1234
name Optional[str] Name assigned to identify this tax rate. GST on Purchases
code OptionalNullable[str] Tax code assigned to identify this tax rate. ABN
description OptionalNullable[str] Description of tax rate Reduced rate GST Purchases
effective_tax_rate OptionalNullable[float] Effective tax rate 10
total_tax_rate OptionalNullable[float] Not compounded sum of the components of a tax rate 10
tax_payable_account_id OptionalNullable[str] Unique identifier for the account for tax collected. 123456
tax_remitted_account_id OptionalNullable[str] Unique identifier for the account for tax remitted. 123456
components List[models.Components] N/A
type OptionalNullable[str] Tax type used to indicate the source of tax collected or paid NONE
report_tax_type OptionalNullable[str] Report Tax type to aggregate tax collected or paid for reporting purposes NONE
original_tax_rate_id OptionalNullable[str] ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. 12345
status OptionalNullable[models.TaxRateStatus] Tax rate status active
row_version OptionalNullable[str] A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. 1-12345
pass_through List[models.PassThroughBody] The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.
subsidiaries List[models.SubsidiariesModel] The subsidiaries this belongs to.
custom_fields List[models.CustomField] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AccountingTaxRatesUpdateResponse

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 Tax Rate

Example Usage

from apideck_unify import Apideck
import os

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

    res = apideck.accounting.tax_rates.delete(id="<id>", service_id="salesforce")

    assert res.delete_tax_rate_response is not None

    # Handle response
    print(res.delete_tax_rate_response)

Parameters

Parameter Type Required Description Example
id str ✔️ ID of the record you are acting upon.
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.AccountingTaxRatesDeleteResponse

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 */*