When a customer purchases a private offer, Google creates an entitlement, which indicates that the customer has bought the offer from Cloud Marketplace.
This document reviews how to manage entitlements for your private offers that have automatic offer approval turned on by using the Partner Procurement API.
If you haven't turned on automatic offer approval for your software as a service (SaaS) product, you receive different Pub/Sub messages than those described in this document. For details of those Pub/Sub messages, refer to Manage entitlements for private offers.
For details on using the Partner Procurement API for private offers, visit the reference documentation.
Verify when your customer's offers will become active
When you turn on automatic offer approval for a SaaS product, you receive different Pub/Sub messages than those you receive for SaaS products that don't have automatic approval turned on. Because SaaS products with automatic offer approval support scheduled start dates, after a private offer is accepted, you must verify when the offer is expected to begin, so that you can provision resources at the right time.
When a customer purchases a private offer, Cloud Marketplace creates an entitlement and sends the following Pub/Sub message to your product:
{ "eventId": "...", "eventType": "ENTITLEMENT_OFFER_ACCEPTED", "entitlement": { "id": "ENTITLEMENT_ID", "updateTime": "...", "newPendingOfferDuration": "", // Contract duration for the offer "newOfferStartTime": "...", // Starting time for the offer "newOfferEndTime": "...", // Ending time for the offer }, }
In this example, ENTITLEMENT_ID is an ID created by
Cloud Marketplace. The newOfferStartTime and newOfferEndTime fields are
formatted as an RFC 3339 timestamp in
UTC, such as "2022-01-01T00:00:00Z". If you use the Partner Procurement API
to retrieve the
entitlement,
the API response also includes these newOfferStartTime and newOfferEndTime
fields.
In your system, update the user's account to reflect that they've purchased the
offer. Use the newOfferStartTime field to verify the time that the offer is
expected to start, so that you can provision resources as needed.
When the offer reaches its start date and becomes active, you receive an
additional Pub/Sub message with an eventType of ENTITLEMENT_ACTIVE.
What's next
Turn on automatic offer approval for SaaS products that you offer.
Create a private offer for a specific customer.