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

# Trigger sending a Partner subscription event

> MarketONE invokes this endpoint to trigger Partner subscription-related events, such as creation, activation, cancelation, and provisioning failed. Resellers can subscribe to these webhook events.



## OpenAPI

````yaml /marketONE/MarketONECSPAdapter.yaml post /event/partnerSubscription
openapi: 3.0.1
info:
  title: MarketONE Reseller Adapter API
  description: >
    # Introduction

    The MarketONE Reseller (CSP) Adapter OpenAPIs are essential interfaces for
    Resellers (Service Providers) to implement for integration with MarketONE.
    Reseller developers can use the provided specifications to build APIs that
    interact with MarketONE. Reseller developers are responsible for writing the
    code to handle requests and responses and ensuring their implementation
    adheres to the specifications.


    Unlike traditional APIs, these APIs are not called by Resellers. Instead,
    MarketONE invokes them to perform operations such as triggering customer
    notifications or subscription lifecycle events. 


    While these APIs offer comprehensive resources for development, they do not
    encompass every possible API call. For information about APIs Resellers can
    call, see the [MarketONE
    OpenAPIs](https://docs.saas.amdocs.com/bundle/MarketONEAPIs/page/index.html).


    For a list of all the APIs Resellers can build and call, see the [API
    Reference for
    Resellers](https://docs.saas.amdocs.com/bundle/b_aggregatorAPIGuide/page/topics/serviceProviderAPIs_r.html). 


    # HTTP Methods


    The MarketONE Reseller (CSP) Adapter OpenAPIs support the following HTTP
    methods:

    | Method | Description |

    | ----------  | ------------------ |

    | GET  | Retrieve resources (as a list or single record fetch) |

    | POST  | Create new resources or update existing ones (overloading during
    create/update is permitted where specified) |


    # Example Request and Response


    ```

    POST /v2/notification/

    Content-Type: application/json

    X-API-KEY: {Insert API KEY here}

    {
      "type": "partnerSubscriptionAdded",
      "parameters": [
        {
          "key": "redemptionUrl",
          "value": "http://www.acme.com/redeem"
        }
      ]
    }


    HTTP/1.1 200 OK

    ```


    # Status Codes

    MarketONE uses the following HTTP response codes to indicate the success or
    failure of an API request.


    | Code | Status | Description |

    | --------  | ------ | ------------------- |

    | **200** | OK | Everything worked as expected. |

    | **201** | OK | Everything worked as expected. |

    | **400** | Bad Request | The request was unacceptable, often due to missing
    a required parameter. Other possibilities include: <ul><li>A parameter
    doesn't fit the data type</li><li>A parameter is outside the maximum or
    minimum boundaries of what can be accepted.</li> |

    | **401** | Unauthorized | Couldn’t authenticate your request. This could be
    due to a wrong or invalid API key. |

    | **403** | Forbidden | Authentication failed. Check your username and
    password. |

    | **404** | Not Found | The requested resource doesn’t exist. |

    | **409** | Conflict | |

    | **429** | Too Many Requests | Too many requests were made to the API too
    quickly. |

    | **500** | Internal Server Error  | |

    | **501** | Not Implemented | |

    | **503** | Service Unavailable | We’re temporarily offline for maintenance.
    Please try again later. |


    # Authentication


    An API key is required for MarketONE to make requests to the MarketONE
    Reseller (CSP) Adapter OpenAPIs. Resellers (Service Providers) need to
    generate an API key using their system and provide the API key during
    [gateway
    configuration](https://docs.saas.amdocs.com/bundle/b_userGuideForResellers/page/topics/gateway_c.html)
    and [webhook
    registration](https://docs.saas.amdocs.com/bundle/b_userGuideForResellers/page/topics/webhooksAbout_c.html)
    in Partner Ecosystem Management. As an alternative, Resellers can
    authenticate using a username and password (basic auth) or OAuth2. 


    # Errors


    All error responses will return an error object.


    ## Attributes


    | Name | Type | Required/Optional | Description |

    | -------  | ------ | ------ | ------ |

    | **code** | string | required | The error type, such as
    \"authentication-required\" (401) or \"not-found\" (404). |

    | **message** | string | required | A human-readable message providing more
    detailed information about the error. |

    | **validationErrors** | object | optional | An array of validation errors
    with **code** and **message** attributes provided. |


    # Tracing Headers


    The following tracing headers can be used for all APIs:


    - **X-B3-TraceId**: 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.


    - **X-B3-SpanId**: 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.


    - **X-B3-ParentSpanId**: 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.
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0
  version: Released
servers:
  - url: /
security:
  - CSPApiKeyAuth: []
paths:
  /event/partnerSubscription:
    post:
      tags:
        - Partner Subscription events (Reseller webhook events)
      summary: Trigger sending a Partner subscription event
      description: >-
        MarketONE invokes this endpoint to trigger Partner subscription-related
        events, such as creation, activation, cancelation, and provisioning
        failed. Resellers can subscribe to these webhook events.
      operationId: postPartnerSubscriptionEvents
      requestBody:
        description: Notification Request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartnerSubscriptionEvent'
        required: true
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Error'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/409Error'
        '500':
          description: System Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/500Error'
components:
  schemas:
    PartnerSubscriptionEvent:
      required:
        - contents
        - eventClass
        - eventDatetime
        - eventType
      type: object
      properties:
        eventClass:
          maxLength: 36
          type: string
          description: the event id provided by application generating the event.
          enum:
            - PartnerSubscription
        eventType:
          maxLength: 128
          type: string
          description: the name of the application sending this event
          enum:
            - PartnerSubscriptionCreated
            - PartnerSubscriptionModified
            - PartnerSubscriptionActivated
            - PartnerProvisioningFailed
            - PartnerSubscriptionCancelled
            - PartnerSubscriptionPaused
            - PartnerSubscriptionResumed
            - PartnerInitiatedCancelCompleted
            - PartnerSubscriptionActivationFailed
            - PartnerSubscriptionDeactivated
            - PartnerInitiatedCancel
            - PartnerInitiatedUpdate
            - BillingPartnerSubscriptionCancelled
            - BillingPartnerSubscriptionActive
            - BillingPartnerSubscriptionUpdated
        subType:
          maxLength: 128
          type: string
          description: >-
            the subtype of the event, only applicable for the
            PartnerProvisioningFailed event.
          enum:
            - CreateFailed
            - UpdateFailed
            - CancelFailed
            - PauseFailed
            - ResumeFailed
        eventDatetime:
          type: string
        contents:
          $ref: '#/components/schemas/PartnerSubscriptionWithReason'
    400Error:
      required:
        - code
      type: object
      properties:
        code:
          type: string
          enum:
            - invalid-request
        message:
          type: string
        validationErrors:
          type: array
          items:
            $ref: '#/components/schemas/400ValError'
    401Error:
      required:
        - code
      type: object
      properties:
        code:
          type: string
          enum:
            - authentication-required
            - invalid-api-key
            - api-key-not-found
        message:
          type: string
    404Error:
      required:
        - code
      type: object
      properties:
        code:
          type: string
          enum:
            - not-found
        message:
          type: string
    409Error:
      required:
        - code
      type: object
      properties:
        code:
          type: string
          enum:
            - input-conflict
        message:
          type: string
    500Error:
      required:
        - code
      type: object
      properties:
        code:
          type: string
          enum:
            - server-error
        message:
          type: string
    PartnerSubscriptionWithReason:
      required:
        - accountId
        - createdDate
        - organizationId
        - partnerCode
        - partnerCustomerId
        - partnerSubscriptionId
        - productCode
        - serviceStatus
        - subscriptionId
        - subscriptionItemId
      type: object
      properties:
        partnerSubscriptionId:
          maxLength: 256
          type: string
          description: MarketONE partner service provisioning record identifier.
        partnerCustomerId:
          maxLength: 256
          type: string
          description: MarketONE unique customer identifier per partner.
        organizationId:
          maxLength: 50
          type: string
          description: >-
            The ID of the aggregator organization in MarketONE for which this
            record was created.
        accountId:
          maxLength: 128
          type: string
          description: >-
            The ID of the MarketONE account associated with this partner service
            record. This ID is not returned when the API is called with a
            partner API key. This will be returned withwhen the API is called
            with an aggregator API key.
        accountVid:
          maxLength: 128
          type: string
          description: >-
            The id of the SLM subscription associated with this partner service
            given by SLM in its response.
        subscriptionId:
          maxLength: 128
          type: string
          description: The id of the SLM subscription associated with this partner service.
        subscriptionVid:
          maxLength: 128
          type: string
          description: >-
            The id of the SLM subscription associated with this partner service
            given by SLM in its response.
        subscriptionItemId:
          maxLength: 128
          type: string
          description: >-
            The id of the SLM subscription Item associated with this partner
            service.
        externalPartnerSubscriptionId:
          maxLength: 256
          type: string
          description: >-
            The identifier returned by the partner from the "AddSubscription"
            callback.
        externalPartnerCustomerId:
          maxLength: 256
          type: string
          description: The unique customer identifier at merchant side.
        registrationString:
          maxLength: 256
          type: string
          description: >-
            Information that was sent to the partner as part of the
            "AddSubscription" callback; e.g. registration code
        partnerUrl:
          maxLength: 2048
          type: string
          description: >-
            The optional response value that identifies the Url where user will
            be directed to for entering the registration code and completing the
            registration
        tokenizedPartnerUrl:
          maxLength: 2048
          type: string
          description: >-
            The optional response value that represents the combined one click
            activation URL
        redemptionCodeExpirationTime:
          type: string
          description: Indicates until when the redemption code is valid.
          format: datetime
        partnerCode:
          maxLength: 32
          type: string
          description: The partner code as set by the partner admin in MarketONE.
        productCode:
          maxLength: 64
          type: string
          description: The product code defined by the partner identified by partner code.
        slmProductCode:
          maxLength: 64
          type: string
          description: >-
            The offer code defined by the reseller in MarketONE in cases where
            billing is handled in MarketONE.
        createdDate:
          type: string
          description: >-
            The timestamp (ISO 8601 format) when the partner service
            provisioning information record was created.
          format: datetime
        updatedDate:
          type: string
          description: >-
            The timestamp (ISO 8601 format) when the partner service
            provisioning information record was updated.
          format: datetime
        startServiceDate:
          type: string
          description: >-
            The timestamp (ISO 8601 format) when the partner service
            provisioning information record was created.
          format: datetime
        endServiceDate:
          type: string
          description: >-
            The timestamp (ISO 8601 format) when the partner service
            provisioning information record was updated.
          format: datetime
        activatedDate:
          type: string
          description: >-
            The timestamp (ISO 8601 format) when the partner service was
            activated (redeemed).
          format: datetime
        serviceStatus:
          maxLength: 50
          type: string
          description: >-
            Status of the partner service MarketONE information. UNPROVISIONED
            indicates that the record was created by the callback response was
            not received. INACTIVE indicates the provisioning callback was
            sucesfully received by the partner service, but it has not been
            claimed by any service user yet. ACTIVE indicates that the service
            entitlement has been sucesfully provisioned, and a partner service
            user has claimed it. CANCELLATION-IN-PROGRESS indicates that the a 
            de-provisioning request is pending. CANCELLED indicates that the
            de-provisioning request confirmation has been received.
          enum:
            - UNPROVISIONED
            - INACTIVE
            - ACTIVE
            - PAUSED
            - UPDATE-IN-PROGRESS
            - PAUSE-IN-PROGRESS
            - RESUME-IN-PROGRESS
            - CANCELLATION-IN-PROGRESS
            - CANCELLED
        state:
          maxLength: 50
          type: string
          description: >-
            Current state of the calls in regards to Create, Cancel and
            Reprovision Subscriptions. Used for state machine orchestration for
            MarketONE managed subscriptions.
          enum:
            - PROVISION-PENDING
            - PROVISION-FAILED
            - PROVISION-COMPLETE
            - CANCELLATION-PENDING
            - CANCELLATION-FAILED
            - CANCELLATION-COMPLETE
            - CANCELLATION-FAILED-PROVISION
            - UPDATE-PENDING-ACTIVE
            - UPDATE-PENDING-INACTIVE
            - UPDATE-FAILED-ACTIVE
            - UPDATE-FAILED-INACTIVE
            - UPDATE-COMPLETE
            - UPDATE-METADATA-PENDING-ACTIVE
            - UPDATE-METADATA-PENDING-INACTIVE
            - UPDATE-METADATA-FAILED-ACTIVE
            - UPDATE-METADATA-FAILED-INACTIVE
            - PAUSE-PENDING-ACTIVE
            - PAUSE-PENDING-INACTIVE
            - PAUSE-FAILED-ACTIVE
            - PAUSE-FAILED-INACTIVE
            - PAUSE-FAILED-COMPENSATE-BY-RESUME
            - PAUSE-COMPLETE-ACTIVE
            - PAUSE-COMPLETE-INACTIVE
            - RESUME-PENDING-ACTIVE
            - RESUME-PENDING-INACTIVE
            - RESUME-FAILED-ACTIVE
            - RESUME-FAILED-INACTIVE
            - RESUME-COMPLETE
            - PARTNER-CANCELLED
            - PARTNER-UPDATED
            - PARTNER-INITIATED-SUBSCRIPTION-CANCEL-STARTED
            - PARTNER-INITIATED-SUBSCRIPTION-CANCEL-COMPLETE
            - PARTNER-INITIATED-SUBSCRIPTION-CANCEL-FAILED
            - CANCEL-CSP-EVENT-SENT-FOR-INACTIVITY
            - ACTIVATION-FAILED
            - AUTO-CANCEL-DUE-TO-INACTIVITY
        billingStatus:
          maxLength: 50
          type: string
          description: >-
            The status of the OTT billing partner subscription.
            PENDING-VALIDATION - the BILLING partner subscription creation was
            requested by the OTT partner and it requires validation, MarketONE
            triggered the OTP notification, aggregator sends the OTP to the
            consumer. The customer aggregator account details have not yet been
            validated as being correct. E.g. a MSISDN was provided, but we have
            not yet verified it belongs to the user. PENDING-CONFIRMATION -
            MarketONE successfully validated the BILLING partner subscription.
            All the BILLING partner subscription details are validated at this
            point, MarketONE awaiting confirmation from the customer via the OTT
            partner that they wish this partner subscription to be active for
            billing. ACTIVE - the BILLING partner subscription is available for
            billing CANCELLED - the BILLING partner subscription was canceled
            and can no longer be used for charges, but may be used for refunds
            if it had previously been active.
          enum:
            - PENDING-VALIDATION
            - PENDING-CONFIRMATION
            - ACTIVE
            - CANCELLED
        type:
          type: string
          description: >-
            the type of the partner subscription record; ENTITLEMENT - is when
            the partner subscription is represeting a entitlement relationship;
            BILLING - when the partner subscription is representing a billing
            relationship.
          enum:
            - ENTITLEMENT
            - BILLING
        billingPaymentMethod:
          $ref: '#/components/schemas/ID'
        reasonCode:
          type: string
        reasonDescription:
          type: string
      description: The information managed in MarketONE about partner service provisioning.
    400ValError:
      required:
        - code
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    ID:
      maxLength: 128
      type: string
      description: A unique identifier.
  securitySchemes:
    CSPApiKeyAuth:
      type: apiKey
      description: The authorization key obtained from the CSP organization.
      name: X-API-KEY
      in: header

````

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