| name | flexport-hello-world |
| description | Create a minimal working Flexport example — list shipments and track containers.
Use when starting a new Flexport integration, testing your setup,
or learning the Flexport REST API v2 patterns.
Trigger: "flexport hello world", "flexport example", "flexport quick start".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(curl:*) |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","logistics","flexport"] |
| compatibility | Designed for Claude Code |
Flexport Hello World
Overview
List shipments and retrieve tracking milestones using the Flexport REST API v2. Flexport has no npm SDK -- you call https://api.flexport.com directly with bearer token auth and a Flexport-Version: 2 header.
Prerequisites
FLEXPORT_API_KEY environment variable set
- Completed
flexport-install-auth setup
- Node.js 18+ (uses native
fetch)
Instructions
Step 1: List Your Shipments
const BASE = 'https://api.flexport.com';
const headers = {
'Authorization': `Bearer ${process.env.FLEXPORT_API_KEY}`,
'Flexport-Version': '2',
'Content-Type': 'application/json',
};
const res = await fetch(`${BASE}/shipments?per=5&page=1`, { headers });
const { data } = await res.json();
data.records.forEach((shipment: any) => {
console.log(`${shipment.id} | ${shipment.status} | ${shipment.freight_type}`);
console.log(` Origin: ${shipment.origin_port?.name ?? 'N/A'}`);
.();
});