openapi: 3.0.3
info:
  title: MasProvision API
  version: 2.5.0
  description: >
    ### Release Notes

    * **2.0.0**
      - Provision TV Disney refactor
    * **2.1.0**
      - Provision TV Netflix refactor
    * **2.2.0**
      - Add Provision TV HBO API
    * **2.3.0**
      - Add Provision Insurance Device API
    * **2.4.0**
      - Add Suspension and Reconnection to Provision Insurance Device API
    * **2.5.0**
      - Add Provision TV Orange Standalone (TVLibre) API

    ## Release and compatibility

    - Deprecations for current versions whenever a new version is announced is 1 months.
    - After 1 months, the deprecated version will no longer be supported but will remain accessible for at least 3 months.
    - Our APIs will allow requests only from two versions simultaneously, however we won't support the older of the two.
    - All enum in responses are define as x-extensible-enum, it means they all are susceptible to increase values.

    ## Version criteria

        {MAJOR}.{MINOR}.{PATCH}

    1. `{MAJOR}` implies incompatible changes with the previous `{MAJOR}` version
    2. `{MINOR}` implies new functionalities or information compatible with previous version
    3. `{PATCH}` implies bug fixes compatible with previous version

servers:
  - url: https://provision-master.private.dev.k8s.masmovil.com/v2
    description: development
  - url: https://provision.sta.masstack.com/v2
    description: staging
  - url: https://provision.masstack.com/v2
    description: production

tags:
  - name: Disney Tv
    description: Disney provides users access to Disney content across various application and platform combinations including mobile devices, smart TVs, and desktop computers.
  - name: Netflix Tv
    description: Netflix provides users access to Netflix content across various application and platform combinations including mobile devices, smart TVs, and desktop computers.
  - name: HBO Tv
    description: HBO provides users access to HBO content across various application and platform combinations including mobile devices, smart TVs, and desktop computers.
  - name: Insurance Device
    description: This API is used to manage operations of device insurance, including contract reservation, activation, cancellation, termination, suspension, and reconnection of insurance policies.
  - name: Orange TV Standalone
    description: TVLibre (Orange TV Standalone) provides users access to OrangeTV content independently from the bundled OrangeTV offering.

