Official Python SDK for the Ottimate API — AP automation, invoice processing, and payment management
Project description
Ottimate Python SDK
Official Python SDK for the Ottimate API.
Installation
pip install ottimate-sdk
Requirements
- Python 3.8 or higher
Configuration
Create a .env file in your project root with your Ottimate credentials:
OTTIMATE_API_KEY="your_api_key"
OTTIMATE_BASE_URL="your_base_url"
OTTIMATE_CLIENT_ID="your_client_id"
OTTIMATE_CLIENT_SECRET="your_client_secret"
OTTIMATE_COMPANY_ID="your_company_id"
OTTIMATE_LOCATION_ID="your_location_id"
Authentication
The Ottimate API uses OAuth 2.0. Authentication is a two-step process:
- Create a temporary client to obtain an OAuth access token
- Initialize the main client using the access token
import httpx
from ottimate import Ottimate
# Step 1: Get an access token
auth_client = Ottimate(
base_url=base_url,
api_key=api_key,
httpx_client=httpx.Client(timeout=60, follow_redirects=True)
)
token_response = auth_client.oauth.post_oauth_token(
client_id=client_id,
client_secret=client_secret,
scope="accounts.can_access_dashboard"
)
access_token = token_response.access_token
# Step 2: Initialize the authenticated client
client = Ottimate(
base_url=base_url,
api_key=api_key,
api_version="1.0.0",
headers={"Authorization": f"Bearer {access_token}"},
httpx_client=httpx.Client(timeout=60, follow_redirects=True)
)
Full Example
import os
import httpx
from dotenv import load_dotenv
from ottimate import Ottimate
load_dotenv()
base_url = os.environ["OTTIMATE_BASE_URL"]
api_key = os.environ["OTTIMATE_API_KEY"]
client_id = os.environ["OTTIMATE_CLIENT_ID"]
client_secret = os.environ["OTTIMATE_CLIENT_SECRET"]
# Obtain access token
auth_client = Ottimate(
base_url=base_url,
api_key=api_key,
httpx_client=httpx.Client(timeout=60, follow_redirects=True)
)
token_response = auth_client.oauth.post_oauth_token(
client_id=client_id,
client_secret=client_secret,
scope="accounts.can_access_dashboard"
)
# Create authenticated client
client = Ottimate(
base_url=base_url,
api_key=api_key,
api_version="1.0.0",
headers={"Authorization": f"Bearer {token_response.access_token}"},
httpx_client=httpx.Client(timeout=60, follow_redirects=True)
)
Version
0.1.7
Support
For API documentation and guides, visit the Ottimate Developer Docs.
Project details
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 ottimate_sdk-0.1.7.tar.gz.
File metadata
- Download URL: ottimate_sdk-0.1.7.tar.gz
- Upload date:
- Size: 149.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcb012da0f1a2338608ef00fb7efa53e18b452a945632d3a388b4458d480b133
|
|
| MD5 |
e58132ef61462b5d1d4117e14ebdcc61
|
|
| BLAKE2b-256 |
2e811a1911e86285634dfcdd80e8a38d4bf185b58daaca7654e315b1ae919c39
|
Provenance
The following attestation bundles were made for ottimate_sdk-0.1.7.tar.gz:
Publisher:
generate-python-sdk.yml on plateiq/fern-docs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ottimate_sdk-0.1.7.tar.gz -
Subject digest:
fcb012da0f1a2338608ef00fb7efa53e18b452a945632d3a388b4458d480b133 - Sigstore transparency entry: 1870458500
- Sigstore integration time:
-
Permalink:
plateiq/fern-docs@8fa0fd5d3f88ba15f3551e4b5017afbb4750aa52 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/plateiq
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
generate-python-sdk.yml@8fa0fd5d3f88ba15f3551e4b5017afbb4750aa52 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file ottimate_sdk-0.1.7-py3-none-any.whl.
File metadata
- Download URL: ottimate_sdk-0.1.7-py3-none-any.whl
- Upload date:
- Size: 305.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a28c91a465e659be54d5a8f034b44cbddfff84b0f0a25f40d506af798d72b081
|
|
| MD5 |
a326e4aac1d004b052bf175bb1a2b46f
|
|
| BLAKE2b-256 |
49a7487f8ab262a353918237958f49c4042db6f20552fa91fa942d3d631b60ea
|
Provenance
The following attestation bundles were made for ottimate_sdk-0.1.7-py3-none-any.whl:
Publisher:
generate-python-sdk.yml on plateiq/fern-docs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ottimate_sdk-0.1.7-py3-none-any.whl -
Subject digest:
a28c91a465e659be54d5a8f034b44cbddfff84b0f0a25f40d506af798d72b081 - Sigstore transparency entry: 1870458557
- Sigstore integration time:
-
Permalink:
plateiq/fern-docs@8fa0fd5d3f88ba15f3551e4b5017afbb4750aa52 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/plateiq
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
generate-python-sdk.yml@8fa0fd5d3f88ba15f3551e4b5017afbb4750aa52 -
Trigger Event:
workflow_dispatch
-
Statement type: