agentsclimarketplace

Flexport common errors

Skill jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/flexport-pack/skills/flexport-common-errors

'Diagnose and fix common Flexport API errors including HTTP status codes,From its SKILL.md

Install
npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill flexport-common-errors

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.2 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it

Flexport Common Errors

Overview

Quick reference for the most common Flexport API v2 errors. The API returns standard HTTP codes with JSON error bodies containing code, message, and sometimes details fields.

Error Reference

401 Unauthorized — Invalid or Missing API Key

{ "error": { "code": "UNAUTHORIZED", "message": "Invalid API key" } }

Causes: Missing Authorization header, expired JWT token, revoked API key.

Fix:

# Verify key is set
echo $FLEXPORT_API_KEY | head -c 10
# Test with cURL
curl -s -o /dev/null -w "%{http_code}" \
  -H "Authorization: Bearer $FLEXPORT_API_KEY" \
  -H "Flexport-Version: 2" \
  https://api.flexport.com/shipments?per=1

403 Forbidden — Insufficient Permissions

Causes: API key lacks required scope, IP whitelist blocking, sandbox key used on production.

Fix: Check key permissions in Flexport Portal > Settings > Developer. Ensure key scope includes the endpoint you are calling.

404 Not Found — Resource Does Not Exist

{ "error": { "code": "NOT_FOUND", "message": "Shipment shp_xxx not found" } }

Causes: Wrong ID format, resource deleted, using test ID in production.

Fix: List resources first to get valid IDs:

curl -s -H "Authorization: Bearer $FLEXPORT_API_KEY" \
     -H "Flexport-Version: 2" \
     https://api.flexport.com/shipments?per=1 | jq '.data.records[0].id'

422 Unprocessable Entity — Validation Failed

{ "error": { "code": "VALIDATION_ERROR", "message": "Invalid port code", "details": [...] } }

Common validation failures:

FieldIssueFix
origin_port.codeNot a valid UN/LOCODEUse CNSHA, USLAX, DEHAM format
hs_codeWrong formatUse 6-10 digit codes like 8479.89
cargo_ready_dateIn the pastUse future ISO date
freight_typeUnsupported valueUse ocean, air, or trucking
incotermInvalidUse FOB, CIF, EXW, DDP

429 Too Many Requests — Rate Limited

{ "error": { "code": "RATE_LIMITED", "message": "Rate limit exceeded" } }

Fix: Check response headers and back off:

function handleRateLimit(res: Response): number {
  const retryAfter = res.headers.get('Retry-After');
  const remaining = res.headers.get('X-RateLimit-Remaining');
  console.log(`Rate limited. Remaining: ${remaining}. Retry after: ${retryAfter}s`);
  return parseInt(retryAfter || '60') * 1000;
}

500/502/503 — Server Errors

Causes: Flexport internal issue, maintenance window, upstream provider failure.

Fix:

# Check Flexport status page
curl -s https://status.flexport.com/api/v2/status.json | jq '.status'

Retry with exponential backoff for transient 5xx errors. See flexport-rate-limits.

Diagnostic Script

#!/bin/bash
echo "=== Flexport Diagnostics ==="
echo "API Key set: ${FLEXPORT_API_KEY:+YES}"
echo "Key prefix: ${FLEXPORT_API_KEY:0:8}..."
echo -n "API status: "
curl -s -o /dev/null -w "%{http_code}" \
  -H "Authorization: Bearer $FLEXPORT_API_KEY" \
  -H "Flexport-Version: 2" \
  https://api.flexport.com/shipments?per=1
echo ""
echo -n "Status page: "
curl -s https://status.flexport.com/api/v2/status.json | jq -r '.status.description'

Escalation Path

  1. Run diagnostic script above
  2. Collect request ID from response headers (X-Request-Id)
  3. Check Flexport Status
  4. Contact Flexport support with request ID and error details

Resources

Next Steps

For comprehensive debugging, see flexport-debug-bundle.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,144. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.