paths:
  /orgs/{org_id}/tv/disney/users/{user_id}:
    post:
      tags:
        - Disney Tv
      summary: Create a subscription
      description: Create a subscription
      operationId: disneyCreateSubscription
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/UserId'
        - $ref: '#/components/parameters/RequestCorrelationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubscriptionBody'
      responses:
        "202":
          description: The operation request was successfully accepted and returned the workflow initiation data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/disney/users/{user_id}/subscriptions/{subscription_id}:
    patch:
      tags:
        - Disney Tv
      summary: Modify subscription
      description: Modifiy the product for the current subscription
      operationId: disneyModifySubscription
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/UserId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/RequestCorrelationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModifySubscriptionBody'
      responses:
        "204":
          description: Subscription modified successfully.
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'
    delete:
      tags:
        - Disney Tv
      summary: Terminate a subscription
      description: Terminate a subscription
      operationId: disneyTerminateSubscription
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/UserId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/Product'
      responses:
        "204":
          description: Subscription terminated successfully.
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'
    get:
      tags:
        - Disney Tv
      summary: Get subscription status
      description: Get subscription status
      operationId: disneyGetSubscriptionStatus
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/UserId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/RequestCorrelationId'
      responses:
        "200":
          description: Get subscription status request successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionStatus'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/disney/users/{user_id}/subscriptions/{subscription_id}/suspend:
    post:
      tags:
        - Disney Tv
      summary: Suspend a subscription
      description: Suspend a subscription
      operationId: disneySuspendSubscription
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/UserId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/RequestCorrelationId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SuspendSubscriptionBody'
      responses:
        "204":
          description: Subscription suspended successfully.
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/disney/users/{user_id}/subscriptions/{subscription_id}/reactivate:
    post:
      tags:
        - Disney Tv
      summary: Reactivate a subscription
      description: Reactivate a subscription
      operationId: disneyReactivateSubscription
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/UserId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/RequestCorrelationId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReactivateSubscriptionBody'
      responses:
        "204":
          description: Subscription reactivated successfully.
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/disney/users/{user_id}/subscriptions/{subscription_id}/activation_url:
    post:
      tags:
        - Disney Tv
      summary: Generate an URL to be used by the user to activate his subscription
      description: Generate activation URL
      operationId: disneyGenerateActivationUrl
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/UserId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/RequestCorrelationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivationUrlRequest'
      responses:
        "201":
          description: New url with token was created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivationUrlResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/disney/users/{user_id}/callbacks/activate:
    post:
      tags:
        - Disney Tv
      summary: Notify the result of the Disney+ subscription activate
      description: Notify the result of the Disney+ subscription activate
      operationId: disneyCallbackActivate
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/UserId'
      responses:
        "204":
          description: Activate done successfully
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/netflix/subscriptions:
    post:
      tags:
        - Netflix Tv
      summary: Create a bundle subscription
      description: Create a bundle subscription
      operationId: netflixCreateSubscription
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/RequestCorrelationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubscription'
      responses:
        "201":
          description: Enrolled in the entitlement offer successfully.
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "409":
          description: Conflict
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/netflix/subscriptions/{subscription_id}:
    patch:
      tags:
        - Netflix Tv
      summary: Update a bundle subscription
      description: Update a bundle subscription
      operationId: netflixUpdateSubscription
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/RequestCorrelationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscription'
      responses:
        "204":
          description: Bundle updated successfully.
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          description: Bundle not found
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        "500":
          $ref: '#/components/responses/InternalError'
    delete:
      tags:
        - Netflix Tv
      summary: Cancel a bundle subscription
      description: Cancel a bundle subscription
      operationId: netflixCancelSubscription
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/CancelEventID'
        - $ref: '#/components/parameters/CancelReason'
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/ExternalId'
      responses:
        "204":
          description: Canceled entitlement offer successfully.
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          description: Bundle not found
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/netflix/subscriptions/{subscription_id}/geturl:
    post:
      tags:
        - Netflix Tv
      summary: Generate a url with token to be used in the redirect link to a Netflix flow
      description: Generate a url
      operationId: netflixGenerateUrl
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/RequestCorrelationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateUrl'
      responses:
        "201":
          description: New url with token was created successfully.
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateUrlResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/netflix/subscriptions/{subscription_id}/status:
    get:
      tags:
        - Netflix Tv
      summary: Provide status of Netflix subscription
      description: The API provides status of Netflix subscription.
      operationId: netflixGetSubscriptionStatus
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/RequestCorrelationId'
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSubscriptionStatusResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/netflix/subscriptions/events:
    get:
      tags:
        - Netflix Tv
      summary: Provide events concerning the account lifecycle of Netflix members
      description: The API provides "At least once" delivery semantics i.e. duplicate events may be returned across pages/dates.
      operationId: netflixFetchSubscriptionEvents
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/EventsQueryStartTimestamp'
        - $ref: '#/components/parameters/EventsQueryEndTimestamp'
        - $ref: '#/components/parameters/EventsQueryOffset'
        - $ref: '#/components/parameters/EventsQueryEventTypes'
        - $ref: '#/components/parameters/RequestCorrelationId'
      responses:
        "200":
          description: Success
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FetchSubscriptionEventsResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/netflix/subscriptions/{subscription_id}/suspend:
    post:
      tags:
        - Netflix Tv
      summary: Suspend a netflix subscription
      description: Suspend subscription
      operationId: netflixSuspend
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/RequestCorrelationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Suspend'
      responses:
        "204":
          description: Suspend done successfully.
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/netflix/subscriptions/{subscription_id}/reactivate:
    post:
      tags:
        - Netflix Tv
      summary: Reactivate a suspended netflix subscription
      description: Reactivate subscription
      operationId: netflixReactivate
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/RequestCorrelationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Reactivate'
      responses:
        "204":
          description: Reactivate done successfully.
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/netflix/subscriptions/{subscription_id}/digitalvirgo:
    post:
      tags:
        - Netflix Tv
      summary: Enroll digitalvirgo subscription
      description: Enroll digitalvirgo subscription
      operationId: netflixEnrollDigitalVirgoSubscription
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/RequestCorrelationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnrollDigitalVirgoSubscription'
      responses:
        "201":
          description: Enrolled in the entitlement offer successfully.
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrollDigitalVirgoSubscriptionResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/netflix/subscriptions/{subscription_id}/digitalvirgo/{phone_number}:
    delete:
      tags:
        - Netflix Tv
      summary: Deactivate a digitalvirgo subscription
      description: Deactivate a digitalvirgo subscription
      operationId: netflixDeactivateDigitalVirgoSubscription
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/SubscriptionId'
        - $ref: '#/components/parameters/PhoneNumber'
        - $ref: '#/components/parameters/RequestCorrelationId'
      responses:
        "204":
          description: Canceled entitlement offer successfully.
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          description: Bundle not found
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/hbo/subscriptions:
    post:
      tags:
        - HBO Tv
      summary: Create a subscription
      description: Create a subscription
      operationId: createSubscription
      parameters:
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrgId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubscriptionHBO'
        required: true
      responses:
        "202":
          description: The creation operation request was successfully accepted, returned the request external reference identifier.
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSubscriptionResponseHBO'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/hbo/subscriptions/{service_id}/cancel:
    put:
      tags:
        - HBO Tv
      summary: Cancel a subscription
      description: Cancel a subscription
      operationId: cancelSubscription
      parameters:
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ServiceId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelSubscriptionHBO'
        required: true
      responses:
        "202":
          description: The cancel operation request was successfully accepted, returned the request external reference identifier.
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelSubscriptionResponseHBO'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/hbo/subscriptions/{service_id}:
    patch:
      tags:
        - HBO Tv
      summary: Update a subscription
      description: Update a subscription
      operationId: updateSubscription
      parameters:
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ServiceId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscriptionHBO'
        required: true
      responses:
        "202":
          description: The update operation request was successfully accepted, returned the request external reference identifier.
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateSubscriptionResponseHBO'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          description: Subscription not found
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: SUBSCRIPTION_NOT_FOUND
                  title: Subscription not found
                  details: Subscription not found.
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/hbo/subscriptions/{external_id}:
    get:
      tags:
        - HBO Tv
      summary: Get HBO subscription
      description: The API provides the HBO subscription for a client
      operationId: getSubscription
      parameters:
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ExternalIdHBO'
      responses:
        "200":
          description: Success.
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSubscriptionResponseHBO'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/hbo/subscriptions/{service_id}/activation_url:
    post:
      tags:
        - HBO Tv
      summary: Generate activation URL
      description: Generate an activation URL to redirect to an HBO flow
      operationId: generateActivationUrl
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ServiceId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateActivationUrlHBO'
        required: true
      responses:
        "200":
          description: Activation URL successfully generated.
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateActivationURLResponseHBO'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org_id}/tv/hbo/subscriptions/{service_id}/activate:
    post:
      tags:
        - HBO Tv
      summary: Activate a subscription
      description: Activate a subscription
      operationId: activateSubscription
      parameters:
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ServiceId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivateSubscriptionHBO'
        required: true
      responses:
        "202":
          description: The activate operation request was successfully accepted, returned the request external reference identifier.
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivateSubscriptionResponseHBO'
        "400":
          description: Bad Request
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: INVALID_ORG_ID
                  title: Invalid Organization ID
                  details: The provided org_id is not valid.
        "401":
          description: Unauthorized request
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: UNAUTHORIZED
                  title: Unauthorized
                  details: Authorization failed.
        "500":
          description: Internal Server Error
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: INTERNAL_ERROR
                  title: Internal server error
                  details: Cannot process the request due to an unexpected error.

  /orgs/{org_id}/tv/hbo/subscriptions/{service_id}/reactivate:
    post:
      tags:
        - HBO Tv
      summary: Reactivate a subscription
      description: Reactivate a subscription
      operationId: reactivateSubscription
      parameters:
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ServiceId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReactivateSubscriptionHBO'
        required: true
      responses:
        "202":
          description: The reactivation operation request was successfully accepted, returned the request external reference identifier.
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReactivateSubscriptionResponseHBO'
        "400":
          description: Bad Request
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: INVALID_ORG_ID
                  title: Invalid Organization ID
                  details: The provided org_id is not valid.
        "401":
          description: Unauthorized request
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: UNAUTHORIZED
                  title: Unauthorized
                  details: Authorization failed.
        "404":
          description: Subscription not found
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: SUBSCRIPTION_NOT_FOUND
                  title: Subscription not found
                  details: Subscription not found.
        "500":
          description: Internal Server Error
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: INTERNAL_ERROR
                  title: Internal server error
                  details: Cannot process the request due to an unexpected error.

  /orgs/{org_id}/tv/hbo/subscriptions/{service_id}/suspend:
    post:
      tags:
        - HBO Tv
      summary: Suspend a subscription
      description: Suspend a subscription
      operationId: suspendSubscription
      parameters:
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ServiceId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SuspendSubscriptionHBO'
        required: true
      responses:
        "202":
          description: The suspension operation request was successfully accepted, returned the request external reference identifier.
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuspendSubscriptionResponseHBO'
        "400":
          description: Bad Request
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: INVALID_ORG_ID
                  title: Invalid Organization ID
                  details: The provided org_id is not valid.
        "401":
          description: Unauthorized request
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: UNAUTHORIZED
                  title: Unauthorized
                  details: Authorization failed.
        "404":
          description: Subscription not found
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: SUBSCRIPTION_NOT_FOUND
                  title: Subscription not found
                  details: Subscription not found.
        "500":
          description: Internal Server Error
          headers:
            X-B3-TraceID:
              $ref: '#/components/headers/X-B3-TraceID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: INTERNAL_ERROR
                  title: Internal server error
                  details: Cannot process the request due to an unexpected error.

  /orgs/{organization}/insurance/device/reserve:
    post:
      summary: Contratar seguro de dispositivo
      tags:
        - Insurance Device
      description: Permite reservar/contratar un seguro de dispositivo con opción de detallar el ciclo de facturación.
      operationId: reserveInsurance
      parameters:
        - in: header
          name: Request-Correlation-Id
          description: Unique request identifier
          schema:
            type: string
            example: 01968069-ad7b-7cef-8cd0-7dddaecbf813
          required: true
        - name: organization
          in: path
          description: Identificador único de la organización
          required: true
          schema:
            type: string
      requestBody:
        description: Device Insurance DTO request
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InsuranceCreationRequestDTO'
      responses:
        200:
          description: Order created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsuranceCreationResponseDTO'
        400:
          description: Error en los datos de la solicitud
        500:
          description: Error interno del servidor

  /orgs/{organization}/insurance/device/cancel:
    post:
      summary: Cancelar seguro de dispositivo
      tags:
        - Insurance Device
      description: Permite cancelar un seguro de dispositivo mediante número de póliza.
      operationId: cancelInsurance
      parameters:
        - in: header
          name: Request-Correlation-Id
          description: Unique request identifier
          schema:
            type: string
            example: 01968069-ad7b-7cef-8cd0-7dddaecbf813
          required: true
        - name: organization
          in: path
          description: Identificador único de la organización
          required: true
          schema:
            type: string
      requestBody:
        description: Datos para cancelar la póliza
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelInsuranceRequest'
      responses:
        200:
          description: The operation request was successfully accepted, returned the request external reference identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessResponse'
        400:
          description: Error en los datos de la solicitud
        500:
          description: Error interno del servidor

  /orgs/{organization}/insurance/device/activate:
    post:
      summary: Activar seguro de dispositivo
      tags:
        - Insurance Device
      description: Permite activar una póliza de seguro.
      operationId: activateInsurance
      parameters:
        - in: header
          name: Request-Correlation-Id
          description: Unique request identifier
          schema:
            type: string
            example: 01968069-ad7b-7cef-8cd0-7dddaecbf813
          required: true
        - name: organization
          in: path
          description: Identificador único de la organización
          required: true
          schema:
            type: string
      requestBody:
        description: Datos para activar la póliza
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivateInsuranceRequest'
      responses:
        200:
          description: The operation request was successfully accepted, returned the request external reference identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessResponse'
        400:
          description: Error en los datos de la solicitud
        500:
          description: Error interno del servidor

  /orgs/{organization}/insurance/device/terminate:
    post:
      summary: Dar de baja seguro de dispositivo
      tags:
        - Insurance Device
      description: Permite dar de baja una póliza de seguro.
      operationId: terminateInsurance
      parameters:
        - in: header
          name: Request-Correlation-Id
          description: Unique request identifier
          schema:
            type: string
            example: 01968069-ad7b-7cef-8cd0-7dddaecbf813
          required: true
        - name: organization
          in: path
          description: Identificador único de la organización
          required: true
          schema:
            type: string
      requestBody:
        description: Datos para dar de baja la póliza
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TerminateInsuranceRequest'
      responses:
        200:
          description: The operation request was successfully accepted, returned the request external reference identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessResponse'
        400:
          description: Error en los datos de la solicitud
        500:
          description: Error interno del servidor

  /orgs/{organization}/insurance/device/requestinfo:
    get:
      summary: Consultar información de seguro de dispositivo
      tags:
        - Insurance Device
      description: Permite consultar información de una póliza mediante teléfono, documento o número de póliza.
      operationId: insuranceRequestInfo
      parameters:
        - in: header
          name: Request-Correlation-Id
          description: Unique request identifier
          schema:
            type: string
            example: 01968069-ad7b-7cef-8cd0-7dddaecbf813
          required: true
        - name: organization
          in: path
          description: Identificador único de la organización
          required: true
          schema:
            type: string
        - name: phoneNumber
          in: query
          description: Teléfono asociado a la póliza (opcional)
          required: false
          schema:
            type: string
        - name: document
          in: query
          description: Documento del asegurado (opcional)
          required: false
          schema:
            type: string
        - name: policyNumber
          in: query
          description: Número de póliza (opcional)
          required: false
          schema:
            type: string
      responses:
        200:
          description: Order created
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/InsuranceInfoResponseDTO'
        400:
          description: Error en los parámetros de consulta
        404:
          description: Póliza no encontrada
        500:
          description: Error interno del servidor

  /orgs/{organization}/insurance/device/suspend:
    post:
      summary: Suspender seguro de dispositivo
      tags:
        - Insurance Device
      description: Permite suspender una póliza de seguro.
      operationId: insuranceSuspend
      parameters:
        - in: header
          name: Request-Correlation-Id
          description: Unique request identifier
          schema:
            type: string
            example: 01968069-ad7b-7cef-8cd0-7dddaecbf813
          required: true
        - name: organization
          in: path
          description: Identificador único de la organización
          required: true
          schema:
            type: string
      requestBody:
        description: Datos para dar de suspender la póliza
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InsuranceSuspendRequest'
      responses:
        200:
          description: The operation request was successfully accepted, returned the request external reference identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessResponse'
        400:
          description: Error en los datos de la solicitud
        500:
          description: Error interno del servidor

  /orgs/{organization}/insurance/device/reconnect:
    post:
      summary: Reconectar seguro de dispositivo
      tags:
        - Insurance Device
      description: Permite reconectar una póliza de seguro.
      operationId: insuranceReconnect
      parameters:
        - in: header
          name: Request-Correlation-Id
          description: Unique request identifier
          schema:
            type: string
            example: 01968069-ad7b-7cef-8cd0-7dddaecbf813
          required: true
        - name: organization
          in: path
          description: Identificador único de la organización
          required: true
          schema:
            type: string
      requestBody:
        description: Datos para dar de reconectar la póliza
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InsuranceReconnectRequest'
      responses:
        200:
          description: The operation request was successfully accepted, returned the request external reference identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessResponse'
        400:
          description: Error en los datos de la solicitud
        500:
          description: Error interno del servidor

  /orgs/{org}/tv/orange_standalone/subscriptions/{service_id}:
    post:
      tags:
        - Orange TV Standalone
      summary: Activate a subscription
      description: Activate a subscription
      operationId: orangeStandaloneActivateSubscription
      parameters:
        - $ref: '#/components/parameters/OrgStandalone'
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrangeStandaloneServiceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivateSubscriptionOrangeStandalone'
      responses:
        "201":
          description: Subscription activated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "500":
          $ref: '#/components/responses/InternalError'
    patch:
      tags:
        - Orange TV Standalone
      summary: Update a subscription
      description: Update a subscription
      operationId: orangeStandaloneModifySubscription
      parameters:
        - $ref: '#/components/parameters/OrgStandalone'
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrangeStandaloneServiceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModifySubscriptionOrangeStandalone'
      responses:
        "201":
          description: Subscription modified successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          description: Subscription not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: SERVICE_NOT_FOUND
                  title: SERVICE_NOT_FOUND
                  details: subscriptionExternalId not found
        "500":
          $ref: '#/components/responses/InternalError'
    delete:
      tags:
        - Orange TV Standalone
      summary: Terminate a subscription
      description: Terminate a subscription
      operationId: orangeStandaloneTerminateSubscription
      parameters:
        - $ref: '#/components/parameters/OrgStandalone'
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrangeStandaloneServiceId'
        - $ref: '#/components/parameters/OrangeStandaloneExperience'
        - $ref: '#/components/parameters/OrangeStandaloneExternalId'
      responses:
        "201":
          description: Subscription terminated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          description: Subscription not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: SERVICE_NOT_FOUND
                  title: SERVICE_NOT_FOUND
                  details: subscriptionExternalId not found
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org}/tv/orange_standalone/subscriptions/{service_id}/suspend:
    post:
      tags:
        - Orange TV Standalone
      summary: Suspend a subscription
      description: Suspends an active subscription.
      operationId: orangeStandaloneSuspendSubscription
      parameters:
        - $ref: '#/components/parameters/OrgStandalone'
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrangeStandaloneServiceId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SuspendSubscriptionOrangeStandalone'
      responses:
        "201":
          description: Subscription suspended successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          description: Subscription not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: SERVICE_NOT_FOUND
                  title: SERVICE_NOT_FOUND
                  details: subscriptionExternalId not found
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org}/tv/orange_standalone/subscriptions/{service_id}/reactivate:
    post:
      tags:
        - Orange TV Standalone
      summary: Reactivate a subscription
      description: Reactivates a previously suspended subscription.
      operationId: orangeStandaloneReactivateSubscription
      parameters:
        - $ref: '#/components/parameters/OrgStandalone'
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrangeStandaloneServiceId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReactivateSubscriptionOrangeStandalone'
      responses:
        "201":
          description: Subscription reactivated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowResponse'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          description: Subscription not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: SERVICE_NOT_FOUND
                  title: SERVICE_NOT_FOUND
                  details: subscriptionExternalId not found
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org}/tv/orange_standalone/customers/{service_id}:
    patch:
      tags:
        - Orange TV Standalone
      summary: Modify customer attributes
      description: Modify customer attributes
      operationId: orangeStandaloneModifyCustomer
      parameters:
        - $ref: '#/components/parameters/OrgStandalone'
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrangeStandaloneServiceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModifyCustomerOrangeStandalone'
      responses:
        "204":
          description: Customer updated successfully.
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: MEMBER_NOT_FOUND
                  title: MEMBER_NOT_FOUND
                  details: customerExternalId not found
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org}/tv/orange_standalone/customers/{service_id}/devices:
    get:
      tags:
        - Orange TV Standalone
      summary: Get devices
      description: Get devices
      operationId: orangeStandaloneGetDevices
      parameters:
        - $ref: '#/components/parameters/OrgStandalone'
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrangeStandaloneServiceId'
        - $ref: '#/components/parameters/OrangeStandaloneExperience'
      responses:
        "200":
          description: Get devices request successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDevicesResponseOrangeStandalone'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: MEMBER_NOT_FOUND
                  title: MEMBER_NOT_FOUND
                  details: customerExternalId not found
        "500":
          $ref: '#/components/responses/InternalError'

  /orgs/{org}/tv/orange_standalone/customers/{service_id}/devices/{serial_number}:
    delete:
      tags:
        - Orange TV Standalone
      summary: Delete a device
      description: Delete a device
      operationId: orangeStandaloneDeleteDevice
      parameters:
        - $ref: '#/components/parameters/OrgStandalone'
        - $ref: '#/components/parameters/RequestCorrelationId'
        - $ref: '#/components/parameters/OrangeStandaloneServiceId'
        - $ref: '#/components/parameters/OrangeStandaloneSerialNumber'
        - $ref: '#/components/parameters/OrangeStandaloneExperience'
      responses:
        "204":
          description: Device deleted successfully.
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "404":
          description: Device not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                - code: TERMINAL_NOT_FOUND
                  title: TERMINAL_NOT_FOUND
                  details: No terminal found with the given SerialNumber
        "500":
          $ref: '#/components/responses/InternalError'

