Skip to content

Commit 93435f0

Browse files
authored
Merge pull request #64 from XeroAPI/xero-python-1.10.0
generates from OAS 2.17.1 minus finance API
2 parents bfbad5b + 1767d62 commit 93435f0

File tree

24 files changed

+393
-141
lines changed

24 files changed

+393
-141
lines changed

docs/v1/accounting/index.html

Lines changed: 132 additions & 36 deletions
Large diffs are not rendered by default.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ def read_file(filename):
4848
keywords="xero python sdk API oAuth",
4949
name="xero_python",
5050
packages=find_packages(include=["xero_python", "xero_python.*"]),
51-
version="1.9.0",
51+
version="1.10.0",
5252
)

xero_python/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__author__ = """Xero Developer API"""
44
__email__ = "[email protected]"
5-
__version__ = "1.9.0"
5+
__version__ = "1.10.0"

xero_python/accounting/api/accounting_api.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"""
1111

1212
"""
13-
OpenAPI spec version: 2.16.1
13+
OpenAPI spec version: 2.17.1
1414
"""
1515

1616
import importlib
@@ -7559,14 +7559,18 @@ def get_budget(
75597559
self,
75607560
xero_tenant_id,
75617561
budget_id,
7562+
date_to=empty,
7563+
date_from=empty,
75627564
_return_http_data_only=True,
75637565
_preload_content=True,
75647566
_request_timeout=None,
75657567
):
7566-
"""Retrieves a specific budgets, which includes budget lines # noqa: E501
7568+
"""Retrieves a specific budget, which includes budget lines # noqa: E501
75677569
OAuth2 scope: accounting.budgets.read
75687570
:param str xero_tenant_id: Xero identifier for Tenant (required)
75697571
:param str budget_id: Unique identifier for Budgets (required)
7572+
:param date date_to: Filter by start date
7573+
:param date date_from: Filter by end date
75707574
:param bool _return_http_data_only: return received data only
75717575
:param bool _preload_content: load received data in models
75727576
:param bool _request_timeout: maximum wait time for response
@@ -7593,6 +7597,12 @@ def get_budget(
75937597

75947598
query_params = []
75957599

7600+
if date_to is not empty:
7601+
query_params.append(("DateTo", date_to))
7602+
7603+
if date_from is not empty:
7604+
query_params.append(("DateFrom", date_from))
7605+
75967606
header_params = {
75977607
"xero-tenant-id": xero_tenant_id,
75987608
}
@@ -8450,6 +8460,7 @@ def get_contacts(
84508460
page=empty,
84518461
include_archived=empty,
84528462
summary_only=empty,
8463+
search_term=empty,
84538464
_return_http_data_only=True,
84548465
_preload_content=True,
84558466
_request_timeout=None,
@@ -8464,6 +8475,7 @@ def get_contacts(
84648475
:param int page: e.g. page=1 - Up to 100 contacts will be returned in a single API call.
84658476
:param bool include_archived: e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response
84668477
:param bool summary_only: Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient.
8478+
:param str search_term: Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields.
84678479
:param bool _return_http_data_only: return received data only
84688480
:param bool _preload_content: load received data in models
84698481
:param bool _request_timeout: maximum wait time for response
@@ -8502,6 +8514,9 @@ def get_contacts(
85028514
if summary_only is not empty:
85038515
query_params.append(("summaryOnly", summary_only))
85048516

8517+
if search_term is not empty:
8518+
query_params.append(("searchTerm", search_term))
8519+
85058520
header_params = {
85068521
"xero-tenant-id": xero_tenant_id,
85078522
}

xero_python/accounting/docs/AccountingApi.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Method | HTTP request | Description
9090
[**get_branding_theme**](AccountingApi.md#get_branding_theme) | **GET** /BrandingThemes/{BrandingThemeID} | Retrieves a specific branding theme using a unique branding theme Id
9191
[**get_branding_theme_payment_services**](AccountingApi.md#get_branding_theme_payment_services) | **GET** /BrandingThemes/{BrandingThemeID}/PaymentServices | Retrieves the payment services for a specific branding theme
9292
[**get_branding_themes**](AccountingApi.md#get_branding_themes) | **GET** /BrandingThemes | Retrieves all the branding themes
93-
[**get_budget**](AccountingApi.md#get_budget) | **GET** /Budgets/{BudgetID} | Retrieves a specific budgets, which includes budget lines
93+
[**get_budget**](AccountingApi.md#get_budget) | **GET** /Budgets/{BudgetID} | Retrieves a specific budget, which includes budget lines
9494
[**get_budgets**](AccountingApi.md#get_budgets) | **GET** /Budgets | Retrieve a list of budgets
9595
[**get_contact**](AccountingApi.md#get_contact) | **GET** /Contacts/{ContactID} | Retrieves a specific contacts in a Xero organisation using a unique contact Id
9696
[**get_contact_attachment_by_file_name**](AccountingApi.md#get_contact_attachment_by_file_name) | **GET** /Contacts/{ContactID}/Attachments/{FileName} | Retrieves a specific attachment from a specific contact by file name
@@ -593,7 +593,7 @@ api_client = ApiClient(
593593
api_instance = AccountingApi(api_client)
594594

595595
xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant
596-
bank_transfers = { "BankTransfers": [ { "FromBankAccount": { "Code": "090", "Name": "My Savings", "AccountID": "00000000-0000-0000-0000-000000000000", "Type": "BANK", "BankAccountNumber": "123455", "Status": "ACTIVE", "BankAccountType": "BANK", "CurrencyCode": "USD", "TaxType": "NONE", "EnablePaymentsToAccount": false, "ShowInExpenseClaims": false, "Class": "ASSET", "ReportingCode": "ASS", "ReportingCodeName": "Assets", "HasAttachments": false, "UpdatedDateUTC": "2016-10-17T13:45:33.993-07:00" }, "ToBankAccount": { "Code": "088", "Name": "Business Wells Fargo", "AccountID": "00000000-0000-0000-0000-000000000000", "Type": "BANK", "BankAccountNumber": "123455", "Status": "ACTIVE", "BankAccountType": "BANK", "CurrencyCode": "USD", "TaxType": "NONE", "EnablePaymentsToAccount": false, "ShowInExpenseClaims": false, "Class": "ASSET", "ReportingCode": "ASS", "ReportingCodeName": "Assets", "HasAttachments": false, "UpdatedDateUTC": "2016-06-03T08:31:14.517-07:00" }, "Amount": "50.00" } ] } # BankTransfers | BankTransfers with array of BankTransfer objects in request body
596+
bank_transfers = { "BankTransfers": [ { "FromBankAccount": { "Code": "090", "Name": "My Savings", "AccountID": "00000000-0000-0000-0000-000000000000", "Type": "BANK", "BankAccountNumber": "123455", "Status": "ACTIVE", "BankAccountType": "BANK", "CurrencyCode": "USD", "TaxType": "NONE", "EnablePaymentsToAccount": false, "ShowInExpenseClaims": false, "Class": "ASSET", "ReportingCode": "ASS", "ReportingCodeName": "Assets", "HasAttachments": false, "UpdatedDateUTC": "2016-10-17T13:45:33.993-07:00" }, "ToBankAccount": { "Code": "088", "Name": "Business Wells Fargo", "AccountID": "00000000-0000-0000-0000-000000000000", "Type": "BANK", "BankAccountNumber": "123455", "Status": "ACTIVE", "BankAccountType": "BANK", "CurrencyCode": "USD", "TaxType": "NONE", "EnablePaymentsToAccount": false, "ShowInExpenseClaims": false, "Class": "ASSET", "ReportingCode": "ASS", "ReportingCodeName": "Assets", "HasAttachments": false, "UpdatedDateUTC": "2016-06-03T08:31:14.517-07:00" }, "Amount": "50.00", "FromIsReconciled": true, "ToIsReconciled": true, "Reference": "Sub 098801" } ] } # BankTransfers | BankTransfers with array of BankTransfer objects in request body
597597
try:
598598
# Creates a bank transfer
599599
api_response = api_instance.create_bank_transfer(xero_tenant_id, bank_transfers)
@@ -5826,9 +5826,9 @@ Name | Type | Description | Notes
58265826
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
58275827

58285828
# **get_budget**
5829-
> Budgets get_budget(xero_tenant_id, budget_id)
5829+
> Budgets get_budget(xero_tenant_id, budget_id, date_to=date_to, date_from=date_from)
58305830

5831-
Retrieves a specific budgets, which includes budget lines
5831+
Retrieves a specific budget, which includes budget lines
58325832

58335833
### Example
58345834

@@ -5858,9 +5858,11 @@ api_instance = AccountingApi(api_client)
58585858

58595859
xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant
58605860
budget_id = '00000000-0000-0000-0000-000000000000' # str | Unique identifier for Budgets
5861+
date_to = '2019-10-31' # date | Filter by start date (optional)
5862+
date_from = '2019-10-31' # date | Filter by end date (optional)
58615863
try:
5862-
# Retrieves a specific budgets, which includes budget lines
5863-
api_response = api_instance.get_budget(xero_tenant_id, budget_id)
5864+
# Retrieves a specific budget, which includes budget lines
5865+
api_response = api_instance.get_budget(xero_tenant_id, budget_id, date_to=date_to, date_from=date_from)
58645866
pprint(api_response)
58655867
except ApiException as e:
58665868
print("Exception when calling AccountingApi->get_budget: %s\n" % e)
@@ -5872,6 +5874,8 @@ Name | Type | Description | Notes
58725874
------------- | ------------- | ------------- | -------------
58735875
**xero_tenant_id** | **str**| Xero identifier for Tenant |
58745876
**budget_id** | [**str**](.md)| Unique identifier for Budgets |
5877+
**date_to** | **date**| Filter by start date | [optional]
5878+
**date_from** | **date**| Filter by end date | [optional]
58755879

58765880
### Return type
58775881

@@ -5921,8 +5925,8 @@ api_instance = AccountingApi(api_client)
59215925

59225926
xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant
59235927
i_ds = ['"00000000-0000-0000-0000-000000000000"'] # list[str] | Filter by BudgetID. Allows you to retrieve a specific individual budget. (optional)
5924-
date_to = '2013-10-20' # date | Filter by start date (optional)
5925-
date_from = '2013-10-20' # date | Filter by end date (optional)
5928+
date_to = '2019-10-31' # date | Filter by start date (optional)
5929+
date_from = '2019-10-31' # date | Filter by end date (optional)
59265930
try:
59275931
# Retrieve a list of budgets
59285932
api_response = api_instance.get_budgets(xero_tenant_id, i_ds=i_ds, date_to=date_to, date_from=date_from)
@@ -6533,7 +6537,7 @@ Name | Type | Description | Notes
65336537
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
65346538

65356539
# **get_contacts**
6536-
> Contacts get_contacts(xero_tenant_id, if_modified_since=if_modified_since, where=where, order=order, i_ds=i_ds, page=page, include_archived=include_archived, summary_only=summary_only)
6540+
> Contacts get_contacts(xero_tenant_id, if_modified_since=if_modified_since, where=where, order=order, i_ds=i_ds, page=page, include_archived=include_archived, summary_only=summary_only, search_term=search_term)
65376541

65386542
Retrieves all contacts in a Xero organisation
65396543

@@ -6571,9 +6575,10 @@ i_ds = ['"00000000-0000-0000-0000-000000000000"'] # list[str] | Filter
65716575
page = 1 # int | e.g. page=1 - Up to 100 contacts will be returned in a single API call. (optional)
65726576
include_archived = True # bool | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response (optional)
65736577
summary_only = False # bool | Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (optional) (default to False)
6578+
search_term = 'searchTerm=Joe Bloggs' # str | Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields. (optional)
65746579
try:
65756580
# Retrieves all contacts in a Xero organisation
6576-
api_response = api_instance.get_contacts(xero_tenant_id, if_modified_since=if_modified_since, where=where, order=order, i_ds=i_ds, page=page, include_archived=include_archived, summary_only=summary_only)
6581+
api_response = api_instance.get_contacts(xero_tenant_id, if_modified_since=if_modified_since, where=where, order=order, i_ds=i_ds, page=page, include_archived=include_archived, summary_only=summary_only, search_term=search_term)
65776582
pprint(api_response)
65786583
except ApiException as e:
65796584
print("Exception when calling AccountingApi->get_contacts: %s\n" % e)
@@ -6591,6 +6596,7 @@ Name | Type | Description | Notes
65916596
**page** | **int**| e.g. page=1 - Up to 100 contacts will be returned in a single API call. | [optional]
65926597
**include_archived** | **bool**| e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response | [optional]
65936598
**summary_only** | **bool**| Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. | [optional] [default to False]
6599+
**search_term** | **str**| Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields. | [optional]
65946600

65956601
### Return type
65966602

@@ -10682,10 +10688,10 @@ api_instance = AccountingApi(api_client)
1068210688

1068310689
xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant
1068410690
if_modified_since = '2020-02-06T12:17:43.202-08:00' # datetime | Only records created or modified since this timestamp will be returned (optional)
10685-
date_from = '2013-10-20' # date | Filter for quotes after a particular date (optional)
10686-
date_to = '2013-10-20' # date | Filter for quotes before a particular date (optional)
10687-
expiry_date_from = '2013-10-20' # date | Filter for quotes expiring after a particular date (optional)
10688-
expiry_date_to = '2013-10-20' # date | Filter for quotes before a particular date (optional)
10691+
date_from = '2019-10-31' # date | Filter for quotes after a particular date (optional)
10692+
date_to = '2019-10-31' # date | Filter for quotes before a particular date (optional)
10693+
expiry_date_from = '2019-10-31' # date | Filter for quotes expiring after a particular date (optional)
10694+
expiry_date_to = '2019-10-31' # date | Filter for quotes before a particular date (optional)
1068910695
contact_id = '00000000-0000-0000-0000-000000000000' # str | Filter for quotes belonging to a particular contact (optional)
1069010696
status = 'DRAFT' # str | Filter for quotes of a particular Status (optional)
1069110697
page = 1 # int | e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote (optional)
@@ -11545,9 +11551,9 @@ api_instance = AccountingApi(api_client)
1154511551

1154611552
xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant
1154711553
contact_id = '00000000-0000-0000-0000-000000000000' # str | Unique identifier for a Contact
11548-
date = '2013-10-20' # date | The date of the Aged Payables By Contact report (optional)
11549-
from_date = '2013-10-20' # date | filter by the from date of the report e.g. 2021-02-01 (optional)
11550-
to_date = '2013-10-20' # date | filter by the to date of the report e.g. 2021-02-28 (optional)
11554+
date = '2019-10-31' # date | The date of the Aged Payables By Contact report (optional)
11555+
from_date = '2019-10-31' # date | filter by the from date of the report e.g. 2021-02-01 (optional)
11556+
to_date = '2019-10-31' # date | filter by the to date of the report e.g. 2021-02-28 (optional)
1155111557
try:
1155211558
# Retrieves report for aged payables by contact
1155311559
api_response = api_instance.get_report_aged_payables_by_contact(xero_tenant_id, contact_id, date=date, from_date=from_date, to_date=to_date)
@@ -11614,9 +11620,9 @@ api_instance = AccountingApi(api_client)
1161411620

1161511621
xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant
1161611622
contact_id = '00000000-0000-0000-0000-000000000000' # str | Unique identifier for a Contact
11617-
date = '2013-10-20' # date | The date of the Aged Receivables By Contact report (optional)
11618-
from_date = '2013-10-20' # date | filter by the from date of the report e.g. 2021-02-01 (optional)
11619-
to_date = '2013-10-20' # date | filter by the to date of the report e.g. 2021-02-28 (optional)
11623+
date = '2019-10-31' # date | The date of the Aged Receivables By Contact report (optional)
11624+
from_date = '2019-10-31' # date | filter by the from date of the report e.g. 2021-02-01 (optional)
11625+
to_date = '2019-10-31' # date | filter by the to date of the report e.g. 2021-02-28 (optional)
1162011626
try:
1162111627
# Retrieves report for aged receivables by contact
1162211628
api_response = api_instance.get_report_aged_receivables_by_contact(xero_tenant_id, contact_id, date=date, from_date=from_date, to_date=to_date)
@@ -11757,8 +11763,8 @@ api_client = ApiClient(
1175711763
api_instance = AccountingApi(api_client)
1175811764

1175911765
xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant
11760-
from_date = '2013-10-20' # date | filter by the from date of the report e.g. 2021-02-01 (optional)
11761-
to_date = '2013-10-20' # date | filter by the to date of the report e.g. 2021-02-28 (optional)
11766+
from_date = '2019-10-31' # date | filter by the from date of the report e.g. 2021-02-01 (optional)
11767+
to_date = '2019-10-31' # date | filter by the to date of the report e.g. 2021-02-28 (optional)
1176211768
try:
1176311769
# Retrieves report for bank summary
1176411770
api_response = api_instance.get_report_bank_summary(xero_tenant_id, from_date=from_date, to_date=to_date)
@@ -12015,8 +12021,8 @@ api_client = ApiClient(
1201512021
api_instance = AccountingApi(api_client)
1201612022

1201712023
xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant
12018-
from_date = '2013-10-20' # date | filter by the from date of the report e.g. 2021-02-01 (optional)
12019-
to_date = '2013-10-20' # date | filter by the to date of the report e.g. 2021-02-28 (optional)
12024+
from_date = '2019-10-31' # date | filter by the from date of the report e.g. 2021-02-01 (optional)
12025+
to_date = '2019-10-31' # date | filter by the to date of the report e.g. 2021-02-28 (optional)
1202012026
periods = 3 # int | The number of periods to compare (integer between 1 and 12) (optional)
1202112027
timeframe = 'MONTH' # str | The period size to compare to (MONTH, QUARTER, YEAR) (optional)
1202212028
tracking_category_id = '00000000-0000-0000-0000-000000000000' # str | The trackingCategory 1 for the ProfitAndLoss report (optional)

xero_python/accounting/docs/BankTransfer.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Name | Type | Description | Notes
1111
**currency_rate** | **float** | The currency rate | [optional]
1212
**from_bank_transaction_id** | **str** | The Bank Transaction ID for the source account | [optional]
1313
**to_bank_transaction_id** | **str** | The Bank Transaction ID for the destination account | [optional]
14+
**from_is_reconciled** | **bool** | The Bank Transaction boolean to show if it is reconciled for the source account | [optional] [default to False]
15+
**to_is_reconciled** | **bool** | The Bank Transaction boolean to show if it is reconciled for the destination account | [optional] [default to False]
16+
**reference** | **str** | Reference for the transactions. | [optional]
1417
**has_attachments** | **bool** | Boolean to indicate if a Bank Transfer has an attachment | [optional] [default to False]
1518
**created_date_utc** | **datetime** | UTC timestamp of creation date of bank transfer | [optional]
1619
**validation_errors** | [**list[ValidationError]**](ValidationError.md) | Displays array of validation error messages from the API | [optional]

xero_python/accounting/docs/BudgetBalance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**period** | **date** | Period the amount applies to (e.g. “2019-08”) | [optional]
7-
**amount** | **int** | LineItem Quantity | [optional]
8-
**unit_amount** | **int** | Budgeted amount | [optional]
7+
**amount** | **float** | LineItem Quantity | [optional]
8+
**unit_amount** | **float** | Budgeted amount | [optional]
99
**notes** | **str** | Any footnotes associated with this balance | [optional]
1010

1111
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

0 commit comments

Comments
 (0)