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

# Calculate order price

> Calculate the total price for an order including taxes, fees, and discounts.

Use this to preview the final price of an order before submission
in regions where explicit tax calculation is required, such as the US.

Responses are cached, so if no change is made to the order, subsequent
requests will return the same result.

Invalid orders cannot be priced. Fetch the order to see validation errors.




## OpenAPI

````yaml /api-reference/bundled_openapi.json post /orders/{orderId}/calculate-price
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}/calculate-price:
    post:
      tags:
        - Orders
      summary: Calculate order price
      description: >
        Calculate the total price for an order including taxes, fees, and
        discounts.


        Use this to preview the final price of an order before submission

        in regions where explicit tax calculation is required, such as the US.


        Responses are cached, so if no change is made to the order, subsequent

        requests will return the same result.


        Invalid orders cannot be priced. Fetch the order to see validation
        errors.
      operationId: calculateOrderPrice
      parameters:
        - name: orderId
          in: path
          required: true
          description: The unique identifier of the order
          schema:
            type: string
        - $ref: '#/components/parameters/IdempotencyKey'
      responses:
        '200':
          description: Price calculation completed successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - pricing
                additionalProperties: false
                properties:
                  pricing:
                    $ref: '#/components/schemas/OrderPricing'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    IdempotencyKey:
      in: header
      name: X-Idempotency-Key
      required: false
      description: >
        A unique key to ensure idempotency of requests. If a request with the
        same key has already been processed, the same result will be returned.

        The key must be unique for each distinct operation. Keys are expired
        after 24 hours, but we recommend using a new key for each request.


        Modified requests with the same idempotency keys are rejected with a
        `409 Conflict` status code.
      schema:
        type: string
        maxLength: 256
  schemas:
    OrderPricing:
      description: >-
        Detailed pricing information for an order including taxes, fees, and
        discounts.
      allOf:
        - $ref: '#/components/schemas/OrderPricingSummary'
        - properties:
            lineItems:
              description: Pricing breakdown per line item.
              type: array
              items:
                $ref: '#/components/schemas/OrderLineItemPricing'
    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'
    OrderLineItemPricing:
      type: object
      required:
        - lineItemId
        - subtotal
        - total
      additionalProperties: false
      properties:
        lineItemId:
          type: string
          description: The line item identifier.
        subtotal:
          type: number
          format: decimal
          description: Line item subtotal.
        total:
          type: number
          format: decimal
          description: Line item total after taxes and fees.
        taxBreakdown:
          type: array
          description: Tax breakdown for this line item.
          items:
            $ref: '#/components/schemas/TaxBreakdownItem'
        taxAmount:
          type: number
          format: decimal
          description: Total taxes for this line item.
          example: 24.75
        taxIncluded:
          type: boolean
          description: Whether taxes are included in the total.
          example: true
        fees:
          type: array
          description: Detailed fee breakdown for this line item.
          items:
            type: object
            required:
              - name
              - amount
            additionalProperties: false
            properties:
              name:
                type: string
                description: Fee name or description.
                example: Activation fee
              amount:
                type: number
                format: decimal
                description: Fee amount.
                example: 25
        totalFees:
          type: number
          format: decimal
          description: Total fees for this line item.
          example: 25
        discounts:
          type: array
          description: Detailed discount breakdown for this line item.
          items:
            type: object
            required:
              - name
              - amount
            additionalProperties: false
            properties:
              name:
                type: string
                description: Discount name or description.
                example: First month free
              amount:
                type: number
                format: decimal
                description: Discount amount (positive value).
                example: 50
        totalDiscounts:
          type: number
          format: decimal
          description: Total discounts for this line item.
          example: 50
        description:
          type: string
          description: Description of what this line item covers.
          example: Premium Plan
        recurringAmount:
          type: number
          format: decimal
          description: Recurring cost for this line item per billing cycle.
          example: 29.99
        initialInvoiceAmount:
          type: number
          format: decimal
          description: >-
            Amount for this line item on the first invoice, when different from
            recurring.
          example: 14.5
    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.
    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
    TaxBreakdownItem:
      type: object
      description: Individual tax component with description, amount, and optional rate.
      required:
        - description
        - amount
      additionalProperties: false
      properties:
        description:
          type: string
          description: Description of this tax component.
          example: Sales Tax
        amount:
          type: number
          format: decimal
          description: Tax amount for this component.
          example: 2.4
        rate:
          type: number
          format: decimal
          description: Tax rate as a percentage (optional).
          example: 8.25
    Any:
      oneOf:
        - type: string
        - type: number
        - type: boolean
        - type: object
          additionalProperties: true
        - type: array
  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'
    TooManyRequests:
      description: Too many requests have been sent in a given amount of time.
      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.

````

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