エンドユーザーが発行して Google ウォレットに保存できるパスのほとんどは、パスクラスとパス オブジェクトの 2 つのコンポーネントで定義されます。ユーザーにパスを発行するときは常に、パスクラスとパス オブジェクトの両方のインスタンスが必要になります。パスクラスは、作成するパスのタイプと、パスに表示する詳細情報(ギフトカードの金額やチケット所有者の名前など)を Google Wallet API に伝えるものです。
Google Wallet API には、パスクラスとパス オブジェクトの事前定義セットが用意されています。これらのセットのインスタンスを作成して、ユーザーに発行するパス(GiftCardClass、GiftCardObject、GenericClass、GenericObject など)の作成に使用します。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-03 UTC。"],[[["\u003cp\u003eGoogle Wallet passes are built using two components: Passes Classes (templates for shared pass properties) and Passes Objects (unique details for individual passes).\u003c/p\u003e\n"],["\u003cp\u003ePasses Classes define common pass details like event name or issuer, while Passes Objects include unique information like seat numbers or gift card balances.\u003c/p\u003e\n"],["\u003cp\u003ePasses Objects are linked to Passes Classes, allowing updates to the class to instantly propagate to all associated passes in users' wallets.\u003c/p\u003e\n"],["\u003cp\u003eAdding a pass to Google Wallet involves creating a JWT containing the pass details, which users access via an "Add to Google Wallet" button or link.\u003c/p\u003e\n"],["\u003cp\u003eRemoving a pass from Google Wallet simply unlinks it from the user's account; the pass can be re-added later without creating a new pass instance.\u003c/p\u003e\n"]]],["Google Wallet passes rely on Passes Classes and Passes Objects. Classes act as templates, defining shared properties (e.g., event name, venue) via a unique Class ID. Objects contain unique pass details (e.g., seat number), referencing the Class ID. Issuers create a JSON Web Token (JWT) with the Object ID and provide an \"Add to Google Wallet\" button or link to deliver it. User interactions link/de-link the object in the user's wallet, but doesn't delete it. Class updates propagate to linked Objects.\n"],null,["# Passes Classes and Objects overview\n\nAlmost all of the passes you can issue for an end-user to save in their Google Wallet are defined by two components: a Passes Class and a Passes Object. Anytime you issue a pass to a user, you will need an instance of both a Passes Class and a Passes Object, which tells the Google Wallet API what type of pass to construct, as well as details to display on the pass, such as the value of a gift card or a ticketholder's name.\n\nThe Google Wallet API provides a predefined set of Passes Classes and Passes Objects that you create instances of, then use to create a pass that is issued to a user, such as `GiftCardClass` and `GiftCardObject`, `GenericClass` and `GenericObject`, and others.\n\nEach Passes Class and Passes Object instance is defined as a JSON object, which has a set of required and optional properties that correspond to the specific use case intended for that pass type.\n\nPasses Classes\n--------------\n\nThink of a Passes Class as a shared template that is used to create one or more passes\nyou will issue to your users. A Passes Class defines a common set of properties that will be included\nin all passes that reference it.\n\nFor example, the following instance of the `EventTicketClass` defines the fields that are common to all issued tickets for an upcoming event(venue, event name, issuer, date/time). \n\n```\n{\n \"id\": \"ISSUER_ID.EVENT_CLASS_ID\",\n \"issuerName\": \"[TEST ONLY] Heraldic Event\",\n \"localizedIssuerName\": {\n \"defaultValue\": {\n \"language\": \"en-US\",\n \"value\": \"[TEST ONLY] Heraldic Event\"\n }\n },\n \"eventName\": {\n \"defaultValue\": {\n \"language\": \"en-US\",\n \"value\": \"Google Live\"\n }\n },\n \"venue\": {\n \"name\": {\n \"defaultValue\": {\n \"language\": \"en-US\",\n \"value\": \"Shoreline Amphitheater\"\n }\n },\n \"address\": {\n \"defaultValue\": {\n \"language\": \"en-US\",\n \"value\": \"ADDRESS_OF_THE_VENUE\"\n }\n }\n },\n \"dateTime\": {\n \"start\": \"2023-04-12T11:30\"\n },\n \"reviewStatus\": \"UNDER_REVIEW\"\n}\n \n```\n\nEach instance of a Passes Class requires an `id` property, which you specify. This Class ID\nacts as a unique identifier that you will reference whenever you use it to create a new Passes Object\ninstance.\n\nPasses Objects\n--------------\n\nWhile an instance of a Passes Class specifies a set of shared properties to be used in one or more\npasses, a Passes Object specifies the unique details of a specific pass that is issued to a specific user.\n\nFor example, when an Event Ticket Pass is created with the Google Wallet API, an `EventTicketObject`\ninstance includes properties for the seat assigned to that ticket since those values will be unique to each\nticket issued. \n\n```\n{\n \"id\": \"ISSUER_ID.OBJECT_ID\",\n \"classId\": \"ISSUER_ID.EVENT_CLASS_ID\",\n \"state\": \"ACTIVE\",\n \"seatInfo\": {\n \"seat\": {\n \"defaultValue\": {\n \"language\": \"en-us\",\n \"value\": \"9\"\n }\n },\n \"row\": {\n \"defaultValue\": {\n \"language\": \"en-us\",\n \"value\": \"L\"\n }\n },\n \"section\": {\n \"defaultValue\": {\n \"language\": \"en-us\",\n \"value\": \"45\"\n }\n },\n \"gate\": {\n \"defaultValue\": {\n \"language\": \"en-us\",\n \"value\": \"7C\"\n }\n }\n },\n \"barcode\": {\n \"type\": \"BARCODE_TYPE_UNSPECIFIED\",\n \"value\": \"BARCODE_VALUE\",\n \"alternateText\": \"\"\n }\n}\n \n```\n\nEach instance of a Passes Object requires an `id` property, which you specify. This Object ID\nacts as a unique identifier that you will reference when you issue the pass to a user.\n\nHow Passes Classes work with Passes Objects\n-------------------------------------------\n\nPasses Objects must extend an instance of a Passes Class either by referencing its Class ID or including the full Passes Class definition. This relationship between a Passes Class and Passes Object instance\nmeans you can set and update properties that are common to all issued passes via the Passes Class instance,\nand properties unique to an individual pass in the Passes Object instance.\n\nFor example, the following diagram of a simple Event Ticket pass shows how the fields that are defined in the shared `EventTicketClass`, and the fields for a specific ticket defined in the `EventTicketObject` combine to construct the final issued pass. Note how the ID of the Passes Class is referenced in `classId` property of the Passes Object.\n\nChanges made to a Passes Class instance instance will propagate immediately across all Passes Object instances\nthat reference it. Users will see any changes you make to a Passes Class instance reflected\non the pass in their Google Wallet app the next time they sync.\n\nAdding a pass to a user's Google Wallet\n---------------------------------------\n\nTo add a pass to a user's Google Wallet, you create a JSON Web Token (JWT) that contains claims\nyou (the issuer) are making about the Passes Object instance that will be saved in the user's Google Wallet -\nmost importantly, the Object ID of the Passes Object instance you are issuing to the user. The JWT\nis then delivered to the user via the a **Add to Google Wallet** button or an **Add to Google Wallet**\nlink.\n\nAfter a user clicks the button or link to add an issued pass into their Google Wallet, a link the\nPasses Object instance encoded in the JWT is linked to that user's Google account. This means that\nwhen the user clicks the button again, a link already exists to that Passes Object, so duplicate\ncopies won't be added to the user's wallet.\n\nIf a user removes a pass from the Google Wallet app, the corresponding Passes Object instance is\nautomatically de-linked from the user, but it is not deleted. This means that a user can click the\n**Add to Google Wallet** button or link again, to save the pass without the need for a\nnew Passes Object instance or JWT to be created."]]