npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

apimatic-tql-sdk

v0.0.1

Published

this is a sample SDK generated by APIMatic

Readme

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 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 from your project directory to install the package from npm:

npm install [email protected]

For additional package details, see the Npm page for the [email protected] npm.

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 | number | Timeout for API calls.Default: 30000 | | httpClientOptions | Partial<HttpClientOptions> | Stable configurable http client options. | | unstableHttpClientOptions | any | Unstable configurable http client options. | | logging | PartialLoggingOptions | Logging Configuration to enable logging | | clientCredentialsAuthCredentials | ClientCredentialsAuthCredentials | The credential object for clientCredentialsAuth |

The API client can be initialized as follows:

Code-Based Client Initialization

import { Client, LogLevel, OauthScope } from 'apimatic-tql-sdk';

const client = new Client({
  clientCredentialsAuthCredentials: {
    oauthClientId: 'OAuthClientId',
    oauthClientSecret: 'OAuthClientSecret',
    oauthScopes: [
      OauthScope.FactoringWrite,
      OauthScope.FactoringRead
    ]
  },
  timeout: 30000,
  logging: {
    logLevel: LogLevel.Info,
    logRequest: {
      logBody: true
    },
    logResponse: {
      logHeaders: true
    }
  },
});

Configuration-Based Client Initialization

import * as path from 'path';
import * as fs from 'fs';
import { Client } from 'apimatic-tql-sdk';

// Provide absolute path for the configuration file
const absolutePath = path.resolve('./config.json');

// Read the configuration file content
const fileContent = fs.readFileSync(absolutePath, 'utf-8');

// Initialize client from JSON configuration content
const client = Client.fromJsonConfig(fileContent);

See the Configuration-Based Client Initialization section for details.

Environment-Based Client Initialization

import * as dotenv from 'dotenv';
import * as path from 'path';
import * as fs from 'fs';
import { Client } from 'apimatic-tql-sdk';

// Optional - Provide absolute path for the .env file
const absolutePath = path.resolve('./.env');

if (fs.existsSync(absolutePath)) {
  // Load environment variables from .env file
  dotenv.config({ path: absolutePath, override: true });
}

// Initialize client using environment variables
const client = Client.fromEnvironment(process.env);

See the Environment-Based Client Initialization section for details.

Authorization

This API uses the following authentication schemes.

List of APIs

SDK Infrastructure

Configuration

HTTP

Utilities