> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ServiceError (JSON)

> ServiceError (JSON)

# ServiceError (JSON)

包含服務呼叫失敗時所傳回錯誤的相關資訊。

## ServiceError

ServiceError 物件具有下列規格。

| 成員 | 類型 | 描述 |
| - | - | - |
| code | 32 位元帶正負號的整數 | 錯誤的類型。如需可能的值，請參閱下表。 |
| source | string | 引發錯誤的服務名稱。例如，`ReputationFD` 值表示錯誤發生在信譽服務中。 |
| description | string | 錯誤的描述。 |

### 錯誤碼

\| 值| 描述|
\| --- | --- | --- | --- | --- |
\| 0| Success 沒有錯誤|
\| 4000| Invalid Request Body 隨 POST 要求提交的 JSON 文件未通過驗證。如需詳細資料，請參閱 description 欄位。 |
\| 4100| User Does Not Exist 要求 URI 中包含的 XUID 不代表 XBOX Live 上的有效使用者。|
\| 4500| Authorization Error 呼叫者未獲授權執行所要求的作業。|
\| 5000| Service Error 服務中發生內部錯誤|
\| 5300| Service Unavailable 服務無法使用。|

## 範例 JSON 語法

```json theme={null}
{
    "code": 4000,
    "source": "ReputationFD",
    "description": "No targetXuid field was supplied in the request"
}
    
```

## 另請參閱

##### 上層

[JavaScript Object Notation (JSON) 物件參考](https://docs.xbox.com/zh-TW/reference/live/rest/json/atoc-xboxlivews-reference-json.md)


## Related topics

- [JavaScript 物件標記法 (JSON) 物件參考](https://docs.xbox.com/zh-TW/reference/live/rest/json/atoc-xboxlivews-reference-json.md)
- [ServiceErrorResponse (JSON)](https://docs.xbox.com/zh-TW/reference/live/rest/json/json-serviceerrorresponse.md)
- [GameClipsServiceErrorResponse (JSON)](https://docs.xbox.com/zh-TW/reference/live/rest/json/json-gameclipsserviceerrorresponse.md)
- [更新 User Store ID 金鑰](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-renew-userstoreid.md)
- [collections.mp.microsoft.com/v8.0/collections/consume](https://docs.xbox.com/zh-TW/reference/microsoft-store-apis/xstore-v8-consume.md)
