> ## Documentation Index
> Fetch the complete documentation index at: https://docs.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Events

This document describes the events that MarketONE generates and delivers to external systems (i.e., Reseller (Service Provider) integration layers). Resellers (Service Providers) can use event data for business analytics, or for constructing and sending notifications to end customers.

## How MarketONE Events Work

Event data is driven by changes that Resellers (Service Providers) perform against the MarketONE data store. You can think of events as a kind of continuous paper trail of subscription lifecycle updates that your organization performs using MarketONE OpenAPIs (the APIs for MarketONE), like creating, updating, and deleting subscriptions. In other words, an event record confirms that requests have been processed by the platform. As changes occur, MarketONE generates events and publishes them an internal message to queue, and then delivers them to your organization via a webhook. Your organization can subscribe to the webhook and set up a listener to receive the event notification

MarketONE provides flexibility for your organization to subscribe to one or many events. During your onboarding and integration with MarketONE, you can select the type of events that you want to receive. For example, you might prefer to be notified whenever a subscription is created, or when a subscription is due be to renewed, or both. Although all event types are generated and published internally, your organization will receive only the events for which you have selected. You can also choose to have these events sent to multiple endpoints.

## Setup and Configuration

To setup your automated event delivery, your organization will do the following:

1. Review MarketONE's API specification for receiving events, and build the endpoint(s) to which MarketONE will deliver them.
2. Review the available event types that MarketONE provides, and determine which events you want to receive, (i.e., one, many, or all).
3. Provide the endpoint URL(s) and desired event configurations to your delivery prime during your onboarding and integration phase with MarketONE.

Our operations team then handles all the event configuration on the MarketONE backend. Available upon request, you can also update your event configurations at a later date.

## Event API

MarketONE triggers and delivers events to Resellers (Service Providers) using the following webhooks:

