Getting Started with Xero
Introduction
All the endpoints on the Accounting API.
To make requests you'll need a valid access_token and xero-tenant-id in your environment variables. These can be set by following the steps in the Xero OAuth2.0 collection.
Note: access tokens expire after 30 minutes but can be refreshed using the POST Refresh token request in the Xero OAuth2.0 collection.
Install the Package
The package is compatible with Python versions 3.7+.
Install the package from PyPi using the following pip command:
pip install xero-accounting-sdk==1.0.0
You can also view the package at: https://pypi.python.org/pypi/xero-accounting-sdk/1.0.0
Test the SDK
You can test the generated SDK and the server with test cases. unittest is used as the testing framework and pytest is used as the test runner. You can run the tests as follows:
Navigate to the root directory of the SDK and run the following commands
pip install -r test-requirements.txt
pytest
Initialize the API Client
Note: Documentation for the client can be found here.
The following parameters are configurable for the API Client:
| Parameter | Type | Description |
|---|---|---|
| environment | Environment |
The API environment. Default: Environment.PRODUCTION |
| http_client_instance | HttpClient |
The Http Client passed from the sdk user for making requests |
| override_http_client_configuration | bool |
The value which determines to override properties of the passed Http Client from the sdk user |
| http_call_back | HttpCallBack |
The callback value that is invoked before and after an HTTP call is made to an endpoint |
| timeout | float |
The value to use for connection timeout. Default: 60 |
| max_retries | int |
The number of times to retry an endpoint call if it fails. Default: 0 |
| backoff_factor | float |
A backoff factor to apply between attempts after the second try. Default: 2 |
| retry_statuses | Array of int |
The http statuses on which retry is to be done. Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524] |
| retry_methods | Array of string |
The http methods on which retry is to be done. Default: ['GET', 'PUT'] |
| implicit_auth_credentials | ImplicitAuthCredentials |
The credential object for OAuth 2 Implicit Grant |
The API client can be initialized as follows:
from xero.configuration import Environment
from xero.http.auth.o_auth_2 import ImplicitAuthCredentials
from xero.xero_client import XeroClient
client = XeroClient(
implicit_auth_credentials=ImplicitAuthCredentials(
o_auth_client_id='OAuthClientId',
o_auth_redirect_uri='OAuthRedirectUri'
),
environment=Environment.PRODUCTION
)
Authorization
This API uses the following authentication schemes.
List of APIs
- File Name
- Account ID
- Batch Payment ID History
- Batch Payments
- Bank Transaction ID
- Bank Transactions
- Bank Transfer ID
- Bank Transfers
- Payment Services
- Branding Theme ID
- Branding Themes
- Contact ID
- Contact Group ID
- Contact Groups
- Credit Note ID
- Credit Notes
- Expense Claim ID
- Expense Claims
- Invoice ID
- Item ID
- Linked Transaction ID
- Linked Transactions
- Manual Journal ID
- Manual Journals
- Overpayment ID
- Payment ID
- Prepayment ID
- Purchase Order ID
- Purchase Orders
- Quote ID
- Receipt ID
- Repeating Invoice ID
- Repeating Invoices
- Tax Rates
- Tracking Option ID
- Tracking Category ID
- Tracking Categories
- Attachments
- Accounts
- History
- Contacts
- Currencies
- Employees
- Invoices
- Items
- Journals
- Organisation
- Overpayments
- Payments
- Prepayments
- Quotes
- Receipts
- Reports
- Options
- Users
- Misc
SDK Infrastructure
HTTP
Utilities
Metadata
Release files for xero-accounting-sdk 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xero_accounting_sdk-1.0.0.tar.gz | 91.9 kB | Without provenance | Details for xero_accounting_sdk-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xero_accounting_sdk-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for xero_accounting_sdk-1.0.0-py3-none-any.whl |
Total release size: 390.2 kB
Release files / xero_accounting_sdk-1.0.0.tar.gz
| Download URL | xero_accounting_sdk-1.0.0.tar.gz |
|---|---|
| Size | 91.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd9b1b80b60c9b9fbc1b74b4e28690e5e2968db280e5b61c1a17b0ee99315249
|
|
BLAKE2b-256 checksum How to use checksums |
5346ef1fa2cd1dca26323d83b8877893083689bb953a244815829376779ecfdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.13
|
Release files / xero_accounting_sdk-1.0.0-py3-none-any.whl
| Download URL | xero_accounting_sdk-1.0.0-py3-none-any.whl |
|---|---|
| Size | 298.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
926c5f380d5ef549dad9886c0b2fd99d15cc690af33296a84e828abacf4bb466
|
|
BLAKE2b-256 checksum How to use checksums |
5c4e630c6c1c31384cd320e03777054a88c821ffd997a7852d8fe83ec2adb440
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.13
|
Security for xero-accounting-sdk 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.