API Docs
Tools

SDKs & Client Libraries

The 3PLGuys API is a standard REST API with an OpenAPI 3.0 spec. There's no official SDK yet, but you can use any HTTP client or auto-generate a typed client from the spec.

Recommended HTTP Clients

JavaScript / Node.js

fetchBuilt-in, no dependencies
axiosInterceptors, auto-retry
kyLightweight, retry built-in

Python

httpxAsync support, modern API
requestsSimple, widely used

Other Languages

curlCLI, scripting, testing
net/httpGo standard library
HttpClientC# / .NET

Quick Examples

Fetching shipments in three languages — all using the same REST endpoint.

curl
curl https://api.3plguys.com/v0/shipments?take=10 \
-H "Authorization: Bearer YOUR_TOKEN"
Node.js (fetch)
const res = await fetch("https://api.3plguys.com/v0/shipments?take=10", {
headers: { Authorization: "Bearer YOUR_TOKEN" },
});
const shipments = await res.json();
console.log(shipments);
Python (httpx)
import httpx
res = httpx.get(
"https://api.3plguys.com/v0/shipments",
params={"take": 10},
headers={"Authorization": "Bearer YOUR_TOKEN"},
)
shipments = res.json()
print(shipments)

Generate a Typed Client

Use the OpenAPI spec to auto-generate a fully typed client in your language of choice.

Generate TypeScript client
npx @hey-api/openapi-ts \
-i https://api.3plguys.com/openapi.json \
-o ./src/api-client \
-c @hey-api/client-fetch
Generate Python client
pip install openapi-python-client
openapi-python-client generate \
--url https://api.3plguys.com/openapi.json

Compatible Generators

ToolLanguagesNotes
@hey-api/openapi-tsTypeScriptGenerates fetch/axios clients with full types, Zod schemas, and plugins
openapi-python-clientPythonGenerates httpx-based async client with Pydantic models
OpenAPI Generator50+ languagesJava, Go, C#, Ruby, PHP, Swift, Kotlin, and more
oapi-codegenGoGenerates Go server/client from OpenAPI 3.0

Building a Wrapper

If you prefer a hand-crafted client, here's a minimal wrapper pattern with automatic token refresh:

API wrapper with auto-refresh (Node.js)
class ThreePLClient {
constructor({ clientId, clientSecret, refreshToken }) {
this.clientId = clientId;
this.clientSecret = clientSecret;
this.refreshToken = refreshToken;
this.accessToken = null;
this.expiresAt = 0;
}
async getToken() {
if (this.accessToken && Date.now() < this.expiresAt) {
return this.accessToken;
}
const res = await fetch("https://api.3plguys.com/oauth/token", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
grant_type: "refresh_token",
refresh_token: this.refreshToken,
client_id: this.clientId,
client_secret: this.clientSecret,
}),
});
const data = await res.json();
this.accessToken = data.access_token;
this.refreshToken = data.refresh_token;
this.expiresAt = Date.now() + data.expires_in * 1000 - 60000;
return this.accessToken;
}
async request(path, options = {}) {
const token = await this.getToken();
const res = await fetch(`https://api.3plguys.com${path}`, {
...options,
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
...options.headers,
},
});
if (!res.ok) throw new Error(`${res.status}: ${(await res.json()).message}`);
if (res.status === 204) return null;
return res.json();
}
getShipments(params) {
const qs = new URLSearchParams(params).toString();
return this.request(`/v0/shipments?${qs}`);
}
getProducts(params) {
const qs = new URLSearchParams(params).toString();
return this.request(`/v0/inventory/products?${qs}`);
}
}

Generate a typed client

The OpenAPI spec gives you everything you need to generate a fully typed client for any language. See the OpenAPI page for details.