Batch Shipping

作者 goshippocf8e96532f24無授權條款3 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫2 週前更新

Process bulk shipments from CSV files, create and purchase batch labels, and generate end-of-day manifests via the Shippo API

僅含說明Business & Finance
AI 產生的概覽

透過 Shippo API 處理 CSV 批次貨件、購買批次標籤並產生每日結束清單。

功能
此技能引導代理使用 Shippo API 執行批次出貨作業:解析貨件 CSV、驗證資料列、為國際資料列建立海關申報,並建立貨件批次。內容涵蓋輪詢批次狀態、修正無效批次、在購買正式標籤前取得使用者明確確認,以及回報追蹤編號與標籤網址。它也說明如何依指定交易物件 ID 建立每日結束清單,並回傳清單 PDF 網址與貨件數量。
適用情境
當需要從 CSV 檔案批次出貨,並透過 Shippo 批次購買標籤時使用。也適合為已購買的交易產生承運商每日結束清單。
執行需求
需要存取 Shippo API,以及可為正式標籤購買扣款的已授權 Shippo 帳戶。內容引用 Shippo 的 CSV 格式與海關指南參考文件。此技能不附指令碼,僅為操作說明。
<!-- ⚠️ DO NOT EDIT. Auto-generated from skills/batch-shipping/SKILL.md by scripts/sync.js Edits here will be overwritten on the next sync. To change this content, edit the canonical source and re-run the sync script. -->

Batch Shipping

Purchases Are Live

Batch purchases charge the authorized Shippo account for real. Before PurchaseBatch, show the shipment count, carrier/service, and estimated total cost, and require explicit user confirmation.


Purchase Confirmation Gate

Before every call to PurchaseBatch, summarize the following and ask the user for explicit confirmation:

  • Total number of shipments to be purchased
  • Carrier and service level (or selection rule if varied)
  • Estimated total cost
  • Number of domestic vs international shipments

Do not proceed without explicit user confirmation.


CSV Batch Processing

See shippo/references/csv-format.md for the column specification.

  1. Read and parse the CSV. Validate required columns are present. Report row count.
  2. Validate each row for non-empty required fields. Report invalid rows with reasons.
  3. Detect international rows (sender_country != recipient_country). Create customs declarations for those rows. See shippo/references/customs-guide.md. Use correct customs enum values: RETURN_MERCHANDISE (not RETURN) for returned goods, HUMANITARIAN_DONATION (not HUMANITARIAN) for charitable donations.
  4. Build the batch_shipments array with inline address and parcel objects per row.
  5. Call CreateBatch with the array.
  6. Poll GetBatch until status is VALID or INVALID. See Polling Intervals below.
  7. If the status is INVALID, some batch shipments failed validation: see "Fixing an INVALID batch" below, fix them, and re-poll until VALID. Report per-shipment failures either way before proceeding.
  8. Confirm purchase (see Purchase Confirmation Gate above).
  9. Call PurchaseBatch to buy labels for all valid shipments.
  10. Poll GetBatch until status changes from PURCHASING to PURCHASED. See Polling Intervals below.
  11. Report: total attempted, succeeded, failed. For successes: tracking_number and label_url (complete URL). For failures: error messages.

Retrieving batch labels

A purchased batch does not put each label URL inline on the batch object. Each entry in batch_shipments[] carries a transaction field, which is a Transaction object_id. Call GetTransaction on it to get that shipment's label_url and tracking_number. The batch-level label_url is a merged multi-label PDF (up to 100 labels per file) and cannot be split per order.

Batch Size Guidance

For batches over 500 shipments, consider splitting into multiple batches. Large batches take longer to validate and purchase, and a single failure can be harder to diagnose.


Polling Intervals

  • For batches under 100 shipments: poll every 3-5 seconds.
  • For batches with 100+ shipments: poll every 5-10 seconds.
  • Report progress to the user every 30 seconds.
  • Stop after 60 retries and suggest the user check back later using GetBatch with the batch object_id.

