• Projects
  • Service
  • About
  • branding.bz
  • Podcast
  • Tips
  • FAQ
  • Recruit
  • Download
  • Contact
  • branding.bz(ブランド構築SaaS)
  • DESIGN NOW(デザインメディア)
  • X
  • LinkedIn
  • Spotify
  • Facebook

213-0011 神奈川県川崎市高津区久本3-6-7-303

© 2026 ID INC. All rights reserved

claude-skills/スキル
SKILLOfficialproductivity

label-purchase

プラグイン
shippo
ソース
GitHub で見る ↗
説明

Shippo APIを通じて、国内配送および国際配送のラベル購入、税関申告書の処理、返品ラベル、および無効化・返金ラベルを取り扱います。

原文を表示

Purchase domestic and international shipping labels, handle customs declarations, return labels, and void/refund labels via the Shippo API

ユースケース
  • 国内配送のラベルを購入する
  • 国際配送のラベルを購入する
  • 税関申告書を処理する
  • 返品ラベルを取り扱う
  • ラベルを無効化・返金する
本文(日本語訳)

ラベル購入

配送ラベル購入は実際に課金されます

ラベル購入は、認可されたShippoアカウントから実際に課金されます。購入前に、必ず「このShippoアカウントに課金されます」と、配送業者・サービス内容・金額を明示したうえで、ユーザーの確認を得てください。 確認なしに購入してはいけません。


購入前の確認ゲート

CreateTransactionを呼び出す前に、毎回以下の内容をまとめてユーザーに確認を求めてください:

  • 配送業者とサービスレベル
  • 見積金額
  • 予想配達日数
  • 発送元と宛先

ユーザーの明確な確認なしに進めてはいけません。


国内配送ラベル

  1. 必要に応じて両方のアドレスをValidateAddressで検証する(アドレス検証を参照)。
  2. CreateShipmentを呼び出し、address_from、address_to(street1、city、state、zip、countryといったv1形式のフィールドを使ったインラインアドレスオブジェクト)、parcels、async: falseを指定する。
  3. 配送料金をユーザーに提示し、選択させる。
  4. 購入を確認する(上記の購入前の確認ゲートを参照)。
  5. CreateTransactionを呼び出し、rate(選択した料金のobject_id)、label_file_type(デフォルトPDF_4x6)、async: falseを指定する。
  6. レスポンスのstatusを確認:
    • SUCCESS: tracking_number、label_url(S3署名付きURLは途中で切られると機能しないため、完全なURLを表示してください)、tracking_url_providerを返す。
    • QUEUED/WAITING: GetTransactionを繰り返し呼び出して解決するまで待つ。
    • ERROR: messages配列からメッセージを報告する。

国際配送ラベル

国内配送のすべてのステップに加えて、配送作成前に税関対応を行います。完全な税関ワークフローはshippo/references/customs-guide.mdを参照してください。

  1. 必要に応じてアドレスをValidateAddressで検証する。送信者はemailとphoneを含める必要があります。不足していたら尋ねてください。
  2. 税関申告品目を作成: 品目ごとにCreateCustomsItemを呼び出す(説明、数量、正味重量、重量単位、金額、通貨、原産国、関税番号)。別の方法として、このステップをスキップして、宣言内でインラインの品目オブジェクトを直接渡すことも可能です(ステップ3参照)。
  3. 税関宣言書を作成: CreateCustomsDeclarationを呼び出し、contents_type、non_delivery_option、certify: true、certify_signer、および品目(ステップ2のobject_idまたはインライン品目オブジェクト)を指定する。フィールド詳細はshippo/references/customs-guide.mdを参照してください。
  4. CreateShipmentを呼び出し、すべての標準フィールドに加えてcustoms_declaration(宣言書のobject_id)を指定する。
  5. 配送料金を提示し、購入を確認し(購入前の確認ゲートを参照)、ラベルを購入して、国内配送の流れと同じように結果を返す。

内容物タイプの判定フロー

contents_typeの値を決定するには以下を使用してください:

シナリオ 値
受取人への販売(商業売上) MERCHANDISE
無料ギフトを送付 GIFT
製品サンプルを送付 SAMPLE
紙の書類のみ DOCUMENTS
購入品の返品 RETURN_MERCHANDISE
慈善寄付 HUMANITARIAN_DONATION
上記に該当しない OTHER(contents_explanationが必須)

インコターム(取引条件)の判定ロジック

税関宣言書のincotermフィールドは、誰が関税・税金を負担するかを制御します:

  • 企業から消費者へ / 電子商取引(デフォルト): DDU(Delivered Duty Unpaid・関税未払い)を使用 -- 受取人が配達時に関税を支払う。
  • 売り手が関税を先払いする場合: DDP(Delivered Duty Paid・関税支払済み)を使用 -- 売り手がすべての関税と税金を負担する。
  • FedEx/DHLのみ: 高度な貿易シナリオ用にFCA(Free Carrier・運送人のもとで引き渡し)が利用可能です。

ユーザーが指定しない場合、標準的な電子商取引配送にはDDUをデフォルトとしてください。


