> ## 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.

# Service Provisioning Callbacks

> Callbacks allow a OTT service provider system to know about MarketONE service provisioning events as they occur. You can provide a callback URL and when those events happen, MarketONE will immediately generate an HTTPS POST request with a JSON payload. MarketONE callback actions are intended to be actionable on their own. As such they will include the full related object(s) in JSON format.



## OpenAPI

````yaml /marketONE/MarketONEOTTServiceCallbacks.yaml post /trial-ending-notification-callback
openapi: 3.0.1
info:
  title: MarketONE OTT Service Callbacks
  description: Callback API's
  termsOfService: urn:tos
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0
  version: Released
servers:
  - url: /
security:
  - ApiKeyAuth: []
tags:
  - name: MarketONE
paths:
  /trial-ending-notification-callback:
    post:
      tags:
        - Free Trial Ending callback
      summary: Service Provisioning Callbacks
      description: >-
        Callbacks allow a OTT service provider system to know about MarketONE
        service provisioning events as they occur. You can provide a callback
        URL and when those events happen, MarketONE will immediately generate an
        HTTPS POST request with a JSON payload. MarketONE callback actions are
        intended to be actionable on their own. As such they will include the
        full related object(s) in JSON format.
      operationId: callbackTrialEnd
      parameters:
        - name: X-B3-TraceId
          in: header
          description: >-
            The TraceId indicates the overall ID of the trace. Every span in a
            trace shares this ID. The X-B3-TraceId header is encoded as 32 or 16
            lower-hex characters. For example, a 128-bit TraceId header might
            look like 463ac35c9f6413ad48485a3953bb6124.
          required: false
          schema:
            type: string
        - name: X-B3-SpanId
          in: header
          description: >-
            The SpanId is 64-bit in length and indicates the position of the
            current operation in the trace tree. The value should not be
            interpreted; it may or may not be derived from the value of the
            TraceId. The X-B3-SpanId header is encoded as 16 lower-hex
            characters. For example, a SpanId header might look like
            a2fb4a1d1a96d312. Unless propagating only the Sampling State, the
            X-B3-SpanId header is required.
          required: false
          schema:
            type: string
        - name: X-B3-ParentSpanId
          in: header
          description: >-
            The ParentSpanId is 64-bit in length and indicates the position of
            the parent operation in the trace tree. When the span is the root of
            the trace tree, there is no ParentSpanId. The X-B3-ParentSpanId
            header may be present on a child span and must be absent on the root
            span. It is encoded as 16 lower-hex characters. For example, a
            ParentSpanId header might look like 0020000000000001.
          required: false
          schema:
            type: string
      requestBody:
        description: >-
          A Callback Request will contain an "action" parameter. Action
          Parameter can be "AddSubscription", "DeleteSubscription",
          "UpdateSubscription", "PauseSubscription", "ResumeSubscription".
          Please note that callbacks must be idempotent; e.g "AddSubscription"
          if a record already exist for a subscriptionId, a new OTT service
          provider subscription record should not be created but rather updated
          with new registration code; "DeleteSubscription" if a record was
          already deleted, return OK, "UpdateSubscriptionMetadata" If only
          metadata on subscription changed etc.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Trial_ending_notification_callback_body'
      responses:
        '200':
          description: OK
components:
  schemas:
    Trial_ending_notification_callback_body:
      required:
        - action
        - partnerCustomerId
        - partnerSubscriptionId
      type: object
      properties:
        action:
          type: string
          enum:
            - SubscriptionTrialEnding
        subscriptionId:
          maxLength: 128
          type: string
          description: >-
            The id of a MarketONE subscription.Will be sent in the request call
            for "PauseSubscription"
        partnerSubscriptionId:
          maxLength: 256
          type: string
          description: The unique identifier for the provisioning record
        partnerCustomerId:
          maxLength: 256
          type: string
          description: The unique identifier for the partner customer account
        externalPartnerSubscriptionId:
          maxLength: 256
          type: string
          description: >-
            A OTT service provider specific ID that identifies the OTT service
            subscription. This id is returned during initial provisioning.
            Required for "UpdateSubscription" and
            "DeleteSubscription","PauseSubscription" callbacks.
        organizationCode:
          maxLength: 128
          type: string
          description: The organization code for the aggregator
        productCode:
          maxLength: 128
          type: string
          description: >-
            the merchant product code which is subscribed by the customer as
            defined by the Merchant in MarketONE for which there is a MarketONE
            agreement.
        trialEndDate:
          type: string
          description: The start date of the subscription pause (ISO 8601 ).
          format: date-time
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: >-
        The authorization key obtained from the OTT service provider for a given
        CSP organization.
      name: X-API-KEY
      in: header

````

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