Batch with Rate Shopping

  1. Call CreateShipment per shipment to get rate quotes (see Rate Shopping).
  2. Present rates. User picks a service level rule (e.g., "cheapest for each" or a specific carrier/service).
  3. Build batch_shipments with servicelevel_token per item.
  4. Create, validate, confirm purchase, purchase, report as above.

Managing an Existing Batch

  • Add shipments: AddShipmentsToBatch (before purchase only). Note: adding an invalid shipment will change the entire batch status to INVALID. Check per-shipment statuses after adding.
  • Remove shipments: RemoveShipmentsFromBatch (before purchase only).

Fixing an INVALID batch

If GetBatch returns status INVALID, one or more batch shipments failed validation and the batch cannot be purchased until they are fixed.

  1. Find the failures. Call GetBatch with object_results=creation_failed to return only the failed shipments (paginate with ?page= if there are many), or read each batch_shipments[].status (VALID / INVALID / INCOMPLETE / TRANSACTION_FAILED) and its messages for the reason. The batch-level errors array collects the same per-shipment failures in one place.
  2. Fix them, either:
    • Remove: RemoveShipmentsFromBatch with the failed batch-shipment object_ids (from batch_shipments[].object_id, not the shipment object_id) to drop them, or
    • Correct and re-add: AddShipmentsToBatch with corrected shipment objects (fixed address, parcel, or servicelevel).
  3. Re-poll GetBatch until status is VALID.
  4. Then confirm purchase (see Purchase Confirmation Gate) and PurchaseBatch.

End-of-Day Manifest

  1. Collect: carrier_account (object_id), shipment_date (YYYY-MM-DD, default today), address_from (pickup address).
  2. Optionally collect specific transaction object_ids to scope the manifest. You must pass specific transaction object_ids -- there is no auto-include for a date range.
  3. Call CreateManifest.
  4. Poll GetManifest until status is SUCCESS or ERROR.
  5. Return the manifest PDF URL(s) and shipment count.

Quick Reference

CSV batch: Parse CSV -> CreateCustomsDeclaration (international rows) -> CreateBatch -> poll GetBatch -> confirm -> PurchaseBatch -> poll GetBatch

Manifest: CreateManifest (with transaction object_ids) -> poll GetManifest

來源與署名

來源:goshippo/ai位於providers/claude/plugin/skills/batch-shipping提交cf8e965

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架

更多來自 goshippo/ai 的技能

Upgrade Shippo

goshippo

說明 Shippo API 版本變更、Webhook 承載內容版本管理,以及託管 Shippo MCP 伺服器的疑難排解。

Software Development32 週前更新

Tracking

goshippo

透過 Shippo API 跨貨運業者追蹤包裹,包含貨態歷程與追蹤 webhook。

Productivity & Workflow32 週前更新

Shippo Support Ticket

goshippo

Generate a complete, auto-classified, ready-to-paste Shippo support ticket for a single shipment or label. Use when a support agent or customer needs to escalate a shipping issue (lost/delayed package, unused-label refund, billing/rate adjustment, address exception, customs hold, carrier-account, or tracking-webhook problem). Given a tracking number + carrier, a transaction (label) ID, or a shipment ID, it classifies the issue, runs the right read-only Shippo MCP lookups, computes the triage timeline, and emits both a copy-paste support message and a routing-tagged JSON block so the ticket lands in the right pipeline first time.

待分類32 週前更新

Shippo Best Practices

goshippo

Guides Shippo integration decisions, choosing between Rates at Checkout vs. full Shipments+Transactions vs. Batch processing, address validation strategy (v1 vs v2 fields), domestic vs international workflows (customs declarations, incoterms), label format selection, and webhook setup. Use when planning, building, or reviewing any Shippo integration, including building checkout flows, bulk fulfillment pipelines, address validation, label generation, package tracking, customs handling, or webhook subscriptions.

待分類32 週前更新

Shipping Analysis

goshippo

透過 Shippo API 分析運費、比較承運商、最佳化包裹尺寸並檢視歷史運費支出。

Business & Finance32 週前更新

Rate Shopping

goshippo

透過 Shippo API 比較多家貨運商的運費,並推薦最便宜、最快或最超值的方案。

Business & Finance32 週前更新