this is a sample SDK generated by APIMatic
Project description
Getting Started with TQL <> OTR — Factoring Data Exchange
Introduction
Overview
The TQL <> OTR Factoring Data Exchange API enables factoring clients to submit carrier invoices against loads managed by TQL, upload supporting documentation, search for invoices, and check processing status including any outstanding exceptions.
Key Capabilities
- Invoice Submission —
POST /api/invoices— Submit a factoring company invoice referencing a TQL load, including carrier details, stops, charges, and reference numbers. - Invoice Search —
POST /api/invoices/search— Search and retrieve a paginated list of invoices with status and last-updated timestamps. - Invoice Status —
GET /api/invoices/{invoiceNumber}— Retrieve the current processing status of an invoice, including any outstanding exceptions. - Document Upload —
POST /api/documents— Upload a supporting document (BOL, rate confirmation, proof of delivery, etc.) viamultipart/form-dataand link it to an invoice. Supports arbitrary key-value tags for metadata. - Carrier Assignment —
PUT /api/assignments— Notify TQL that a factoring company has been assigned to (or unassigned from) a carrier, including the effective date. - Load Lookup —
GET /api/loads/{loadNumber}— Verify a load exists in TQL's system and retrieve basic details (carrier, status, dates). - Load Search —
POST /api/loads/search— Search for TQL loads by carrier, date range, or status.
Authentication
This API uses OAuth 2.0 Client Credentials for authentication. TQL will provision each factoring partner with a unique Client ID and Client Secret during onboarding.
How it works:
-
Obtain an access token — Make a
POSTrequest to the TQL token endpoint with your Client ID and Client Secret using theclient_credentialsgrant type. -
Include the token — Pass the access token as a Bearer token in the
Authorizationheader on every API request:Authorization: Bearer <access_token> -
Token expiry — Access tokens have a limited lifetime (typically 1 hour). When the token expires, request a new one from the token endpoint. Do not request a new token on every API call — cache and reuse the token until it expires.
Required scopes:
Factoring.Write— Submit invoices, upload documents, manage assignmentsFactoring.Read— Query invoice status, search invoices The scopes your client is allowed to request are configured during onboarding. Include the required scope(s) in thescopeparameter when requesting a token.
Example token request:
POST /oauth2/token HTTP/1.1 Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id=<your_client_id>
&client_secret=<your_client_secret>
&scope=Factoring.Write Factoring.Read
TQL will provide the exact token endpoint URL, Client ID, and Client Secret during partner onboarding.
Philosophy
- Authentication — All endpoints require a valid OAuth 2.0 Bearer token in the
Authorizationheader. See the Authentication section above for details. - Asynchronous processing — Write endpoints return
202 Acceptedimmediately; pollGET /api/invoices/{invoiceNumber}for completion and exceptions. - Error handling — Non-2xx responses follow RFC 7807 Problem Details with
title,status, anddetailfields.
Install the Package
The package is compatible with Python versions 3.7+.
Install the package from PyPi using the following pip command:
pip install apimatic-tql-sdk==0.0.1
You can also view the package at: https://pypi.python.org/pypi/apimatic-tql-sdk/0.0.1
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 |
|---|---|---|
| http_client_instance | Union[Session, HttpClientProvider] |
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: 30 |
| 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"] |
| proxy_settings | ProxySettings |
Optional proxy configuration to route HTTP requests through a proxy server. |
| logging_configuration | LoggingConfiguration |
The SDK logging configuration for API calls |
| client_credentials_auth_credentials | ClientCredentialsAuthCredentials |
The credential object for OAuth 2 Client Credentials Grant |
The API client can be initialized as follows:
Code-Based Client Initialization
import logging
from tqlotrfactoringdataexchange.configuration import Environment
from tqlotrfactoringdataexchange.http.auth.oauth_2 import ClientCredentialsAuthCredentials
from tqlotrfactoringdataexchange.logging.configuration.api_logging_configuration import LoggingConfiguration
from tqlotrfactoringdataexchange.logging.configuration.api_logging_configuration import RequestLoggingConfiguration
from tqlotrfactoringdataexchange.logging.configuration.api_logging_configuration import ResponseLoggingConfiguration
from tqlotrfactoringdataexchange.models.oauth_scope import OauthScope
from tqlotrfactoringdataexchange.tqlotrfactoringdataexchange_client import TqlotrfactoringdataexchangeClient
client = TqlotrfactoringdataexchangeClient(
client_credentials_auth_credentials=ClientCredentialsAuthCredentials(
oauth_client_id='OAuthClientId',
oauth_client_secret='OAuthClientSecret',
oauth_scopes=[
OauthScope.FACTORING_WRITE,
OauthScope.FACTORING_READ
]
),
environment=Environment.PRODUCTION,
logging_configuration=LoggingConfiguration(
log_level=logging.INFO,
request_logging_config=RequestLoggingConfiguration(
log_body=True
),
response_logging_config=ResponseLoggingConfiguration(
log_headers=True
)
)
)
Environment-Based Client Initialization
from tqlotrfactoringdataexchange.tqlotrfactoringdataexchange_client import TqlotrfactoringdataexchangeClient
# Specify the path to your .env file if it’s located outside the project’s root directory.
client = TqlotrfactoringdataexchangeClient.from_environment(dotenv_path='/path/to/.env')
See the Environment-Based Client Initialization section for details.
Authorization
This API uses the following authentication schemes.
List of APIs
SDK Infrastructure
Configuration
- ProxySettings
- Environment-Based Client Initialization
- AbstractLogger
- LoggingConfiguration
- RequestLoggingConfiguration
- ResponseLoggingConfiguration
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 apimatic_tql_sdk-0.0.1.tar.gz.
File metadata
- Download URL: apimatic_tql_sdk-0.0.1.tar.gz
- Upload date:
- Size: 54.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
098c72d38ecccd9bef09b85b33f14f8445a25e89a92645ecf52938c1f45c64d8
|
|
| MD5 |
98e34e5f5c6b3ec7bd6a0f8342b8dffc
|
|
| BLAKE2b-256 |
506e871ab0771be8096a8b578444fcff34b4cd182554cbb698768d9b3b779c96
|
File details
Details for the file apimatic_tql_sdk-0.0.1-py3-none-any.whl.
File metadata
- Download URL: apimatic_tql_sdk-0.0.1-py3-none-any.whl
- Upload date:
- Size: 116.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64ed8a19b4c8065a66e8ab9b0b359deb645fdf2b256b4b373730dc387800d5fe
|
|
| MD5 |
306f8362d9fd7f6ef5248d2c380e68c6
|
|
| BLAKE2b-256 |
619cd0f904b34123fe516816361a9f009f8377712ae28c85c57a72d9dedd8a0d
|