When a customer purchases a [private offer](https://docs.cloud.google.com/marketplace/docs/partners/offers.md.txt),
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](https://docs.cloud.google.com/marketplace/docs/partners/offers/automatic-approval.md.txt)
by using the Partner Procurement API.

> [!CAUTION]
> **Caution:** Once you turn on automatic offer approval for a SaaS product, you no longer receive `ENTITLEMENT_CREATION_REQUESTED` or `ENTITLEMENT_PLAN_CHANGE_REQUESTED` Pub/Sub messages for that SaaS product.

If you haven't turned on [automatic offer
approval](https://docs.cloud.google.com/marketplace/docs/partners/offers/automatic-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](https://docs.cloud.google.com/marketplace/docs/partners/offers/manage-entitlements).

For details on using the Partner Procurement API for private offers, visit
the [reference documentation](https://docs.cloud.google.com/marketplace/docs/partners/offers/rest-resources).

> [!NOTE]
> **Note:** You can also perform some management tasks in Producer Portal when you view your list of offers.

## Verify when your customer's offers will become active

When you turn on
[automatic offer approval](https://docs.cloud.google.com/marketplace/docs/partners/offers/automatic-approval.md.txt)
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.

> [!NOTE]
> **Note:** If you've turned on automatic offer approval for SaaS products, you still must [approve your customer's account](https://docs.cloud.google.com/marketplace/docs/partners/offers/approve-offer.md.txt) before an offer can take effect. If you don't approve your customer's account before the scheduled start date of their offer, that offer is automatically rejected, for both new offers and amendments to existing offers.

When a customer purchases a private offer, Cloud Marketplace creates an
entitlement and sends the following Pub/Sub message to your product:

```json
{
  "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, <var translate="no">ENTITLEMENT_ID</var> is an ID created by
Cloud Marketplace. The `newOfferStartTime` and `newOfferEndTime` fields are
formatted as an [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp in
UTC, such as `"2022-01-01T00:00:00Z"`. If you use the Partner Procurement API
to [retrieve the
entitlement](https://docs.cloud.google.com/marketplace/docs/partners/commerce-procurement-api/reference/rest/v1/providers.entitlements/get),
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](https://docs.cloud.google.com/marketplace/docs/partners/offers/automatic-approval.md.txt)
  for SaaS products that you offer.

- [Create a private offer](https://docs.cloud.google.com/marketplace/docs/partners/offers/create-private-offers.md.txt)
  for a specific customer.