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

# Work out a quote's totals

> Work out the total contract value, discount value and duration of a quote's pricing, without saving a quote. The body uses the same field names as the quote update body, so that body can be sent as it is. A discount or minimum pointing at a price ID that isn't in its phase is rejected.



## OpenAPI

````yaml quote.2024-07-30.product.live POST /quotes/total
openapi: 3.0.0
info:
  title: ''
  description: ''
  version: 0.0.1
servers:
  - url: https://dev.seqhq.io
    description: E2E
  - url: https://dev.seqhq.io
    description: DEV
  - url: https://sandbox.sequencehq.com
    description: SANDBOX
  - url: https://eu.sequencehq.com
    description: PRODUCTION
security: []
tags:
  - name: Quotes
  - name: Quote Templates
paths:
  /quotes/total:
    servers: []
    parameters: []
    post:
      tags:
        - Quotes
      summary: Work out a quote's totals
      description: >-
        Work out the total contract value, discount value and duration of a
        quote's pricing, without saving a quote. The body uses the same field
        names as the quote update body, so that body can be sent as it is. A
        discount or minimum pointing at a price ID that isn't in its phase is
        rejected.
      operationId: postQuotesTotal
      parameters:
        - name: Authorization
          in: header
          description: >-
            Your [API credentials](/reference/authentication). Eg. `Basic
            {credentials}`.
          required: true
          schema:
            type: string
        - name: sequence-version
          in: header
          description: Use this header to select an API version
          required: false
          schema:
            type: string
            enum:
              - '2024-07-30'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuoteTotalRequestModel'
              example:
                currency: USD
                preliminaryBillingStartDate: '2026-01-01'
                phases:
                  - duration:
                      days: 0
                      weeks: 0
                      months: 0
                      years: 1
                    prices:
                      - temporaryId: price-1
                        structure:
                          price: '12000'
                          pricingType: FIXED
                        billingFrequency: YEARLY
                        billingType: IN_ADVANCE
                    discounts:
                      - restrictToPrices:
                          - price-1
                        type: PERCENTAGE
                        amount: '10'
                    minimums: []
            examples:
              QuoteTotalRequestModel:
                summary: ''
                value:
                  currency: USD
                  preliminaryBillingStartDate: '2026-01-01'
                  phases:
                    - duration:
                        days: 0
                        weeks: 0
                        months: 0
                        years: 1
                      prices:
                        - temporaryId: price-1
                          structure:
                            price: '12000'
                            pricingType: FIXED
                          billingFrequency: YEARLY
                          billingType: IN_ADVANCE
                      discounts:
                        - restrictToPrices:
                            - price-1
                          type: PERCENTAGE
                          amount: '10'
                      minimums: []
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteTotalResponseModel'
                example:
                  total:
                    contractValue: '10800'
                    discountValue: '1200'
                    duration:
                      days: 0
                      weeks: 0
                      months: 0
                      years: 1
              examples:
                QuoteTotalResponseModel:
                  summary: ''
                  value:
                    total:
                      contractValue: '10800'
                      discountValue: '1200'
                      duration:
                        days: 0
                        weeks: 0
                        months: 0
                        years: 1
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '500':
          description: Internal Server Error
          content: {}
