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

# サービスから XBOX Game Pass サブスクリプションのアクセスを検出する

> collections の publisherQuery API を使用してサービスから XBOX Game Pass サブスクリプションの状態を検出し、アクティブなサブスクライバーに報酬を付与します。

タイトルが Game Pass に参加している場合、サービスは [collections.mp.microsoft.com/v9.0/collections/publisherQuery API](/reference/microsoft-store-apis/xstore-v9-query-for-products) を使用して、アクティブなサブスクライバーの状態を確認し、ゲーム内報酬や特典を付与できます。Game Pass の状態を照会する前に、確認したいティアに対して発行元が承認されている必要があります。この承認は Developer Partner Manager または Microsoft 担当者を通じて要求してください。

## クライアントのライセンス チェックにおける Game Pass ライセンス

Game Pass のエンタイトルメントは、ゲーム クライアントから検出できません。ユーザーが Game Pass を通じてタイトルの権利を付与されている場合、[XStoreQueryGameLicenseAsync](/reference/system/xstore/functions/xstorequerygamelicenseasync) は、直接購入の場合と同様に `isActive = true` のライセンスを返します。[XStoreGameLicense](/reference/system/xstore/structs/xstoregamelicense) 構造体には、ライセンスの取得方法を示すフィールドは含まれていません。

テレメトリなどの目的でユーザーがタイトルをどのように取得したかを記録するには、クライアントからユーザーの ID を独自のサービスに送信します。その後、サービスが publisherQuery API を呼び出し、`acquisitionType` を確認します。値が `Recurring` の場合は Game Pass のエンタイトルメントを示し、`Single` の場合は直接所有を示します。

## 承認済みおよび未承認の発行元での応答データの動作

発行元が承認されていない場合、Game Pass によって権利が付与されたアイテムは直接所有のエンタイトルメントとして表示されます。たとえば、`acquisitionType` は `Single` として表示され、Game Pass ProductId は `satisfiedByProductIds` に表示されません。

承認済みの発行元では、アクティブな Game Pass サブスクリプションのみが返されます。ユーザーの Game Pass サブスクリプションがキャンセルまたは終了した場合、それ以降のクエリには Game Pass 情報が含まれなくなります。また、`EndDate` は最大値に正規化されるため、サブスクリプション終了の検出には使用できません。

## サーバー間のエンタイトルメント結果における Game Pass のリリース日の遅延

タイトルやアドオンが Game Pass で提供開始されると、クライアントの可用性と `publisherQuery` の可視性との間に遅延が予想されます。この動作は、Store システム全体でキャッシュの更新間隔が異なるためです。実際には、ローカル ライセンス供与が通常最初に更新され、publisherQuery は 2 \~ 3 時間遅れる場合があります。

Game Pass の ProductId に対する直接チェックには影響がなく、遅延は主に満足するエンタイトルメントを通じて付与されるアイテムに対してです。

## 開発サンドボックスでの Game Pass サブスクリプションのテスト

XBOX Game Pass のティアは、開発サンドボックス内の XBOX Store アプリで検索することで有効化してアクセスできるようになっている必要があります。XBOX テスト アカウントはテスト用のクレジット カードで作成され、サンドボックスで Game Pass のティアにサブスクライブできます。サンドボックスで Game Pass のティアが見つからない場合は、支援について Developer Partner Manager または Microsoft 担当者にお問い合わせください。

<Note>
  Game Pass のサブスクリプション状態はサンドボックス間で引き継がれません。サンドボックスのテスト アカウントに Game Pass を追加した際は、そのテスト アカウントを Game Pass やその他のコマース関連のテストやデバッグのために別のサンドボックスに移動しないでください。
</Note>

## Game Pass サブスクリプション状態の要求

ユーザーの Game Pass サブスクリプション状態を要求するには、確認する権限のあるサブスクリプション ティアの対応する ProductId をクエリ要求の productSkuIds リストに追加します (表を参照)。

| サブスクリプション ティア                     | ProductID    |
| --------------------------------- | ------------ |
| XBOX Game Pass for Console (提供終了) | CFQ7TTC0K6L8 |
| XBOX Game Pass (Starter Edition)  | CFQ7TTC10QFD |
| PC Game Pass                      | CFQ7TTC0KGQ8 |
| XBOX Game Pass Essential          | CFQ7TTC0K5DJ |
| XBOX Game Pass Premium            | CFQ7TTC0P85B |
| XBOX Game Pass Ultimate           | CFQ7TTC0KHS0 |

