(accounting.bills)
- list - List Bills
- create - Create Bill
- get - Get Bill
- update - Update Bill
- delete - Delete Bill
- create_batch - Create Bills in batch
List Bills
import apideck_unify
from apideck_unify import Apideck
from apideck_unify.utils import parse_datetime
import os
with Apideck(
consumer_id="test-consumer",
app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:
res = apideck.accounting.bills.list(raw=False, service_id="salesforce", company_id="12345", limit=20, filter_={
"updated_since": parse_datetime("2020-09-30T07:43:32.000Z"),
}, sort={
"by": apideck_unify.By.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.BillsFilter] | ➖ | Apply filters | { "updated_since": "2020-09-30T07:43:32.000Z", "status": "paid", "id_since": "1", "billed_since": "2020-09-30", "due_since": "2020-09-30", "bill_number": "10001", "reference": "PO-9711" } |
sort |
Optional[models.BillsSort] | ➖ | 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.AccountingBillsAllResponse
| 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 Bill
import apideck_unify
from apideck_unify import Apideck
from apideck_unify.utils import parse_datetime
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.bills.create(raw=False, service_id="salesforce", idempotency_key="your-unique-key-per-create", display_id="123456", bill_number="10001", supplier={
"id": "12345",
"display_name": "Windsurf Shop",
"address": {
"id": "123",
"type": apideck_unify.Type.PRIMARY,
"string": "25 Spring Street, Blackburn, VIC 3130",
"name": "HQ US",
"line1": "Main street",
"line2": "apt #",
"line3": "Suite #",
"line4": "delivery instructions",
"street_number": "25",
"city": "San Francisco",
"state": "CA",
"postal_code": "94104",
"country": "US",
"latitude": "40.759211",
"longitude": "-73.984638",
"county": "Santa Clara",
"contact_name": "Elon Musk",
"salutation": "Mr",
"phone_number": "111-111-1111",
"fax": "122-111-1111",
"email": "elon@musk.com",
"website": "https://elonmusk.com",
"notes": "Address notes or delivery instructions.",
"row_version": "1-12345",
},
}, company_id="12345", subsidiary={
"display_id": "123456",
"name": "Acme Inc.",
}, location_id="12345", department_id="12345", currency=apideck_unify.Currency.USD, currency_rate=0.69, tax_inclusive=True, bill_date=date.fromisoformat("2020-09-30"), due_date=date.fromisoformat("2020-10-30"), paid_date=date.fromisoformat("2020-10-30"), po_number="90000117", reference="123456", line_items=[
{
"row_id": "12345",
"code": "120-C",
"line_number": 1,
"description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
"type": apideck_unify.LineItemType.EXPENSE_ACCOUNT,
"tax_amount": 27500,
"total_amount": 27500,
"quantity": 1,
"unit_price": 27500.5,
"unit_of_measure": "pc.",
"discount_percentage": 0.01,
"discount_amount": 19.99,
"location_id": "12345",
"department_id": "12345",
"item": {
"id": "12344",
"code": "120-C",
"name": "Model Y",
},
"tax_rate": {
"id": "123456",
"rate": 10,
},
"ledger_account": {
"id": "123456",
"nominal_code": "N091",
"code": "453",
},
"tracking_categories": [
{
"id": "123456",
"name": "New York",
},
],
"row_version": "1-12345",
},
], terms="Net 30 days", terms_id="12345", balance=27500, deposit=0, sub_total=27500, total_tax=2500, total=27500, tax_code="1234", notes="Some notes about this bill.", status=apideck_unify.BillStatus.DRAFT, ledger_account={
"id": "123456",
"nominal_code": "N091",
"code": "453",
}, payment_method="cash", channel="email", language="EN", accounting_by_row=False, bank_account={
"bank_name": "Monzo",
"account_number": "123465",
"account_name": "SPACEX LLC",
"account_type": apideck_unify.AccountType.CREDIT_CARD,
"iban": "CH2989144532982975332",
"bic": "AUDSCHGGXXX",
"routing_number": "012345678",
"bsb_number": "062-001",
"branch_identifier": "001",
"bank_code": "BNH",
"currency": apideck_unify.Currency.USD,
}, discount_percentage=5.5, template_id="123456", approved_by="John Doe", tax_method="Due to supplier", document_received=True, source_document_url="https://www.invoicesolution.com/bill/123456", payment_allocations=[
{
"id": "123456",
"allocated_amount": 1000,
"date_": parse_datetime("2020-09-30T07:43:32.000Z"),
},
], tracking_categories=[
{
"id": "123456",
"name": "New York",
},
{
"id": "123456",
"name": "New York",
},
{
"id": "123456",
"name": "New York",
},
], row_version="1-12345", custom_fields=[
{
"id": "2389328923893298",
"name": "employee_level",
"description": "Employee Level",
"value": {
"0": {
},
"1": {
},
},
},
{
"id": "2389328923893298",
"name": "employee_level",
"description": "Employee Level",
"value": {
"0": {
},
"1": {
},
},
},
{
"id": "2389328923893298",
"name": "employee_level",
"description": "Employee Level",
"value": {
"0": {
},
"1": {
},
},
},
], 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",
},
},
},
],
},
], accounting_period="01-24", attachments=[
{
"name": "sample.jpg",
"mime_type": "image/jpeg",
"is_compressed": False,
"encoding": "base64",
"content": "data:image/jpeg;base64,...",
"notes": "A sample image",
},
])
assert res.create_bill_response is not None
# Handle response
print(res.create_bill_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 |
idempotency_key |
Optional[str] | ➖ | A unique key you generate for one create or update, to make retrying it safe. If the request times out or fails with an uncertain outcome, resend it with the same key and the same body: the record is created, or the update applied, at most once. Keys are 1-255 printable ASCII characters (a UUID is recommended) and are accepted bare or as a quoted string. A key is remembered for 24 hours from its first use, or for the connector's own deduplication window where that is shorter (Xero: 6 minutes; Sage Intacct REST: 1 hour); after that, the same key is treated as a new request, so retry within the window. Some connectors also replay an error to retries with the same key: if retries keep returning the same error, check whether the record exists before sending it again with a new key. Reusing a key with a different body returns 422, and retrying while the first attempt is still running returns 409. A key is bound to its first request even if that request was rejected, so after fixing a rejected body, send it with a new key. Connectors that cannot honour the key on this operation reject the request with 400 instead of writing unprotected. | your-unique-key-per-create |
display_id |
OptionalNullable[str] | ➖ | Id to be displayed. | 123456 |
bill_number |
OptionalNullable[str] | ➖ | Reference to supplier bill number | 10001 |
supplier |
OptionalNullable[models.LinkedSupplierInput] | ➖ | The supplier this entity is linked to. | |
company_id |
OptionalNullable[str] | ➖ | The company ID the transaction belongs to | 12345 |
subsidiary |
OptionalNullable[models.LinkedSubsidiaryInput] | ➖ | N/A | |
location_id |
OptionalNullable[str] | ➖ | The ID of the location | 12345 |
department_id |
OptionalNullable[str] | ➖ | The ID of the department | 12345 |
currency |
OptionalNullable[models.Currency] | ➖ | Indicates the associated currency for an amount of money. Values correspond to ISO 4217. | USD |
currency_rate |
OptionalNullable[float] | ➖ | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 |
tax_inclusive |
OptionalNullable[bool] | ➖ | Amounts are including tax | true |
bill_date |
datetime | ➖ | Date bill was issued - YYYY-MM-DD. | 2020-09-30 |
due_date |
datetime | ➖ | The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. | 2020-10-30 |
paid_date |
datetime | ➖ | The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. | 2020-10-30 |
po_number |
OptionalNullable[str] | ➖ | A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. | 90000117 |
reference |
OptionalNullable[str] | ➖ | Optional reference identifier for the transaction. | INV-2024-001 |
line_items |
List[models.BillLineItemInput] | ➖ | N/A | |
terms |
OptionalNullable[str] | ➖ | Terms of payment. | Net 30 days |
terms_id |
OptionalNullable[str] | ➖ | The ID of the payment terms | 12345 |
balance |
OptionalNullable[float] | ➖ | Balance of bill due. | 27500 |
deposit |
OptionalNullable[float] | ➖ | Amount of deposit made to this bill. | 0 |
sub_total |
OptionalNullable[float] | ➖ | Subtotal amount, normally before tax. | 250 |
total_tax |
OptionalNullable[float] | ➖ | Total tax amount applied to this transaction. | 25 |
total |
OptionalNullable[float] | ➖ | Total amount of bill, including tax. | 27500 |
tax_code |
OptionalNullable[str] | ➖ | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 |
notes |
OptionalNullable[str] | ➖ | N/A | Some notes about this bill. |
status |
OptionalNullable[models.BillStatus] | ➖ | Invoice status | draft |
ledger_account |
OptionalNullable[models.LinkedLedgerAccount] | ➖ | N/A | |
payment_method |
OptionalNullable[str] | ➖ | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash |
channel |
OptionalNullable[str] | ➖ | The channel through which the transaction is processed. | |
language |
OptionalNullable[str] | ➖ | language code according to ISO 639-1. For the United States - EN | EN |
accounting_by_row |
OptionalNullable[bool] | ➖ | Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. | false |
bank_account |
Optional[models.BankAccount] | ➖ | N/A | |
discount_percentage |
OptionalNullable[float] | ➖ | Discount percentage applied to this transaction. | 5.5 |
template_id |
OptionalNullable[str] | ➖ | Optional bill template | 123456 |
approved_by |
OptionalNullable[str] | ➖ | The user who approved the bill | John Doe |
amortization_type |
OptionalNullable[models.AmortizationType] | ➖ | Type of amortization | |
tax_method |
OptionalNullable[str] | ➖ | Method of tax calculation | Due to supplier |
document_received |
OptionalNullable[bool] | ➖ | Whether the document has been received | true |
source_document_url |
OptionalNullable[str] | ➖ | URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. | https://www.invoicesolution.com/bill/123456 |
payment_allocations |
List[Nullable[models.LinkedPaymentAllocations]] | ➖ | A list of linked payment allocations. | |
tracking_categories |
List[Nullable[models.LinkedTrackingCategory]] | ➖ | A list of linked tracking categories. | |
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 |
custom_fields |
List[models.CustomField] | ➖ | N/A | |
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. | |
accounting_period |
OptionalNullable[str] | ➖ | Accounting period | 01-24 |
attachments |
List[Nullable[models.LinkedAttachment]] | ➖ | N/A | |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.AccountingBillsAddResponse
| 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 Bill
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.bills.get(id="<id>", service_id="salesforce", company_id="12345", raw=False, fields="id,updated_at")
assert res.get_bill_response is not None
# Handle response
print(res.get_bill_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 |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.AccountingBillsOneResponse
| 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 Bill
import apideck_unify
from apideck_unify import Apideck
from apideck_unify.utils import parse_datetime
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.bills.update(id="<id>", service_id="salesforce", raw=False, display_id="123456", bill_number="10001", supplier={
"id": "12345",
"display_name": "Windsurf Shop",
"address": {
"id": "123",
"type": apideck_unify.Type.PRIMARY,
"string": "25 Spring Street, Blackburn, VIC 3130",
"name": "HQ US",
"line1": "Main street",
"line2": "apt #",
"line3": "Suite #",
"line4": "delivery instructions",
"street_number": "25",
"city": "San Francisco",
"state": "CA",
"postal_code": "94104",
"country": "US",
"latitude": "40.759211",
"longitude": "-73.984638",
"county": "Santa Clara",
"contact_name": "Elon Musk",
"salutation": "Mr",
"phone_number": "111-111-1111",
"fax": "122-111-1111",
"email": "elon@musk.com",
"website": "https://elonmusk.com",
"notes": "Address notes or delivery instructions.",
"row_version": "1-12345",
},
}, company_id="12345", subsidiary={
"display_id": "123456",
"name": "Acme Inc.",
}, location_id="12345", department_id="12345", currency=apideck_unify.Currency.USD, currency_rate=0.69, tax_inclusive=True, bill_date=date.fromisoformat("2020-09-30"), due_date=date.fromisoformat("2020-10-30"), paid_date=date.fromisoformat("2020-10-30"), po_number="90000117", reference="123456", line_items=[
{
"row_id": "12345",
"code": "120-C",
"line_number": 1,
"description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
"type": apideck_unify.LineItemType.EXPENSE_ACCOUNT,
"tax_amount": 27500,
"total_amount": 27500,
"quantity": 1,
"unit_price": 27500.5,
"unit_of_measure": "pc.",
"discount_percentage": 0.01,
"discount_amount": 19.99,
"location_id": "12345",
"department_id": "12345",
"item": {
"id": "12344",
"code": "120-C",
"name": "Model Y",
},
"tax_rate": {
"id": "123456",
"rate": 10,
},
"ledger_account": {
"id": "123456",
"nominal_code": "N091",
"code": "453",
},
"tracking_categories": [
{
"id": "123456",
"name": "New York",
},
{
"id": "123456",
"name": "New York",
},
],
"row_version": "1-12345",
},
], terms="Net 30 days", terms_id="12345", balance=27500, deposit=0, sub_total=27500, total_tax=2500, total=27500, tax_code="1234", notes="Some notes about this bill.", status=apideck_unify.BillStatus.DRAFT, ledger_account={
"id": "123456",
"nominal_code": "N091",
"code": "453",
}, payment_method="cash", channel="email", language="EN", accounting_by_row=False, bank_account={
"bank_name": "Monzo",
"account_number": "123465",
"account_name": "SPACEX LLC",
"account_type": apideck_unify.AccountType.CREDIT_CARD,
"iban": "CH2989144532982975332",
"bic": "AUDSCHGGXXX",
"routing_number": "012345678",
"bsb_number": "062-001",
"branch_identifier": "001",
"bank_code": "BNH",
"currency": apideck_unify.Currency.USD,
}, discount_percentage=5.5, template_id="123456", approved_by="John Doe", tax_method="Due to supplier", document_received=True, source_document_url="https://www.invoicesolution.com/bill/123456", payment_allocations=[
{
"id": "123456",
"allocated_amount": 1000,
"date_": parse_datetime("2020-09-30T07:43:32.000Z"),
},
], tracking_categories=[
{
"id": "123456",
"name": "New York",
},
], row_version="1-12345", custom_fields=[
{
"id": "2389328923893298",
"name": "employee_level",
"description": "Employee Level",
"value": "Uses Salesforce and Marketo",
},
], 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",
},
},
},
],
},
], accounting_period="01-24", attachments=[
{
"name": "sample.jpg",
"mime_type": "image/jpeg",
"is_compressed": False,
"encoding": "base64",
"content": "data:image/jpeg;base64,...",
"notes": "A sample image",
},
])
assert res.update_bill_response is not None
# Handle response
print(res.update_bill_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 | |
display_id |
OptionalNullable[str] | ➖ | Id to be displayed. | 123456 |
bill_number |
OptionalNullable[str] | ➖ | Reference to supplier bill number | 10001 |
supplier |
OptionalNullable[models.LinkedSupplierInput] | ➖ | The supplier this entity is linked to. | |
company_id |
OptionalNullable[str] | ➖ | The company ID the transaction belongs to | 12345 |
subsidiary |
OptionalNullable[models.LinkedSubsidiaryInput] | ➖ | N/A | |
location_id |
OptionalNullable[str] | ➖ | The ID of the location | 12345 |
department_id |
OptionalNullable[str] | ➖ | The ID of the department | 12345 |
currency |
OptionalNullable[models.Currency] | ➖ | Indicates the associated currency for an amount of money. Values correspond to ISO 4217. | USD |
currency_rate |
OptionalNullable[float] | ➖ | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 |
tax_inclusive |
OptionalNullable[bool] | ➖ | Amounts are including tax | true |
bill_date |
datetime | ➖ | Date bill was issued - YYYY-MM-DD. | 2020-09-30 |
due_date |
datetime | ➖ | The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. | 2020-10-30 |
paid_date |
datetime | ➖ | The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. | 2020-10-30 |
po_number |
OptionalNullable[str] | ➖ | A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. | 90000117 |
reference |
OptionalNullable[str] | ➖ | Optional reference identifier for the transaction. | INV-2024-001 |
line_items |
List[models.BillLineItemInput] | ➖ | N/A | |
terms |
OptionalNullable[str] | ➖ | Terms of payment. | Net 30 days |
terms_id |
OptionalNullable[str] | ➖ | The ID of the payment terms | 12345 |
balance |
OptionalNullable[float] | ➖ | Balance of bill due. | 27500 |
deposit |
OptionalNullable[float] | ➖ | Amount of deposit made to this bill. | 0 |
sub_total |
OptionalNullable[float] | ➖ | Subtotal amount, normally before tax. | 250 |
total_tax |
OptionalNullable[float] | ➖ | Total tax amount applied to this transaction. | 25 |
total |
OptionalNullable[float] | ➖ | Total amount of bill, including tax. | 27500 |
tax_code |
OptionalNullable[str] | ➖ | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 |
notes |
OptionalNullable[str] | ➖ | N/A | Some notes about this bill. |
status |
OptionalNullable[models.BillStatus] | ➖ | Invoice status | draft |
ledger_account |
OptionalNullable[models.LinkedLedgerAccount] | ➖ | N/A | |
payment_method |
OptionalNullable[str] | ➖ | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash |
channel |
OptionalNullable[str] | ➖ | The channel through which the transaction is processed. | |
language |
OptionalNullable[str] | ➖ | language code according to ISO 639-1. For the United States - EN | EN |
accounting_by_row |
OptionalNullable[bool] | ➖ | Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. | false |
bank_account |
Optional[models.BankAccount] | ➖ | N/A | |
discount_percentage |
OptionalNullable[float] | ➖ | Discount percentage applied to this transaction. | 5.5 |
template_id |
OptionalNullable[str] | ➖ | Optional bill template | 123456 |
approved_by |
OptionalNullable[str] | ➖ | The user who approved the bill | John Doe |
amortization_type |
OptionalNullable[models.AmortizationType] | ➖ | Type of amortization | |
tax_method |
OptionalNullable[str] | ➖ | Method of tax calculation | Due to supplier |
document_received |
OptionalNullable[bool] | ➖ | Whether the document has been received | true |
source_document_url |
OptionalNullable[str] | ➖ | URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. | https://www.invoicesolution.com/bill/123456 |
payment_allocations |
List[Nullable[models.LinkedPaymentAllocations]] | ➖ | A list of linked payment allocations. | |
tracking_categories |
List[Nullable[models.LinkedTrackingCategory]] | ➖ | A list of linked tracking categories. | |
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 |
custom_fields |
List[models.CustomField] | ➖ | N/A | |
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. | |
accounting_period |
OptionalNullable[str] | ➖ | Accounting period | 01-24 |
attachments |
List[Nullable[models.LinkedAttachment]] | ➖ | N/A | |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.AccountingBillsUpdateResponse
| 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 Bill
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.bills.delete(id="<id>", service_id="salesforce", raw=False)
assert res.delete_bill_response is not None
# Handle response
print(res.delete_bill_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.AccountingBillsDeleteResponse
| 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 multiple bills in a single request. Each item is processed independently, so some may be created while others fail; the response returns 200 with one result per item, in the order the items were sent. The maximum number of items accepted per request depends on the connector.
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.bills.create_batch(items=[], raw=False, service_id="salesforce", company_id="12345")
assert res.batch_bills_response is not None
# Handle response
print(res.batch_bills_response)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
items |
List[models.BatchBillsRequestItems] | ✔️ | The records to write. The per-connector limit is the real cap and is usually lower than the ceiling here: read batch_support.resources[<resource>].max_items on the Connector API for the connector you are calling, or the resource gotchas. This ceiling exists so an oversized array is rejected by request validation before any per-item work runs, rather than after it. |
|
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 |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.AccountingBillsBatchAddResponse
| 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 | */* |