Skip to content
Skillv1.0.0

flexport-upgrade-migration

Migrate between Flexport API versions (v1 to v2, Logistics API versions). Use when upgrading API version headers, handling deprecated endpoints, or migrating from legacy Flexport API patterns. Trigger

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/flexport-upgrade-migration/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill flexport-upgrade-migration. Copyright stays with the author (MIT).

Flexport Upgrade & Migration

Overview

Guide for migrating between Flexport API versions. The main API uses Flexport-Version header (currently 2). The Logistics API has dated versions (2023-10, 2024-04). Breaking changes are versioned -- old versions remain available during deprecation windows.

Prerequisites

  • Current vendor release information and an inventory of version headers, endpoints, mappings, consumers, and retention rules.
  • Sandbox access, fictional shipment fixtures, a rollback owner, and explicit reconciliation criteria.

Output

Keep an upgrade receipt listing versions reviewed, affected mappings, sandbox result, canary result, reconciliation evidence, approver, and rollback decision. Exclude commercial documents, addresses, invoice details, and credentials.

Error Handling

  • Classify unexpected response changes as schema, permission, pagination, delivery, or retention failures.
  • Stop promotion and restore the prior version/mapping on a mismatch; do not bulk replay live bookings or documents to diagnose it.
  • Quarantine failed records by opaque identifier for reviewed reconciliation.

Examples

Run old and proposed headers against a fictional sandbox shipment, compare only approved schema fields and aggregate results, and test an unauthorized response. If any mapping or access behavior changes unexpectedly, disable the canary and retain the prior path pending review.

Instructions

Step 1: Identify Current API Usage

# Find all Flexport API calls in your codebase
grep -rn "Flexport-Version\|api.flexport.com\|logistics-api.flexport.com" src/ --include="*.ts" --include="*.py"

# Check which version header you're sending
grep -rn "Flexport-Version" src/ --include="*.ts"

Step 2: API v1 to v2 Migration

Change v1 v2
Header Flexport-Version: 1 Flexport-Version: 2
Response wrapper { "_object": "Shipment", ... } { "data": { ... } }
Pagination { "next": "/shipments?page=2" } { "data": { "records": [], "total_count": N } }
Error format { "errors": [...] } { "error": { "code": "...", "message": "..." } }
Date format Mixed ISO 8601 consistently
// v1 pattern (deprecated)
const res = await fetch(`${BASE}/shipments`, { headers: { 'Flexport-Version': '1' } });
const { _object, id, status } = await res.json();

// v2 pattern (current)
const res = await fetch(`${BASE}/shipments`, { headers: { 'Flexport-Version': '2' } });
const { data } = await res.json();
data.records.forEach(s => console.log(s.id, s.status));

Step 3: Logistics API Version Migration

// The Logistics API has separate versioned URLs
// Old: https://docs.logistics-api.flexport.com/2023-10/
// New: https://docs.logistics-api.flexport.com/2024-04/

// Check OpenAPI spec for changes
// https://logistics-api.flexport.com/logistics/api/2024-04/documentation/raw

Step 4: Dual-Version Testing

// Run both versions in parallel during migration
async function migrateEndpoint(path: string) {
  const [v1Res, v2Res] = await Promise.all([
    fetch(`${BASE}${path}`, { headers: { ...auth, 'Flexport-Version': '1' } }),
    fetch(`${BASE}${path}`, { headers: { ...auth, 'Flexport-Version': '2' } }),
  ]);

  const v1 = await v1Res.json();
  const v2 = await v2Res.json();

  // Compare key fields to verify migration correctness
  console.log('v1 count:', v1.total || 'N/A');
  console.log('v2 count:', v2.data?.total_count || 'N/A');
}

Migration Checklist

  • Update Flexport-Version header to 2
  • Update response parsing from _object to data.records
  • Update pagination logic for v2 format
  • Update error handling for v2 error format
  • Run test suite against v2 endpoints
  • Deploy to staging and verify
  • Monitor error rates after production deployment

Resources

Next Steps

For CI integration during upgrades, see flexport-ci-integration.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-flexport-upgr-d64cfe/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-flexport-upgr-d64cfe.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-flexport-upgr-d64cfe",
  "kind": "skill",
  "name": "flexport-upgrade-migration",
  "description": "Migrate between Flexport API versions (v1 to v2, Logistics API versions). Use when upgrading API version headers, handling deprecated endpoints, or migrating from legacy Flexport API patterns. Trigger: \"upgrade flexport\", \"flexport API version\", \"flexport migration\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "saas",
      "logistics",
      "flexport",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Migrate between Flexport API versions (v1 to v2, Logistics API versions). Use when upgrading API version headers, handling deprecated endpoints, or migrating from legacy Flexport API patterns. Trigger: \"upgrade flexport\", \"flexport API version\", \"flexport migration\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/flexport-upgrade-migration/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/flexport-upgrade-migration/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/flexport-upgrade-migration/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(npm:*),",
      "Grep"
    ],
    "license": "MIT"
  },
  "instructions": "# Flexport Upgrade & Migration\n\n## Overview\n\nGuide for migrating between Flexport API versions. The main API uses `Flexport-Version` header (currently `2`). The Logistics API has dated versions (`2023-10`, `2024-04`). Breaking changes are versioned -- old versions remain available during deprecation windows.\n\n## Prerequisites\n\n- Current vendor release information and an inventory of version headers, endpoints, mappings, consumers, and retention rules.\n- Sandbox access, fictional shipment fixtures, a rollback owner, and explicit reconciliation criteria.\n\n## Output\n\nKeep an upgrade receipt listi",
  "cost": {
    "context_tokens": 1031
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-flexport-upgr-d64cfe/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.