Method: jwt.insert
Stay organized with collections
Save and categorize content based on your preferences.
Inserts the resources in the JWT.
HTTP request
POST https://walletobjects.googleapis.com/walletobjects/v1/jwt
The URL uses gRPC Transcoding syntax.
Request body
The request body contains an instance of JwtResource
.
Response body
If successful, the response body contains data with the following structure:
JSON representation |
{
"saveUri": string,
"resources": {
object (Resources )
}
} |
Fields |
saveUri |
string
A URI that, when opened, will allow the end user to save the object(s) identified in the JWT to their Google account.
|
resources |
object (Resources )
Data that corresponds to the ids of the provided classes and objects in the JWT. resources will only include the non-empty arrays (i.e. if the JWT only includes eventTicketObjects, then that is the only field that will be present in resources).
|
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/wallet_object.issuer
Resources
JSON representation |
{
"eventTicketClasses": [
{
object (EventTicketClass )
}
],
"eventTicketObjects": [
{
object (EventTicketObject )
}
],
"flightClasses": [
{
object (FlightClass )
}
],
"flightObjects": [
{
object (FlightObject )
}
],
"giftCardClasses": [
{
object (GiftCardClass )
}
],
"giftCardObjects": [
{
object (GiftCardObject )
}
],
"loyaltyClasses": [
{
object (LoyaltyClass )
}
],
"loyaltyObjects": [
{
object (LoyaltyObject )
}
],
"offerClasses": [
{
object (OfferClass )
}
],
"offerObjects": [
{
object (OfferObject )
}
],
"transitClasses": [
{
object (TransitClass )
}
],
"transitObjects": [
{
object (TransitObject )
}
],
"genericClasses": [
{
object (GenericClass )
}
],
"genericObjects": [
{
object (GenericObject )
}
]
} |
Fields |
eventTicketClasses[] |
object (EventTicketClass )
A list of event ticket classes.
|
eventTicketObjects[] |
object (EventTicketObject )
A list of event ticket objects.
|
flightClasses[] |
object (FlightClass )
A list of flight classes.
|
flightObjects[] |
object (FlightObject )
A list of flight objects.
|
giftCardClasses[] |
object (GiftCardClass )
A list of gift card classes.
|
giftCardObjects[] |
object (GiftCardObject )
A list of gift card objects.
|
loyaltyClasses[] |
object (LoyaltyClass )
A list of loyalty classes.
|
loyaltyObjects[] |
object (LoyaltyObject )
A list of loyalty objects.
|
offerClasses[] |
object (OfferClass )
A list of offer classes.
|
offerObjects[] |
object (OfferObject )
A list of offer objects.
|
transitClasses[] |
object (TransitClass )
A list of transit classes.
|
transitObjects[] |
object (TransitObject )
A list of transit objects.
|
genericClasses[] |
object (GenericClass )
A list of generic classes.
|
genericObjects[] |
object (GenericObject )
A list of generic objects.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-13 UTC.
[null,null,["Last updated 2025-03-13 UTC."],[[["\u003cp\u003eInserts resources into a JWT for Google Wallet.\u003c/p\u003e\n"],["\u003cp\u003eUses a POST request to \u003ccode\u003ehttps://walletobjects.googleapis.com/walletobjects/v1/jwt\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003ehttps://www.googleapis.com/auth/wallet_object.issuer\u003c/code\u003e authorization scope.\u003c/p\u003e\n"],["\u003cp\u003eThe request body contains a \u003ccode\u003eJwtResource\u003c/code\u003e object, and the response includes a save URI and inserted resource data.\u003c/p\u003e\n"],["\u003cp\u003eResource data in the response includes arrays of objects and classes for various Google Wallet pass types, like event tickets, flights, or loyalty cards.\u003c/p\u003e\n"]]],["This documentation details the process of inserting resources into a JWT via a `POST` request to `https://walletobjects.googleapis.com/walletobjects/v1/jwt`. The request body contains a `JwtResource` instance. The successful response includes a `saveUri` string for users to save objects and a `resources` object. This object contains arrays of classes and objects, including event tickets, flights, gift cards, loyalty programs, offers, transit options, and generic types, based on what's in the JWT. It requires the `https://www.googleapis.com/auth/wallet_object.issuer` OAuth scope.\n"],null,["# Method: jwt.insert\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.JwtInsertResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Resources](#Resources)\n - [JSON representation](#Resources.SCHEMA_REPRESENTATION)\n\nInserts the resources in the JWT.\n\n### HTTP request\n\n`POST https://walletobjects.googleapis.com/walletobjects/v1/jwt`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains an instance of [JwtResource](/wallet/reference/rest/v1/jwt#JwtResource).\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------|\n| ``` { \"saveUri\": string, \"resources\": { object (/wallet/reference/rest/v1/jwt/insert#Resources) } } ``` |\n\n| Fields ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `saveUri` | `string` A URI that, when opened, will allow the end user to save the object(s) identified in the JWT to their Google account. |\n| `resources` | `object (`[Resources](/wallet/reference/rest/v1/jwt/insert#Resources)`)` Data that corresponds to the ids of the provided classes and objects in the JWT. resources will only include the non-empty arrays (i.e. if the JWT only includes eventTicketObjects, then that is the only field that will be present in resources). |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/wallet_object.issuer`\n\nResources\n---------\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"eventTicketClasses\": [ { object (/wallet/reference/rest/v1/eventticketclass#EventTicketClass) } ], \"eventTicketObjects\": [ { object (/wallet/reference/rest/v1/eventticketobject#EventTicketObject) } ], \"flightClasses\": [ { object (/wallet/reference/rest/v1/flightclass#FlightClass) } ], \"flightObjects\": [ { object (/wallet/reference/rest/v1/flightobject#FlightObject) } ], \"giftCardClasses\": [ { object (/wallet/reference/rest/v1/giftcardclass#GiftCardClass) } ], \"giftCardObjects\": [ { object (/wallet/reference/rest/v1/giftcardobject#GiftCardObject) } ], \"loyaltyClasses\": [ { object (/wallet/reference/rest/v1/loyaltyclass#LoyaltyClass) } ], \"loyaltyObjects\": [ { object (/wallet/reference/rest/v1/loyaltyobject#LoyaltyObject) } ], \"offerClasses\": [ { object (/wallet/reference/rest/v1/offerclass#OfferClass) } ], \"offerObjects\": [ { object (/wallet/reference/rest/v1/offerobject#OfferObject) } ], \"transitClasses\": [ { object (/wallet/reference/rest/v1/transitclass#TransitClass) } ], \"transitObjects\": [ { object (/wallet/reference/rest/v1/transitobject#TransitObject) } ], \"genericClasses\": [ { object (/wallet/reference/rest/v1/genericclass#GenericClass) } ], \"genericObjects\": [ { object (/wallet/reference/rest/v1/genericobject#GenericObject) } ] } ``` |\n\n| Fields ||\n|------------------------|---------------------------------------------------------------------------------------------------------------------------------|\n| `eventTicketClasses[]` | `object (`[EventTicketClass](/wallet/reference/rest/v1/eventticketclass#EventTicketClass)`)` A list of event ticket classes. |\n| `eventTicketObjects[]` | `object (`[EventTicketObject](/wallet/reference/rest/v1/eventticketobject#EventTicketObject)`)` A list of event ticket objects. |\n| `flightClasses[]` | `object (`[FlightClass](/wallet/reference/rest/v1/flightclass#FlightClass)`)` A list of flight classes. |\n| `flightObjects[]` | `object (`[FlightObject](/wallet/reference/rest/v1/flightobject#FlightObject)`)` A list of flight objects. |\n| `giftCardClasses[]` | `object (`[GiftCardClass](/wallet/reference/rest/v1/giftcardclass#GiftCardClass)`)` A list of gift card classes. |\n| `giftCardObjects[]` | `object (`[GiftCardObject](/wallet/reference/rest/v1/giftcardobject#GiftCardObject)`)` A list of gift card objects. |\n| `loyaltyClasses[]` | `object (`[LoyaltyClass](/wallet/reference/rest/v1/loyaltyclass#LoyaltyClass)`)` A list of loyalty classes. |\n| `loyaltyObjects[]` | `object (`[LoyaltyObject](/wallet/reference/rest/v1/loyaltyobject#LoyaltyObject)`)` A list of loyalty objects. |\n| `offerClasses[]` | `object (`[OfferClass](/wallet/reference/rest/v1/offerclass#OfferClass)`)` A list of offer classes. |\n| `offerObjects[]` | `object (`[OfferObject](/wallet/reference/rest/v1/offerobject#OfferObject)`)` A list of offer objects. |\n| `transitClasses[]` | `object (`[TransitClass](/wallet/reference/rest/v1/transitclass#TransitClass)`)` A list of transit classes. |\n| `transitObjects[]` | `object (`[TransitObject](/wallet/reference/rest/v1/transitobject#TransitObject)`)` A list of transit objects. |\n| `genericClasses[]` | `object (`[GenericClass](/wallet/reference/rest/v1/genericclass#GenericClass)`)` A list of generic classes. |\n| `genericObjects[]` | `object (`[GenericObject](/wallet/reference/rest/v1/genericobject#GenericObject)`)` A list of generic objects. |"]]