> For the complete documentation index, see [llms.txt](https://docs.groobee.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groobee.ai/ja/developer-guide/api-guide/goods.md). Agents can also search and read this documentation through its [MCP server](https://docs.groobee.ai/~gitbook/mcp).

# 商品

## **連携方式**

HTTPSプロトコルを使ったREST API

***

## **必須項目**

| 項目      | 説明               |
| ------- | ---------------- |
| API Key | 設定画面で発行したAPIキーの値 |

***

## **リクエストURL**

[https://api.groobee.io](https://api.groobee.io/)

***

## **共通事項**

### **リクエスト方法**

REST APIをリクエストするときは、ヘッダーの x-api-key にAPIキーを値として含めてください。

```
curl --location --request GET 'https://api.groobee.io/<エンドポイント>' \
--header 'x-api-key: <発行したAPIキーの値>'
```

* **APIキーの確認方法**
  * <https://app.groobee.io/> にアクセスしてアカウントでログイン
  * [設定 > サイト > サイト設定 > キー管理](https://app.groobee.io/setting/main)でキーを作成すると確認できます

### **レスポンス**

JSON形式で返します。形式は次のとおりです。

```
{
    "httpStatus": {
        "code": <HTTPステータスコード>,
        "reasonPhrase": <HTTPステータスの内容>
    },
    "processCode": <成否>,
    "processValue": <リクエストしたエンドポイントのレスポンス値>
}

```

### **processCode の値**

| コード値  | 状態 | 説明                       |
| ----- | -- | ------------------------ |
| 0     | 成功 | -                        |
| -1000 | 失敗 | リクエストヘッダーに x-api-key がない |
| -1001 | 失敗 | 利用企業が存在しない               |
| -1002 | 失敗 | 利用企業が未承認（承認が必要）          |
| -1003 | 失敗 | 利用企業の契約期間が満了             |
| -9997 | 失敗 | データが正しくありません。            |
| -9998 | 失敗 | HTTP関連のエラー               |
| -9999 | 失敗 | APIサーバーのエラー              |

***

## **エンドポイント**

### **商品ステータスコード**

| コード値 | 説明   |
| ---- | ---- |
| FS   | 販売中  |
| SS   | 販売停止 |

<br>

### **商品照会API**

* 複数リクエストの形式とデータ：照会する商品コード値を配列でリクエストします。

| Method | URI       | リクエスト/レスポンス形式 |
| ------ | --------- | ------------- |
| GET    | /v1/goods | JSON          |

```
[
    "商品コード値_1",
    "商品コード値_2"
    ...
]

```

* 単一リクエストの形式

| Method | URI                | リクエスト/レスポンス形式 |
| ------ | ------------------ | ------------- |
| GET    | /v1/goods/<商品コード値> | JSON          |

* 共通レスポンスデータ

```
{
    "httpStatus": {
        "code": <HTTPステータスコード>,
        "reasonPhrase": <HTTPステータスの内容>
    },
    "processCode": <成否>,
    "processValue": [
        {
            "goodsNm": <商品名>,
            "goodsCd": <商品コード値>,
            "goodsImg": <商品画像のURL>,
            "goodsCateNm": <商品カテゴリ名>,
            "goodsCate": <商品カテゴリ>,
            "goodsPrc": <単品価格>,
            "goodsSalePrc": <販売価格>,
            "goodsStatusCd": <商品ステータスコード値>
        }
        ...
    ]
}
```

<br>

### **商品登録API**

* リクエストの形式とデータ：登録する商品情報を配列でリクエストします。

| Method | URI       | リクエスト/レスポンス形式 |
| ------ | --------- | ------------- |
| POST   | /v1/goods | JSON          |

```
[
    {
        "goodsNm": <商品名>,
        "goodsCd": <商品コード値>,
        "goodsImg": <商品画像のURL>,
        "goodsCateNm": <商品カテゴリ名>,
        "goodsCate": <商品カテゴリ>,
        "goodsPrc": <単品価格>,
        "goodsSalePrc": <販売価格>,
        "goodsStatusCd": <商品ステータスコード値>
    }
    ...
]
```

* レスポンスデータ：成否にかかわらず、processValue キーの値はありません。

```
{
    "httpStatus": {
        "code": <HTTPステータスコード>,
        "reasonPhrase": <HTTPステータスの内容>
    },
    "processCode": <成否>,
    "processValue": ""
}
```

<br>

### **商品情報変更API**

{% hint style="warning" %}
商品情報のキーをすべて指定する必要はありません。変更したい商品情報のキーだけを指定すれば変更できます。

例）商品名と商品画像のURLだけを変更する場合
{% endhint %}

```
{
	"goodsNm": <商品名>,
	"goodsImg": <商品画像のURL>
}
```

* **複数リクエストの形式とデータ**

| Method | URI       | リクエスト/レスポンス形式 |
| ------ | --------- | ------------- |
| PUT    | /v1/goods | JSON          |

```
{
    <変更する商品コード値> : {
        "goodsNm": <商品名>,
        "goodsCd": <商品コード値>,
        "goodsImg": <商品画像のURL>,
        "goodsCateNm": <商品カテゴリ名>,
        "goodsCate": <商品カテゴリ>,
        "goodsPrc": <単品価格>,
        "goodsSalePrc": <販売価格>,
        "goodsStatusCd": <商品ステータスコード値>
    }
    ...
}
```

* **単一リクエストの形式とデータ**

| Method | URI                | リクエスト/レスポンス形式 |
| ------ | ------------------ | ------------- |
| PUT    | /v1/goods/<商品コード値> | JSON          |

```
{
    "goodsNm": <商品名>,
    "goodsCd": <商品コード値>,
    "goodsImg": <商品画像のURL>,
    "goodsCateNm": <商品カテゴリ名>,
    "goodsCate": <商品カテゴリ>,
    "goodsPrc": <単品価格>,
    "goodsSalePrc": <販売価格>,
    "goodsStatusCd": <商品ステータスコード値>
}
```

<br>

* **共通レスポンスデータ**

```
{
    "httpStatus": {
        "code": <HTTPステータスコード>,
        "reasonPhrase": <HTTPステータスの内容>
    },
    "processCode": <成否>,
    "processValue": [
        {
            "goodsCd" : <商品コード>,
            "count" : <変更された商品データの数>
        }
        ...
    ]
}
```

### **商品ステータス変更API**

* **リクエストの形式とデータ**

| Method | URI              | リクエスト/レスポンス形式 |
| ------ | ---------------- | ------------- |
| PUT    | /v1/goods/status | JSON          |

```
[
    {
        "goodsCd" : <商品コード>,
        "goodsStatusCd" : <商品ステータスコード値>
    }
    ...
]
```

* **レスポンスデータ**

```
{
    "httpStatus": {
        "code": <HTTPステータスコード>,
        "reasonPhrase": <HTTPステータスの内容>
    },
    "processCode": <成否>,
    "processValue": [
        {
            "goodsCd" : <商品コード>,
            "count" : <変更された商品データの数>
        }
        ...
    ]
}
```

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.groobee.ai/ja/developer-guide/api-guide/goods.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
