최종 사용자가 Google 월렛에 저장하도록 발급할 수 있는 패스는 대부분 패스 클래스와 패스 객체라는 두 가지 구성요소로 정의됩니다. 사용자에게 패스를 발급할 때마다 Google Wallet API에 구성할 패스 유형과 패스에 표시할 세부정보(예: 기프트 카드의 값 또는 티켓 소지자 이름)를 알려주는 패스 클래스와 패스 객체의 인스턴스가 모두 필요합니다.
Google Wallet API는 인스턴스를 만든 후 사용자에게 발급되는 패스(예: GiftCardClass, GiftCardObject, GenericClass, GenericObject)를 만드는 데 사용할 수 있는 사전 정의된 패스 클래스 및 패스 객체 집합을 제공합니다.
각 패스 클래스 및 패스 객체 인스턴스는 해당 패스 유형의 특정 사용 사례에 해당하는 필수 및 선택적 속성 집합을 갖는 JSON 객체로 정의됩니다.
패스 클래스
패스 클래스는 하나 이상의 패스를 만드는 데 사용되는 공유 템플릿으로 생각하면 됩니다.
사용자에게 발행할 것입니다. 패스 클래스는 포함될 공통 속성 집합을 정의합니다.
모든 패스에 적용됩니다
예를 들어 EventTicketClass의 다음 인스턴스는 예정된 이벤트(장소, 이벤트 이름, 발급기관, 날짜/시간)에 대해 발급된 모든 티켓에 공통된 필드를 정의합니다.
패스 객체의 각 인스턴스에는 사용자가 지정하는 id 속성이 필요합니다. 이 객체 ID
는 사용자에게 패스를 발급할 때 참조하는 고유 식별자 역할을 합니다.
패스 클래스가 패스 객체와 작동하는 방식
패스 객체는 클래스 ID를 참조하거나 전체 패스 클래스 정의를 포함하여 패스 클래스의 인스턴스를 확장해야 합니다. 패스 클래스와 패스 객체 인스턴스 간의 관계
패스 클래스 인스턴스를 통해 발급된 모든 패스에 공통된 속성을 설정하고 업데이트할 수 있습니다.
패스 객체 인스턴스의 개별 패스에 고유한 및 속성을 제공합니다.
예를 들어 간단한 이벤트 티켓 패스의 다음 다이어그램은 공유 EventTicketClass에 정의된 필드와 EventTicketObject에 정의된 특정 티켓의 필드가 결합되어 최종 발급된 패스를 구성하는 방법을 보여줍니다. 패스 객체의 classId 속성에서 패스 클래스의 ID를 참조하는 방법을 확인하세요.
패스 클래스 인스턴스 인스턴스에 대한 변경사항은 모든 패스 객체 인스턴스에 즉시 전파됩니다.
확인할 수 있습니다 사용자는 패스 클래스 인스턴스에 대한 변경사항이 반영된 것을 확인할 수 있습니다.
다음번 동기화 시 Google 월렛 앱의 패스에 표시됩니다.
사용자의 Google 월렛에 패스 추가
사용자의 Google 월렛에 패스를 추가하려면 클레임이 포함된 JSON 웹 토큰 (JWT)을 만듭니다.
사용자의 Google 월렛에 저장될 패스 객체 인스턴스에 대해 귀하 (발급기관)가 만들고 있는
가장 중요한 것은 사용자에게 발급하는 패스 객체 인스턴스의 객체 ID입니다. JWT
그런 다음 Google 월렛에 추가 버튼 또는 Google 월렛에 추가 버튼을 통해 사용자에게 전달됩니다.
링크를 클릭합니다.
사용자가 발급된 패스를 Google 월렛에 추가하기 위해 버튼이나 링크를 클릭하면
JWT로 인코딩된 패스 객체 인스턴스가 해당 사용자의 Google 계정에 연결됩니다. 즉,
사용자가 버튼을 다시 클릭할 때 패스 객체에 대한 링크가 이미 존재하므로
사본은 사용자의 월렛에 추가되지 않습니다.
사용자가 Google 월렛 앱에서 패스를 삭제하면 해당 패스 객체 인스턴스는
사용자와의 연결이 자동으로 해제되지만 삭제되지는 않습니다. 즉, 사용자가
Google 월렛에 추가 버튼이나 링크를 다시 표시하여
생성할 새 패스 객체 인스턴스 또는 JWT입니다.
[[["이해하기 쉬움","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-04(UTC)"],[[["\u003cp\u003eGoogle Wallet passes are built using two components: Passes Classes (templates for shared pass properties) and Passes Objects (defining unique pass details).\u003c/p\u003e\n"],["\u003cp\u003ePasses Classes act like blueprints for multiple passes, holding common information like event venue, issuer, and date.\u003c/p\u003e\n"],["\u003cp\u003ePasses Objects store individual pass data, such as seat numbers for event tickets, referencing their corresponding Passes Class.\u003c/p\u003e\n"],["\u003cp\u003eUpdating a Passes Class instantly reflects changes across all associated passes in users' Google Wallets upon syncing.\u003c/p\u003e\n"],["\u003cp\u003ePasses are added to a user's Google Wallet through a JWT containing the Passes Object ID, accessible via "Add to Google Wallet" buttons or links.\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."]]