ユーザーが要求したティアのサブスクリプションを持っている場合、クエリ応答には対応する Game Pass サブスクリプション ティアの ProductId を持つアイテムが含まれます。

### 上位ティアに含まれるティアの要求時の動作

一部の Game Pass ティアは、サブスクライバーが上位ティアを持っている場合に含まれます。承認済みティアのうち上位ティアに含まれるティアは、ユーザーが上位ティアをサブスクライブしている場合に返されます。

例: 発行元は XBOX Game Pass Essential に対して承認されています。ユーザーは XBOX Game Pass Ultimate を持っており、すべての Game Pass ProductId に対してクエリを実行すると、publisherQuery は XBOX Game Pass Essential の結果のみを返します。発行元が他のティアを表示するアクセス権を持っている場合、それらのティアも返されます。

<Note>
  XBOX Game Pass (Starter Edition) は継承の例外であり、スタンドアロン ティアです。他のいずれのティアにも含まれません。
</Note>

### Game Pass サブスクライバーへのゲーム内特典の付与

サブスクライバーにゲーム内特典と恩恵を付与するために必要な最低の Game Pass ティアへのアクセスを要求することをお勧めします。

例: コンソールのすべての Game Pass サブスクライバーにゲーム内報酬を付与しています。Premium と Ultimate には Essential が含まれるため、XBOX Game Pass Essential (CFQ7TTC0K5DJ) へのアクセスのみが必要です。

### satisfiedByProductIds を使用した Game Pass サブスクリプションで権利が付与された製品の検出

承認された後、`satisfiedByProductIds` と `acquisitionType` の値を確認して Game Pass 由来のエンタイトルメントを特定します。Game Pass ベースのエンタイトルメントは、`acquisitionType` が `Recurring` であり、`satisfiedByProductIds` には承認済みの最上位 Game Pass ティアの ProductID が含まれます。

<Note>
  excludeDuplicates フィルター オプションを使用している場合、ユーザーが直接タイトルを所有していると Game Pass 関連のエンタイトルメントはフィルターで除外されます。
</Note>

アイテムの `satisfiedByProductIds` に Game Pass productIDs があるかをチェックすると、アイテムが Game Pass を通じて権利が付与されているかがわかりますが、ユーザーが Game Pass メンバーかを判断するには十分ではありません。したがって、ユーザーの Game Pass サブスクリプション状態を確認する場合は、リクエストの `productSkuIds` に Game Pass ProductId 値を含めるのが最善です。

### XBOX Game Pass による重複アイテムの例

ユーザーが同じ製品に対して直接所有と Game Pass エンタイトルメントの両方を持っている場合、`excludeDuplicates` が `false` の場合に 2 つのエントリが表示されることがあります。`excludeDuplicates` が `true` の場合、直接購入アイテムが返されます。