* [POST /event/subscription](https://docs.saas.amdocs.com/bundle/MarketONECSPAdapter/page/index.html#tag/Subscription-events-\(CSP-Webhook-events\)/operation/postSubscriptionEvents) - triggers an event message related to Platform-Managed subscriptions. For example, when a subscription is created, started, canceled, paused, resumed, etc.
* [POST /event/partnerSubscription](https://docs.saas.amdocs.com/bundle/MarketONECSPAdapter/page/index.html#tag/Partner-Subscription-events-\(CSP-Webhook-Events\)/operation/postPartnerSubscriptionEvents) - triggers an event related to Platform-Managed Merchant partner subscriptions. For example, when a Merchant partner subscription is created, activated, cancelled, failed provisioning, etc.

<img src="https://mintcdn.com/amdocs-spbu/v6XW4z-1DbX5IGa9/marketONE/aggregatorAPIGuide/images/eventExample.png?fit=max&auto=format&n=v6XW4z-1DbX5IGa9&q=85&s=fd33c4d7ca6e25f78725976debd53864" alt="Subscription events flow" width="942" height="572" data-path="marketONE/aggregatorAPIGuide/images/eventExample.png" />

## Event categories

Below are all of the events available for Resellers (Service Providers). Events are group under subscription events, and Merchant partner subscription events.

## Subscription Events

All subscription events contain the Subscription object.

| Event | Subscription Model | Description |
| - | - | - |
| subscription**Created** | Platform-Managed | A customer purchases a Platform-Managed Merchant subscription through the Reseller's (Service Provider's) website. The Reseller uses the MarketONE API to provision the new subscription in the MarketONE data store. Once the subscription is successfully created, MarketONE generates the `subscriptionCreated` event. This event triggers regardless of the specified start date of the subscription. |
| subscription**Started** | Platform-Managed | MarketONE generates and delivers to the Reseller (Service Provider) at the MarketONE Service Start—Subscription Start Date reached in MarketONE. |
| subscription**Paused** | Platform-Managed | MarketONE generates and delivers this event when a subscription is paused in MarketONE. |
| subscription**Resumed** | Platform-Managed | MarketONE generates and delivers this event when a subscription is resumed/re-activated in MarketONE. |
| subscription**Modified** | Platform-Managed | MarketONE generates and delivers this event when a subscription is modified in one of the following ways: - Product replacement - Product add/remove - Discount add/remove - Change in billing date - Change in billing plan The event is sent only when the request is processed. No event is available when the entitlement is effective. |
| subscription**Cancelled** | Platform-Managed | A Reseller (Service Provider) sends a subscription cancellation to MarketONE via API request. This applies to voluntary (i.e., user-initiated) and involuntary (i.e., system-initiated) cancellations. MarketONE generates the `subscriptionCancelled` event as confirmation that MarketONE has processed the cancel request. MarketONE generates and delivers the event on the same day as the actual API request from the Reseller (Service Provider), regardless of the subscription's specific end-of-cycle date. If the end date is further away (e.g., the cancel request comes in on the 15th, but the subscription cycle ends on the 30th), then this event is not delivered on the end date. Instead, the `subscriptionStopped` event is delivered on the actual date the subscription ends. **Note:** Involuntary cancellation are always effective immediately. |
| subscription**Stopped** | Platform-Managed | MarketONE generates and delivers this event when an Platform-Managed subscription reaches its end date. This applies to both voluntary (i.e., user-initiated) and involuntary (i.e., system-initiated) subscription cancellations. Whereas the `subcriptionCancelled` event indicate that the cancellation request has been processed, this event confirms that the subscription has been fully terminated in MarketONE. For voluntary cancellations, the end date (or the date the cancellation takes effect) can be today, or at the end of the subscription of cycle. In those cases, the `subscriptionStopped` event is sent on the end date. Conversely, involuntary cancellations take immediate effect, so the `subscriptionStopped` event is sent right away. |
| `subscription**Renewed**` | Platform-Managed | An end customer's subscription is renewed (e.g., based on a reoccurring subscription billing cycle). MarketONE generates and delivers the `subscriptionRenewed` event to the Reseller (Service Provider) when the renewal is successful. |
| **partnerSubscription events** | | |

All partnerSubscription events contain the relevant Merchant Partner Subscription object.

| Event | Subscription Model | Description |
| - | - | - |
| partnerSubscription**Created** | Platform-managed, Merchant-managed | A customer purchases a Platform-managed Merchant partner subscription through the Reseller's (Service Provider's) website. The Reseller uses the MarketONE API to provision the new `partnerSubscription` in the MarketONE data store. Typically there are two scenarios for this: - The Reseller creates a new subscription in MarketONE with one or many products. For every Merchant product, a `partnerSubscription` will be created and provisioned to Merchant(s). - The Reseller adds new products to an existing subscription in MarketONE. A new `partnerSubscription` will be created and provisioned to Merchant. Once one of these changes occur, MarketONE then sends an `AddSubscription` callback to the relevant Merchant. If the Merchant returns a successful response, then MarketONE generates the `partnerSubscriptionCreated` event as a confirmation of the change success. |
| partnerSubscription**Activated** | Platform-managed, Merchant-managed | A customer activates/redeems their subscription with the Merchant service, and the Merchant sends the updated status to MarketONE. MarketONE then generates this event for Resellers (Service Providers), to confirm that the customer has successfully redeemed the subscription. |
| `partnerSubscription**Modified**` | Platform-managed, Merchant-managed | A customer modifies an Platform-managed Merchant partner subscription through the Reseller's (Service Provider's) website. The Reseller uses the MarketONE API to update the existing `partnerSubscription` in the MarketONE data store (the `partnerSubscription` remains the same, but the corresponding Merchant product for that subscription is updated). MarketONE sends an `UpdateSubscription` callback to the relevant Merchant. If the Merchant returns a successful response, then MarketONE generates the `partnerSubscriptionModified` event as a confirmation of the change success. |
| partnerSubscription**Cancelled** | Platform-managed, Merchant-managed | A customer cancels an Platform-Managed Merchant partner subscription through the Reseller's (Service Provider's) website. The Reseller calls the MarketONE API to de-provision the `partnerSubscription`. Typically there are two scenarios for this: - The Reseller cancels the subscription. All of the associated `partnerSubscription`s are de-provisioned. - The Reseller updates a subscription by removing one or more products. The corresponding `partnerSubscriptions` are de-provisioned. Once one of these changes occurs, MarketONE then sends a `DeleteSubscription` callback to the relevant Merchant. If the Merchant returns a successful response, then MarketONE generates the `partnerSubscriptionCancelled` event as a confirmation of the change success. |
| partnerProvisioning**Failed** | Platform-managed, Merchant-managed | MarketONE sends an add/delete/update callback to the Merchant, and the request fails. MarketONE attempts a set number of retries to the Merchant and, if that number is exhausted, generates `partnerProvisioningFailed` event as a confirmation of the fail. Applies to use cases where MarketONE is unable to provision/de-provision/update a `partnerSubscription` to the Merchant. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.