legacy-knowledge-base
公開されました Sep. 10, 2025

ポータルで利用できない場合、製品仕様書が作成されない

written-by

Pooja Bhambani

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • ポータルサイトで仕様が公開されていない場合。 ヘッドレスAPIで製品を作成する際に、レスポンスボディに500 Internal Server Errorが表示されます。
  • 再現するための手順
    1. POST /v1.0/productsで商品を作成する(リクエストは添付)。
    2. 以下は製品仕様のリクエストです:(素材と寸法はポータル上ですでに作成/利用可能です。)
    "productSpecifications": [
    {
    "specificationKey": "material",
    "value": {
    "en_US": "Rubber"
    }
    },
    {
    "specificationKey": "dimensions",
    "value": {
    "en_US": "22mm"
    }
    }
    ]
    3. Requestで、 'material''dimensions' を、ポータルで利用できないものに変更する。 例 を、 「ブランド」 「サイズ」
    4. 実行し、500コードで応答していることを確認する。
    期待される行動 製品は仕様で作成する必要があります。
    実際の動作: 実際の動作:製品は作成されず、500のレスポンスコードが返される。

Environment

  • Liferay DXP 7.3
  • Commerce 3.0

解決策

  • 製品の仕様を作成するには、'label'値を提供する必要があります。 仕様のタイトルになっているからです。
  • 製品を作るためには、以下のような変更が必要です。
    "productSpecifications": [
    {
    "specificationKey": "test",
    "label": {
    "en_US": "Test Label"
    },
    "value": {
    "en_US": "Rubber"
    }
    },
    {
    "specificationKey": "test",
    "label": {
    "en_US": "Brand"
    },
    "value": {
    "en_US": "Apple"
    }
    }
    ]

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base