Overview
Card linked offers allow existing offers to appear within the loyalty card view, making relevant
content easier for the user to discover. The writable list field linkedOfferIds in a
LoyaltyObject indicates which offers are associated with the loyalty card. The existing offers can be linked to a
loyalty card using the REST calls insert, update, or modifylinkedofferobjects.
Creating the offer before linking
To create a card linked offer, the offer classes and objects one will link to the loyalty card must already be created.
The guide on creating offers can be found
here. Unlike standalone offers,
loyalty card linked offers do not require a user to explicitly save the offer.
The id field found in the offer object is used to point to the object from the
loyalty card.
Link offers to a loyalty card
A loyalty card can have offers linked to it upon its creation using the insert call, as well as when it is updated. A new REST call is also available specifically for changing the offers linked to a loyalty card.
Linking an offer when a loyalty card is created
Offers can be linked to a loyalty card upon creation of the loyalty card.
LoyaltyObjects are inserted by making a POST request to the following REST URI:
https://www.googleapis.com/walletobjects/v1/loyaltyClass
The field linkedOfferIds can be written with the rest of the LoyaltyObject,
using the established format:
{
"kind": "walletobjects#loyaltyObject",
"id": "2945482443380251551.ExampleObject1",
"classId": "2945482443380251551.ExampleClass1",
...
"linkedOfferObjectIds": [
"2945482443380251551.OfferObject1", "2945482443380251551.OfferObject2"
]
}
Linking an offer to an existing loyalty card
Alternatively, you can modify the offers linked to a loyalty card even after its creation. This can be done with an update call or with a new endpoint, modifylinkedofferobjects, created specifically to support linking and removing offers to the loyalty card.
You can update an existing LoyaltyObject by making a PUT request to
the following address:
https://www.googleapis.com/walletobjects/v1/loyaltyObject/resourceId
The modifylinkedofferobjects method is unique to the loyalty class, and sends a POST
request to the following address:
https://www.googleapis.com/walletobjects/v1/loyaltyObject/resourceId/modifylinkedofferobjects
More information on using the
modifylinkedofferobjects call can be found
here.
Its request body has the following format:
{
"addLinkedOfferObjectIds": [
"2945482443380251551.OfferObject1", "2945482443380251551.OfferObject2"
],
"removeLinkedOfferObjectIds": [
"2945482443380251551.OfferObject3", "2945482443380251551.OfferObject4"
]
}
Remove linked offers from a loyalty card
If the field linkedOfferIds is written to during an update call for the LoyaltyObject,
the new offers included in this call will overwrite any existing ones. In addition, an offer
can be removed using the removeLinkedOfferObjectIds field in the
modifylinkedofferobjects call.
Designing loyalty cards with card linked offers
A loyalty card with offers linked to it has a different template from the typical loyalty card, as shown below.
|
|
The card linked offer also takes a different template, as shown below.
|
|

























