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

# Post Calculate Order



## OpenAPI

````yaml POST /api/orders/calculate/
openapi: 3.0.0
info:
  title: Vitau API
  x-logo:
    url: https://vitau-logos.s3.us-west-1.amazonaws.com/profile-logo.png
    backgroundColor: '#FFFFFF'
  version: v2
servers:
  - url: https://api-v2.vitau.mx/
security:
  - APIKeyAuth: []
  - JWTAuth: []
  - CookieAuth: []
paths:
  /api/orders/calculate/:
    parameters: []
    post:
      tags:
        - api
      operationId: api_orders_calculate
      requestBody:
        $ref: '#/components/requestBodies/PatientOrderCalculate'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatientOrderWrite'
components:
  requestBodies:
    PatientOrderCalculate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PatientOrderCalculate'
      required: true
  schemas:
    PatientOrderWrite:
      required:
        - details
        - patient
        - payment_method
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        details:
          type: array
          items:
            $ref: '#/components/schemas/OrderDetailWrite'
        patient:
          title: Patient
          type: integer
        shipping:
          title: Shipping
          type: integer
          nullable: true
        store:
          title: Store
          type: integer
          nullable: true
        payment:
          title: Payment
          type: integer
          nullable: true
        paypal_agreement:
          title: Paypal agreement
          type: integer
        payment_method:
          title: Payment method
          type: integer
        invoicing:
          title: Invoicing
          type: integer
          nullable: true
        coupon:
          title: Coupon
          type: string
          maxLength: 16
          minLength: 1
        shipping_method:
          title: Shipping method
          type: integer
        prescriptions:
          type: array
          items:
            $ref: '#/components/schemas/PrescriptionWrite'
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        deleted_at:
          title: Deleted at
          type: string
          format: date-time
          nullable: true
        insurance_refund_status:
          title: Insurance refund status
          type: string
          enum:
            - not_started
            - missing_data
            - sent_to_broker
            - sent_to_insurer
            - approved_by_insurer
        order_status:
          title: Order status
          type: string
          enum:
            - quoted
            - pending_approval
            - approved
            - in_process
            - ready
            - shipped
            - delivered
            - cancelled
            - delayed
            - shortage
          readOnly: true
        payment_status:
          title: Payment status
          type: string
          enum:
            - unpaid
            - credit
            - paid
            - in_process
            - processing
            - rejected
        rejection_reason:
          title: MP rejection reason
          type: string
          readOnly: true
          minLength: 1
        origin:
          title: Origin
          type: string
          maxLength: 20
        subtotal:
          title: Subtotal
          type: string
          format: decimal
          readOnly: true
        iva:
          title: Iva
          type: string
          format: decimal
          readOnly: true
        shipping_price:
          title: Shipping price
          type: string
          format: decimal
          readOnly: true
        shipping_discount:
          title: Temporal shipping discount
          type: string
          format: decimal
          nullable: true
        shipping_cost:
          title: Shipping cost
          type: string
          format: decimal
          readOnly: true
        discount:
          title: Order discount
          type: string
          format: decimal
          readOnly: true
        total:
          title: Total
          type: string
          format: decimal
          readOnly: true
        payment_date:
          title: Payment date
          type: string
          format: date-time
          readOnly: true
        shipping_date:
          title: Shipping date
          type: string
          format: date-time
          readOnly: true
        expected_delivery_date:
          title: Expected delivery date
          type: string
          format: date-time
          readOnly: true
        max_delivery_date:
          title: Maximum delivery date
          type: string
          format: date-time
          readOnly: true
        receiving_date:
          title: Receiving date
          type: string
          format: date-time
          readOnly: true
        folio:
          title: Folio
          type: string
          maxLength: 20
        cfdi:
          title: Facturama's cfdi id
          type: string
          readOnly: true
          minLength: 1
        external_payment_id:
          title: External payment id
          type: string
          readOnly: true
          minLength: 1
        generated_by:
          title: Order generated by user
          type: integer
          nullable: true
        updated_by:
          title: Last user to update order
          type: integer
          nullable: true
        reminder:
          title: Reminder
          type: integer
          nullable: true
        subscription:
          title: Subscription
          type: integer
          readOnly: true
    PatientOrderCalculate:
      required:
        - details
      type: object
      properties:
        details:
          type: array
          items:
            $ref: '#/components/schemas/OrderDetailWrite'
        zipcode:
          title: Zip Code
          type: string
        coupon:
          title: Coupon
          type: string
          nullable: true
        store:
          type: integer
          nullable: true
    OrderDetailWrite:
      required:
        - product
        - quantity
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        product:
          title: Product
          type: integer
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        price:
          title: Price
          type: string
          format: decimal
          readOnly: true
        subtotal:
          title: Subtotal
          type: string
          format: decimal
          readOnly: true
        total:
          title: Total
          type: string
          format: decimal
          readOnly: true
        discount:
          title: Discount
          type: string
          format: decimal
          readOnly: true
        iva:
          title: Iva
          type: string
          format: decimal
          readOnly: true
        quantity:
          title: Quantity
          type: integer
          maximum: 32767
          minimum: 0
        order:
          title: Order
          type: integer
          readOnly: true
    PrescriptionWrite:
      required:
        - document
        - issue_date
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        document:
          title: File Content
          type: string
          readOnly: false
          description: Content of the file base64 encoded
          format: uri
        document_name:
          title: Document name
          type: string
          minLength: 1
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        issue_date:
          title: Issue date
          type: string
          format: date
        expiring_date:
          title: Expiring date
          type: string
          format: date
        is_verified:
          title: Is verified
          type: boolean
          readOnly: true
        patient:
          title: Patient
          type: integer
          readOnly: true
        order:
          title: Order
          type: integer
          readOnly: true
        updated_by:
          title: Last user to update prescription
          type: integer
          readOnly: true
  securitySchemes:
    APIKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
    JWTAuth:
      type: apiKey
      in: header
      name: Bearer
    CookieAuth:
      type: apiKey
      in: header
      name: sessionid

````