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

# Approve order

> Approve an order that requires admin or manager approval. Only orders in PENDING_APPROVAL
status can be approved. The approving user must have the appropriate role for the approval
type required by the order.




## OpenAPI

````yaml /api-reference/bundled_openapi.json post /orders/{orderId}/approve
openapi: 3.1.0
info:
  title: Telness Tech Connect
  version: 2.0.0-alpha
  description: >
    Telness Tech Connect API provides all you need to own your user's
    connectivity experience.


    Go back to [Telnesstech.com](https://telnesstech.com)
servers:
  - url: https://apiv2.example.com
    description: Connect API URL for your domain
security:
  - apiKey: []
  - bearerAuth: []
    apiKey: []
tags:
  - name: Auth
    description: Authenticate users and obtain access tokens.
  - name: Users
    description: Manage users.
  - name: Customers
    description: Manage customers.
  - name: Subscriptions
    description: Manage subscriptions and subscription.
  - name: Subscription Addons
    description: Manage subscription addons.
  - name: Subscription Usage
    description: Get subscription usage.
  - name: Subscribers
    description: Manage subscribers.
  - name: Licenses
    description: Manage licenses.
  - name: Product Offerings
    description: Browse product offerings.
  - name: Product Catalogs
    description: Browse product catalogs.
  - name: Product Discounts
    description: Discounts and promotions.
  - name: Orders
    description: Manage orders and line items.
  - name: Payment Intents
    description: >-
      Inspect payment intents, the money collected over card rails for orders
      and renewals.
  - name: Payment Links
    description: Create and manage payment links for orders and invoices.
  - name: Payment Sessions
    description: Create and manage payment sessions for orders.
  - name: Payment Profiles
    description: Manage customer payment profiles and methods.
  - name: Payment Profile Sessions
    description: Create sessions for setting up payment profiles.
  - name: Signing sessions
    description: Handle contract signing sessions for postpaid orders.
  - name: Porting
    description: Manage number porting for subscriptions.
  - name: Taxes
    description: Calculate taxes for products and line items.
  - name: Invoices
    description: Manage invoices and invoice items.
  - name: Tools
    description: >-
      Tools for address validation, number porting, device info, and network
      coverage.
  - name: Inventory
    description: Manage phone number inventory, SIM cards, and reservations.
  - name: Workflows
    description: Dynamic processing of customer journeys and events.
paths:
  /orders/{orderId}/approve:
    post:
      tags:
        - Orders
      summary: Approve order
      description: >
        Approve an order that requires admin or manager approval. Only orders in
        PENDING_APPROVAL

        status can be approved. The approving user must have the appropriate
        role for the approval

        type required by the order.
      operationId: approveOrder
      parameters:
        - name: orderId
          in: path
          required: true
          description: The unique identifier of the order
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApproveOrderRequest'
      responses:
        '200':
          description: Order approved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    ApproveOrderRequest:
      type: object
      description: >-
        Approve an order that requires admin or manager approval before
        fulfillment can proceed.
      additionalProperties: false
      properties:
        comment:
          type: string
          maxLength: 1000
          description: Optional comment explaining the approval decision.
          example: Approved after reviewing customer credit check
    Order:
      type: object
      description: >
        A shopping cart for telecommunications services and products. Add line
        items to configure

        services, get pricing, and submit for fulfillment. Orders track progress
        from creation through completion.
      required:
        - orderId
        - state
        - lineItems
        - validation
        - requirements
        - createdAt
        - expiresAt
        - updatedAt
      additionalProperties: false
      properties:
        orderId:
          type: string
          description: Unique identifier for the order.
          example: order-123
        state:
          $ref: '#/components/schemas/OrderState'
        user:
          $ref: '#/components/schemas/OrderUserResult'
        customer:
          $ref: '#/components/schemas/OrderCustomerResult'
        billing:
          $ref: '#/components/schemas/OrderBilling'
        shipping:
          $ref: '#/components/schemas/Shipping'
        promoCode:
          type: string
          description: Promotional code applied to this order, if any.
          example: STUDENT2024
        paymentSessionId:
          type: string
          description: >-
            The payment session that collected payment for this order, set when
            the order was submitted with one.
          example: d2e3f4a5-b6c7-8901-2345-012345678901
        paymentProfileSessionId:
          type: string
          description: >-
            The payment profile session used to set up a payment method for this
            order, set when the order was submitted with one.
          example: 69321a62-f1fe-461f-8761-a19ae6587bb2
        signingSessionId:
          type: string
          description: >-
            The signing session that captured the customer's signature for this
            order, set when the order was submitted with one.
          example: 8f3b1c2d-4e5f-6789-abcd-1234567890ef
        consents:
          $ref: '#/components/schemas/Consents'
        lineItems:
          type: array
          description: Line items in the order.
          items:
            $ref: '#/components/schemas/OrderLineItem'
        pricing:
          $ref: '#/components/schemas/OrderPricingSummary'
        validation:
          type: object
          description: Validation status of the order and its line items.
          additionalProperties: false
          required:
            - isValid
          properties:
            isValid:
              type: boolean
              description: Whether the order is valid and ready for submission.
              example: false
            missingFields:
              type: array
              description: Required fields that are still missing.
              items:
                type: string
              example:
                - customer
                - billing.address
            errors:
              type: array
              description: Order-level validation errors.
              items:
                $ref: '#/components/schemas/InlineValidationError'
            lineItemValidation:
              type: array
              description: Validation status for each line item.
              items:
                type: object
                additionalProperties: false
                properties:
                  lineItemId:
                    type: string
                    description: Reference to the line item.
                    example: line-item-1
                  isValid:
                    type: boolean
                    description: Whether this line item is valid.
                    example: false
                  missingFields:
                    type: array
                    description: Required fields that are still missing.
                    items:
                      type: string
                    example:
                      - subscriber.name
                      - sim.iccid
                  errors:
                    type: array
                    description: Validation errors for this line item.
                    items:
                      $ref: '#/components/schemas/InlineValidationError'
        requirements:
          type: object
          description: >
            Requirements to submit the order. All listed requirements must be
            met before the order can be submitted.


            What is required depends on platform configuration and the contents
            of the order.


            For example, a prepaid order with only free items would not require
            payment, it could however require card capture.

            Postpaid orders typically either require card capture or signing.
          additionalProperties: false
          properties:
            requiresPayment:
              $ref: '#/components/schemas/OrderRequirement'
              description: >-
                Whether this order requires payment before submission. If
                required, a paymentSessionId must be provided when submitting
                the order.
            requiresPaymentProfile:
              $ref: '#/components/schemas/OrderRequirement'
              description: >-
                Whether this order requires saving a payment profile for future
                billing. If required, a paymentProfileSessionId must be provided
                when submitting the order.
            requiresSigning:
              $ref: '#/components/schemas/OrderRequirement'
              description: >-
                Whether this order requires digital signing. If required, a
                signingSessionId must be provided when submitting the order.
        externalPayment:
          type: object
          description: External payment details if the order was paid outside the system.
          additionalProperties: false
          properties:
            reference:
              type: string
              description: Reference from the external payment system.
              example: ext-payment-ref-123
            receiptDescription:
              type: string
              description: Description of the external payment.
              example: Payment via external billing system
            receiptUrl:
              type: string
              format: uri
              description: URL to the external payment receipt.
              example: https://external.example.com/receipts/123
            receivedAt:
              type: string
              format: date-time
              description: When the external payment was recorded.
              example: '2024-01-15T14:30:00Z'
        expiresAt:
          type: string
          format: date-time
          description: >-
            When the order expires if not submitted (automatically refreshed on
            each order update to maintain active session).
          example: '2024-01-22T10:30:00Z'
        submittedAt:
          type: string
          format: date-time
          description: When the order was submitted for fulfillment.
          example: '2024-01-15T14:30:00Z'
        completedAt:
          type: string
          format: date-time
          description: When the order was completed.
          example: '2024-01-15T15:00:00Z'
        createdEntities:
          type: object
          description: Entities created as part of order fulfillment.
          additionalProperties: false
          properties:
            subscriptions:
              type: array
              description: Subscriptions created during order fulfillment.
              items:
                allOf:
                  - $ref: '#/components/schemas/SubscriptionListItem'
                  - required:
                      - createdByLineItem
                    additionalProperties: false
                    properties:
                      createdByLineItem:
                        type: string
                        description: Line item ID that created this subscription.
                        example: f47ac10b-58cc-4372-a567-0e02b2c3d479
            licenses:
              type: array
              description: Licenses created during order fulfillment.
              items:
                allOf:
                  - $ref: '#/components/schemas/LicenseListItem'
                  - required:
                      - createdByLineItem
                    additionalProperties: false
                    properties:
                      createdByLineItem:
                        type: string
                        description: Line item ID that created this license.
                        example: g47ac10b-58cc-4372-a567-0e02b2c3d479
            addons:
              type: array
              description: Add-ons created during order fulfillment.
              items:
                allOf:
                  - $ref: '#/components/schemas/SubscriptionAddonListItem'
                  - required:
                      - createdByLineItem
                    additionalProperties: false
                    properties:
                      createdByLineItem:
                        type: string
                        description: Line item ID that created this add-on.
                        example: h47ac10b-58cc-4372-a567-0e02b2c3d479
            modifications:
              type: array
              description: Modifications applied during order fulfillment.
              items:
                allOf:
                  - $ref: '#/components/schemas/OrderModification'
                  - required:
                      - createdByLineItem
                    additionalProperties: false
                    properties:
                      createdByLineItem:
                        type: string
                        description: Line item ID that created this modification.
                        example: i47ac10b-58cc-4372-a567-0e02b2c3d479
        createdAt:
          type: string
          format: date-time
          description: When the order was created.
          example: '2024-01-15T10:00:00Z'
        updatedAt:
          type: string
          format: date-time
          description: When the order was last updated.
          example: '2024-01-15T10:30:00Z'
        metadata:
          $ref: '#/components/schemas/Metadata'
    OrderState:
      type: string
      description: |
        The status of an order in its lifecycle.

        - PENDING: Order is in cart state, can be modified
        - PENDING_PAYMENT: Order is locked and awaiting payment completion
        - SUBMITTED: Order has been submitted for processing
        - PENDING_APPROVAL: Order is pending approval
        - PROCESSING: Order is being fulfilled
        - COMPLETED: Order has been successfully fulfilled
        - CANCELLED: Order was cancelled before completion
        - EXPIRED: Order expired due to inactivity
        - FAILED: Order fulfillment failed
      enum:
        - PENDING
        - PENDING_PAYMENT
        - SUBMITTED
        - PENDING_APPROVAL
        - PROCESSING
        - COMPLETED
        - CANCELLED
        - EXPIRED
        - FAILED
    OrderUserResult:
      type: object
      description: >
        The user associated with this order. Includes minimal details about the
        user

        and creation details if the user was created during order fulfillment.
      additionalProperties: false
      properties:
        userId:
          type: string
          description: The user ID (existing or newly created).
          example: c47ac10b-58cc-4372-a567-0e02b2c3d479
        name:
          type: string
          description: User full name, only returned for new users.
          example: John Doe
        newUser:
          type: boolean
          description: >-
            Indicates if the user was/will be created as part of order
            fulfillment.
          example: true
      required:
        - userId
        - email
        - newUser
    OrderCustomerResult:
      type: object
      description: >
        The customer associated with this order. Includes minimal details about
        the customer

        and creation details if the customer was created during order
        fulfillment.
      additionalProperties: false
      properties:
        customerId:
          type: string
          description: The customer ID (existing or newly created when created).
          example: b47ac10b-58cc-4372-a567-0e02b2c3d479
        customerType:
          $ref: '#/components/schemas/CustomerType'
        name:
          type: string
          description: Customer name.
          example: John Doe
        newCustomer:
          type: boolean
          description: >-
            Indicates if the customer was/will be created as part of order
            fulfillment.
          example: true
      required:
        - customerType
        - name
        - newCustomer
    OrderBilling:
      type: object
      description: >
        Billing information for an order.


        For existing customers, we suggest you pre-fill this with the customer's
        billing information,

        however it is possible to override this at the order level.
      additionalProperties: false
      properties:
        name:
          type: string
          description: Billing contact name.
          example: John Doe
        email:
          type: string
          format: email
          description: Billing contact email.
          example: billing@example.com
        address:
          $ref: '#/components/schemas/Address'
    Shipping:
      type: object
      description: >-
        Shipping information for order fulfillment. Only required if the order
        contains shippable items.
      required:
        - name
        - address
      additionalProperties: false
      properties:
        name:
          type: string
          description: Name of the shipping recipient.
          example: John Doe
        msisdn:
          type: string
          format: phone
          description: Phone number for delivery contact.
          example: '+15551234567'
        address:
          $ref: '#/components/schemas/Address'
        instructions:
          type: string
          description: Special delivery instructions.
          example: Leave at front door
    Consents:
      type: object
      description: Customer consents and acknowledgments.
      additionalProperties:
        type: string
      example:
        termsOfService: 'true'
        marketing: 'true'
    OrderLineItem:
      description: A line item in an order representing a billable action or service.
      oneOf:
        - $ref: '#/components/schemas/SubscriptionLineItem'
        - $ref: '#/components/schemas/LicenseLineItem'
        - $ref: '#/components/schemas/AddonLineItem'
        - $ref: '#/components/schemas/ExternalProductLineItem'
        - $ref: '#/components/schemas/ExternalLineItem'
        - $ref: '#/components/schemas/SubscriptionChangeLineItem'
        - $ref: '#/components/schemas/LicenseChangeLineItem'
        - $ref: '#/components/schemas/AddonChangeLineItem'
      discriminator:
        propertyName: type
        mapping:
          SUBSCRIPTION:
            $ref: '#/components/schemas/SubscriptionLineItem'
          LICENSE:
            $ref: '#/components/schemas/LicenseLineItem'
          ADDON:
            $ref: '#/components/schemas/AddonLineItem'
          EXTERNAL_PRODUCT:
            $ref: '#/components/schemas/ExternalProductLineItem'
          EXTERNAL:
            $ref: '#/components/schemas/ExternalLineItem'
          SUBSCRIPTION_CHANGE:
            $ref: '#/components/schemas/SubscriptionChangeLineItem'
          LICENSE_CHANGE:
            $ref: '#/components/schemas/LicenseChangeLineItem'
          ADDON_CHANGE:
            $ref: '#/components/schemas/AddonChangeLineItem'
    OrderPricingSummary:
      type: object
      description: >
        The price of an order. In regions with complex tax rules (e.g., the US),
        you need to call the price calculation endpoint

        to get accurate tax amounts before submitting the order. In other
        regions, tax is dependent on customer type but typically

        included.
      required:
        - total
        - currency
        - calculatedAt
      additionalProperties: false
      properties:
        subtotal:
          type: number
          format: decimal
          description: Subtotal before taxes and fees.
          example: 125.99
        taxAmount:
          type: number
          format: decimal
          description: |
            Tax amount for the order.
            Set to 0 for orders that will be invoiced separately.
          example: 10.08
        fees:
          type: number
          format: decimal
          description: Setup fees, activation fees, processing fees, etc.
          example: 1.32
        total:
          type: number
          format: decimal
          description: Total amount due for the order.
          example: 137.39
        taxIncluded:
          type: boolean
          description: Whether taxes are included in the total.
          example: true
        currency:
          type: string
          description: Currency for all pricing amounts.
          example: USD
        recurringCosts:
          type: object
          description: |
            Expected recurring costs after the initial period.
            Represents the typical monthly/billing cycle charges.
          additionalProperties: false
          properties:
            subtotal:
              type: number
              format: decimal
              description: Recurring subtotal before taxes.
              example: 29.99
            total:
              type: number
              format: decimal
              description: Total estimated recurring amount.
              example: 32.39
            taxAmount:
              type: number
              format: decimal
              description: >
                Estimated tax on recurring charges.


                Only calculated in certain regions. In the US, taxes are
                calculated at

                the time of invoicing and are not estimated here.
              example: 2.4
            taxIncluded:
              type: boolean
              description: Whether taxes are included in the total.
              example: true
            billingCycle:
              $ref: '#/components/schemas/BillingCycle'
        initialInvoice:
          type: object
          description: >
            Optional breakdown for the first invoice when different from
            recurring.

            Used for prorated charges, first-month adjustments, etc.
          additionalProperties: false
          properties:
            subtotal:
              type: number
              format: decimal
              description: First invoice subtotal (e.g., prorated amount, setup fees).
              example: 14.5
            total:
              type: number
              format: decimal
              description: Total first invoice amount.
              example: 15.66
            taxAmount:
              type: number
              format: decimal
              description: >
                Estimated tax on initial invoice charges.


                Only calculated in certain regions. In the US, taxes are
                calculated at

                the time of invoicing and are not estimated here.
            taxIncluded:
              type: boolean
              description: Whether taxes are included in the total.
              example: true
            period:
              type: object
              description: Period covered by the initial invoice.
              additionalProperties: false
              properties:
                start:
                  type: string
                  format: date
                  x-ogen-type: telnesstech.com/apiv2/apiv2types.Date
                  description: Start date of the initial billing period.
                  example: '2024-01-15'
                end:
                  type: string
                  format: date
                  x-ogen-type: telnesstech.com/apiv2/apiv2types.Date
                  description: End date of the initial billing period.
                  example: '2024-01-31'
        calculatedAt:
          type: string
          format: date-time
          description: When the pricing was last calculated.
          example: '2024-01-15T10:30:00Z'
    InlineValidationError:
      type: object
      required:
        - message
      additionalProperties: false
      properties:
        message:
          type: string
          description: Validation error message.
        property:
          type: string
          description: >-
            Property related to the error, if applicable. May be nested using
            dot notation (e.g., "customer.email").
    OrderRequirement:
      type: string
      enum:
        - NOT_REQUIRED
        - OPTIONAL
        - REQUIRED
    SubscriptionListItem:
      type: object
      description: >-
        Simplified subscription representation optimized for list operations.
        Use the detailed Subscription schema for individual subscription views.
      required:
        - subscriptionId
        - status
        - type
        - display
        - msisdn
        - customerId
        - productOfferingId
        - subscriberId
        - activatedAt
        - createdAt
        - updatedAt
      properties:
        subscriptionId:
          type: string
          description: The unique identifier for the subscription.
        status:
          $ref: '#/components/schemas/SubscriptionStatus'
        type:
          $ref: '#/components/schemas/SubscriptionType'
        display:
          type: string
          description: >-
            The display name for the subscription, typically a pretty-print of
            the msisdn.
        msisdn:
          type: string
          description: The currently active phone number for this subscription.
        customerId:
          type: string
          description: The unique identifier for the customer who owns this subscription.
        productOfferingId:
          type: string
          description: >-
            The unique identifier for the product offering associated with this
            subscription.
        subscriberId:
          type: string
          description: >-
            The unique identifier for the subscriber associated with this
            subscription.
        activatedAt:
          type: string
          format: date-time
          description: The date and time when the subscription was activated.
        cancelledAt:
          type: string
          format: date-time
          description: >-
            The date and time when the subscription was cancelled (if
            applicable).
        createdAt:
          type: string
          format: date-time
          description: The date and time when the subscription was created.
        updatedAt:
          type: string
          format: date-time
          description: The date and time when the subscription was last updated.
    LicenseListItem:
      type: object
      description: >-
        Simplified license representation optimized for list operations. Use the
        detailed License schema for individual license views.
      required:
        - licenseId
        - status
        - type
        - customerId
        - productOfferingId
        - activatedAt
        - createdAt
        - updatedAt
      properties:
        licenseId:
          type: string
          description: The unique identifier for the license.
        status:
          $ref: '#/components/schemas/LicenseStatus'
        type:
          $ref: '#/components/schemas/LicenseType'
        customerId:
          type: string
          description: The unique identifier for the customer who owns this license.
        productOfferingId:
          type: string
          description: >-
            The unique identifier for the product offering associated with this
            license.
        assignedTo:
          $ref: '#/components/schemas/AssignedTo'
        activatedAt:
          type: string
          format: date-time
          description: The date when the license was activated.
        cancelledAt:
          type: string
          format: date-time
          description: The date when the license was cancelled (if applicable).
        pausedAt:
          type: string
          format: date
          x-ogen-type: telnesstech.com/apiv2/apiv2types.Date
          description: The date when the license was paused (if applicable).
    SubscriptionAddonListItem:
      type: object
      description: An add-on option for a subscription.
      required:
        - productOffering
        - status
      additionalProperties: false
      properties:
        productOfferingId:
          type: string
          description: The unique identifier for the product offering.
        referenceId:
          type: string
          description: >
            A reference identifier provided by API clients or upstream provider
            integrations

            to identify this subscription add-on in their own systems. Unique
            per tenant when

            set. Use this field to look up add-ons by your external identifier
            (for example a

            provider-side package ID). Typically populated by a workflow once
            the add-on has

            been provisioned with the underlying network provider.
          example: telna-package-12345
          maxLength: 255
        status:
          $ref: '#/components/schemas/SubscriptionAddonStatus'
        productOfferingGroupId:
          type: string
          description: The unique identifier for the product offering group.
        licenseId:
          type: string
          description: >-
            The unique identifier of the license associated with this add-on (if
            applicable).
        addedAt:
          type: string
          format: date-time
          description: The date and time when the add-on was added to the subscription.
        updatedAt:
          type: string
          format: date-time
          description: The date and time when the add-on was last updated.
        cancelledAt:
          type: string
          format: date-time
          description: The date and time when the add-on was cancelled (if applicable).¨
        metadata:
          $ref: '#/components/schemas/Metadata'
    OrderModification:
      type: object
      description: A modification applied to an existing service during order fulfillment.
      required:
        - type
        - targetId
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - SUBSCRIPTION_CHANGE
            - LICENSE_CHANGE
            - ADDON_CHANGE
          description: Type of modification applied.
        targetId:
          type: string
          description: ID of the entity that was modified.
          example: e8174435-6378-4be5-a9f5-8b4aaadae5d4
        newProductOfferingId:
          type: string
          description: New product offering ID (for changes).
          example: po_mobile_premium_plus
        appliedAt:
          type: string
          format: date-time
          description: When the modification was applied.
    Metadata:
      type: object
      additionalProperties:
        type: string
      description: >
        A set of key-value pairs that can be attached to an object for storing
        additional information in a semi-structured format.
    Error:
      type: object
      required:
        - message
        - code
      properties:
        message:
          type: string
          description: A human-readable message providing more details about the error.
        code:
          type: string
          description: A machine-readable code for the error.
        details:
          type: array
          description: Additional details about the error.
          items:
            type: object
            required:
              - message
              - code
            properties:
              message:
                type: string
                description: >-
                  A human-readable message providing more details about the
                  error.
              code:
                type: string
                description: A machine-readable code for the specific detail.
              property:
                type: string
                description: The property or field related to the error.
              suggestion:
                $ref: '#/components/schemas/Any'
                description: >
                  A suggested value for the particular property.


                  For example, this may be set when validating an address with
                  an alias, suggesting the expected value by the operator.
        hint:
          type: string
          description: A hint to help resolve the error.
    CustomerType:
      type: string
      description: The type of customer.
      enum:
        - CONSUMER
        - BUSINESS
    Address:
      type: object
      required:
        - street1
        - city
        - zip
        - country
      properties:
        street1:
          type: string
          description: The first line of the address, typically street and house number.
          example: 500 S Main St
        street2:
          type: string
          description: >-
            The second line of the address, typically apartment, suite, unit,
            building, floor, etc.
          example: Apt 1
        city:
          type: string
          description: The city or municipality of the address.
          example: Natick
        zip:
          type: string
          description: >
            The zip code of the address.


            Depending on the country, this may be referred to as a postal code
            or postcode.


            Specifically for US addresses, the zip can include the optional
            four-digit extension (e.g., '27604-5121').
          example: '01701'
        country:
          type: string
          description: >-
            The two-letter country abbreviation (e.g., 'US' for United States,
            'SE' for Sweden).
          pattern: ^[A-Z]{2}$
          example: US
        state:
          type: string
          description: >-
            For countries that use states or regions, the state or
            administrative area code (e.g., 'CA' for California in the United
            States).
          example: CA
        region:
          type: string
          description: >-
            A province, region, or territory name, applicable in certain
            countries (e.g., 'Ontario' in Canada, 'Sindh' in Pakistan).
        attention:
          type: string
          description: >-
            An optional line for specifying a person, department, or attention
            to a specific entity within an address.
    SubscriptionLineItem:
      type: object
      title: Subscription
      description: >-
        Create a new subscription in this order. This will set up a new phone
        service for a customer with their chosen plan and phone number.
      required:
        - type
        - lineItemId
        - productOfferingId
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - SUBSCRIPTION
          description: Line item type discriminator.
        lineItemId:
          type: string
          description: Unique identifier for this line item within the order.
          example: line-item-1
        productOfferingId:
          type: string
          description: The product offering to create a subscription for.
          example: mobile-plan-basic
        msisdn:
          type: string
          description: >
            The phone number for this subscription.

            - Leave empty to have one assigned.

            - When the number pool is available, you can choose a number from
            the pool and provide the leaseToken.

            - When porting a number, provide the number and porting details.
          example: '+15551234567'
        leaseToken:
          type: string
          description: >-
            Token received when leasing a number. Required when an msisdn is
            provided from the number pool.
        tempNumber:
          type: boolean
          description: >
            Whether to use a temporary number until the porting is completed.


            If true, a temporary number will be assigned and activated as soon
            as possible until the porting is finalized.


            Can only be used when porting in a number (i.e., when msisdn and
            porting details are provided).
        portingRequested:
          type: boolean
          description: If true, the number is a port-in.
        porting:
          type: object
          description: Details needed to port in a number for this subscription.
          required:
            - details
          additionalProperties: false
          properties:
            details:
              $ref: '#/components/schemas/PortingDetails'
        extensions:
          type: object
          description: >-
            Additional subscription extensions fields for custom subscription
            types.
          additionalProperties:
            type: string
        display:
          type: string
          description: >-
            Custom display name for the subscription. If not provided, will be
            auto-generated from msisdn.
        subscriber:
          type: object
          description: Subscriber information (required eventually).
          additionalProperties: false
          properties:
            name:
              type: string
              description: Name of the subscriber.
              example: John Doe
            email:
              type: string
              format: email
              description: Contact email of the subscriber.
              example: john.doe@example.com
            msisdn:
              type: string
              format: phone
              description: >-
                Contact phone number of the subscriber. May be the same as the
                subscription's msisdn.
              example: '+15551234567'
            address:
              $ref: '#/components/schemas/Address'
              description: >
                The address of the subscriber. Depending on local regulations,
                this may be required for certain subscriptions.


                In the US, this is the E911 address.
        sim:
          type: object
          description: SIM configuration (required eventually).
          additionalProperties: false
          required:
            - esim
          properties:
            esim:
              type: boolean
              description: Whether this subscription should use eSIM technology.
              example: true
            imei:
              type: string
              description: |
                International Mobile Equipment Identity for eSIM activation.

                Some networks require this to activate the eSIM.
              example: '356938035643809'
            iccid:
              type: string
              description: |
                Integrated Circuit Card identifier for existing SIM.
                Provide if using a pre-existing SIM card.

                This feature only applies to certain networks.
              example: '8931440400000000000'
        scheduleActivationAt:
          type: string
          format: date
          x-ogen-type: telnesstech.com/apiv2/apiv2types.Date
          description: Date when the subscription should be activated.
          example: '2024-02-01'
        metadata:
          $ref: '#/components/schemas/Metadata'
        status:
          $ref: '#/components/schemas/OrderLineItemStatus'
          readOnly: true
          description: Server-resolved fulfillment status for this line item.
    LicenseLineItem:
      type: object
      title: License
      description: Line item for creating a new license.
      required:
        - type
        - lineItemId
        - productOfferingId
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - LICENSE
          description: Line item type discriminator.
        lineItemId:
          type: string
          description: Unique identifier for this line item within the order.
          example: line-item-2
        productOfferingId:
          type: string
          description: The product offering to create a license for.
          example: license-premium
        details:
          type: object
          description: Additional license details specific to certain license types.
          additionalProperties: true
        scheduleActivationAt:
          type: string
          format: date
          x-ogen-type: telnesstech.com/apiv2/apiv2types.Date
          description: When to activate the license.
          example: '2024-02-01'
        parentLineItemId:
          type: string
          description: >-
            Reference to parent line item in this order this license is assigned
            to.
          example: line-item-1
        metadata:
          $ref: '#/components/schemas/Metadata'
        status:
          $ref: '#/components/schemas/OrderLineItemStatus'
          readOnly: true
          description: Server-resolved fulfillment status for this line item.
    AddonLineItem:
      type: object
      title: Add-on
      description: Line item for adding an add-on to a subscription.
      required:
        - type
        - lineItemId
        - productOfferingId
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - ADDON
          description: Line item type discriminator.
        lineItemId:
          type: string
          description: Unique identifier for this line item within the order.
          example: line-item-3
        productOfferingId:
          type: string
          description: The add-on product offering to add.
          example: addon-data-5gb
        subscriptionId:
          type: string
          description: |
            An existing subscription to add the add-on to.

            Either this or `parentLineItemId` must be provided.
          example: subscription-456
        parentLineItemId:
          type: string
          description: |
            Reference to parent subscription line item in this same order.

            Either this or `subscriptionId` must be provided.
          example: line-item-1
        scheduledAt:
          type: string
          format: date
          x-ogen-type: telnesstech.com/apiv2/apiv2types.Date
          description: When to activate the add-on.
          example: '2024-02-01'
        metadata:
          $ref: '#/components/schemas/Metadata'
        status:
          $ref: '#/components/schemas/OrderLineItemStatus'
          readOnly: true
          description: Server-resolved fulfillment status for this line item.
    ExternalProductLineItem:
      type: object
      title: External Product
      description: Line item for external product from catalog with external fulfillment.
      required:
        - type
        - lineItemId
        - productOfferingId
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - EXTERNAL_PRODUCT
          description: Line item type discriminator.
        lineItemId:
          type: string
          description: Unique identifier for this line item within the order.
          example: line-item-5
        productOfferingId:
          type: string
          description: The external product offering from the catalog.
          example: external-device-iphone15
        quantity:
          type: integer
          minimum: 1
          description: Quantity of the external product.
          example: 2
        parentLineItemId:
          type: string
          description: Reference to parent line item in this order.
          example: line-item-1
        metadata:
          $ref: '#/components/schemas/Metadata'
        status:
          $ref: '#/components/schemas/OrderLineItemStatus'
          readOnly: true
          description: Server-resolved fulfillment status for this line item.
    ExternalLineItem:
      type: object
      title: External Item
      description: >-
        Line item for custom external item with which allows for selling
        externally managed products.
      required:
        - type
        - lineItemId
        - name
        - price
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - EXTERNAL
          description: Line item type discriminator.
        lineItemId:
          type: string
          description: Unique identifier for this line item within the order.
          example: line-item-6
        name:
          type: string
          description: Name of the external item.
          example: Custom Installation Service
        description:
          type: string
          description: Description of the external item.
          example: Professional on-site installation and setup
        price:
          type: object
          description: Custom pricing for the external item.
          required:
            - amount
            - currency
          additionalProperties: false
          properties:
            amount:
              type: number
              format: decimal
              description: Price amount.
              example: 99.99
            currency:
              type: string
              description: Currency code.
              example: USD
        quantity:
          type: integer
          minimum: 1
          description: Quantity of the external item.
          example: 1
        taxationId:
          type: string
          description: US taxation ID for tax calculation.
          example: TAX123456
        fulfillmentWebhook:
          type: string
          format: uri
          description: Optional webhook URL for fulfillment notifications.
          example: https://partner.com/webhooks/fulfillment
        parentLineItemId:
          type: string
          description: Reference to parent line item in this order.
          example: line-item-1
        metadata:
          $ref: '#/components/schemas/Metadata'
        status:
          $ref: '#/components/schemas/OrderLineItemStatus'
          readOnly: true
          description: Server-resolved fulfillment status for this line item.
    SubscriptionChangeLineItem:
      type: object
      title: Subscription Change
      description: Line item for changing a subscription's product offering.
      required:
        - type
        - lineItemId
        - subscriptionId
        - productOfferingId
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - SUBSCRIPTION_CHANGE
          description: Line item type discriminator.
        lineItemId:
          type: string
          description: Unique identifier for this line item within the order.
          example: line-item-7
        subscriptionId:
          type: string
          description: The subscription to modify.
          example: subscription-456
        productOfferingId:
          type: string
          description: New product offering to change to.
          example: mobile-plan-premium
        scheduleDate:
          type: string
          format: date
          x-ogen-type: telnesstech.com/apiv2/apiv2types.Date
          description: >-
            Earliest date to perform the change on. If the change schedule
            doesn't fit this date, the earliest date after this will be chosen.
          example: '2024-02-01'
        metadata:
          $ref: '#/components/schemas/Metadata'
        status:
          $ref: '#/components/schemas/OrderLineItemStatus'
          readOnly: true
          description: Server-resolved fulfillment status for this line item.
    LicenseChangeLineItem:
      type: object
      title: License Change
      description: Line item for changing a license's product offering.
      required:
        - type
        - lineItemId
        - licenseId
        - productOfferingId
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - LICENSE_CHANGE
          description: Line item type discriminator.
        lineItemId:
          type: string
          description: Unique identifier for this line item within the order.
          example: line-item-8
        licenseId:
          type: string
          description: The license to modify.
          example: license-789
        productOfferingId:
          type: string
          description: New product offering to change to.
          example: license-premium
        scheduleDate:
          type: string
          format: date
          x-ogen-type: telnesstech.com/apiv2/apiv2types.Date
          description: >-
            Earliest date to perform the change on. If the change schedule
            doesn't fit this date, the earliest date after this will be chosen.
          example: '2024-02-01'
        metadata:
          $ref: '#/components/schemas/Metadata'
        status:
          $ref: '#/components/schemas/OrderLineItemStatus'
          readOnly: true
          description: Server-resolved fulfillment status for this line item.
    AddonChangeLineItem:
      type: object
      title: Add-on Change
      description: Line item for changing an add-on's product offering.
      required:
        - type
        - lineItemId
        - subscriptionId
        - addonId
        - productOfferingId
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - ADDON_CHANGE
          description: Line item type discriminator.
        lineItemId:
          type: string
          description: Unique identifier for this line item within the order.
          example: line-item-9
        subscriptionId:
          type: string
          description: The subscription containing the add-on to modify.
          example: subscription-456
        addonId:
          type: string
          description: The add-on to change.
          example: addon-123
        productOfferingId:
          type: string
          description: New add-on product offering to change to.
          example: addon-data-5gb
        scheduleDate:
          type: string
          format: date
          x-ogen-type: telnesstech.com/apiv2/apiv2types.Date
          description: >-
            Earliest date to perform the change on. If the change schedule
            doesn't fit this date, the earliest date after this will be chosen.
          example: '2024-02-01'
        reason:
          type: string
          description: Reason for the change.
          example: Customer upgrade request
        metadata:
          $ref: '#/components/schemas/Metadata'
        status:
          $ref: '#/components/schemas/OrderLineItemStatus'
          readOnly: true
          description: Server-resolved fulfillment status for this line item.
    BillingCycle:
      type: object
      description: The billing cycle for recurring prices.
      required:
        - period
        - interval
      properties:
        period:
          type: string
          description: The billing period.
          enum:
            - MONTHLY
        interval:
          type: integer
          description: The interval of the billing period.
          example: 1
    SubscriptionStatus:
      type: string
      description: The status of the subscription.
      enum:
        - PENDING
        - ACTIVATED
        - BLOCKED
        - CANCELLED
        - PAUSED
        - SUSPENDED
    SubscriptionType:
      type: string
      description: >
        The type of subscription, categorizing the service into various
        telecommunications service types.
    LicenseStatus:
      type: string
      description: The status of the license.
      enum:
        - PENDING
        - ACTIVE
        - PAUSED
        - CANCELLED
        - BLOCKED
    LicenseType:
      type: string
      description: >
        The type of license, categorizing the software product or service into
        various telecommunications license types.
    AssignedTo:
      description: >
        Assignment reference for a license, indicating what entity the license
        is assigned to.

        This is a simplified version for list operations - use
        EmbeddedAssignedTo for detailed views.
      oneOf:
        - type: object
          title: Subscription
          required:
            - type
            - subscriptionId
          properties:
            type:
              type: string
              enum:
                - SUBSCRIPTION
            subscriptionId:
              type: string
    SubscriptionAddonStatus:
      type: string
      description: |
        The status of an add-on on a subscription.

        - PENDING: Add-on is scheduled but not yet active
        - ACTIVE: Add-on is currently active and billable
        - CANCELLED: Add-on has been cancelled and is no longer active
        - EXPIRED: Add-on has expired and is no longer active
      enum:
        - PENDING
        - ACTIVE
        - CANCELLED
        - EXPIRED
    Any:
      oneOf:
        - type: string
        - type: number
        - type: boolean
        - type: object
          additionalProperties: true
        - type: array
    PortingDetails:
      description: >
        description: Detailed information required for the porting process,
        varying by country and provider.
      oneOf:
        - $ref: '#/components/schemas/PortingDetailsUS'
        - $ref: '#/components/schemas/PortingDetailsSweden'
    OrderLineItemStatus:
      type: string
      description: >
        The current fulfillment status of an order line item.


        Resolved dynamically from the underlying entity (subscription action,
        license, activation).

        An order can complete while individual line items remain RUNNING or
        FAILED; failures on

        one line item do not block completion of the rest of the order.
      enum:
        - PENDING
        - RUNNING
        - COMPLETED
        - FAILED
    PortingDetailsUS:
      title: USPortingDetails
      type: object
      required:
        - firstName
        - lastName
        - address
      properties:
        accountNumber:
          type: string
          description: >
            The account number with the current provider.


            If not provided here, must be provided in the future for activation
            on-demand.
        passcode:
          type: string
          description: >
            The passcode or pin associated with the account at the current
            provider.


            If not provided here, must be provided in the future for activation
            on-demand.
        firstName:
          type: string
          description: The first name of the person requesting the port.
        lastName:
          type: string
          description: The last name of the person requesting the port.
        address:
          $ref: '#/components/schemas/Address'
    PortingDetailsSweden:
      title: SwedishPortingDetails
      type: object
      required:
        - identity
      properties:
        identity:
          type: string
          description: >-
            The identity of the current owner of the phone number, e.g.,
            "personal identity number" or "company registration number".
  responses:
    BadRequest:
      description: The request was malformed or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication is required to access this resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Access to this resource is forbidden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: An unexpected error occurred on the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >
        An API key that grants access to the Connect API. You can create and
        manage API keys in the portal.
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        Bearer authentication with JWT tokens is used to authenticate users.


        Do note that a valid API keys is also required to access the Connect API
        to prove that requests are made by a trusted party.


        Requests with a JWT token is scoped to the permissions of the user the
        token belongs to, regardless of the API key used.

````