0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【eBay API落とし穴】Action FigureカテゴリでUSEDが登録できない理由と対策

Last updated at Posted at 2025-07-06

背景

Action Figureカテゴリでは、eBayの出品画面(UI)上、コンディションは NEW と USED の2択しか表示されません。

しかし、Inventory API で SKU を作成する際、USED をそのまま指定するとエラーが発生します。

原因

eBayのAPI仕様では、"USED" という ConditionEnum が存在しない ためです。

UI表記 → 「USED」
API実体 → USED_EXCELLENT (Condition ID: 3000)

つまり、UIの「USED」をAPIで再現するには、USED_EXCELLENT を使う必要があります。

参考資料

解決例

curl -X PUT 'https://api.ebay.com/sell/inventory/v1/inventory_item/test-sku-001' \
  -H "Authorization: Bearer DUMMY_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "condition": "USED", # ここの値が誤っている
    "product": {
      "title": "Dummy Action Figure",
      "description": "Dummy description for an action figure item.",
      "imageUrls": ["https://dummyurl.com/dummy-image.jpg"]
    },
    "availability": {
      "shipToLocationAvailability": {
        "quantity": 1
      }
    }
  }'

エラー内容:

{
  "errors": [
    {
      "message": "Could not serialize field [condition]"
    }
  ]
}

成功例

curl -X PUT 'https://api.ebay.com/sell/inventory/v1/inventory_item/test-sku-001' \
  -H "Authorization: Bearer DUMMY_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "condition": "USED_EXCELLENT", # 中古にしたい場合は、USED_EXCELLENTが正しい
    "product": {
      "title": "Dummy Action Figure",
      "description": "Dummy description for an action figure item.",
      "imageUrls": ["https://dummyurl.com/dummy-image.jpg"]
    },
    "availability": {
      "shipToLocationAvailability": {
        "quantity": 1
      }
    }
  }'

これで無事、Action Figure の USED 出品が可能に。

まとめ

  • Action Figure のように、UI(画面)上では「New」と「Used」しか選択できないカテゴリでも、eBay Inventory API では condition に「USED」という文字列は存在しない。
  • 代わりに、USED_EXCELLENT が Used の代替として利用される。(Condition ID は 3000)
  • つまり、こうしたカテゴリでは:
    • 新品なら → "condition": "NEW"
    • 中古なら → "condition": "USED_EXCELLENT"
  • これは API の仕様と eBay の ConditionEnum の設計上の理由によるものだが、ドキュメントや UI に明記されておらず非常に分かりづらいポイント。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?