components:
  schemas:
    QuoteTotalRequestModel:
      required:
        - currency
        - phases
      type: object
      example:
        currency: USD
        preliminaryBillingStartDate: '2026-01-01'
        phases:
          - duration:
              days: 0
              weeks: 0
              months: 0
              years: 1
            prices:
              - temporaryId: price-1
                structure:
                  price: '12000'
                  pricingType: FIXED
                billingFrequency: YEARLY
                billingType: IN_ADVANCE
            discounts:
              - restrictToPrices:
                  - price-1
                type: PERCENTAGE
                amount: '10'
            minimums: []
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
          description: The currency the quote is priced in
        preliminaryBillingStartDate:
          type: string
          description: The date billing would start on. Leave it out if it isn't known yet.
          nullable: true
          example: '2026-01-01'
        phases:
          type: array
          description: The quote's phases, in order
          example:
            - duration:
                days: 0
                weeks: 0
                months: 0
                years: 1
              prices:
                - temporaryId: price-1
                  structure:
                    price: '12000'
                    pricingType: FIXED
                  billingFrequency: YEARLY
                  billingType: IN_ADVANCE
              discounts:
                - restrictToPrices:
                    - price-1
                  type: PERCENTAGE
                  amount: '10'
              minimums: []
          items:
            $ref: '#/components/schemas/QuoteTotalPhaseRequestModel'
    QuoteTotalResponseModel:
      required:
        - total
      type: object
      example:
        total:
          contractValue: '10800'
          discountValue: '1200'
          duration:
            days: 0
            weeks: 0
            months: 0
            years: 1
      properties:
        total:
          $ref: '#/components/schemas/QuoteTotal'
    Currency:
      type: string
      example: GBP
      enum:
        - AED
        - ARS
        - AUD
        - BRL
        - BGN
        - CAD
        - CHF
        - CLP
        - CNY
        - COP
        - CZK
        - DKK
        - EGP
        - EUR
        - GBP
        - HKD
        - ILS
        - INR
        - ISK
        - JPY
        - KRW
        - MXN
        - NOK
        - NZD
        - PLN
        - SAR
        - SEK
        - SGD
        - THB
        - USD
        - UYU
        - ZAR
    QuoteTotalPhaseRequestModel:
      required:
        - prices
      type: object
      example:
        duration:
          days: 0
          weeks: 0
          months: 0
          years: 1
        prices:
          - temporaryId: price-1
            structure:
              price: '12000'
              pricingType: FIXED
            billingFrequency: YEARLY
            billingType: IN_ADVANCE
        discounts:
          - restrictToPrices:
              - price-1
            type: PERCENTAGE
            amount: '10'
        minimums: []
      properties:
        duration:
          $ref: '#/components/schemas/Duration'
          nullable: true
        prices:
          type: array
          description: The prices in this phase
          example:
            - temporaryId: price-1
              structure:
                price: '12000'
                pricingType: FIXED
              billingFrequency: YEARLY
              billingType: IN_ADVANCE
          items:
            $ref: '#/components/schemas/QuoteTotalPriceRequestModel'
        discounts:
          type: array
          description: The discounts in this phase. Leave it out if there are none.
          nullable: true
          example:
            - restrictToPrices:
                - price-1
              type: PERCENTAGE
              amount: '10'
          items:
            $ref: '#/components/schemas/QuoteTotalDiscountRequestModel'
        minimums:
          type: array
          description: The minimums in this phase. Leave it out if there are none.
          nullable: true
          example: []
          items: {}
    QuoteTotal:
      required:
        - contractValue
        - discountValue
      type: object
      description: The quote's totals
      example:
        contractValue: '10800'
        discountValue: '1200'
        duration:
          days: 0
          weeks: 0
          months: 0
          years: 1
      properties:
        contractValue:
          type: string
          description: >-
            The quote's total contract value, as the dashboard shows it, rounded
            to the currency
          example: '10800'
        discountValue:
          type: string
          description: The total amount taken off by discounts, rounded to the currency
          example: '1200'
        duration:
          $ref: '#/components/schemas/Duration'
          nullable: true
    Duration:
      required:
        - days
        - months
        - weeks
        - years
      type: object
      description: Duration of phase. Null denotes an open-ended phase.
      example:
        days: -1
        weeks: 0
        months: 6
        years: 1
      properties:
        days:
          type: integer
          format: int32
          example: -1
        weeks:
          type: integer
          format: int32
          example: 0
        months:
          type: integer
          format: int32
          example: 6
        years:
          type: integer
          format: int32
          example: 1
    QuoteTotalPriceRequestModel:
      required:
        - billingFrequency
        - billingType
        - structure
      type: object
      example:
        temporaryId: price-1
        structure:
          price: '12000'
          pricingType: FIXED
        billingFrequency: YEARLY
        billingType: IN_ADVANCE
      properties:
        temporaryId:
          type: string
          description: >-
            An ID for this price that discounts and minimums in the same phase
            can point at. Any text.
          nullable: true
          example: price-1
        structure:
          oneOf:
            - $ref: '#/components/schemas/ONE_TIME'
            - $ref: '#/components/schemas/FIXED'
            - $ref: '#/components/schemas/LINEAR'
            - $ref: '#/components/schemas/SEAT_BASED'
            - $ref: '#/components/schemas/GRADUATED'
            - $ref: '#/components/schemas/VOLUME'
            - $ref: '#/components/schemas/PACKAGE'
          discriminator:
            propertyName: pricingType
          required:
            - pricingType
        billingFrequency:
          $ref: '#/components/schemas/BillingFrequency'
          description: How often the price is charged
        billingType:
          $ref: '#/components/schemas/BillingType'
          description: Whether the price is billed in advance or in arrears
    QuoteTotalDiscountRequestModel:
      required:
        - amount
        - restrictToPrices
        - type
      type: object
      example:
        restrictToPrices:
          - price-1
        type: PERCENTAGE
        amount: '10'
      properties:
        restrictToPrices:
          type: array
          description: >-
            The IDs of the prices this discount applies to. Required; send an
            empty list to apply it to every price in the phase.
          example:
            - price-1
          items:
            type: string
        type:
          $ref: '#/components/schemas/DiscountCalculationType'
          description: Whether the amount is a percentage or a fixed amount
        amount:
          type: string
          description: The discount's amount
          example: '10'
    ONE_TIME:
      properties:
        price:
          example: '150.00'
          description: A fixed amount that is charged once.
          type: string
          nullable: false
        pricingType:
          enum:
            - ONE_TIME
          example: ONE_TIME
          type: string
      example:
        price: '150.00'
        pricingType: ONE_TIME
      type: object
      required:
        - price
        - pricingType
    FIXED:
      properties:
        price:
          example: '20.00'
          description: A fixed amount that is charged once every billing period.
          type: string
          nullable: false
        pricingType:
          enum:
            - FIXED
          example: FIXED
          type: string
      example:
        price: '20.00'
        pricingType: FIXED
      type: object
      required:
        - price
        - pricingType
    LINEAR:
      properties:
        pricePerUnit:
          example: '0.25'
          description: >-
            The per unit rate to apply to usage for this product. In the case of
            percentage pricing where `isPricePercentage` is set to `true`, a
            value of 1 represents 100%.
          type: string
          nullable: false
        usageMetricId:
          example: 04c62961-04ba-48e6-b985-758bb7d3e712
          description: Usage metric associated to this pricing structure
          type: string
          nullable: false
        isPricePercentage:
          example: false
          description: >-
            Indicate whether the price attribute is to be considered as a
            percentage or an absolute value.
          type: boolean
          nullable: false
        pricingType:
          enum:
            - LINEAR
          example: LINEAR
          type: string
      example:
        pricePerUnit: '0.25'
        usageMetricId: 04c62961-04ba-48e6-b985-758bb7d3e712
        isPricePercentage: false
        pricingType: LINEAR
      type: object
      required:
        - isPricePercentage
        - pricePerUnit
        - pricingType
        - usageMetricId
    SEAT_BASED:
      properties:
        seatMetricId:
          example: bc61d4b8-e9d6-4f4a-9bcf-f5dae874c730
          description: Seat metric associated to this pricing structure
          type: string
          nullable: false
        pricePerSeat:
          example: '0.25'
          description: Price charged per seat per full billing period
          type: string
          nullable: false
        prorationStrategy:
          $ref: '#/components/schemas/SeatProrationStrategy'
          description: >-
            The proration strategy to use when calculating the price for a seat.
            A `USE_MAXIMUM` will not prorate and charge the highest seat balance
            for the entire billing period, while a PRORATE_INCREMENTS will
            charge incremental seats from the day they're added
        contractedMinimumSeats:
          example: 10
          description: The number of contractually agreed minimum seats
          type: integer
          nullable: false
        overagesBillingFrequency:
          $ref: '#/components/schemas/OveragesFrequency'
          description: The frequency with which to charge overages
        tiers:
          items:
            $ref: '#/components/schemas/SeatUsageTier'
          example:
            - upperBound: '100'
              price: '1.00'
              fee: '50.00'
            - price: '0.75'
              fee: '25.00'
          description: A list of contiguous pricing tiers
          type: array
          nullable: false
        prorateFlatFees:
          example: false
          description: >-
            If set any flat fees will be pro-rated if the invoice service period
            length does not match the billing frequency
          type: boolean
          nullable: true
        pricingType:
          enum:
            - SEAT_BASED
          example: SEAT_BASED
          type: string
      example:
        seatMetricId: bc61d4b8-e9d6-4f4a-9bcf-f5dae874c730
        pricePerSeat: '0.25'
        prorationStrategy: USE_MAXIMUM
        contractedMinimumSeats: 10
        overagesBillingFrequency: YEARLY
        tiers:
          - upperBound: '100'
            price: '1.00'
            fee: '50.00'
          - price: '0.75'
            fee: '25.00'
        prorateFlatFees: false
        pricingType: SEAT_BASED
      type: object
      required:
        - contractedMinimumSeats
        - pricePerSeat
        - pricingType
        - prorationStrategy
        - seatMetricId
        - tiers
    GRADUATED:
      properties:
        tiers:
          items:
            $ref: '#/components/schemas/GraduatedUsageTier'
          example:
            - upperBound: '200'
              price: '1.00'
              fee: '50.00'
              isPricePercentage: false
            - upperBound: '400'
              price: '0.75'
              fee: '25.00'
              isPricePercentage: false
            - price: '0.50'
              fee: '0.00'
              isPricePercentage: false
          description: A list of contiguous pricing tiers
          type: array
          nullable: false
        usageMetricId:
          example: 04c62961-04ba-48e6-b985-758bb7d3e712
          description: The usage metric associated to this pricing structure
          type: string
          nullable: false
        usageCalculationMode:
          $ref: '#/components/schemas/UsageCalculationMode'
          description: Indicates the scope of usage calculation
        pricingType:
          enum:
            - GRADUATED
          example: GRADUATED
          type: string
      example:
        tiers:
          - upperBound: '200'
            price: '1.00'
            fee: '50.00'
            isPricePercentage: false
          - upperBound: '400'
            price: '0.75'
            fee: '25.00'
            isPricePercentage: false
          - price: '0.50'
            fee: '0.00'
            isPricePercentage: false
        usageMetricId: 04c62961-04ba-48e6-b985-758bb7d3e712
        usageCalculationMode: BILLING_PERIOD
        pricingType: GRADUATED
      type: object
      required:
        - pricingType
        - tiers
        - usageCalculationMode
        - usageMetricId
    VOLUME:
      properties:
        tiers:
          items:
            $ref: '#/components/schemas/VolumeUsageTier'
          example:
            - upperBound: '100'
              price: '1.00'
              fee: '50.00'
              isPricePercentage: true
              maxPrice: '10'
              minPrice: '5'
            - price: '0.75'
              fee: '25.00'
              isPricePercentage: true
              maxPrice: '10'
              minPrice: '5'
          description: A list of contiguous pricing tiers
          type: array
          nullable: false
        usageMetricId:
          example: 04c62961-04ba-48e6-b985-758bb7d3e712
          description: The usage metric associated to this tier
          type: string
          nullable: false
        pricingType:
          enum:
            - VOLUME
          example: VOLUME
          type: string
      example:
        tiers:
          - upperBound: '100'
            price: '1.00'
            fee: '50.00'
            isPricePercentage: true
            maxPrice: '10'
            minPrice: '5'
          - price: '0.75'
            fee: '25.00'
            isPricePercentage: true
            maxPrice: '10'
            minPrice: '5'
        usageMetricId: 04c62961-04ba-48e6-b985-758bb7d3e712
        pricingType: VOLUME
      type: object
      required:
        - pricingType
        - tiers
        - usageMetricId
    PACKAGE:
      properties:
        packageSize:
          example: '50'
          description: The amount of usage allowed for the price in this structure
          type: string
          nullable: false
        pricePerPackage:
          example: '2.00'
          description: The price charged for each package
          type: string
          nullable: false
        usageMetricId:
          example: 04c62961-04ba-48e6-b985-758bb7d3e712
          description: The usage metric associated to this tier
          type: string
          nullable: false
        pricingType:
          enum:
            - PACKAGE
          example: PACKAGE
          type: string
      example:
        packageSize: '50'
        pricePerPackage: '2.00'
        usageMetricId: 04c62961-04ba-48e6-b985-758bb7d3e712
        pricingType: PACKAGE
      type: object
      required:
        - packageSize
        - pricePerPackage
        - pricingType
        - usageMetricId
    BillingFrequency:
      type: string
      example: MONTHLY
      enum:
        - ON_DEMAND
        - ONE_TIME
        - MONTHLY
        - QUARTERLY
        - HALF_YEARLY
        - YEARLY
        - PER_EVENT
    BillingType:
      type: string
      example: IN_ARREARS
      enum:
        - IN_ARREARS
        - IN_ADVANCE
    DiscountCalculationType:
      type: string
      example: PERCENTAGE
      enum:
        - PERCENTAGE
        - NOMINAL
    SeatProrationStrategy:
      example: USE_MAXIMUM
      enum:
        - USE_MAXIMUM
        - PRORATE_INCREMENTS
        - PRORATE_ALL_CHANGES
      type: string
      nullable: false
    OveragesFrequency:
      example: YEARLY
      enum:
        - NONE
        - MONTHLY
        - QUARTERLY
        - HALF_YEARLY
        - YEARLY
      type: string
      nullable: true
    SeatUsageTier:
      properties:
        upperBound:
          example: '100'
          description: >-
            The upper bound of usage for this tier. Set to null to if this is a
            final tier and is unbounded. The lower bound is set by the previous
            tier or 0 if it's the first one.
          type: string
          nullable: true
        price:
          example: '1.00'
          description: >-
            The rate to apply to usage for this product in this tier. In the
            case of percentage pricing where `isPricePercentage` is set to
            `true`, a value of 1 represents 100%.
          type: string
          nullable: false
        fee:
          example: '50.00'
          description: The nominal fee associated with usage at this tier
          type: string
          nullable: true
      example:
        upperBound: '100'
        price: '1.00'
        fee: '50.00'
      type: object
      required:
        - price
    GraduatedUsageTier:
      properties:
        upperBound:
          example: '200'
          description: >-
            The upper bound of usage for this tier. Set to null to if this is a
            final tier and is unbounded. The lower bound is set by the previous
            tier or 0 if it's the first one.
          type: string
          nullable: true
        price:
          example: '1.00'
          description: >-
            The rate to apply to usage for this product in this tier. In the
            case of percentage pricing where `isPricePercentage` is set to
            `true`, a value of 1 represents 100%.
          type: string
          nullable: false
        fee:
          example: '50.00'
          description: The nominal fee associated with usage at this tier
          type: string
          nullable: true
        isPricePercentage:
          example: false
          description: >-
            Indicate whether the price attribute is to be considered as a
            percentage or an absolute value.
          type: boolean
          nullable: false
      example:
        upperBound: '200'
        price: '1.00'
        fee: '50.00'
        isPricePercentage: false
      type: object
      required:
        - isPricePercentage
        - price
    UsageCalculationMode:
      example: BILLING_PERIOD
      enum:
        - BILLING_PERIOD
        - CUMULATIVE
        - PERIODIC
      type: string
      nullable: false
    VolumeUsageTier:
      properties:
        upperBound:
          example: '100'
          description: >-
            The upper bound of usage for this tier. Set to null to if this is a
            final tier and is unbounded. The lower bound is set by the previous
            tier or 0 if it's the first one.
          type: string
          nullable: true
        price:
          example: '1.00'
          description: >-
            The rate to apply to usage for this product in this tier. In the
            case of percentage pricing where `isPricePercentage` is set to
            `true`, a value of 1 represents 100%.
          type: string
          nullable: false
        fee:
          example: '50.00'
          description: The nominal fee associated with usage at this tier
          type: string
          nullable: true
        isPricePercentage:
          example: true
          description: >-
            Indicate whether the price attribute is to be considered as a
            percentage or an absolute value.
          type: boolean
          nullable: false
        maxPrice:
          example: '10'
          description: Maximum Price to Charge for each Unit if Price is Percentage Based
          type: string
          nullable: true
        minPrice:
          example: '5'
          description: Minimum Price to Charge for each Unit if Price is Percentage Based
          type: string
          nullable: true
      example:
        upperBound: '100'
        price: '1.00'
        fee: '50.00'
        isPricePercentage: true
        maxPrice: '10'
        minPrice: '5'
      type: object
      required:
        - isPricePercentage
        - price

````

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