Google Wallet REST API の認証情報を生成する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Google ウォレットには REST API が用意されており、
HTTP 経由で Google Wallet API にリクエストを送信する。この機能は
プログラムでパスを操作するサーバーサイド サービスを構築する場合。
Google Wallet REST API を使用するには、Google Cloud コンソールで API を有効にする必要があります。
Google Cloud サービス アカウントを作成し、そのサービス アカウントのキーを生成する。
REST API でパスを作成する場合、パスの署名に使用されるサービス アカウント キーが
JSON ウェブトークンでエンコードされたパス オブジェクト。
パスの更新や削除などの他のオペレーションでは、サービス アカウント キーを使用して、
が、パス発行者としての認証リクエストとともに送信されます。
1. Google Wallet REST API を有効にする
Google Wallet REST API を有効にする手順は次のとおりです。
- Google Cloud アカウントをまだお持ちでない場合は、Google Cloud コンソールに移動します。
手順に沿って新しいアカウントを登録してください。
- コンソールの上部にある [プロジェクト] プルダウン メニューで、
Cloud プロジェクトを選択するか、新しいプロジェクトを作成します。
- Google Wallet API の [商品の詳細] ページに移動します。
Google Cloud コンソール Marketplace から
入手できます
- [有効にする] をクリック] ボタンを離します。まもなく、Google Wallet REST API が
プロジェクトで使用可能なものが表示されます。
2. Google Cloud サービス アカウント キーを生成する
Google Wallet REST API へのリクエストを認証するには、サービス アカウントを
サービス アカウントを作成し、次の手順に沿ってサービス アカウント キーを生成します。
- [サービス アカウントの作成]ページ
確認できます。
- サービス アカウントの詳細を入力します。サービスのメールアドレスをメモします。
[サービス アカウント ID] の下に表示されるアカウント表示されます。後で必要になります
サービス アカウントを使用して Google ウォレットへのリクエストを認証するとき
REST API。
- [完了] をクリックします。] ボタンを離します。他のサービス アカウントをすべて入力する必要はありません。
作成手順が含まれます。
- [キー] をクリックします。上部のメニュー項目から移動します。
- [鍵を追加] をクリックします。[新しい鍵を作成] をクリックします。
- 鍵のタイプとして [JSON] を選択します。
- [作成] をクリックします。サービス アカウント キーを作成してダウンロードします。
3. Google ウォレット コンソールでサービス アカウントを承認する
サービス アカウントを使用して Google Wallet REST API へのリクエストを認証するには
追加するには、サービス アカウントのメールアドレスをユーザーとして
発行者アカウント。サービス アカウントをユーザーとして追加する手順は次のとおりです。
- Google Cloud コンソールで [サービス アカウント] ページに移動します。
- Google Wallet API へのリクエストの認証に使用するサービス アカウントのメールアドレスをコピーします。
- Google Pay &ウォレット コンソール。
- 左側のナビゲーションで [ユーザー] をクリックします。
- [ユーザーを招待] をクリックします。
- サービス アカウントのメールアドレスを入力します。
- [アクセスレベル] でプルダウンで [Developer] を選択します。
- [招待] をクリックします。] ボタンを離します。
サービス アカウントを追加すると、生成されたサービス アカウント キーを
Google Wallet REST API へのリクエストを認証するために使用できます。サービスの使用時
使用する場合、これらは機密性の高い認証情報であり、
安全なサーバーサイド環境でのみ使用してください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-04 UTC。
[null,null,["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eGoogle Wallet's REST API enables programmatic management of passes via HTTP requests.\u003c/p\u003e\n"],["\u003cp\u003eTo use the API, you must enable it in Google Cloud Console, create a service account, and generate a key.\u003c/p\u003e\n"],["\u003cp\u003eThe service account key is used for authentication and signing JSON Web Token-encoded Passes Objects.\u003c/p\u003e\n"],["\u003cp\u003eFor security, store and use service account keys in secure, server-side environments.\u003c/p\u003e\n"]]],["The Google Wallet REST API allows programmatic pass management via HTTP requests. To use it, enable the API in the Google Cloud console, create a service account, and generate a JSON key. This key is used to sign JSON Web Token-encoded Pass Objects for creation and authenticates requests for updates or deletions. Finally, authorize the service account by adding its email as a 'Developer' user in the Google Pay & Wallet console. This process enables secure, server-side interaction with the Google Wallet.\n"],null,["# Generating Google Wallet REST API authentication credentials\n\nGoogle Wallet offers a REST API that lets you create and manage passes by\nsending requests to the Google Wallet API over HTTP. This is useful for those who\nwant to build server-side services to work with passes programmatically.\n\nTo use the Google Wallet REST API, you must enable the API in the Google Cloud console,\ncreate a Google Cloud service account, then generate a key for the service account.\n\nWhen you create passes with the REST API, the service account key used to sign your\nJSON Web Token-encoded Passes Objects.\n\nFor other operations, such as updating or deleting passes, the service account key\nis sent with the request to authenticate you as the Pass Issuer.\n\n1. Enable the Google Wallet REST API\n------------------------------------\n\nTo enable the Google Wallet REST API, do the following:\n\n1. If you don't already have a Google Cloud account, go to the [Google Cloud console](https://console.cloud.google.com) and follow the steps to register for a new account.\n2. From the project drop-down menu at the top of the console, select the Google Cloud project you want to use, or create a new one.\n3. Go to the [Google Wallet API product details page](https://console.cloud.google.com/apis/library/walletobjects.googleapis.com) in the Google Cloud console Marketplace.\n4. Click the 'Enable' button. In a few moments, the Google Wallet REST API will be available for the selected Google Cloud project.\n\n2. Generate a Google Cloud service account key\n----------------------------------------------\n\nTo authenticate requests to the Google Wallet REST API, you'll need to create a\nservice account, and generate a service account key by doing the following:\n\n1. Go to the ['Create service account' page](https://console.cloud.google.com/iam-admin/serviceaccounts/create) in the Google Cloud console.\n2. Fill in the service account details. Note the email address for the service account that appears below the 'Service account ID' field. You will need this later when you use the service account to authenticate your requests to the Google Wallet REST API.\n3. Click the 'DONE' button. There is no need to complete the other service account creation steps.\n4. Click the 'KEYS' menu item at the top of the page.\n5. Click the 'ADD KEY' drop-down menu, then click 'Create new key'.\n6. Select key type 'JSON'.\n7. Click 'CREATE' to create and download the service account key.\n\n3. Authorize your service account in the Google Wallet console\n--------------------------------------------------------------\n\nTo authenticate your requests to the Google Wallet REST API using a service account\nkey, you must add the email address of your service account as a user to your\nIssuer account. To add your service account as a user, do the following:\n\n1. Go to the ['Service accounts'](https://console.cloud.google.com/iam-admin/serviceaccounts) page in the Google Cloud console.\n2. Copy the email address of the service account you want to use to authenticate your requests to the Google Wallet API.\n3. Go to the [Google Pay \\& Wallet console](https://pay.google.com/business/console/).\n4. In the left nav, click 'Users'.\n5. Click 'Invite a user'.\n6. Input the email address of your service account.\n7. In the 'Access level' drop-down, select 'Developer'.\n8. Click the 'Invite' button.\n\nOnce your service account is added, you can use any service account keys generated\nfor it to authenticate requests to the Google Wallet REST API. When using service\naccount keys, keep in mind that these are highly sensitive credentials that\nshould only be used in secure, server-side environments."]]