返品用ラベル

返品用ラベルを生成するには、address_fromとaddress_toを入れ替え、元の受取人が送信者となり、元の送信者が受取人となるようにしてください。配送作成、料金選択、ラベル購入のその他すべてのステップは変わりません。


ラベル形式オプション

ユーザーが指定しない限り、デフォルトはPDF_4x6です。対応形式: PDF_4x6、PDF_4x8、PDF_A4、PDF_A5、PDF_A6、PDF、PDF_2.3x7.5、PNG、PNG_2.3x7.5、ZPLII。


ラベルカスタマイズオプション

CreateTransactionでラベルを購入する際、配送またはレートに以下のオプションを設定できます:

  • サイン確認: 配送のextraフィールドにsignature_confirmationを設定します。値: STANDARD、ADULT、CERTIFIED、INDIRECT、CARRIER_CONFIRMATION。
  • 保険: 配送のextraフィールドにinsuranceを設定し、amount、currency、providerを指定します。
  • 土曜日配達: 配送のextraフィールドでsaturday_deliveryをtrueに設定します。一部の配送業者とサービスレベルでのみ対応しています。
  • 参照フィールド: トランザクションでmetadataを渡し、注文番号や内部参照を記録します。

既存の料金から取得したラベル

ユーザーがすでに料金のobject_idを持っている場合: 必要に応じてGetRateを呼び出して詳細を確認し、購入を確認し(購入前の確認ゲートを参照)、CreateTransactionを直接呼び出してください。


ラベルのキャンセル

CreateRefundをトランザクションのobject_idで呼び出してください。

返金の制限: キャンセル/返金の対象可否は配送業者とタイミングに依存します。購入後にすべてのラベルを返金できるわけではありません。CreateRefundが失敗した場合、ユーザーにShippoサポートに問い合わせるよう案内してください。


クイックリファレンス

国内ラベル: (任意)ValidateAddress(×2) -> CreateShipment(インラインアドレス使用) -> ユーザーが料金を選択 -> 確認 -> CreateTransaction

国際ラベル: (任意)ValidateAddress(×2) -> CreateCustomsItem(品目ごと) -> CreateCustomsDeclaration -> CreateShipment(インラインアドレス + customs_declaration) -> ユーザーが料金を選択 -> 確認 -> CreateTransaction

返品ラベル: 国内/国際と同じですが、address_fromとaddress_toを入れ替えます。

注文からラベルへ: CreateOrder -> CreateShipment(注文のアドレス/品目データ使用) -> ユーザーが料金を選択 -> 確認 -> CreateTransaction -> 梱包明細(REST フォールバック、下記参照)


注文と梱包明細

注文を使用して、電子商取引の履行(注文処理)リクエストを表現します。注文には配送アドレス、品目、合計金額が含まれ、標準的なラベル購入ワークフローに入力されます。

ツール

  • CreateOrder: 品目、配送アドレス、注文詳細を含む注文を作成します。
  • GetOrder: オブジェクトIDで注文を取得します。
  • ListOrders: すべての注文をリストアップします。
  • 梱包明細(未対応機能): 注文の梱包明細PDFを生成します。MCPカタログに梱包明細ツールはありません。基盤となるRESTエンドポイントはGET /orders/{ORDER_ID}/packingslip/(24時間有効なS3 PDFリンクを返す)に存在します。直接的なREST呼び出しにフォールバックするか、MCPギャップが解決されるまでShippoダッシュボードの使用をユーザーに勧めてください。

ワークフロー

  1. CreateOrderを呼び出し、配送アドレス、品目(タイトル、数量、SKU、合計金額など)、注文レベルのフィールドを指定する。
  2. 注文のアドレスと品目データを使用してCreateShipmentを呼び出し、標準的なラベル購入フロー(料金選択、確認、CreateTransaction)に従う。
  3. ラベルを購入した後、RESTフォールバック経由で梱包明細を生成します(上記のツールセクションでMCP未対応機能を参照)。
原文(English)を表示

<!-- ⚠️ DO NOT EDIT. Auto-generated from skills/label-purchase/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. -->

Label Purchase

Purchases Are Live

Label purchases charge the authorized Shippo account for real. Before purchasing, explicitly state "this will charge your Shippo account" with the carrier, service, and cost, and require the user to acknowledge. Do not purchase without that confirmation.


Purchase Confirmation Gate

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

  • Carrier and service level
  • Estimated cost
  • Estimated delivery time
  • Origin and destination

Do not proceed without explicit user confirmation.


Domestic Label

  1. Optionally validate both addresses with ValidateAddress (see Address Validation).
  2. Call CreateShipment with address_from, address_to (as inline address objects using v1 field names -- street1, city, state, zip, country), parcels, and async: false.
  3. Present rates to the user. Let them choose.
  4. Confirm purchase (see Purchase Confirmation Gate above).
  5. Call CreateTransaction with: rate (selected rate object_id), label_file_type (default PDF_4x6), async: false.
  6. Check response status:
    • SUCCESS: return tracking_number, label_url (display the COMPLETE URL -- S3 signed URLs break if truncated), and tracking_url_provider.
    • QUEUED/WAITING: poll GetTransaction until resolved.
    • ERROR: report messages from the messages array.