components:
  headers:
    X-B3-TraceID:
      description: Unique identifier generated for each request.
      schema:
        type: string

  responses:
    BadRequest:
      description: Bad Request
      headers:
        X-B3-TraceID:
          $ref: '#/components/headers/X-B3-TraceID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
    Unauthorized:
      description: Unauthorized request
      headers:
        X-B3-TraceID:
          $ref: '#/components/headers/X-B3-TraceID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
    InternalError:
      description: Internal Server Error
      headers:
        X-B3-TraceID:
          $ref: '#/components/headers/X-B3-TraceID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'

  parameters:
    # Commons
    OrgId:
      in: path
      name: org_id
      description: Tenant
      required: true
      schema:
        type: string
      example: masmovil
    UserId:
      in: path
      name: user_id
      description: The user_id will be used as the primary identifier for an external user/purchase, and be unique across billing and CRM systems.
      required: true
      schema:
        type: string
      example: MOO1664367665504
    SubscriptionId:
      in: path
      name: subscription_id
      description: Subscription identifier. Corresponds to the Partner Account Identifier (PAI).
      required: true
      schema:
        type: string
      example: 4567890123456789
    RequestCorrelationId:
      in: header
      name: Request-Correlation-Id
      description: A reference for this transaction that can be used to track it.
      required: true
      schema:
        type: string
      example: 2106f808-36e9-402d-bf37-f1f7fa04776b

    # Disney only
    Product:
      in: query
      name: product
      required: true
      description: name of an optional product for this operation
      schema:
        type: string
      example: disney.bundle.basic

    # Netflix only
    EventsQueryEndTimestamp:
      in: query
      name: endTimestamp
      description: A timestamp (specified in UNIX epoch seconds) to filter the events that have occurred before a specific time. Value must be greater than startTimestamp and at least 15 minutes before the current time.
      required: true
      schema:
        type: integer
        format: int64
      example: 1683796942
    EventsQueryEventTypes:
      in: query
      name: events
      description: A case-sensitive comma-separated list of event types.
      required: false
      schema:
        type: array
        items:
          $ref: '#/components/schemas/SubscriptionEventType'
      style: form
      explode: true
      example: BUNDLE_ACTIVATION,BUNDLE_PLAN_CHANGE
    EventsQueryStartTimestamp:
      in: query
      name: startTimestamp
      description: A timestamp (specified in UNIX epoch seconds) to filter the events that have occurred on or after a specific time. Value must be within 14 days of the current time.
      required: true
      schema:
        type: integer
        format: int64
      example: 1683710542
    EventsQueryOffset:
      in: query
      name: offset
      description: Used when retrieving subsequent pages of events for the same time period.
      required: false
      schema:
        type: string
      example: 7hysgqtGuaiqbVyqiIaNhjqqqq811lsU==
    CancelEventID:
      in: query
      name: cancel_event_id
      required: false
      description: A reference for this change/transaction that can be used to track/reconcile with the trigger for this event.
      schema:
        type: string
      example: c02a6e17-7bdd-4c1d-a56b-764bcd1bcf01
    CancelReason:
      in: query
      name: cancel_reason
      description: Indicates the reason for cancellation.
      required: false
      schema:
        type: string
        x-extensible-enum:
          - CUSTOMER_CHANGES_PROVIDER
          - CUSTOMER_REQUESTED_CANCEL
          - CUSTOMER_SWITCHED_BUNDLE
          - FRAUD
          - OTHER
          - PAYMENT_INSTRUMENT_FAILURE
      example: CUSTOMER_REQUESTED_CANCEL
    PhoneNumber:
      in: path
      name: phone_number
      description: The mobile phone number preferred by the customer. Value must be in the E.164 format. +[CountryCode][PhoneNumber]
      required: true
      schema:
        type: string
        pattern: "^\\+\\d{1,3}\\d{1,14}$"
      example: "+525512345678"
    ExternalId:
      in: query
      name: external_id
      description: Netflix external identifier.
      required: false
      schema:
        type: string
      example: 4567890123456789

    # HBO only
    ServiceId:
      in: path
      name: service_id
      description: Service identifier. Corresponds to the Subscription Id in HBO.
      required: true
      schema:
        $ref: '#/components/schemas/ServiceId'
      example: 4567890123456789
    ExternalIdHBO:
      in: path
      name: external_id
      description: partner_user_id
      required: true
      schema:
        $ref: '#/components/schemas/ExternalId'
      example: 913259067

    # Orange TV Standalone parameters
    OrgStandalone:
      in: path
      name: org
      description: Tenant
      required: true
      schema:
        type: string
      example: pepephone
    OrangeStandaloneServiceId:
      in: path
      name: service_id
      description: Partner user identifier in Orange TV Standalone. It's the ID on the Orange side.
      required: true
      schema:
        type: string
      example: "913259067"
    OrangeStandaloneSerialNumber:
      in: path
      name: serial_number
      description: Device serial number
      required: true
      schema:
        type: string
      example: "123123123"
    OrangeStandaloneExperience:
      in: query
      name: experience
      required: true
      description: Tv flavour
      schema:
        type: string
      example: VuelaTV
    OrangeStandaloneExternalId:
      in: query
      name: external_id
      description: External identifier from CRM
      required: false
      schema:
        type: string
      example: crm-external-123

  schemas:
    # Commons
    Errors:
      type: array
      items:
        $ref: '#/components/schemas/Error'
    Error:
      type: object
      properties:
        code:
          type: string
          example: SomeErrorCode
        title:
          type: string
          example: TITLE_OF_THE_DOMAIN_ERROR
        details:
          type: string
          example: Some error happened
        ref:
          type: string
          description: Optional reference URL (used by Netflix)
          example: https://developers.masstack.com/en/docs/apis_provision_doc_swagger/1/apioverview/#errors

    WorkflowResponse:
      properties:
        message:
          type: string
          example: message
        workflowId:
          type: string
          example: workflowId
        runId:
          type: string
          example: workflowId

    # Disney schemas
    CreateSubscriptionBody:
      description: Object used to create a subscription
      type: object
      required:
        - subscriptionId
        - products
      properties:
        subscriptionId:
          description: The subscriptionId will be sent as the entitlement ID, an unique identifier of product(s) to which a customer is entitled.
          type: string
          example: ENT1664367665579
        products:
          $ref: '#/components/schemas/Products'
    ModifySubscriptionBody:
      description: Object used to modify a subscription
      type: object
      required:
        - products
      properties:
        products:
          $ref: '#/components/schemas/Products'
    SuspendSubscriptionBody:
      description: Object used to suspend a subscription
      type: object
      required:
        - products
      properties:
        products:
          $ref: '#/components/schemas/Products'
    ReactivateSubscriptionBody:
      description: Object used to reactivate a subscription
      type: object
      required:
        - products
      properties:
        products:
          $ref: '#/components/schemas/Products'
    SubscriptionStatus:
      description: Object representing the status of a subscription
      type: object
      required:
        - entitled
        - activated
        - products
        - lastUpdated
      properties:
        entitled:
          description: Status field indicating whether the subject can watch content.
          type: string
          enum:
            - ACTIVE
            - BILLING_HOLD
            - CANCELED
            - GRACE_PERIOD
        cancellation:
          description: Indicates why a subscription has been canceled.
          type: string
          enum:
            - VOLUNTARY
            - INVOLUNTARY
            - PLAN_SWITCHED
            - ABUSE_REVOCATION
            - UNKNOWN
        products:
          $ref: '#/components/schemas/Products'
        activated:
          description: The status of an active subscription
          type: string
          enum:
            - LINKED
            - UNLINKED
        lastUpdated:
          description: ISO-8601 timestamp indicating when this subscription was last updated.
          type: string
          format: date-time
    ActivationUrlRequest:
      type: object
      required:
        - products
        - country
        - expireDate
      properties:
        products:
          $ref: '#/components/schemas/Products'
        country:
          type: string
          example: ES
        expireDate:
          description: ISO-8601 timestamp indicating when the activation will expire
          type: string
          format: date-time
          example: 2021-01-01T00:00:00Z
    ActivationUrlResponse:
      required:
        - url
      properties:
        expiryDate:
          description: Date when activation URL expires in ISO 8601 format.
          type: string
          example: 2023-06-20T14:32:45+02:00
        url:
          description: Activation URL.
          type: string
          example: https://www.example.com/activation/123
    Products:
      description: List of product identifiers.
      type: array
      items:
        type: string
      example:
        - "com.disney.yoigo.es.bundle.basic"
        - "com.disney.yoigo.es.bundle.premium"

    # Netflix Schemas
    CreateSubscription:
      required:
        - bundle_id
        - netflix_offer_id
        - partner_account_id
      properties:
        external_id:
          $ref: '#/components/schemas/ExternalID'
        billing_event_id:
          $ref: '#/components/schemas/BillingEventID'
        bundle_id:
          $ref: '#/components/schemas/BundleID'
        channel:
          $ref: '#/components/schemas/Channel'
        netflix_email:
          $ref: '#/components/schemas/Email'
        netflix_offer_id:
          $ref: '#/components/schemas/OfferID'
        netflix_phone:
          $ref: '#/components/schemas/Phone'
        partner_account_id:
          $ref: '#/components/schemas/PartnerAccountId'
        partner_charge_country:
          $ref: '#/components/schemas/PartnerChargeCountry'
        preferred_language:
          $ref: '#/components/schemas/PreferredLanguage'
    EnrollDigitalVirgoSubscription:
      required:
        - phone_number
      properties:
        phone_number:
          $ref: '#/components/schemas/Phone'
        pai:
          $ref: '#/components/schemas/Pai'
    EnrollDigitalVirgoSubscriptionResponse:
      properties:
        id:
          $ref: '#/components/schemas/SubscriptionId'
    GenerateUrl:
      required:
        - token_error_url
        - type
      properties:
        channel:
          $ref: '#/components/schemas/BundleActivationChannel'
        partner_charge_country:
          $ref: '#/components/schemas/PartnerChargeCountry'
        promotion_id:
          $ref: '#/components/schemas/PromotionID'
        token_error_url:
          $ref: '#/components/schemas/TokenErrorURL'
        type:
          $ref: '#/components/schemas/TokenType'
        validity_duration_in_seconds:
          $ref: '#/components/schemas/ValidityDurationInSeconds'
    GenerateUrlResponse:
      properties:
        expiry_date:
          $ref: '#/components/schemas/TokenExpiryDate'
        token:
          $ref: '#/components/schemas/Token'
        requested_securitized_url:
          $ref: '#/components/schemas/RequestedSecuritizedUrl'
    GetSubscriptionStatusResponse:
      type: object
      properties:
        has_partner_mop:
          type: boolean
        product_type:
          type: string
        subscription:
          $ref: '#/components/schemas/Subscription'
        bundle:
          $ref: '#/components/schemas/Bundle'
    Subscription:
      type: object
      properties:
        plan:
          $ref: '#/components/schemas/Plan'
    Plan:
      type: object
      properties:
        localized_type:
          type: string
        type:
          type: string
    Bundle:
      type: object
      properties:
        id:
          type: string
        offer_id:
          type: string
        status:
          type: string
    FetchSubscriptionEventsResponse:
      properties:
        events:
          description: List of zero or more Event objects that are relevant to the time period defined by startTimestamp and endTimestamp
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionEvent'
        next_page_offset:
          description: A value to retrieve subsequent pages for the same period.
          type: string
          example: 7hysgqtGuaiqbVyqiIaNhjqqqq811lsU==
    Suspend:
      required:
        - suspend_event_id
        - reason
      properties:
        external_id:
          $ref: '#/components/schemas/ExternalID'
        suspend_event_id:
          description: Partner-provided reference identifier for the suspend event.
          type: string
          example: c2a45099-1cda-4178-83a8-02c02356ea01
        reason:
          type: string
          x-extensible-enum:
            - PAYMENT_INSTRUMENT_FAILURE
            - PAYMENT_PAST_DUE
            - OTHER
          example: PAYMENT_INSTRUMENT_FAILURE
    Reactivate:
      required:
        - reactivate_event_id
      properties:
        external_id:
          $ref: '#/components/schemas/ExternalID'
        reactivate_event_id:
          description: Partner-provided reference identifier for the reactivate event.
          type: string
          example: c2a45099-1cda-4178-83a8-02c02356ea01
    UpdateSubscription:
      properties:
        external_id:
          $ref: '#/components/schemas/ExternalID'
        billing_event_id:
          $ref: '#/components/schemas/BillingEventID'
        bundle_id:
          $ref: '#/components/schemas/BundleID'
        channel:
          $ref: '#/components/schemas/Channel'
        netflix_email:
          $ref: '#/components/schemas/Email'
        netflix_offer_id:
          $ref: '#/components/schemas/OfferID'
        netflix_phone:
          $ref: '#/components/schemas/Phone'
        partner_charge_country:
          $ref: '#/components/schemas/PartnerChargeCountry'
        preferred_language:
          $ref: '#/components/schemas/PreferredLanguage'
    ExternalID:
      description: Identifier of the subscription on the CRM
      type: string
      example: external_subscription_12345
    BillingEventID:
      description: Reference identifier used for tracking/reconciliation. Max 1024 bytes.
      type: string
      example: e307f177-091a-4840-9830-dda1c29eea44
    BundleActivationChannel:
      description: Channel used to activate the Bundle.
      type: string
      x-extensible-enum:
        - EMAIL
        - MOBILE
        - SMS
        - STORE
        - WEB
        - OTHER
      example: WEB
    BundleID:
      description: Describes your bundle offers. Each of your offers should correspond to a unique BundleID.
      type: string
      example: c2a45099-1cda-4178-83a8-02c02356ea01
    Channel:
      description: Channel used to sign up for the Bundle.
      type: string
      x-extensible-enum:
        - STORE
        - TELESALES
        - DOOR_TO_DOOR
        - WEB
        - MOBILE
        - STB
        - OTHER
      example: WEB
    Email:
      description: Customer's primary email address (standard email format).
      type: string
      example: test@email.com
    OfferID:
      description: Pre-agreed UUID for each Netflix plan available in your bundle offers.
      type: string
      example: 2106f808-36e9-402d-bf37-f1f7fa04776b
    PartnerAccountId:
      description: Partner Account Identifier (PAI) to associate a partner account with a Netflix account.
      type: string
      example: 4567890123456789
    PartnerChargeCountry:
      description: Two letter codes that conform to ISO 3166-1
      type: string
      pattern: '^[A-Z]{2}$'
      example: ES
    Phone:
      description: E.164 format. +[CountryCode][PhoneNumber]
      type: string
      pattern: '^\\+\\d{1,3}\\d{1,14}$'
      example: '+525512345678'
    Pai:
      description: Pai number to identify subscription.
      type: string
      example: '123456'
    PreferredLanguage:
      description: Language preferred for contact.
      type: string
      x-extensible-enum:
        - ar
        - ar-SA
        - da
        - da-DK
        - de
        - de-DE
        - en
        - en-AU
        - en-CA
        - en-FR
        - en-GB
        - en-IE
        - en-IN
        - en-NZ
        - en-PH
        - en-US
        - es
        - es-AR
        - es-CO
        - es-CL
        - es-ES
        - es-MX
        - es-PE
        - es-US
        - fi
        - fr
        - fr-CA
        - fr-FR
        - it
        - it-IT
        - ja
        - ja-JP
        - ko
        - ko-KR
        - nl
        - nl-NL
        - nb
        - nb-NO
        - pl
        - pl-PL
        - pt-BR
        - pt-PT
        - ro
        - sv
        - sv-SE
        - th
        - th-TH
        - tr
        - tr-TR
        - zh-TW
      example: es-ES
    PromotionID:
      description: PromotionID agreed upon with Netflix. Applies to prepaid promotion integrations.
      type: string
      example: PROMO_ID
    SubscriptionEvent:
      description: Subscription event. Future releases may add new fields without breaking backward compatibility.
      properties:
        bundle_id:
          $ref: '#/components/schemas/BundleID'
        event_type:
          description: Type of subscription event.
          type: string
          example: BUNDLE_ACTIVATION
        netflix_event_id:
          description: Unique ID per event (useful for deduplication).
          type: string
          example: 5a875d71-7deb-4693-a4d0-ae97aac9da8a
        netflix_offer_id:
          $ref: '#/components/schemas/OfferID'
        original_netflix_transaction_id:
          description: Depends on event type. See API docs.
          type: string
          example: e307f177-091a-4840-9830-dda1c29eea44
        partner_account_id:
          $ref: '#/components/schemas/PartnerAccountId'
        partner_reference_id:
          description: Depends on event type. See API docs.
          type: string
          example: e307f177-091a-4840-9830-dda1c29eea44
        timestamp:
          description: Time in seconds since UNIX epoch when event occurred.
          type: integer
          format: int64
          example: 1683710542
    SubscriptionEventType:
      description: Subscription event type
      type: string
      x-extensible-enum:
        - BUNDLE_ACTIVATION
        - BUNDLE_CANCELLATION
        - BUNDLE_DISCONNECTION
        - BUNDLE_ENROLLMENT
        - BUNDLE_PLAN_CHANGE
        - BUNDLE_SUSPENSION
        - BUNDLE_UNSUSPENSION
      example: BUNDLE_ACTIVATION
    SubscriptionId:
      description: Subscription identifier. Corresponds to the Partner Account Identifier (PAI).
      type: string
      example: 4567890123456789
    Token:
      description: Token value is a unique identifier based on UUID
      type: string
      example: 73e90548-b839-423f-be6d-7ed715de656e
    RequestedSecuritizedUrl:
      description: RequestedSecuritizedUrl use token value to reference a Netflix url
      type: string
      example: https://www.sandbox.netflix.com/partner/home?ptoken=73e90548-b839-423f-be6d-7ed715de656e
    TokenErrorURL:
      description: URL where Netflix can redirect the user when token is invalid.
      type: string
      example: https://www.example.com/error/token
    TokenExpiryDate:
      description: Date when token expires in ISO 8601 format.
      type: string
      example: 2023-05-20T14:32:45+02:00
    TokenType:
      description: The token type indicates the purpose of the token and its intended usage.
      type: string
      x-extensible-enum:
        - ACCOUNT_RECOVERY
        - BUNDLE
        - INT_PAY
        - PROMO
      example: BUNDLE
    ValidityDurationInSeconds:
      description: For ACCOUNT_RECOVERY token type only. Up to 24 hours.
      type: integer
      format: int32
      example: 43200
    EndTimestamp:
      description: Timestamp (UNIX epoch seconds) to filter events before a specific time.
      type: integer
      format: int64
      example: 1683796942
    StartTimestamp:
      description: Timestamp (UNIX epoch seconds) to filter events on or after a specific time.
      type: integer
      format: int64
      example: 1683710542

    # HBO Schemas
    Product:
      type: object
      required:
        - code
      properties:
        code:
          $ref: '#/components/schemas/ProductCode'
        name:
          $ref: '#/components/schemas/ProductName'
        starts:
          $ref: '#/components/schemas/ProductStarts'
        renews:
          $ref: '#/components/schemas/ProductRenews'
        expires:
          $ref: '#/components/schemas/ProductExpires'
        sub_id:
          $ref: '#/components/schemas/ProductSubId'
        status:
          $ref: '#/components/schemas/ProductStatus'
        trx_id:
          $ref: '#/components/schemas/TrxId'
    ProductCode:
      description: Alphanumeric URL safe product related unique identifier from partner, length to max 64 characters
      type: string
      example: MAX_AVOD
    ProductName:
      description: The name of the product
      type: string
      example: MAX Ad VOD
    ProductStarts:
      description: Start date/time to indicate since when user has authorization/subscription to the product; number of seconds since Unix Epoch.
      type: integer
      format: int64
      example: 1616425200
    ProductRenews:
      description: Date/time when access to product will be re-evaluated; number of seconds since Unix Epoch.
      type: integer
      format: int64
      example: 1616425200
    ProductExpires:
      description: End date/time to indicate when user will lose the authorization/subscription to the product; number of seconds since Unix Epoch.
      type: integer
      format: int64
      example: 1616425200
    ProductSubId:
      description: The identifier of the subscription in the partner system. In MasMovil is service_id.
      type: string
      example: 1d732753-ae1f-45f8-82f7-7243d395b1ac
    ProductStatus:
      description: Current state of the authorization/subscription {ACTIVE, PENDING, TERMINATED}
      type: string
      enum:
        - ACTIVE
        - PENDING
        - TERMINATED
      example: ACTIVE
    TrxId:
      type: string
      description: ID of the transaction that granted the user access to the product
      example: 1234567890
    CreateSubscriptionHBO:
      required:
        - service_id
        - external_id
        - country
        - products
      properties:
        service_id:
          $ref: '#/components/schemas/ServiceId'
        external_id:
          $ref: '#/components/schemas/ExternalId'
        country:
          $ref: '#/components/schemas/Country'
        products:
          type: array
          items:
            $ref: '#/components/schemas/Product'
    CreateSubscriptionResponseHBO:
      $ref: '#/components/schemas/WorkflowResponse'
    UpdateSubscriptionHBO:
      required:
        - external_id
      properties:
        external_id:
          $ref: '#/components/schemas/ExternalId'
        country:
          $ref: '#/components/schemas/Country'
        reason:
          $ref: '#/components/schemas/ReasonHBO'
        products_to_add:
          type: array
          items:
            $ref: '#/components/schemas/Product'
        products_to_remove:
          type: array
          items:
            $ref: '#/components/schemas/Product'
    UpdateSubscriptionResponseHBO:
      $ref: '#/components/schemas/WorkflowResponse'
    CancelSubscriptionHBO:
      required:
        - external_id
        - reason
        - products
      properties:
        external_id:
          $ref: '#/components/schemas/ExternalId'
        reason:
          $ref: '#/components/schemas/ReasonHBO'
        country:
          $ref: '#/components/schemas/Country'
        products:
          type: array
          items:
            $ref: '#/components/schemas/Product'
    CancelSubscriptionResponseHBO:
      $ref: '#/components/schemas/WorkflowResponse'
    GetSubscriptionResponseHBO:
      type: object
      properties:
        products:
          type: array
          items:
            $ref: '#/components/schemas/Product'
    GenerateActivationUrlHBO:
      required:
        - external_id
        - products
      properties:
        external_id:
          $ref: '#/components/schemas/ExternalId'
        country:
          $ref: '#/components/schemas/Country'
        products:
          type: array
          items:
            $ref: '#/components/schemas/Product'
    GenerateActivationURLResponseHBO:
      properties:
        url:
          $ref: '#/components/schemas/ActivationURL'
    ActivateSubscriptionHBO:
      required:
        - external_id
        - products
      properties:
        external_id:
          $ref: '#/components/schemas/ExternalId'
        country:
          $ref: '#/components/schemas/Country'
        products:
          type: array
          items:
            $ref: '#/components/schemas/Product'
    ActivateSubscriptionResponseHBO:
      $ref: '#/components/schemas/WorkflowResponse'
    ReactivateSubscriptionHBO:
      required:
        - external_id
        - products
      properties:
        external_id:
          $ref: '#/components/schemas/ExternalId'
        country:
          $ref: '#/components/schemas/Country'
        products:
          type: array
          items:
            $ref: '#/components/schemas/Product'
    ReactivateSubscriptionResponseHBO:
      $ref: '#/components/schemas/WorkflowResponse'
    SuspendSubscriptionHBO:
      required:
        - external_id
        - reason
        - products
      properties:
        external_id:
          $ref: '#/components/schemas/ExternalId'
        reason:
          $ref: '#/components/schemas/SuspensionReasonHBO'
        country:
          $ref: '#/components/schemas/Country'
        products:
          type: array
          items:
            $ref: '#/components/schemas/Product'
    SuspendSubscriptionResponseHBO:
      $ref: '#/components/schemas/WorkflowResponse'
    ServiceId:
      description: Service identifier in HBO. Corresponds to Subscription Id.
      type: string
      example: 1234567890123456
    ExternalId:
      description: Partner user identifier in HBO. It's the Id in CRM.
      type: string
      example: 1234567890123456
    Country:
      description: Country code. ISO 3166-1 alpha-2 code.
      type: string
      maxLength: 2
      minLength: 2
      example: ES
    ReasonHBO:
      description: Reason for the cancellation or update of an HBO subscription
      type: string
      enum:
        - PRODUCT_CANCELED
        - PRODUCT_CHANGED
        - OFFER_EXPIRED
      example: PRODUCT_CANCELED
    SuspensionReasonHBO:
      description: Reason for the suspension of an HBO subscription
      type: string
      enum:
        - USER_PAUSED
        - PAYMENT_FAILURE
        - FRAUDULENT_ACTIVITY
      example: USER_PAUSED
    ActivationURL:
      description: Activation URL.
      type: string
      example: https://www.example.com/activation/123

    # Insurance Device Schemas
    InsuranceReconnectRequest:
      type: object
      properties:
        externalReference:
          type: string
          description: Identificador único para la solicitud
        policyNumber:
          type: string
          description: Número de póliza
        phoneNumber:
          type: string
          description: Número del teléfono
        document:
          type: string
          description: Documento del asegurado

    InsuranceSuspendRequest:
      type: object
      properties:
        externalReference:
          type: string
          description: Identificador único para la solicitud
        policyNumber:
          type: string
          description: Número de póliza
        phoneNumber:
          type: string
          description: Número del teléfono
        document:
          type: string
          description: Documento del asegurado

    InsuranceCreationRequestDTO:
      type: object
      properties:
        documentId:
          type: string
          example: 00000000F
        firstName:
          type: string
          example: juan
        lastName1:
          type: string
          example: perez
        lastName2:
          type: string
          example: perez
        msisdn:
          type: string
          example: '666666666'
        address:
          type: string
          example: "paseo de castellana, 4, 002B"
        email:
          type: string
          example: d@g.com
        zipCode:
          type: string
          example: '28000'
        locality:
          type: string
          example: madrid
        province:
          type: string
          example: madrid
        language:
          type: string
          example: >-
            allowed values: es => castellano, eu=> euskera, ga=>gallego,
            ca=>catalán
        sfid:
          type: string
          example: '1234'
        brand:
          type: string
        model:
          type: string
        price:
          type: number
          example: 2.2
        clientType:
          type: string
          example: Autónomo
        invoicePayment:
          type: boolean
        productType:
          type: string
          example: Móvil
        imei:
          type: string
        terminalSaleDate:
          type: string
          example: '2022-01-31T23:00:00Z'
        entity:
          type: string
        officeCode:
          type: string
        dc:
          type: string
        accountNumber:
          type: string
        billingCycle:
          type: string
        salesChannel:
          type: string
      required:
        - documentId
        - firstName
        - email
        - language
        - brand
        - model
        - price

    InsuranceCreationResponseDTO:
      type: object
      properties:
        requestId:
          type: string
        policyNumber:
          type: string
        monthlyFee:
          type: number
          example: 2.2
        annualFee:
          type: number
          example: 2.2
        franchise:
          type: boolean
        franchiseAmount:
          type: number
          example: 2.2
        theft:
          type: boolean
        monthlyNetFee:
          type: number
          example: 2.2
        annualNetFee:
          type: number
          example: 2.2
        annualLea:
          type: number
          example: 2.2
        monthlyLea:
          type: number
          example: 2.2
        annualIps:
          type: number
          example: 2.2
        monthlyIps:
          type: number
          example: 2.2
        annualConsortium:
          type: number
          example: 2.2
        monthlyConsortium:
          type: number
          example: 2.2
        firstAnnualLea:
          type: number
          example: 2.2
        firstMonthlyConsortium:
          type: number
          example: 2.2
        firstAnnualIps:
          type: number
          example: 2.2
        firstAnnualNetFee:
          type: number
          example: 2.2
        firstAnnualFee:
          type: number
          example: 2.2

    CancelInsuranceRequest:
      type: object
      properties:
        policyNumber:
          type: string
          description: Número de póliza
        document:
          type: string
          description: Documento del asegurado
      required:
        - policyNumber

    ActivateInsuranceRequest:
      type: object
      properties:
        externalReference:
          type: string
          description: Referencia externa para la activación
        requestId:
          type: string
          description: Identificador único para la solicitud
        policyNumber:
          type: string
          description: Número de póliza
        imei:
          type: string
          description: IMEI del dispositivo
        document:
          type: string
          description: Documento del asegurado
        subscriptionId:
          type: string
          description: Identificador de la suscripción
      required:
        - requestId
        - policyNumber
        - imei
        - document

    TerminateInsuranceRequest:
      type: object
      properties:
        policyNumber:
          type: string
          description: Número de póliza
        reason:
          type: string
          description: Motivo de la baja
        document:
          type: string
          description: Documento del asegurado
      required:
        - policyNumber

    InsuranceIssueRequestDTO:
      type: object
      properties:
        requestId:
          type: string
          example: 00000000JIUSCS
        policyNumber:
          type: string
          example: 87912HDH
        imei:
          type: string
          example: imei
        msisdn:
          type: string
          example: '666666666'
        document:
          type: string
          example: 000000000K
        subscriptionId:
          type: string
          example: SNMC893CNIE
    InsuranceIssueResponseDTO:
      type: object
      properties:
        requestId:
          type: string
        policyNumber:
          type: string
        monthlyFee:
          type: number
          example: 2.2
        annualFee:
          type: number
          example: 2.2
        franchise:
          type: boolean
        franchiseAmount:
          type: number
          example: 2.2
        theft:
          type: boolean
    InsuranceCancellationRequestDTO:
      type: object
      properties:
        policyNumber:
          type: string
          example: 87912HDH
        document:
          type: string
          example: 000000000K
        reason:
          type: string
          example: Reason is...
    InsuranceCancellationResponseDTO:
      type: object
      properties:
        result:
          type: boolean
    InsuranceInfoResponseDTO:
      type: object
      properties:
        certificateNumber:
          type: string
        imei:
          type: string
        brand:
          $ref: '#/components/schemas/NameDTO'
        model:
          $ref: '#/components/schemas/DescriptionDTO'
        phoneNumber:
          type: string
        document:
          type: string
        firstName:
          type: string
        lastName1:
          type: string
        lastName2:
          type: string
        address:
          type: string
        number:
          type: string
        city:
          type: string
        zipCode:
          type: string
        policyNumber:
          type: string
        province:
          type: string
        effectiveDate:
          type: string
          example: '2022-01-31T23:00:00Z'
        email:
          type: string
        sold:
          type: boolean
        cancelled:
          type: boolean
        cancellationDate:
          type: string
          example: '2022-01-31T23:00:00Z'
        serialNumber:
          type: string
        paymentMethod:
          $ref: '#/components/schemas/DescriptionDTO'
        clientType:
          $ref: '#/components/schemas/NameDTO'
        billPayment:
          type: boolean
        withdrawal:
          type: boolean
        withdrawalDate:
          type: string
          example: '2022-01-31T23:00:00Z'
        emitted:
          type: boolean
        language:
          $ref: '#/components/schemas/NameDTO'
        accident:
          type: boolean
    NameDTO:
      type: object
      properties:
        name:
          type: string
    DescriptionDTO:
      type: object
      properties:
        description:
          type: string
    errorResponseDto:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    ProcessResponse:
      type: object
      properties:
        message:
          type: string
          example: message
        processId:
          type: string
          example: processId
      description: Rest service success process response

    # Orange TV Standalone schemas
    ActivateSubscriptionOrangeStandalone:
      required:
        - firstName
        - maxTerminals
        - spId
        - customerType
        - experience
      properties:
        email:
          type: string
          nullable: true
          example: email@email.com
        firstName:
          type: string
          example: First name
        lastName:
          type: string
          nullable: true
          example: Last name
        maxTerminals:
          type: string
          example: max terminals
        password:
          type: string
          nullable: true
          example: pass1234
        postalCode:
          type: string
          nullable: true
          example: "987564"
        phoneNumber:
          type: string
          nullable: true
          example: +40828383874
        spId:
          type: string
          example: spId
        spendingLimit:
          type: number
          nullable: true
          example: 1234554
        customerType:
          type: string
          example: iptv/ott
        servicePlan:
          type: array
          nullable: true
          items:
            type: string
          example: ["spId-1", "spId-2"]
        externalId:
          type: string
          nullable: true
          example: external_subscription_12345
        experience:
          $ref: '#/components/schemas/ExperienceOrangeStandalone'
        maxstb:
          type: string
          nullable: true
          example: "1"
    ModifySubscriptionOrangeStandalone:
      required:
        - servicePlanToAdd
        - servicePlanToDelete
        - experience
      properties:
        servicePlanToAdd:
          type: array
          items:
            type: string
          example: ["spId-1", "spId-2"]
        servicePlanToDelete:
          type: array
          items:
            type: string
          example: ["spId-3"]
        experience:
          $ref: '#/components/schemas/ExperienceOrangeStandalone'
        externalId:
          type: string
          nullable: true
          example: external_subscription_12345
    SuspendSubscriptionOrangeStandalone:
      required:
        - experience
      properties:
        experience:
          $ref: '#/components/schemas/ExperienceOrangeStandalone'
        externalId:
          type: string
          nullable: true
          example: external_subscription_12345
    ReactivateSubscriptionOrangeStandalone:
      required:
        - experience
      properties:
        experience:
          $ref: '#/components/schemas/ExperienceOrangeStandalone'
        externalId:
          type: string
          nullable: true
          example: external_subscription_12345
    ModifyCustomerOrangeStandalone:
      required:
        - experience
      properties:
        password:
          type: string
          nullable: true
          example: pass1234
        parentalPin:
          type: string
          nullable: true
          example: "1234"
        email:
          type: string
          nullable: true
          example: email@email.com
        postalCode:
          type: string
          nullable: true
          example: "987564"
        spendingLimit:
          type: number
          nullable: true
          example: 1234554
        experience:
          $ref: '#/components/schemas/ExperienceOrangeStandalone'
        maxstb:
          type: string
          nullable: true
          example: "1"
    GetDevicesResponseOrangeStandalone:
      type: array
      items:
        $ref: '#/components/schemas/TerminalOrangeStandalone'
    TerminalOrangeStandalone:
      properties:
        macAddress:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        modelExternalId:
          type: string
          nullable: true
        registrationDate:
          type: string
          nullable: true
        serialNumber:
          type: string
          nullable: true
        vua:
          type: string
          nullable: true
        stbSn:
          type: string
          nullable: true
    ExperienceOrangeStandalone:
      description: Tv flavour
      type: string
      example: VuelaTV