Skip to content

Latest commit

 

History

History
273 lines (194 loc) · 24.8 KB

File metadata and controls

273 lines (194 loc) · 24.8 KB

Exemptions

Overview

Available Operations

list

Retrieve a list of exemptions based on filters.

Example Usage

from kintsugi_tax_platform_sdk import SDK, models


with SDK(
    security=models.Security(
        api_key_header="<YOUR_API_KEY_HERE>",
        custom_header="<YOUR_API_KEY_HERE>",
    ),
) as sdk:

    res = sdk.exemptions.list(search_query="John", status_in="ACTIVE,INACTIVE,EXPIRED", country_code=[

    ], jurisdiction="CA", start_date="2024-01-01", end_date="2024-01-01", customer_id="cust_1234", transaction_id="trans_1234", order_by="end_date,FEIN,sales_tax_id,status", page=1, size=50)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
search_query Optional[str] Search term to filter exemptions by exemption ID, customer name, or customer email John
status_in Optional[str] Filter exemptions by their status
country_code List[models.CountryCodeEnum] Country code in ISO 3166-1 alpha-2 format US
jurisdiction Optional[str] Jurisdiction identifier CA
start_date Optional[str] Start date for filtering exemptions 2024-01-01
end_date Optional[str] End date for filtering exemptions 2024-01-01
customer_id Optional[str] Customer ID to filter exemptions cust_1234
transaction_id Optional[str] Transaction ID to filter exemptions trans_1234
order_by Optional[str] Fields to sort by (comma-separated)
page Optional[int] Page number
size Optional[int] Page size
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.FastapiPaginationDefaultPageExemptionRead2

Errors

Error Type Status Code Content Type
errors.ErrorResponse 401 application/json
errors.BackendSrcExemptionsResponsesValidationErrorResponse 422 application/json
errors.ErrorResponse 500 application/json
errors.APIError 4XX, 5XX */*

create

The Create Exemption API allows you to create a new exemption record. This includes defining details such as exemption type, jurisdiction, Country, State, validity dates, etc.

Example Usage

from datetime import date
from kintsugi_tax_platform_sdk import SDK, models


with SDK(
    security=models.Security(
        api_key_header="<YOUR_API_KEY_HERE>",
        custom_header="<YOUR_API_KEY_HERE>",
    ),
) as sdk:

    res = sdk.exemptions.create(exemption_type=models.ExemptionType.WHOLESALE, start_date=date.fromisoformat("2024-01-01"), customer_id="cust_001", fein="12-3456789", sales_tax_id="ST-98765", status=models.ExemptionStatus.ACTIVE, jurisdiction="CA", country_code=models.CountryCodeEnum.US, end_date="2026-01-01", transaction_id="txn_123", reseller=True)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
exemption_type models.ExemptionType ✔️ N/A
start_date datetime ✔️ Start date for the exemption validity period (YYYY-MM-DD format)
customer_id str ✔️ Unique identifier for the customer associated with the exemption
fein str ✔️ Federal Employer Identification Number
sales_tax_id str ✔️ Sales tax ID for the exemption
status models.ExemptionStatus ✔️ N/A
jurisdiction Optional[str] The jurisdiction identifier for the exemption
country_code Optional[models.CountryCodeEnum] N/A
end_date Optional[str] End date for the exemption validity period (YYYY-MM-DD format)
transaction_id Optional[str] Unique identifier for the transaction, if applicable
reseller Optional[bool] Indicates whether the exemption is for a reseller
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.BackendSrcExemptionsSerializersExemptionRead

Errors

Error Type Status Code Content Type
errors.ErrorResponse 401 application/json
errors.BackendSrcExemptionsResponsesValidationErrorResponse 422 application/json
errors.ErrorResponse 500 application/json
errors.APIError 4XX, 5XX */*

get

The Get Exemption By ID API retrieves a specific exemption record by its unique ID. This API is useful for retrieving detailed information about a particular exemption, including its associated customer, organisation id, status, etc.

Example Usage

from kintsugi_tax_platform_sdk import SDK, models


with SDK(
    security=models.Security(
        api_key_header="<YOUR_API_KEY_HERE>",
        custom_header="<YOUR_API_KEY_HERE>",
    ),
) as sdk:

    res = sdk.exemptions.get(exemption_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
exemption_id str ✔️ The unique identifier for the exemption being retrieved.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.BackendSrcExemptionsModelsExemptionRead

Errors

Error Type Status Code Content Type
errors.ErrorResponse 404 application/json
errors.BackendSrcExemptionsResponsesValidationErrorResponse 422 application/json
errors.ErrorResponse 500 application/json
errors.APIError 4XX, 5XX */*

upload_certificate

The Upload Exemption Certificate API allows you to upload a file attachment (e.g., exemption certificate) for a specific exemption. This is primarily used to associate supporting documents with an exemption record to ensure compliance and facilitate verification.

Example Usage

from kintsugi_tax_platform_sdk import SDK, models


with SDK(
    security=models.Security(
        api_key_header="<YOUR_API_KEY_HERE>",
        custom_header="<YOUR_API_KEY_HERE>",
    ),
) as sdk:

    res = sdk.exemptions.upload_certificate(exemption_id="<id>", file={
        "file_name": "example.file",
        "content": open("example.file", "rb"),
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
exemption_id str ✔️ The unique identifier for the exemption to which the attachment will be associated.
file models.File ✔️ The file to be uploaded. Supported format: PDF. Max size: 10 MB.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AttachmentRead

Errors

Error Type Status Code Content Type
errors.ErrorResponse 401 application/json
errors.BackendSrcExemptionsResponsesValidationErrorResponse 422 application/json
errors.ErrorResponse 500 application/json
errors.APIError 4XX, 5XX */*

list_attachments

The Get Attachments for Exemption API retrieves all attachments associated with a specific exemption. This is used to view and manage supporting documents like exemption certificates uploaded for a particular exemption record.

Example Usage

from kintsugi_tax_platform_sdk import SDK, models


with SDK(
    security=models.Security(
        api_key_header="<YOUR_API_KEY_HERE>",
        custom_header="<YOUR_API_KEY_HERE>",
    ),
) as sdk:

    res = sdk.exemptions.list_attachments(exemption_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
exemption_id str ✔️ The unique identifier for the exemption
whose attachments are being retrieved.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

List[models.AttachmentRead]

Errors

Error Type Status Code Content Type
errors.ErrorResponse 401 application/json
errors.BackendSrcExemptionsResponsesValidationErrorResponse 422 application/json
errors.APIError 4XX, 5XX */*