International Label

All domestic steps apply, plus customs handling before shipment creation. See shippo/references/customs-guide.md for the full customs workflow.

  1. Optionally validate addresses with ValidateAddress. Sender must include email and phone. Ask if missing.
  2. Create customs items: call CreateCustomsItem per item (description, quantity, net_weight, mass_unit, value_amount, value_currency, origin_country, tariff_number). Alternatively, you can skip this step and pass inline item objects directly in the declaration (step 3).
  3. Create the customs declaration: call CreateCustomsDeclaration with contents_type, non_delivery_option, certify: true, certify_signer, and the items (either object_ids from step 2, or inline item objects). See shippo/references/customs-guide.md for field details.
  4. Call CreateShipment with all standard fields plus customs_declaration (the declaration object_id).
  5. Present rates, confirm purchase (see Purchase Confirmation Gate), then purchase label and return results as in the domestic flow.

Contents Type Decision Tree

Use this to determine the correct contents_type value:

Scenario Value
Selling to the recipient (commercial sale) MERCHANDISE
Sending a free gift GIFT
Sending a product sample SAMPLE
Paper documents only DOCUMENTS
Customer returning a purchased item RETURN_MERCHANDISE
Charitable donation HUMANITARIAN_DONATION
None of the above OTHER (requires contents_explanation)

Incoterms Decision Logic

The incoterm field on the customs declaration controls who pays duties and taxes:

  • B2C / e-commerce (default): Use DDU (Delivered Duty Unpaid) -- recipient pays duties at delivery.
  • Seller prepays duties: Use DDP (Delivered Duty Paid) -- seller covers all duties and taxes.
  • FedEx/DHL only: FCA (Free Carrier) is available for advanced trade scenarios.

If the user does not specify, default to DDU for standard e-commerce shipments.


Return Labels

To generate a return label, swap address_from and address_to so the original recipient becomes the sender and the original sender becomes the recipient. All other steps (shipment creation, rate selection, label purchase) remain the same.


Label Format Options

Default to PDF_4x6 unless the user specifies otherwise. Supported formats: PDF_4x6, PDF_4x8, PDF_A4, PDF_A5, PDF_A6, PDF, PDF_2.3x7.5, PNG, PNG_2.3x7.5, ZPLII.


Label Customization Options

When purchasing a label via CreateTransaction, the following options may be set on the shipment or rate:

  • Signature confirmation: set signature_confirmation on the shipment's extra field. Values: STANDARD, ADULT, CERTIFIED, INDIRECT, CARRIER_CONFIRMATION.
  • Insurance: set insurance on the shipment's extra field with amount, currency, and provider.
  • Saturday delivery: set saturday_delivery to true in the shipment's extra field. Only supported by certain carriers and service levels.
  • Reference fields: pass metadata on the transaction for order numbers or internal references.

Label from Existing Rate

If the user already has a rate object_id: optionally call GetRate to confirm details, then confirm purchase (see Purchase Confirmation Gate), then call CreateTransaction directly.


Voiding a Label

Call CreateRefund with the transaction object_id.

Refund limitations: Void/refund eligibility depends on carrier and timing. Not all labels can be refunded after purchase. If CreateRefund fails, advise the user to contact Shippo support.


Quick Reference

Domestic label: (optional) ValidateAddress (x2) -> CreateShipment (with inline addresses) -> user picks rate -> confirm -> CreateTransaction

International label: (optional) ValidateAddress (x2) -> CreateCustomsItem (per item) -> CreateCustomsDeclaration -> CreateShipment (with inline addresses + customs_declaration) -> user picks rate -> confirm -> CreateTransaction

Return label: Same as domestic/international, but swap address_from and address_to.

Order-to-label: CreateOrder -> CreateShipment (using order address/item data) -> user picks rate -> confirm -> CreateTransaction -> packing slip (REST fallback, see below)


Orders and Packing Slips

Use orders to represent e-commerce fulfillment requests. An order captures the shipping address, line items, and totals -- then feeds into the standard label purchase workflow.

Tools

  • CreateOrder: Create an order with line items, shipping address, and order details.
  • GetOrder: Retrieve an order by its object_id.
  • ListOrders: List all orders.
  • Packing slip (known gap): Generate a packing slip PDF for an order. There is no packing-slip tool in the MCP catalog. The underlying REST endpoint exists at GET /orders/{ORDER_ID}/packingslip/ (returns a 24-hour S3 PDF link). Fall back to a direct REST call, or advise the user to use the Shippo dashboard until the MCP gap is closed.

Workflow

  1. Call CreateOrder with the shipping address, line items (title, quantity, sku, total_price, etc.), and order-level fields.
  2. Use the order's address and item data to call CreateShipment, then follow the standard label purchase flow (rate selection, confirmation, CreateTransaction).
  3. After purchasing the label, generate a packing slip via the REST fallback (see Tools above for the known MCP gap).

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。