| name | flexport-core-workflow-a |
| description | Execute Flexport primary workflow: shipment booking and purchase order management.
Use when creating bookings, managing purchase orders, tracking freight,
or building the core shipment lifecycle integration.
Trigger: "flexport booking", "flexport purchase order", "create flexport shipment".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(curl:*), Grep |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","logistics","flexport"] |
| compatibility | Designed for Claude Code |
Flexport Core Workflow A: Bookings & Purchase Orders
Overview
The primary Flexport integration path: create purchase orders, book shipments, and track cargo through the supply chain. The API v2 uses RESTful endpoints at https://api.flexport.com with JSON payloads.
Prerequisites
- Completed
flexport-install-auth setup
- Understanding of Flexport freight types (ocean FCL/LCL, air, trucking)
- Valid shipper/consignee addresses configured in Flexport Portal
Instructions
Step 1: Create a Purchase Order
const BASE = 'https://api.flexport.com';
const headers = {
'Authorization': `Bearer ${process.env.FLEXPORT_API_KEY}`,
'Flexport-Version': '2',
'Content-Type': 'application/json',
};
const po = await fetch(`${BASE}/purchase_orders`, {
method: 'POST',
headers,
body: JSON.stringify({
name: 'PO-2025-001',
status: 'open',
buyer: { name: 'Acme Corp', address: { country: 'US' } },
seller: { name: 'Shanghai Supplier', address: { country: 'CN' } },
line_items: [
{ : , : , : },
{ : , : , : },
],
: ,
: ,
}),
}).( r.());
.();