重複解決ルールとソースの優先度動作の完全な内容については、[レスポンス内の重複アイテムの理解](/publishing/xstore-commerce/xstore-query-entitlements#understanding-duplicate-items-in-the-response)を参照してください。

### XBOX Game Pass Essential サブスクリプション状態のリクエスト例

```json theme={null}
POST https://collections.mp.microsoft.com/v9.0/collections/publisherQuery HTTP/1.1
{authorization header}
User-Agent: {identifier string of your service}
Content-Type: application/json;
Host: collections.mp.microsoft.com

{
  "maxPageSize": 100,
  "excludeDuplicates": true,
  "validityType": "All",
  "productSkuIds": [
    {"productId": "CFQ7TTC0K5DJ"}
  ],
  "beneficiaries": [
    {
      "identitytype": "b2b",
      "identityValue": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjYxNTI2OEI4N0YwNEFDQzIzRDdCQ0E2M...",
      "localTicketReference": ""
    }
  ],
  "sbx":"RETAIL"
}
```

### XBOX Game Pass Essential のレスポンス例

```json theme={null}
HTTP/1.1 200 OK
Date: Mon, 18 May 2026 18:40:32 GMT
Content-Type: application/json; charset=utf-8
Server: Kestrel
Content-Length: 602
MS-CorrelationId: 5ec99421-7fa8-457e-87c1-edf16297528e
MS-RequestId: a604aca2-f60d-4de5-993f-125a57dcabdd
MS-CV: pjtLxeR5BUOY5n.0
X-Content-Type-Options: nosniff

{
 "items": [
  {
   "acquiredDate": "2026-05-15T18:29:24.2131463+00:00",
   "acquisitionType": "Recurring",
   "endDate": "9999-12-31T23:59:59.9999999+00:00",
   "id": "a1702e2c6cff4e0095b3c51d06d9fac9",
   "modifiedDate": "2026-05-15T18:29:24.2153924+00:00",
   "productId": "CFQ7TTC0K5DJ",
   "productKind": "Pass",
   "quantity": 1,
   "recurrenceData": "mdr:0:9ee54c66dc2a49ca81bd2c3eaf148826:a118bfe9-8175-4407-9d14-b2be4af30acd",
   "satisfiedByProductIds": [],
   "skuId": "",
   "startDate": "2026-05-15T00:00:00+00:00",
   "status": "Active",
   "tags": [],
   "transactionId": "a118bfe9-8175-4407-9d14-b2be4af30acd",
   "trialData": {
    "isInTrialPeriod": false,
    "isTrial": false
   }
  }
 ]
}
```

### Game Pass Essential サブスクリプションで権利が付与されたゲームのリクエスト例

```json theme={null}
POST https://collections.mp.microsoft.com/v9.0/collections/publisherQuery HTTP/1.1
{authorization header}
User-Agent: {identifier string of your service}
Content-Type: application/json;
Host: collections.mp.microsoft.com

{
  "maxPageSize": 100,
  "excludeDuplicates": true,
  "validityType": "All",
  "productSkuIds": [
    {"productId": "9NTL0QDWZ4FS"}
  ],
  "beneficiaries": [
    {
      "identitytype": "b2b",
      "identityValue": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjYxNTI2OEI4N0YwNEFDQzIzRDdCQ0E2M...",
      "localTicketReference": ""
    }
  ],
  "sbx":"RETAIL"
}
```

### Game Pass Essential サブスクリプションで権利が付与されたゲームのレスポンス例

```json theme={null}
HTTP/1.1 200 OK
Date: Mon, 18 May 2026 18:41:18 GMT
Content-Type: application/json; charset=utf-8
Server: Kestrel
Content-Length: 602
MS-CorrelationId: d4c6dd08-a80a-4098-9433-757864d3716d
MS-RequestId: 6de32c62-9690-46dc-81c3-d1fef9df10a5
MS-CV: IvL+PCZ9Jk2+C4Xo.0
X-Content-Type-Options: nosniff

{
 "items": [
  {
   "acquiredDate": "2026-05-15T18:29:24.2131463+00:00",
   "acquisitionType": "Recurring",
   "endDate": "9999-12-31T23:59:59.9999999+00:00",
   "id": "a1702e2c6cff4e0095b3c51d06d9fac9",
   "modifiedDate": "2026-05-15T18:29:24.2153924+00:00",
   "productId": "9NTL0QDWZ4FS",
   "productKind": "Game",
   "quantity": 1,
   "satisfiedByProductIds": [
     "CFQ7TTC0K5DJ"  
   ],
   "skuId": "0010",
   "startDate": "2026-05-15T00:00:00+00:00",
   "status": "Active",
   "tags": [],
   "transactionId": "a118bfe9-8175-4407-9d14-b2be4af30acd",
   "trialData": {
    "isInTrialPeriod": false,
    "isTrial": false
   }
  }
 ]
}
```

## 関連項目

[コマースの概要](/publishing/xstore-commerce/xstore-commerce-overview)

[XStore API リファレンス](/reference/system/xstore/xstore_members)


## Related topics

- [プレイヤーにアドオン コンテンツへのアクセスを付与する](/ja-jp/publishing/xstore-commerce/xstore-granting-access.md)
- [基本的な DRM とライセンス チェック](/ja-jp/publishing/xstore-commerce/xstore-basic-drm.md)
- [サービスからサブスクリプション製品を管理する](/ja-jp/publishing/xstore-commerce/xstore-managing-subscriptions.md)
- [collections.mp.microsoft.com/v9.0/collections/publisherQuery](/ja-jp/reference/microsoft-store-apis/xstore-v9-query-for-products.md)
- [用語集](/ja-jp/publishing/game-publishing/glossary.md)
