apimatic-tql-sdk 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- apimatic_tql_sdk-0.0.1/LICENSE +28 -0
- apimatic_tql_sdk-0.0.1/MANIFEST.in +2 -0
- apimatic_tql_sdk-0.0.1/PKG-INFO +197 -0
- apimatic_tql_sdk-0.0.1/README.md +179 -0
- apimatic_tql_sdk-0.0.1/apimatic_tql_sdk.egg-info/PKG-INFO +197 -0
- apimatic_tql_sdk-0.0.1/apimatic_tql_sdk.egg-info/SOURCES.txt +89 -0
- apimatic_tql_sdk-0.0.1/apimatic_tql_sdk.egg-info/dependency_links.txt +1 -0
- apimatic_tql_sdk-0.0.1/apimatic_tql_sdk.egg-info/requires.txt +7 -0
- apimatic_tql_sdk-0.0.1/apimatic_tql_sdk.egg-info/top_level.txt +3 -0
- apimatic_tql_sdk-0.0.1/pyproject.toml +25 -0
- apimatic_tql_sdk-0.0.1/setup.cfg +8 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/__init__.py +13 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/api_helper.py +19 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/apis/__init__.py +10 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/apis/assignments_api.py +95 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/apis/base_api.py +72 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/apis/documents_api.py +154 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/apis/invoices_api.py +211 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/apis/loads_api.py +138 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/apis/oauth_authorization_api.py +94 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/configuration.py +253 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/exceptions/__init__.py +7 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/exceptions/api_exception.py +36 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/exceptions/oauth_provider_exception.py +75 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/exceptions/problem_details_error_exception.py +79 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/http/__init__.py +11 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/http/api_response.py +67 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/http/auth/__init__.py +5 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/http/auth/oauth_2.py +350 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/http/http_call_back.py +20 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/http/http_client_provider.py +23 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/http/http_method_enum.py +25 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/http/http_request.py +55 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/http/http_response.py +45 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/http/proxy_settings.py +50 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/logging/__init__.py +6 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/logging/configuration/__init__.py +5 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/logging/configuration/api_logging_configuration.py +398 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/logging/sdk_logger.py +28 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/__init__.py +50 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/assignment_request.py +225 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/assignment_response.py +208 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/assignment_status.py +59 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/base_64_document.py +181 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/base_64_document_upload_request.py +158 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/carrier.py +158 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/carrier_1.py +158 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/carrier_2.py +158 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/carrier_input.py +207 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/carrier_input_1.py +207 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/charge_code.py +191 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/charge_code_origin.py +69 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/charge_input.py +235 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/document.py +129 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/document_type.py +234 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/document_upload_metadata.py +168 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/document_upload_response.py +230 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/exception_severity.py +48 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/factoring_company_input.py +181 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/invoice.py +397 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/invoice_exception.py +228 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/invoice_item_input.py +283 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/invoice_search_request.py +391 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/invoice_search_response.py +206 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/invoice_status.py +74 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/invoice_status_response.py +319 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/invoice_type.py +75 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/load.py +190 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/load_detail.py +264 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/load_search_request.py +377 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/load_search_response.py +206 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/load_status.py +60 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/location.py +271 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/oauth_provider_error.py +67 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/oauth_scope.py +45 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/oauth_token.py +115 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/payment.py +186 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/problem_details.py +155 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/reference_number_input.py +155 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/reference_type.py +101 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/status.py +51 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/stop_input.py +180 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/stop_type.py +78 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/submit_invoice_request.py +494 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/submit_invoice_response.py +159 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/models/weight_unit.py +59 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/tqlotrfactoringdataexchange_client.py +115 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/utilities/__init__.py +6 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/utilities/file_wrapper.py +45 -0
- apimatic_tql_sdk-0.0.1/tqlotrfactoringdataexchange/utilities/union_type_lookup.py +70 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
License:
|
|
2
|
+
========
|
|
3
|
+
The MIT License (MIT)
|
|
4
|
+
http://opensource.org/licenses/MIT
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2014 - 2026 APIMATIC Limited
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
in the Software without restriction, including without limitation the rights
|
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in
|
|
16
|
+
all copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
+
THE SOFTWARE.
|
|
25
|
+
|
|
26
|
+
Trade Mark:
|
|
27
|
+
==========
|
|
28
|
+
APIMATIC is a trade mark for APIMATIC Limited
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: apimatic-tql-sdk
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: this is a sample SDK generated by APIMatic
|
|
5
|
+
Author-email: developer sdksio <developer+sdksio@apimatic.io>
|
|
6
|
+
Project-URL: Documentation, https://apimatic.io
|
|
7
|
+
Keywords: Apimatic,sdksio
|
|
8
|
+
Requires-Python: >=3.7
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: apimatic-core>=0.2.24,~=0.2.0
|
|
12
|
+
Requires-Dist: apimatic-core-interfaces>=0.1.8,~=0.1.0
|
|
13
|
+
Requires-Dist: apimatic-requests-client-adapter>=0.1.10,~=0.1.0
|
|
14
|
+
Requires-Dist: python-dotenv<2.0,>=0.21
|
|
15
|
+
Provides-Extra: testutils
|
|
16
|
+
Requires-Dist: pytest>=7.2.2; extra == "testutils"
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# Getting Started with TQL <> OTR — Factoring Data Exchange
|
|
21
|
+
|
|
22
|
+
## Introduction
|
|
23
|
+
|
|
24
|
+
### Overview
|
|
25
|
+
|
|
26
|
+
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.
|
|
27
|
+
|
|
28
|
+
#### Key Capabilities
|
|
29
|
+
|
|
30
|
+
- **Invoice Submission** — `POST /api/invoices` — Submit a factoring company invoice referencing a TQL load, including carrier details, stops, charges, and reference numbers.
|
|
31
|
+
- **Invoice Search** — `POST /api/invoices/search` — Search and retrieve a paginated list of invoices with status and last-updated timestamps.
|
|
32
|
+
- **Invoice Status** — `GET /api/invoices/{invoiceNumber}` — Retrieve the current processing status of an invoice, including any outstanding exceptions.
|
|
33
|
+
- **Document Upload** — `POST /api/documents` — Upload a supporting document (BOL, rate confirmation, proof of delivery, etc.) via `multipart/form-data` and link it to an invoice. Supports arbitrary key-value tags for metadata.
|
|
34
|
+
- **Carrier Assignment** — `PUT /api/assignments` — Notify TQL that a factoring company has been assigned to (or unassigned from) a carrier, including the effective date.
|
|
35
|
+
- **Load Lookup** — `GET /api/loads/{loadNumber}` — Verify a load exists in TQL's system and retrieve basic details (carrier, status, dates).
|
|
36
|
+
- **Load Search** — `POST /api/loads/search` — Search for TQL loads by carrier, date range, or status.
|
|
37
|
+
|
|
38
|
+
#### Authentication
|
|
39
|
+
|
|
40
|
+
This API uses **[OAuth 2.0 Client Credentials](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4)** for authentication. TQL will provision each factoring partner with a unique **Client ID** and **Client Secret** during onboarding.
|
|
41
|
+
|
|
42
|
+
**How it works:**
|
|
43
|
+
|
|
44
|
+
1. **Obtain an access token** — Make a `POST` request to the TQL
|
|
45
|
+
token endpoint with your Client ID and Client Secret using the
|
|
46
|
+
`client_credentials` grant type.
|
|
47
|
+
|
|
48
|
+
2. **Include the token** — Pass the access token as a Bearer token
|
|
49
|
+
in the `Authorization` header on every API request:
|
|
50
|
+
`Authorization: Bearer <access_token>`
|
|
51
|
+
|
|
52
|
+
3. **Token expiry** — Access tokens have a limited lifetime
|
|
53
|
+
(typically 1 hour). When the token expires, request a new one from
|
|
54
|
+
the token endpoint. Do **not** request a new token on every API
|
|
55
|
+
call — cache and reuse the token until it expires.
|
|
56
|
+
|
|
57
|
+
**Required scopes:**
|
|
58
|
+
|
|
59
|
+
- **`Factoring.Write`** — Submit invoices, upload documents, manage assignments
|
|
60
|
+
- **`Factoring.Read`** — Query invoice status, search invoices
|
|
61
|
+
The scopes your client is allowed to request are configured during onboarding. Include the required scope(s) in the `scope` parameter when requesting a token.
|
|
62
|
+
|
|
63
|
+
**Example token request:**
|
|
64
|
+
|
|
65
|
+
POST /oauth2/token HTTP/1.1
|
|
66
|
+
Content-Type: application/x-www-form-urlencoded
|
|
67
|
+
|
|
68
|
+
grant_type=client_credentials
|
|
69
|
+
&client_id=<your_client_id>
|
|
70
|
+
&client_secret=<your_client_secret>
|
|
71
|
+
&scope=Factoring.Write Factoring.Read
|
|
72
|
+
|
|
73
|
+
TQL will provide the exact token endpoint URL, Client ID, and Client Secret during partner onboarding.
|
|
74
|
+
|
|
75
|
+
#### Philosophy
|
|
76
|
+
|
|
77
|
+
- **Authentication** — All endpoints require a valid OAuth 2.0 Bearer token in the `Authorization` header. See the **Authentication** section above for details.
|
|
78
|
+
- **Asynchronous processing** — Write endpoints return `202 Accepted` immediately; poll `GET /api/invoices/{invoiceNumber}` for completion and exceptions.
|
|
79
|
+
- **Error handling** — Non-2xx responses follow [RFC 7807 Problem Details](https://datatracker.ietf.org/doc/html/rfc7807) with `title`, `status`, and `detail` fields.
|
|
80
|
+
|
|
81
|
+
## Install the Package
|
|
82
|
+
|
|
83
|
+
The package is compatible with Python versions `3.7+`.
|
|
84
|
+
Install the package from PyPi using the following pip command:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pip install apimatic-tql-sdk==0.0.1
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
You can also view the package at:
|
|
91
|
+
https://pypi.python.org/pypi/apimatic-tql-sdk/0.0.1
|
|
92
|
+
|
|
93
|
+
## Initialize the API Client
|
|
94
|
+
|
|
95
|
+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/client.md)
|
|
96
|
+
|
|
97
|
+
The following parameters are configurable for the API Client:
|
|
98
|
+
|
|
99
|
+
| Parameter | Type | Description |
|
|
100
|
+
| --- | --- | --- |
|
|
101
|
+
| http_client_instance | `Union[Session, HttpClientProvider]` | The Http Client passed from the sdk user for making requests |
|
|
102
|
+
| override_http_client_configuration | `bool` | The value which determines to override properties of the passed Http Client from the sdk user |
|
|
103
|
+
| http_call_back | `HttpCallBack` | The callback value that is invoked before and after an HTTP call is made to an endpoint |
|
|
104
|
+
| timeout | `float` | The value to use for connection timeout. <br> **Default: 30** |
|
|
105
|
+
| max_retries | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
|
|
106
|
+
| backoff_factor | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 2** |
|
|
107
|
+
| retry_statuses | `Array of int` | The http statuses on which retry is to be done. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
|
108
|
+
| retry_methods | `Array of string` | The http methods on which retry is to be done. <br> **Default: ["GET", "PUT"]** |
|
|
109
|
+
| proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
|
|
110
|
+
| logging_configuration | [`LoggingConfiguration`](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/logging-configuration.md) | The SDK logging configuration for API calls |
|
|
111
|
+
| client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
|
|
112
|
+
|
|
113
|
+
The API client can be initialized as follows:
|
|
114
|
+
|
|
115
|
+
### Code-Based Client Initialization
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
import logging
|
|
119
|
+
|
|
120
|
+
from tqlotrfactoringdataexchange.configuration import Environment
|
|
121
|
+
from tqlotrfactoringdataexchange.http.auth.oauth_2 import ClientCredentialsAuthCredentials
|
|
122
|
+
from tqlotrfactoringdataexchange.logging.configuration.api_logging_configuration import LoggingConfiguration
|
|
123
|
+
from tqlotrfactoringdataexchange.logging.configuration.api_logging_configuration import RequestLoggingConfiguration
|
|
124
|
+
from tqlotrfactoringdataexchange.logging.configuration.api_logging_configuration import ResponseLoggingConfiguration
|
|
125
|
+
from tqlotrfactoringdataexchange.models.oauth_scope import OauthScope
|
|
126
|
+
from tqlotrfactoringdataexchange.tqlotrfactoringdataexchange_client import TqlotrfactoringdataexchangeClient
|
|
127
|
+
|
|
128
|
+
client = TqlotrfactoringdataexchangeClient(
|
|
129
|
+
client_credentials_auth_credentials=ClientCredentialsAuthCredentials(
|
|
130
|
+
oauth_client_id='OAuthClientId',
|
|
131
|
+
oauth_client_secret='OAuthClientSecret',
|
|
132
|
+
oauth_scopes=[
|
|
133
|
+
OauthScope.FACTORING_WRITE,
|
|
134
|
+
OauthScope.FACTORING_READ
|
|
135
|
+
]
|
|
136
|
+
),
|
|
137
|
+
environment=Environment.PRODUCTION,
|
|
138
|
+
logging_configuration=LoggingConfiguration(
|
|
139
|
+
log_level=logging.INFO,
|
|
140
|
+
request_logging_config=RequestLoggingConfiguration(
|
|
141
|
+
log_body=True
|
|
142
|
+
),
|
|
143
|
+
response_logging_config=ResponseLoggingConfiguration(
|
|
144
|
+
log_headers=True
|
|
145
|
+
)
|
|
146
|
+
)
|
|
147
|
+
)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Environment-Based Client Initialization
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
from tqlotrfactoringdataexchange.tqlotrfactoringdataexchange_client import TqlotrfactoringdataexchangeClient
|
|
154
|
+
|
|
155
|
+
# Specify the path to your .env file if it’s located outside the project’s root directory.
|
|
156
|
+
client = TqlotrfactoringdataexchangeClient.from_environment(dotenv_path='/path/to/.env')
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
See the [Environment-Based Client Initialization](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/environment-based-client-initialization.md) section for details.
|
|
160
|
+
|
|
161
|
+
## Authorization
|
|
162
|
+
|
|
163
|
+
This API uses the following authentication schemes.
|
|
164
|
+
|
|
165
|
+
* [`bearerAuth (OAuth 2 Client Credentials Grant)`](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/auth/oauth-2-client-credentials-grant.md)
|
|
166
|
+
|
|
167
|
+
## List of APIs
|
|
168
|
+
|
|
169
|
+
* [Invoices](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/controllers/invoices.md)
|
|
170
|
+
* [Documents](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/controllers/documents.md)
|
|
171
|
+
* [Assignments](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/controllers/assignments.md)
|
|
172
|
+
* [Loads](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/controllers/loads.md)
|
|
173
|
+
|
|
174
|
+
## SDK Infrastructure
|
|
175
|
+
|
|
176
|
+
### Configuration
|
|
177
|
+
|
|
178
|
+
* [ProxySettings](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/proxy-settings.md)
|
|
179
|
+
* [Environment-Based Client Initialization](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/environment-based-client-initialization.md)
|
|
180
|
+
* [AbstractLogger](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/abstract-logger.md)
|
|
181
|
+
* [LoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/logging-configuration.md)
|
|
182
|
+
* [RequestLoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/request-logging-configuration.md)
|
|
183
|
+
* [ResponseLoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/response-logging-configuration.md)
|
|
184
|
+
|
|
185
|
+
### HTTP
|
|
186
|
+
|
|
187
|
+
* [HttpResponse](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/http-response.md)
|
|
188
|
+
* [HttpRequest](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/http-request.md)
|
|
189
|
+
|
|
190
|
+
### Utilities
|
|
191
|
+
|
|
192
|
+
* [ApiResponse](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/api-response.md)
|
|
193
|
+
* [ApiHelper](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/api-helper.md)
|
|
194
|
+
* [HttpDateTime](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/http-date-time.md)
|
|
195
|
+
* [RFC3339DateTime](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/rfc3339-date-time.md)
|
|
196
|
+
* [UnixDateTime](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/unix-date-time.md)
|
|
197
|
+
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
|
|
2
|
+
# Getting Started with TQL <> OTR — Factoring Data Exchange
|
|
3
|
+
|
|
4
|
+
## Introduction
|
|
5
|
+
|
|
6
|
+
### Overview
|
|
7
|
+
|
|
8
|
+
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.
|
|
9
|
+
|
|
10
|
+
#### Key Capabilities
|
|
11
|
+
|
|
12
|
+
- **Invoice Submission** — `POST /api/invoices` — Submit a factoring company invoice referencing a TQL load, including carrier details, stops, charges, and reference numbers.
|
|
13
|
+
- **Invoice Search** — `POST /api/invoices/search` — Search and retrieve a paginated list of invoices with status and last-updated timestamps.
|
|
14
|
+
- **Invoice Status** — `GET /api/invoices/{invoiceNumber}` — Retrieve the current processing status of an invoice, including any outstanding exceptions.
|
|
15
|
+
- **Document Upload** — `POST /api/documents` — Upload a supporting document (BOL, rate confirmation, proof of delivery, etc.) via `multipart/form-data` and link it to an invoice. Supports arbitrary key-value tags for metadata.
|
|
16
|
+
- **Carrier Assignment** — `PUT /api/assignments` — Notify TQL that a factoring company has been assigned to (or unassigned from) a carrier, including the effective date.
|
|
17
|
+
- **Load Lookup** — `GET /api/loads/{loadNumber}` — Verify a load exists in TQL's system and retrieve basic details (carrier, status, dates).
|
|
18
|
+
- **Load Search** — `POST /api/loads/search` — Search for TQL loads by carrier, date range, or status.
|
|
19
|
+
|
|
20
|
+
#### Authentication
|
|
21
|
+
|
|
22
|
+
This API uses **[OAuth 2.0 Client Credentials](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4)** for authentication. TQL will provision each factoring partner with a unique **Client ID** and **Client Secret** during onboarding.
|
|
23
|
+
|
|
24
|
+
**How it works:**
|
|
25
|
+
|
|
26
|
+
1. **Obtain an access token** — Make a `POST` request to the TQL
|
|
27
|
+
token endpoint with your Client ID and Client Secret using the
|
|
28
|
+
`client_credentials` grant type.
|
|
29
|
+
|
|
30
|
+
2. **Include the token** — Pass the access token as a Bearer token
|
|
31
|
+
in the `Authorization` header on every API request:
|
|
32
|
+
`Authorization: Bearer <access_token>`
|
|
33
|
+
|
|
34
|
+
3. **Token expiry** — Access tokens have a limited lifetime
|
|
35
|
+
(typically 1 hour). When the token expires, request a new one from
|
|
36
|
+
the token endpoint. Do **not** request a new token on every API
|
|
37
|
+
call — cache and reuse the token until it expires.
|
|
38
|
+
|
|
39
|
+
**Required scopes:**
|
|
40
|
+
|
|
41
|
+
- **`Factoring.Write`** — Submit invoices, upload documents, manage assignments
|
|
42
|
+
- **`Factoring.Read`** — Query invoice status, search invoices
|
|
43
|
+
The scopes your client is allowed to request are configured during onboarding. Include the required scope(s) in the `scope` parameter when requesting a token.
|
|
44
|
+
|
|
45
|
+
**Example token request:**
|
|
46
|
+
|
|
47
|
+
POST /oauth2/token HTTP/1.1
|
|
48
|
+
Content-Type: application/x-www-form-urlencoded
|
|
49
|
+
|
|
50
|
+
grant_type=client_credentials
|
|
51
|
+
&client_id=<your_client_id>
|
|
52
|
+
&client_secret=<your_client_secret>
|
|
53
|
+
&scope=Factoring.Write Factoring.Read
|
|
54
|
+
|
|
55
|
+
TQL will provide the exact token endpoint URL, Client ID, and Client Secret during partner onboarding.
|
|
56
|
+
|
|
57
|
+
#### Philosophy
|
|
58
|
+
|
|
59
|
+
- **Authentication** — All endpoints require a valid OAuth 2.0 Bearer token in the `Authorization` header. See the **Authentication** section above for details.
|
|
60
|
+
- **Asynchronous processing** — Write endpoints return `202 Accepted` immediately; poll `GET /api/invoices/{invoiceNumber}` for completion and exceptions.
|
|
61
|
+
- **Error handling** — Non-2xx responses follow [RFC 7807 Problem Details](https://datatracker.ietf.org/doc/html/rfc7807) with `title`, `status`, and `detail` fields.
|
|
62
|
+
|
|
63
|
+
## Install the Package
|
|
64
|
+
|
|
65
|
+
The package is compatible with Python versions `3.7+`.
|
|
66
|
+
Install the package from PyPi using the following pip command:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install apimatic-tql-sdk==0.0.1
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
You can also view the package at:
|
|
73
|
+
https://pypi.python.org/pypi/apimatic-tql-sdk/0.0.1
|
|
74
|
+
|
|
75
|
+
## Initialize the API Client
|
|
76
|
+
|
|
77
|
+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/client.md)
|
|
78
|
+
|
|
79
|
+
The following parameters are configurable for the API Client:
|
|
80
|
+
|
|
81
|
+
| Parameter | Type | Description |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| http_client_instance | `Union[Session, HttpClientProvider]` | The Http Client passed from the sdk user for making requests |
|
|
84
|
+
| override_http_client_configuration | `bool` | The value which determines to override properties of the passed Http Client from the sdk user |
|
|
85
|
+
| http_call_back | `HttpCallBack` | The callback value that is invoked before and after an HTTP call is made to an endpoint |
|
|
86
|
+
| timeout | `float` | The value to use for connection timeout. <br> **Default: 30** |
|
|
87
|
+
| max_retries | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
|
|
88
|
+
| backoff_factor | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 2** |
|
|
89
|
+
| retry_statuses | `Array of int` | The http statuses on which retry is to be done. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
|
90
|
+
| retry_methods | `Array of string` | The http methods on which retry is to be done. <br> **Default: ["GET", "PUT"]** |
|
|
91
|
+
| proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
|
|
92
|
+
| logging_configuration | [`LoggingConfiguration`](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/logging-configuration.md) | The SDK logging configuration for API calls |
|
|
93
|
+
| client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
|
|
94
|
+
|
|
95
|
+
The API client can be initialized as follows:
|
|
96
|
+
|
|
97
|
+
### Code-Based Client Initialization
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
import logging
|
|
101
|
+
|
|
102
|
+
from tqlotrfactoringdataexchange.configuration import Environment
|
|
103
|
+
from tqlotrfactoringdataexchange.http.auth.oauth_2 import ClientCredentialsAuthCredentials
|
|
104
|
+
from tqlotrfactoringdataexchange.logging.configuration.api_logging_configuration import LoggingConfiguration
|
|
105
|
+
from tqlotrfactoringdataexchange.logging.configuration.api_logging_configuration import RequestLoggingConfiguration
|
|
106
|
+
from tqlotrfactoringdataexchange.logging.configuration.api_logging_configuration import ResponseLoggingConfiguration
|
|
107
|
+
from tqlotrfactoringdataexchange.models.oauth_scope import OauthScope
|
|
108
|
+
from tqlotrfactoringdataexchange.tqlotrfactoringdataexchange_client import TqlotrfactoringdataexchangeClient
|
|
109
|
+
|
|
110
|
+
client = TqlotrfactoringdataexchangeClient(
|
|
111
|
+
client_credentials_auth_credentials=ClientCredentialsAuthCredentials(
|
|
112
|
+
oauth_client_id='OAuthClientId',
|
|
113
|
+
oauth_client_secret='OAuthClientSecret',
|
|
114
|
+
oauth_scopes=[
|
|
115
|
+
OauthScope.FACTORING_WRITE,
|
|
116
|
+
OauthScope.FACTORING_READ
|
|
117
|
+
]
|
|
118
|
+
),
|
|
119
|
+
environment=Environment.PRODUCTION,
|
|
120
|
+
logging_configuration=LoggingConfiguration(
|
|
121
|
+
log_level=logging.INFO,
|
|
122
|
+
request_logging_config=RequestLoggingConfiguration(
|
|
123
|
+
log_body=True
|
|
124
|
+
),
|
|
125
|
+
response_logging_config=ResponseLoggingConfiguration(
|
|
126
|
+
log_headers=True
|
|
127
|
+
)
|
|
128
|
+
)
|
|
129
|
+
)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Environment-Based Client Initialization
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
from tqlotrfactoringdataexchange.tqlotrfactoringdataexchange_client import TqlotrfactoringdataexchangeClient
|
|
136
|
+
|
|
137
|
+
# Specify the path to your .env file if it’s located outside the project’s root directory.
|
|
138
|
+
client = TqlotrfactoringdataexchangeClient.from_environment(dotenv_path='/path/to/.env')
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
See the [Environment-Based Client Initialization](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/environment-based-client-initialization.md) section for details.
|
|
142
|
+
|
|
143
|
+
## Authorization
|
|
144
|
+
|
|
145
|
+
This API uses the following authentication schemes.
|
|
146
|
+
|
|
147
|
+
* [`bearerAuth (OAuth 2 Client Credentials Grant)`](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/auth/oauth-2-client-credentials-grant.md)
|
|
148
|
+
|
|
149
|
+
## List of APIs
|
|
150
|
+
|
|
151
|
+
* [Invoices](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/controllers/invoices.md)
|
|
152
|
+
* [Documents](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/controllers/documents.md)
|
|
153
|
+
* [Assignments](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/controllers/assignments.md)
|
|
154
|
+
* [Loads](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/controllers/loads.md)
|
|
155
|
+
|
|
156
|
+
## SDK Infrastructure
|
|
157
|
+
|
|
158
|
+
### Configuration
|
|
159
|
+
|
|
160
|
+
* [ProxySettings](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/proxy-settings.md)
|
|
161
|
+
* [Environment-Based Client Initialization](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/environment-based-client-initialization.md)
|
|
162
|
+
* [AbstractLogger](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/abstract-logger.md)
|
|
163
|
+
* [LoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/logging-configuration.md)
|
|
164
|
+
* [RequestLoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/request-logging-configuration.md)
|
|
165
|
+
* [ResponseLoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/response-logging-configuration.md)
|
|
166
|
+
|
|
167
|
+
### HTTP
|
|
168
|
+
|
|
169
|
+
* [HttpResponse](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/http-response.md)
|
|
170
|
+
* [HttpRequest](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/http-request.md)
|
|
171
|
+
|
|
172
|
+
### Utilities
|
|
173
|
+
|
|
174
|
+
* [ApiResponse](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/api-response.md)
|
|
175
|
+
* [ApiHelper](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/api-helper.md)
|
|
176
|
+
* [HttpDateTime](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/http-date-time.md)
|
|
177
|
+
* [RFC3339DateTime](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/rfc3339-date-time.md)
|
|
178
|
+
* [UnixDateTime](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/unix-date-time.md)
|
|
179
|
+
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: apimatic-tql-sdk
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: this is a sample SDK generated by APIMatic
|
|
5
|
+
Author-email: developer sdksio <developer+sdksio@apimatic.io>
|
|
6
|
+
Project-URL: Documentation, https://apimatic.io
|
|
7
|
+
Keywords: Apimatic,sdksio
|
|
8
|
+
Requires-Python: >=3.7
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: apimatic-core>=0.2.24,~=0.2.0
|
|
12
|
+
Requires-Dist: apimatic-core-interfaces>=0.1.8,~=0.1.0
|
|
13
|
+
Requires-Dist: apimatic-requests-client-adapter>=0.1.10,~=0.1.0
|
|
14
|
+
Requires-Dist: python-dotenv<2.0,>=0.21
|
|
15
|
+
Provides-Extra: testutils
|
|
16
|
+
Requires-Dist: pytest>=7.2.2; extra == "testutils"
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# Getting Started with TQL <> OTR — Factoring Data Exchange
|
|
21
|
+
|
|
22
|
+
## Introduction
|
|
23
|
+
|
|
24
|
+
### Overview
|
|
25
|
+
|
|
26
|
+
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.
|
|
27
|
+
|
|
28
|
+
#### Key Capabilities
|
|
29
|
+
|
|
30
|
+
- **Invoice Submission** — `POST /api/invoices` — Submit a factoring company invoice referencing a TQL load, including carrier details, stops, charges, and reference numbers.
|
|
31
|
+
- **Invoice Search** — `POST /api/invoices/search` — Search and retrieve a paginated list of invoices with status and last-updated timestamps.
|
|
32
|
+
- **Invoice Status** — `GET /api/invoices/{invoiceNumber}` — Retrieve the current processing status of an invoice, including any outstanding exceptions.
|
|
33
|
+
- **Document Upload** — `POST /api/documents` — Upload a supporting document (BOL, rate confirmation, proof of delivery, etc.) via `multipart/form-data` and link it to an invoice. Supports arbitrary key-value tags for metadata.
|
|
34
|
+
- **Carrier Assignment** — `PUT /api/assignments` — Notify TQL that a factoring company has been assigned to (or unassigned from) a carrier, including the effective date.
|
|
35
|
+
- **Load Lookup** — `GET /api/loads/{loadNumber}` — Verify a load exists in TQL's system and retrieve basic details (carrier, status, dates).
|
|
36
|
+
- **Load Search** — `POST /api/loads/search` — Search for TQL loads by carrier, date range, or status.
|
|
37
|
+
|
|
38
|
+
#### Authentication
|
|
39
|
+
|
|
40
|
+
This API uses **[OAuth 2.0 Client Credentials](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4)** for authentication. TQL will provision each factoring partner with a unique **Client ID** and **Client Secret** during onboarding.
|
|
41
|
+
|
|
42
|
+
**How it works:**
|
|
43
|
+
|
|
44
|
+
1. **Obtain an access token** — Make a `POST` request to the TQL
|
|
45
|
+
token endpoint with your Client ID and Client Secret using the
|
|
46
|
+
`client_credentials` grant type.
|
|
47
|
+
|
|
48
|
+
2. **Include the token** — Pass the access token as a Bearer token
|
|
49
|
+
in the `Authorization` header on every API request:
|
|
50
|
+
`Authorization: Bearer <access_token>`
|
|
51
|
+
|
|
52
|
+
3. **Token expiry** — Access tokens have a limited lifetime
|
|
53
|
+
(typically 1 hour). When the token expires, request a new one from
|
|
54
|
+
the token endpoint. Do **not** request a new token on every API
|
|
55
|
+
call — cache and reuse the token until it expires.
|
|
56
|
+
|
|
57
|
+
**Required scopes:**
|
|
58
|
+
|
|
59
|
+
- **`Factoring.Write`** — Submit invoices, upload documents, manage assignments
|
|
60
|
+
- **`Factoring.Read`** — Query invoice status, search invoices
|
|
61
|
+
The scopes your client is allowed to request are configured during onboarding. Include the required scope(s) in the `scope` parameter when requesting a token.
|
|
62
|
+
|
|
63
|
+
**Example token request:**
|
|
64
|
+
|
|
65
|
+
POST /oauth2/token HTTP/1.1
|
|
66
|
+
Content-Type: application/x-www-form-urlencoded
|
|
67
|
+
|
|
68
|
+
grant_type=client_credentials
|
|
69
|
+
&client_id=<your_client_id>
|
|
70
|
+
&client_secret=<your_client_secret>
|
|
71
|
+
&scope=Factoring.Write Factoring.Read
|
|
72
|
+
|
|
73
|
+
TQL will provide the exact token endpoint URL, Client ID, and Client Secret during partner onboarding.
|
|
74
|
+
|
|
75
|
+
#### Philosophy
|
|
76
|
+
|
|
77
|
+
- **Authentication** — All endpoints require a valid OAuth 2.0 Bearer token in the `Authorization` header. See the **Authentication** section above for details.
|
|
78
|
+
- **Asynchronous processing** — Write endpoints return `202 Accepted` immediately; poll `GET /api/invoices/{invoiceNumber}` for completion and exceptions.
|
|
79
|
+
- **Error handling** — Non-2xx responses follow [RFC 7807 Problem Details](https://datatracker.ietf.org/doc/html/rfc7807) with `title`, `status`, and `detail` fields.
|
|
80
|
+
|
|
81
|
+
## Install the Package
|
|
82
|
+
|
|
83
|
+
The package is compatible with Python versions `3.7+`.
|
|
84
|
+
Install the package from PyPi using the following pip command:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pip install apimatic-tql-sdk==0.0.1
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
You can also view the package at:
|
|
91
|
+
https://pypi.python.org/pypi/apimatic-tql-sdk/0.0.1
|
|
92
|
+
|
|
93
|
+
## Initialize the API Client
|
|
94
|
+
|
|
95
|
+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/client.md)
|
|
96
|
+
|
|
97
|
+
The following parameters are configurable for the API Client:
|
|
98
|
+
|
|
99
|
+
| Parameter | Type | Description |
|
|
100
|
+
| --- | --- | --- |
|
|
101
|
+
| http_client_instance | `Union[Session, HttpClientProvider]` | The Http Client passed from the sdk user for making requests |
|
|
102
|
+
| override_http_client_configuration | `bool` | The value which determines to override properties of the passed Http Client from the sdk user |
|
|
103
|
+
| http_call_back | `HttpCallBack` | The callback value that is invoked before and after an HTTP call is made to an endpoint |
|
|
104
|
+
| timeout | `float` | The value to use for connection timeout. <br> **Default: 30** |
|
|
105
|
+
| max_retries | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
|
|
106
|
+
| backoff_factor | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 2** |
|
|
107
|
+
| retry_statuses | `Array of int` | The http statuses on which retry is to be done. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
|
108
|
+
| retry_methods | `Array of string` | The http methods on which retry is to be done. <br> **Default: ["GET", "PUT"]** |
|
|
109
|
+
| proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
|
|
110
|
+
| logging_configuration | [`LoggingConfiguration`](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/logging-configuration.md) | The SDK logging configuration for API calls |
|
|
111
|
+
| client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
|
|
112
|
+
|
|
113
|
+
The API client can be initialized as follows:
|
|
114
|
+
|
|
115
|
+
### Code-Based Client Initialization
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
import logging
|
|
119
|
+
|
|
120
|
+
from tqlotrfactoringdataexchange.configuration import Environment
|
|
121
|
+
from tqlotrfactoringdataexchange.http.auth.oauth_2 import ClientCredentialsAuthCredentials
|
|
122
|
+
from tqlotrfactoringdataexchange.logging.configuration.api_logging_configuration import LoggingConfiguration
|
|
123
|
+
from tqlotrfactoringdataexchange.logging.configuration.api_logging_configuration import RequestLoggingConfiguration
|
|
124
|
+
from tqlotrfactoringdataexchange.logging.configuration.api_logging_configuration import ResponseLoggingConfiguration
|
|
125
|
+
from tqlotrfactoringdataexchange.models.oauth_scope import OauthScope
|
|
126
|
+
from tqlotrfactoringdataexchange.tqlotrfactoringdataexchange_client import TqlotrfactoringdataexchangeClient
|
|
127
|
+
|
|
128
|
+
client = TqlotrfactoringdataexchangeClient(
|
|
129
|
+
client_credentials_auth_credentials=ClientCredentialsAuthCredentials(
|
|
130
|
+
oauth_client_id='OAuthClientId',
|
|
131
|
+
oauth_client_secret='OAuthClientSecret',
|
|
132
|
+
oauth_scopes=[
|
|
133
|
+
OauthScope.FACTORING_WRITE,
|
|
134
|
+
OauthScope.FACTORING_READ
|
|
135
|
+
]
|
|
136
|
+
),
|
|
137
|
+
environment=Environment.PRODUCTION,
|
|
138
|
+
logging_configuration=LoggingConfiguration(
|
|
139
|
+
log_level=logging.INFO,
|
|
140
|
+
request_logging_config=RequestLoggingConfiguration(
|
|
141
|
+
log_body=True
|
|
142
|
+
),
|
|
143
|
+
response_logging_config=ResponseLoggingConfiguration(
|
|
144
|
+
log_headers=True
|
|
145
|
+
)
|
|
146
|
+
)
|
|
147
|
+
)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Environment-Based Client Initialization
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
from tqlotrfactoringdataexchange.tqlotrfactoringdataexchange_client import TqlotrfactoringdataexchangeClient
|
|
154
|
+
|
|
155
|
+
# Specify the path to your .env file if it’s located outside the project’s root directory.
|
|
156
|
+
client = TqlotrfactoringdataexchangeClient.from_environment(dotenv_path='/path/to/.env')
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
See the [Environment-Based Client Initialization](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/environment-based-client-initialization.md) section for details.
|
|
160
|
+
|
|
161
|
+
## Authorization
|
|
162
|
+
|
|
163
|
+
This API uses the following authentication schemes.
|
|
164
|
+
|
|
165
|
+
* [`bearerAuth (OAuth 2 Client Credentials Grant)`](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/auth/oauth-2-client-credentials-grant.md)
|
|
166
|
+
|
|
167
|
+
## List of APIs
|
|
168
|
+
|
|
169
|
+
* [Invoices](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/controllers/invoices.md)
|
|
170
|
+
* [Documents](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/controllers/documents.md)
|
|
171
|
+
* [Assignments](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/controllers/assignments.md)
|
|
172
|
+
* [Loads](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/controllers/loads.md)
|
|
173
|
+
|
|
174
|
+
## SDK Infrastructure
|
|
175
|
+
|
|
176
|
+
### Configuration
|
|
177
|
+
|
|
178
|
+
* [ProxySettings](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/proxy-settings.md)
|
|
179
|
+
* [Environment-Based Client Initialization](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/environment-based-client-initialization.md)
|
|
180
|
+
* [AbstractLogger](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/abstract-logger.md)
|
|
181
|
+
* [LoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/logging-configuration.md)
|
|
182
|
+
* [RequestLoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/request-logging-configuration.md)
|
|
183
|
+
* [ResponseLoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/response-logging-configuration.md)
|
|
184
|
+
|
|
185
|
+
### HTTP
|
|
186
|
+
|
|
187
|
+
* [HttpResponse](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/http-response.md)
|
|
188
|
+
* [HttpRequest](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/http-request.md)
|
|
189
|
+
|
|
190
|
+
### Utilities
|
|
191
|
+
|
|
192
|
+
* [ApiResponse](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/api-response.md)
|
|
193
|
+
* [ApiHelper](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/api-helper.md)
|
|
194
|
+
* [HttpDateTime](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/http-date-time.md)
|
|
195
|
+
* [RFC3339DateTime](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/rfc3339-date-time.md)
|
|
196
|
+
* [UnixDateTime](https://www.github.com/sdks-io/apimatic-tql-python-sdk/tree/0.0.1/doc/unix-date-time.md)
|
|
197
|
+
|