Xero's Accounting API that contains all the endpoints for managing accounting operations including accounts, attachments, batch payments, bank transactions, and other financial data.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xero_accounting_sdk-1.0.0.tar.gz.
File metadata
- Download URL: xero_accounting_sdk-1.0.0.tar.gz
- Upload date:
- Size: 91.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd9b1b80b60c9b9fbc1b74b4e28690e5e2968db280e5b61c1a17b0ee99315249
|
|
| MD5 |
6d2a561ea76aa0823429b6590a30fb5a
|
|
| BLAKE2b-256 |
5346ef1fa2cd1dca26323d83b8877893083689bb953a244815829376779ecfdd
|
File details
Details for the file xero_accounting_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: xero_accounting_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 298.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
926c5f380d5ef549dad9886c0b2fd99d15cc690af33296a84e828abacf4bb466
|
|
| MD5 |
a3d5f0ea43ca1dcc931a2c181472d803
|
|
| BLAKE2b-256 |
5c4e630c6c1c31384cd320e03777054a88c821ffd997a7852d8fe83ec2adb440
|