> For the complete documentation index, see [llms.txt](https://help.citrusad.com/retail-media-interface/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.citrusad.com/retail-media-interface/partner/ja/partner-api-overview/error-handling.md).

# エラー処理

Epsilon Retail Media パートナーAPIは、構造化され一貫性のあるエラー処理アプローチに従います。これにより、エラーレスポンスの予測が容易になり、解析しやすく、デバッグに役立つようになります。

## エラーレスポンスの構造

エラーが発生すると、APIは以下を返します:

* 標準的なHTTPステータスコード。
* code、message、およびオプションのdetailsフィールドを含む構造化されたJSONボディ。
* フィールドレベルの違反のリスト（該当する場合）。これにより、クライアントは複数の問題を一度に修正できます。

## エラー処理の基本戦略

エラーが発生した場合は、次の手順に従ってください:

1. **エラーメッセージを注意深く確認する** - エラーレスポンスには、何が問題だったのか、どのフィールドが原因で問題が発生したのかに関する具体的な情報が含まれています。
2. **エンドポイントのページを確認する** - 進め方がわからない場合は、使用しているエンドポイントの特定のページを確認してください。
3. **サポートにお問い合わせ** - 問題が解決しない場合は、サポートポータルでケースを作成できます。以下の情報を提供してください:
   * 実行している正確なAPI呼び出し。
   * 特定の小売り業者およびチーム。
   * 作成/更新している特定のエンティティ。
   * 表示されている完全なエラーレスポンス。

これらの情報を提供していただくことで、当社のチームが効率的かつ効果的に支援できるようになります。

### 単一の違反例

```json
{
  "code": 3,
  "message": "Invalid argument(s) for product campaign creation",
  "details": [
    {
      "@type": "type.googleapis.com/google.rpc.BadRequest",
      "fieldViolations": [
        {
          "field": "maxBid",
          "description": "[maxBid] must be greater or equal [minBid]"
        }
      ]
    }
  ]
}
```

### 複数の違反例

```json
{
  "code": 3,
  "message": "Invalid argument(s) for product campaign update",
  "details": [
    {
      "@type": "type.googleapis.com/google.rpc.BadRequest",
      "fieldViolations": [
        {
          "field": "strategy.fixedTenancy.catalogCosts",
          "description": "all catalog cost percentages for fixed tenancy must sum to 100%"
        },
        {
          "field": "strategy.fixedTenancy.catalogCosts",
          "description": "fixed tenancy catalog cost [...] is duplicated in the list"
        }
      ]
    }
  ]
}
```

## 標準HTTPステータスコード

| HTTPステータスコード              | 意味            | 発生タイミング                  |
| ------------------------- | ------------- | ------------------------ |
| 200 OK                    | リクエスト成功       | API呼び出し成功                |
| 204 No Content            | 成功、レスポンスボディなし | 返却データのない正常なリクエスト         |
| 400 Bad Request           | 無効な入力         | 不正な形式のリクエストまたは検証エラー      |
| 401 Unauthorized          | トークンの欠落または無効  | トークンが提供されていないか期限切れ       |
| 403 Forbidden             | アクセス拒否        | トークンは有効だが権限が不足している       |
| 404 Not Found             | リソースが見つかりません  | 無効なエンドポイントまたはリソースID      |
| 409 Conflict              | データの重複または競合   | リソースが既に存在する、または制約に違反している |
| 429 Too Many Requests     | レート制限を超過しました  | 短時間でのリクエスト数が多すぎます        |
| 500 Internal Server Error | サーバー側の問題      | サーバーでの予期しないエラー           |
| 503 Service Unavailable   | 一時的な障害        | サービスがダウンしているかメンテナンス中     |

## gRPCからHTTPへのエラーコードマッピング

| gRPCコード | gRPC名                | HTTPコード | HTTP名                 |
| ------- | -------------------- | ------- | --------------------- |
| 0       | OK                   | 200     | OK                    |
| 1       | CANCELLED            | 499     | Client Closed Request |
| 2       | UNKNOWN              | 500     | Internal Server Error |
| 3       | INVALID\_ARGUMENT    | 400     | Bad Request           |
| 4       | DEADLINE\_EXCEEDED   | 504     | ゲートウェイ タイムアウト         |
| 5       | NOT\_FOUND           | 404     | 未検出                   |
| 6       | ALREADY\_EXISTS      | 409     | 競合                    |
| 7       | PERMISSION\_DENIED   | 403     | 拒否                    |
| 8       | RESOURCE\_EXHAUSTED  | 429     | リクエストが多すぎます           |
| 9       | FAILED\_PRECONDITION | 400     | Bad Request           |
| 10      | ABORTED              | 409     | 競合                    |
| 11      | OUT\_OF\_RANGE       | 400     | Bad Request           |
| 12      | UNIMPLEMENTED        | 501     | 未実装                   |
| 13      | INTERNAL             | 500     | Internal Server Error |
| 14      | UNAVAILABLE          | 503     | サービス利用不可              |
| 15      | DATA\_LOSS           | 500     | Internal Server Error |
| 16      | UNAUTHENTICATED      | 401     | 未認証                   |


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.citrusad.com/retail-media-interface/partner/ja/partner-api-overview/error-handling.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
