(accounting.invoice_items)
- list - List Invoice Items
- create - Create Invoice Item
- get - Get Invoice Item
- update - Update Invoice Item
- delete - Delete Invoice Item
List Invoice Items
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.invoice_items.list(raw=False, service_id="salesforce", company_id="12345", limit=20, filter_={
"name": "Widgets Large",
"type": apideck_unify.InvoiceItemType.SERVICE,
}, sort={
"by": apideck_unify.InvoiceItemsSortBy.UPDATED_AT,
"direction": apideck_unify.SortDirection.DESC,
}, pass_through={
"search": "San Francisco",
}, fields="id,updated_at")
while res is not None:
# Handle items
res = res.next()| 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.InvoiceItemsFilter] | ➖ | Apply filters | { "updated_since": "2020-09-30T07:43:32.000Z", "name": "Widgets Large", "type": "service", "transaction_type": "sale" } |
sort |
Optional[models.InvoiceItemsSort] | ➖ | Apply sorting | { "by": "updated_at", "direction": "desc" } |
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.cityIn 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. |
models.AccountingInvoiceItemsAllResponse
| 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 Invoice Item
import apideck_unify
from apideck_unify import Apideck
from datetime import date
import os
with Apideck(
consumer_id="test-consumer",
app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:
res = apideck.accounting.invoice_items.create(raw=False, service_id="salesforce", company_id="12345", name="Model Y", description="Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", display_id="12345", code="120-C", sold=True, purchased=True, tracked=True, taxable=True, inventory_date=date.fromisoformat("2020-10-30"), type_=apideck_unify.InvoiceItemTypeType.INVENTORY, sales_details={
"unit_price": 27500.5,
"unit_of_measure": "pc.",
"tax_inclusive": True,
"tax_rate": {
"id": "123456",
"rate": 10,
},
}, purchase_details={
"unit_price": 27500.5,
"unit_of_measure": "pc.",
"tax_inclusive": True,
"tax_rate": {
"id": "123456",
"rate": 10,
},
}, quantity=1, unit_price=27500.5, currency=apideck_unify.Currency.USD, asset_account={
"id": "123456",
"nominal_code": "N091",
"code": "453",
}, income_account={
"id": "123456",
"nominal_code": "N091",
"code": "453",
}, expense_account={
"id": "123456",
"nominal_code": "N091",
"code": "453",
}, tracking_categories=[
{
"id": "123456",
"name": "New York",
},
{
"id": "123456",
"name": "New York",
},
], active=True, department_id="12345", location_id="12345", subsidiary_id="12345", category_id="12345", tax_schedule_id="123456", row_version="1-12345", pass_through=[
{
"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",
},
},
},
],
},
{
"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",
},
},
},
],
},
{
"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",
},
},
},
],
},
])
assert res.create_invoice_item_response is not None
# Handle response
print(res.create_invoice_item_response)| 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 |
name |
OptionalNullable[str] | ➖ | Item name | Model Y |
description |
OptionalNullable[str] | ➖ | A short description of the item | Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection. |
display_id |
OptionalNullable[str] | ➖ | Display ID of the item | 12345 |
code |
OptionalNullable[str] | ➖ | User defined item code | 120-C |
sold |
OptionalNullable[bool] | ➖ | Item will be available on sales transactions | true |
purchased |
OptionalNullable[bool] | ➖ | Item is available for purchase transactions | true |
tracked |
OptionalNullable[bool] | ➖ | Item is inventoried | true |
taxable |
OptionalNullable[bool] | ➖ | If true, transactions for this item are taxable | true |
inventory_date |
datetime | ➖ | The date of opening balance if inventory item is tracked - YYYY-MM-DD. | 2020-10-30 |
type |
OptionalNullable[models.InvoiceItemTypeType] | ➖ | Item type | inventory |
sales_details |
Optional[models.InvoiceItemSalesDetails] | ➖ | N/A | |
purchase_details |
Optional[models.InvoiceItemPurchaseDetails] | ➖ | N/A | |
quantity |
OptionalNullable[float] | ➖ | N/A | 1 |
unit_price |
OptionalNullable[float] | ➖ | N/A | 27500.5 |
currency |
OptionalNullable[models.Currency] | ➖ | Indicates the associated currency for an amount of money. Values correspond to ISO 4217. | USD |
asset_account |
OptionalNullable[models.LinkedLedgerAccount] | ➖ | N/A | |
income_account |
OptionalNullable[models.LinkedLedgerAccount] | ➖ | N/A | |
expense_account |
OptionalNullable[models.LinkedLedgerAccount] | ➖ | N/A | |
tracking_category |
OptionalNullable[models.DeprecatedLinkedTrackingCategory] | ➖ | : warning: ** DEPRECATED **: This field is deprecated and may be removed in a future version.. | |
tracking_categories |
List[Nullable[models.LinkedTrackingCategory]] | ➖ | A list of linked tracking categories. | |
active |
OptionalNullable[bool] | ➖ | N/A | true |
department_id |
OptionalNullable[str] | ➖ | The ID of the department | 12345 |
location_id |
OptionalNullable[str] | ➖ | The ID of the location | 12345 |
subsidiary_id |
OptionalNullable[str] | ➖ | The ID of the subsidiary | 12345 |
category_id |
OptionalNullable[str] | ➖ | ID of the category of the item | 12345 |
tax_schedule_id |
OptionalNullable[str] | ➖ | The ID of the tax schedule | 123456 |
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. | |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.AccountingInvoiceItemsAddResponse
| 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 Invoice Item
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.invoice_items.get(id="<id>", service_id="salesforce", company_id="12345", raw=False, fields="id,updated_at", filter_={
"type": apideck_unify.InvoiceItemFilterInvoiceItemType.SERVICE,
})
assert res.get_invoice_item_response is not None
# Handle response
print(res.get_invoice_item_response)| 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 |
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.cityIn 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 |
filter_ |
Optional[models.InvoiceItemFilter] | ➖ | Apply filters | { "type": "service", "transaction_type": "purchase" } |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.AccountingInvoiceItemsOneResponse
| 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 Invoice Item
import apideck_unify
from apideck_unify import Apideck
from datetime import date
import os
with Apideck(
consumer_id="test-consumer",
app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:
res = apideck.accounting.invoice_items.update(id="<id>", service_id="salesforce", raw=False, name="Model Y", description="Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", display_id="12345", code="120-C", sold=True, purchased=True, tracked=True, taxable=True, inventory_date=date.fromisoformat("2020-10-30"), type_=apideck_unify.InvoiceItemTypeType.INVENTORY, sales_details={
"unit_price": 27500.5,
"unit_of_measure": "pc.",
"tax_inclusive": True,
"tax_rate": {
"id": "123456",
"rate": 10,
},
}, purchase_details={
"unit_price": 27500.5,
"unit_of_measure": "pc.",
"tax_inclusive": True,
"tax_rate": {
"id": "123456",
"rate": 10,
},
}, quantity=1, unit_price=27500.5, currency=apideck_unify.Currency.USD, asset_account={
"id": "123456",
"nominal_code": "N091",
"code": "453",
}, income_account={
"id": "123456",
"nominal_code": "N091",
"code": "453",
}, expense_account={
"id": "123456",
"nominal_code": "N091",
"code": "453",
}, tracking_categories=[
{
"id": "123456",
"name": "New York",
},
], active=True, department_id="12345", location_id="12345", subsidiary_id="12345", category_id="12345", tax_schedule_id="123456", row_version="1-12345", pass_through=[
{
"service_id": "<id>",
"extend_paths": [
{
"path": "$.nested.property",
"value": {
"TaxClassificationRef": {
"value": "EUC-99990201-V1-00020000",
},
},
},
],
},
])
assert res.update_invoice_items_response is not None
# Handle response
print(res.update_invoice_items_response)| 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 | |
name |
OptionalNullable[str] | ➖ | Item name | Model Y |
description |
OptionalNullable[str] | ➖ | A short description of the item | Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection. |
display_id |
OptionalNullable[str] | ➖ | Display ID of the item | 12345 |
code |
OptionalNullable[str] | ➖ | User defined item code | 120-C |
sold |
OptionalNullable[bool] | ➖ | Item will be available on sales transactions | true |
purchased |
OptionalNullable[bool] | ➖ | Item is available for purchase transactions | true |
tracked |
OptionalNullable[bool] | ➖ | Item is inventoried | true |
taxable |
OptionalNullable[bool] | ➖ | If true, transactions for this item are taxable | true |
inventory_date |
datetime | ➖ | The date of opening balance if inventory item is tracked - YYYY-MM-DD. | 2020-10-30 |
type |
OptionalNullable[models.InvoiceItemTypeType] | ➖ | Item type | inventory |
sales_details |
Optional[models.InvoiceItemSalesDetails] | ➖ | N/A | |
purchase_details |
Optional[models.InvoiceItemPurchaseDetails] | ➖ | N/A | |
quantity |
OptionalNullable[float] | ➖ | N/A | 1 |
unit_price |
OptionalNullable[float] | ➖ | N/A | 27500.5 |
currency |
OptionalNullable[models.Currency] | ➖ | Indicates the associated currency for an amount of money. Values correspond to ISO 4217. | USD |
asset_account |
OptionalNullable[models.LinkedLedgerAccount] | ➖ | N/A | |
income_account |
OptionalNullable[models.LinkedLedgerAccount] | ➖ | N/A | |
expense_account |
OptionalNullable[models.LinkedLedgerAccount] | ➖ | N/A | |
tracking_category |
OptionalNullable[models.DeprecatedLinkedTrackingCategory] | ➖ | : warning: ** DEPRECATED **: This field is deprecated and may be removed in a future version.. | |
tracking_categories |
List[Nullable[models.LinkedTrackingCategory]] | ➖ | A list of linked tracking categories. | |
active |
OptionalNullable[bool] | ➖ | N/A | true |
department_id |
OptionalNullable[str] | ➖ | The ID of the department | 12345 |
location_id |
OptionalNullable[str] | ➖ | The ID of the location | 12345 |
subsidiary_id |
OptionalNullable[str] | ➖ | The ID of the subsidiary | 12345 |
category_id |
OptionalNullable[str] | ➖ | ID of the category of the item | 12345 |
tax_schedule_id |
OptionalNullable[str] | ➖ | The ID of the tax schedule | 123456 |
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. | |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.AccountingInvoiceItemsUpdateResponse
| 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 Invoice Item
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.invoice_items.delete(id="<id>", service_id="salesforce", raw=False)
assert res.delete_tax_rate_response is not None
# Handle response
print(res.delete_tax_rate_response)| 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. |
models.AccountingInvoiceItemsDeleteResponse
| 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 | */* |