sdksio/apimatic-tql-sdk
最新稳定版本:0.0.1
Composer 安装命令:
composer require sdksio/apimatic-tql-sdk
包简介
this is a sample SDK generated by APIMatic
关键字:
README 文档
README
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
Run the following command to install the package and automatically add the dependency to your composer.json file:
composer require "sdksio/apimatic-tql-sdk:0.0.1"
Or add it to the composer.json file manually as given below:
"require": { "sdksio/apimatic-tql-sdk": "0.0.1" }
You can also view the package at: https://packagist.org/packages/sdksio/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 |
|---|---|---|
| timeout | int |
Timeout for API calls in seconds. Default: 30 |
| enableRetries | bool |
Whether to enable retries and backoff feature. Default: false |
| numberOfRetries | int |
The number of retries to make. Default: 0 |
| retryInterval | float |
The retry time interval between the endpoint calls. Default: 1 |
| backOffFactor | float |
Exponential backoff factor to increase interval between retries. Default: 2 |
| maximumRetryWaitTime | int |
The maximum wait time in seconds for overall retrying requests. Default: 0 |
| retryOnTimeout | bool |
Whether to retry on request timeout. Default: true |
| httpStatusCodesToRetry | array |
Http status codes to retry against. Default: 408, 413, 429, 500, 502, 503, 504, 521, 522, 524 |
| httpMethodsToRetry | array |
Http methods to retry against. Default: 'GET', 'PUT' |
| loggingConfiguration | LoggingConfigurationBuilder |
Represents the logging configurations for API calls |
| proxyConfiguration | ProxyConfigurationBuilder |
Represents the proxy configurations for API calls |
| clientCredentialsAuth | ClientCredentialsAuth |
The Credentials Setter for OAuth 2 Client Credentials Grant |
The API client can be initialized as follows:
use TqlOtrFactoringDataExchangeLib\Logging\LoggingConfigurationBuilder; use TqlOtrFactoringDataExchangeLib\Logging\RequestLoggingConfigurationBuilder; use TqlOtrFactoringDataExchangeLib\Logging\ResponseLoggingConfigurationBuilder; use Psr\Log\LogLevel; use TqlOtrFactoringDataExchangeLib\Authentication\ClientCredentialsAuthCredentialsBuilder; use TqlOtrFactoringDataExchangeLib\Models\OauthScope; use TqlOtrFactoringDataExchangeLib\TqlOtrFactoringDataExchangeClientBuilder; $client = TqlOtrFactoringDataExchangeClientBuilder::init() ->clientCredentialsAuthCredentials( ClientCredentialsAuthCredentialsBuilder::init( 'OAuthClientId', 'OAuthClientSecret' ) ->oauthScopes( [ OauthScope::FACTORING_WRITE, OauthScope::FACTORING_READ ] ) ) ->loggingConfiguration( LoggingConfigurationBuilder::init() ->level(LogLevel::INFO) ->requestConfiguration(RequestLoggingConfigurationBuilder::init()->body(true)) ->responseConfiguration(ResponseLoggingConfigurationBuilder::init()->headers(true)) ) ->build();
Authorization
This API uses the following authentication schemes.
List of APIs
SDK Infrastructure
Configuration
- ProxyConfigurationBuilder
- LoggingConfigurationBuilder
- RequestLoggingConfigurationBuilder
- ResponseLoggingConfigurationBuilder
HTTP
Utilities
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-11