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

# Quote purchase

> Calculate the order cost with your account's discounts and currency, without creating an order or charging your balance.

Send the same `tarif` fields as [Create purchase](https://api-docs.streamskill.pro/api-reference/endpoints/purchases/create.md). The `tariff` alias and dotted keys such as `tarif.id` are also accepted.

The price is recalculated at checkout.


## OpenAPI

````yaml POST /purchases/quote
openapi: 3.0.0
info:
  title: StreamSkill - OpenApi 3.0
  description: ''
  termsOfService: https://streamskill.pro/en/privacy_policy
  version: 1.0.0
  contact:
    email: streamskillpro@gmail.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.streamskill.pro/v1
    description: Production server - v1
security:
  - bearerAuth: []
paths:
  /purchases/quote:
    parameters:
      - $ref: '#/components/parameters/Accept-Language'
    post:
      summary: Quote purchase
      description: >-
        Calculate the order cost with your account's discounts and currency,
        without creating an order or charging your balance.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseQuoteRequest'
            example:
              tarif:
                id: 1
                quantity: 150
                duration: 2
      responses:
        '200':
          description: Order total, including discounts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseQuote'
              example:
                amount: 260.82
                currency: usd
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/validationError'
components:
  parameters:
    Accept-Language:
      name: Accept-Language
      in: header
      required: false
      description: The language of the response
      schema:
        $ref: '#/components/schemas/LanguageObject'
  schemas:
    PurchaseQuoteRequest:
      type: object
      required:
        - tarif
      description: >-
        Same tariff fields as purchase creation. Also accepts the tariff alias
        and dotted keys.
      properties:
        tarif:
          $ref: '#/components/schemas/TarifObject'
    PurchaseQuote:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: number
          minimum: 0
          description: Total after discounts, rounded to two decimal places.
          example: 260.82
        currency:
          $ref: '#/components/schemas/CurrencyObject'
    LanguageObject:
      type: string
      enum:
        - en
        - ru
      default: en
    TarifObject:
      type: object
      required:
        - id
      properties:
        id:
          type: integer
          description: The ID of the tarif
          example: 1
          minimum: 1
        quantity:
          type: integer
          description: >-
            Defaults to the tariff's quantity. Allowed values depend on the
            tariff.
          example: 1000
          minimum: 1
        duration:
          type: integer
          description: >-
            Hours for hourly tariffs; defaults to 1. For other tariffs, omit or
            set to 1.
          example: 24
          minimum: 1
          maximum: 24
          default: 1
    CurrencyObject:
      type: string
      enum:
        - usd
        - rub
      example: usd
    ErrorObject:
      type: object
      required:
        - error_code
        - name
        - message
        - code
        - status
        - type
      properties:
        error_code:
          type: string
          description: Error identifier for handling the response in your application.
        name:
          type: string
          description: Localized error message; equal to message.
        message:
          type: string
          description: Localized explanation of the error.
        code:
          type: integer
          description: Error code, usually 0.
        status:
          type: integer
          description: HTTP status code.
        type:
          type: string
          description: Error type.
    ValidationErrorObject:
      allOf:
        - $ref: '#/components/schemas/ErrorObject'
        - type: object
          required:
            - errors
          properties:
            errors:
              type: object
              description: >-
                Validation messages grouped by field name. Nested fields may use
                dot notation, such as ids.0.
              additionalProperties:
                type: array
                items:
                  type: string
  responses:
    Unauthorized:
      description: A valid API key is required.
      headers:
        Date:
          $ref: '#/components/headers/Date'
        Server:
          $ref: '#/components/headers/Server'
        Content-Length:
          $ref: '#/components/headers/Content-Length'
        Keep-Alive:
          $ref: '#/components/headers/Keep-Alive'
        Connection:
          $ref: '#/components/headers/Connection'
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorObject'
          example:
            error_code: unauthorized
            name: Your request was made with invalid credentials.
            message: Your request was made with invalid credentials.
            code: 0
            status: 401
            type: unauthorized_http_exception
    validationError:
      description: Validation Error
      headers:
        Date:
          $ref: '#/components/headers/Date'
        Server:
          $ref: '#/components/headers/Server'
        Content-Length:
          $ref: '#/components/headers/Content-Length'
        Keep-Alive:
          $ref: '#/components/headers/Keep-Alive'
        Connection:
          $ref: '#/components/headers/Connection'
        Content-Type:
          $ref: '#/components/headers/Content-Type'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorObject'
          example:
            error_code: validation_error
            name: The Channel field is required.
            message: The Channel field is required.
            code: 0
            status: 422
            type: validate_exception
            errors:
              channel:
                - The Channel field is required.
  headers:
    Date:
      schema:
        type: string
        example: Sat, 25 May 2024 23:59:59 GMT
    Server:
      schema:
        type: string
        example: Apache/2.4.38 (Debian)
    Content-Length:
      schema:
        type: integer
        example: '100'
    Keep-Alive:
      schema:
        type: string
        example: timeout=5, max=100
    Connection:
      schema:
        type: string
        example: Keep-Alive
    Content-Type:
      schema:
        type: string
      example: application/json; charset=UTF-8
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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