sdksio/apimatic-tql-sdk

this is a sample SDK generated by APIMatic

Maintainers

Package info

github.com/sdks-io/apimatic-tql-php-sdk

Homepage

pkg:composer/sdksio/apimatic-tql-sdk

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.0.1 2026-06-11 15:12 UTC

This package is auto-updated.

Last update: 2026-06-11 15:12:34 UTC


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 SubmissionPOST /api/invoices — Submit a factoring company invoice referencing a TQL load, including carrier details, stops, charges, and reference numbers.
  • Invoice SearchPOST /api/invoices/search — Search and retrieve a paginated list of invoices with status and last-updated timestamps.
  • Invoice StatusGET /api/invoices/{invoiceNumber} — Retrieve the current processing status of an invoice, including any outstanding exceptions.
  • Document UploadPOST /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.
  • Carrier AssignmentPUT /api/assignments — Notify TQL that a factoring company has been assigned to (or unassigned from) a carrier, including the effective date.
  • Load LookupGET /api/loads/{loadNumber} — Verify a load exists in TQL's system and retrieve basic details (carrier, status, dates).
  • Load SearchPOST /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:

  1. Obtain an access token — Make a POST request to the TQL token endpoint with your Client ID and Client Secret using the client_credentials grant type.

  2. Include the token — Pass the access token as a Bearer token in the Authorization header on every API request: Authorization: Bearer <access_token>

  3. 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 assignments
  • Factoring.Read — Query invoice status, search invoices 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.

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 Authorization header. See the Authentication section above for details.
  • Asynchronous processing — Write endpoints return 202 Accepted immediately; poll GET /api/invoices/{invoiceNumber} for completion and exceptions.
  • Error handling — Non-2xx responses follow RFC 7807 Problem Details with title, status, and detail fields.

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

HTTP

Utilities