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

# Pre-calculate order pricing and resolve booking quota grants

> Calculates prices, taxes, and totals for an order configuration without creating it.
Also resolves all available booking quota grants per booking based on the customer or booking code,
including which grant is preselected and the projected usage for each applicable grant.

This endpoint replaces the need to call `/orders/from-config/booking-quota-grants` separately.



## OpenAPI

````yaml /developers/openapi/admin.openapi.json post /api/v1/orders/calculate
openapi: 3.1.0
info:
  title: admin-api
  version: '1.0'
  description: >-
    The Admin API gives you **full programmatic access** to your anny
    organization. It is built for **server-side integrations** — backend
    services, automation scripts, and custom tooling that act on behalf of your
    team.


    ---


    ## When to use the Admin API


    Use the Admin API when you need to **drive workflows from your own
    systems**:


    - **Sync membership data** — create or update customers, assign them to
    communities, reflect subscription status from an external CRM

    - **Create bookings programmatically** — build back-office tools or automate
    repeat reservations without going through the customer checkout

    - **Issue and forward invoices** — generate invoices, send them to
    customers, or push them to your accounting system

    - **React to real-time events** — pair the API with
    [Webhooks](/developers/guides/admin/webhooks) to trigger side effects
    whenever a booking is created, cancelled, or checked in

    - **Drive display panels** — push live occupancy and schedule data to
    digital signage or lobby displays


    Combined with [webhook subscriptions](/developers/guides/admin/webhooks),
    you can build fully automated, event-driven workflows without polling.


    ---


    ## Authentication


    Generate a long-lived API token directly in the admin dashboard under
    **Organization Settings → API**. All requests require it in the
    `Authorization` header:


    ```

    Authorization: Bearer {access_token}

    ```


    Every endpoint is **organization-scoped**. Pass your organization ID as a
    query parameter on every request:


    ```

    ?o={organization_id}

    ```


    See the [Authentication guide](/developers/guides/authentication) for token
    scopes and the full OAuth2 flow.


    ---


    ## Admin API vs Customer API


    | | Admin API | Customer API |

    |---|---|---|

    | **Use case** | Server-side automation, backend tooling | End-user apps,
    booking widgets |

    | **Auth** | Required — API token or OAuth2 | Optional — many endpoints work
    without a token |

    | **Identifiers** | Immutable UUIDs and integer IDs | Slugs, booking
    numbers, order numbers |

    | **Access** | Full read/write | Public and customer-owned data only |


    → [Go to the Customer API](/developers/api-reference/customer)


    ---


    ## Resource Identifiers


    The Admin API uses **immutable IDs** — UUIDs for most entities, integers for
    legacy ones. These are safe to store in external systems and never change,
    even if an organization renames a resource.


    ---


    ## Starting Points


    | Guide | What it covers |

    |---|---|

    | [Getting Started](/developers) | First steps and quickstart |

    | [JSON:API Conventions](/developers/guides/json-api-conventions) | Request
    and response format |

    | [Authentication](/developers/guides/authentication) | API tokens, OAuth2,
    scopes |

    | [Availability & Booking Search](/developers/guides/availability) | Search
    open slots and timeslots |

    | [Admin Booking Creation](/developers/guides/admin/booking-creation) |
    Create bookings from the back office |

    | [Admin Booking Lifecycle](/developers/guides/admin/booking-lifecycle) |
    Status changes, check-in, cancellations |

    | [Invoices](/developers/guides/admin/invoices) | Create, send, and manage
    invoices |

    | [Customer Management](/developers/guides/admin/customer-management) |
    Create and manage customer records |

    | [Booking Calendars](/developers/guides/admin/calendar-events) | Custom
    calendar events |

    | [Timeslot Management](/developers/guides/admin/timeslot-management) |
    Manage timeslot CRUD, recurrence, allocations, and rescheduling |

    | [Broadcast Campaigns](/developers/guides/admin/broadcasting) | Email and
    push campaigns |

    | [Exports](/developers/guides/admin/exports) | Export bookings and customer
    data |

    | [Webhooks & Events](/developers/guides/admin/webhooks) | Subscribe to
    real-time events |


    ---


    ## Base URLs


    | Environment | URL |

    |---|---|

    | Production | `https://b.anny.co` |

    | Gov-Cloud | `https://b.anny.eu` |
  contact:
    name: anny GmbH
    url: https://anny.co
    email: support@anny.co
servers:
  - url: https://b.anny.co
    description: Production
  - url: https://b.anny.eu
    description: Gov-Cloud
security:
  - Bearer: []
tags:
  - name: Add-On Groups
  - name: Add-Ons
  - name: Booking Add-Ons
  - name: Booking Bundles
  - name: Booking Passes
  - name: Booking Quota Grants
  - name: Booking Quotas
  - name: Booking Rules
  - name: Bookings
  - name: Broadcast Campaigns
  - name: Broadcasts
  - name: Calendars
  - name: Cancellation Policies
  - name: Communities
  - name: External Links
  - name: Community Invites
  - name: Custom Fields
  - name: Custom Forms
  - name: Customers
  - name: Businesses
  - name: Display Panels
  - name: Displays
  - name: Document Templates
  - name: Exports
  - name: External Calendars
  - name: Files
  - name: Images
  - name: Invoices
  - name: Items
  - name: Legal Document Links
  - name: Legal Documents
  - name: Model Identifiers
  - name: Orders
  - name: Organizations
  - name: Payment Setups
  - name: Payments
  - name: Plan Subscriptions
  - name: Price Modifiers
  - name: Properties
  - name: Queues
  - name: Resource Categories
  - name: Resource Groups
  - name: Resource Properties
  - name: Resources
  - name: Scans
  - name: Schedule Groups
  - name: Schedules
  - name: Service Add-Ons
  - name: Service Groups
  - name: Services
  - name: Sub-Resources
  - name: Test-Results
  - name: Test Results
  - name: Tests
  - name: Timeslot Allocations
  - name: Timeslot Series
  - name: Timeslots
  - name: User Invites
  - name: Users
  - name: Customer Balances
  - name: Vouchers
  - name: Webhooks
paths:
  /api/v1/orders/calculate:
    post:
      tags:
        - Orders
      summary: Pre-calculate order pricing and resolve booking quota grants
      description: >-
        Calculates prices, taxes, and totals for an order configuration without
        creating it.

        Also resolves all available booking quota grants per booking based on
        the customer or booking code,

        including which grant is preselected and the projected usage for each
        applicable grant.


        This endpoint replaces the need to call
        `/orders/from-config/booking-quota-grants` separately.
      operationId: orders-calculate
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                order_customer_id:
                  type: string
                  nullable: true
                  description: >-
                    Customer ID to associate with the order. Used to resolve
                    quota grants.
                voucher_code:
                  type: string
                  nullable: true
                  description: Voucher or discount code to apply.
                booking_code:
                  type: string
                  nullable: true
                  description: >-
                    Booking pass code. When provided, quota grants are resolved
                    from the pass instead of the customer.
                check_availability:
                  type: boolean
                  default: true
                notify_customer:
                  type: boolean
                  default: true
                complete_order:
                  type: boolean
                  default: true
                timezone:
                  type: string
                  nullable: true
                add_ons:
                  type: array
                  description: >-
                    Standalone add-ons (unit-priced) billed on the order
                    invoice, independent of any booking.
                  items:
                    type: object
                    required:
                      - add_on_id
                    properties:
                      add_on_id:
                        oneOf:
                          - type: string
                          - type: integer
                      quantity:
                        type: integer
                        minimum: 1
                booking_passes:
                  type: array
                  description: >-
                    Booking passes purchased from bundles, billed on the order
                    invoice.
                  items:
                    type: object
                    required:
                      - booking_bundle_id
                    properties:
                      booking_bundle_id:
                        oneOf:
                          - type: string
                          - type: integer
                      quantity:
                        type: integer
                        minimum: 1
                bookings:
                  type: array
                  description: >-
                    Booking items. May be empty or omitted when add_ons or
                    booking_passes are present.
                  items:
                    type: object
                    required:
                      - resource_id
                      - service_id
                      - start_date
                      - end_date
                    properties:
                      booking_ref:
                        type: string
                        description: >-
                          Client-side reference for correlating response
                          bookings to request bookings.
                      resource_id:
                        type: string
                      service_id:
                        type: object
                        description: 'Map of service ID to quantity, e.g. `{"uuid": 1}`'
                        additionalProperties:
                          type: integer
                      start_date:
                        type: string
                        format: date-time
                      end_date:
                        type: string
                        format: date-time
                      customer_id:
                        type: string
                        nullable: true
                        description: Per-booking customer override.
                      description:
                        type: string
                        nullable: true
                      customer_note:
                        type: string
                        nullable: true
                      booking_quota_grant_id:
                        type: string
                        nullable: true
                        description: Explicitly select a specific grant for this booking.
                      prevent_applying_default_quota:
                        type: boolean
                        default: false
                        description: >-
                          When true, no grant is preselected even if one is
                          available.
                      booking_add_ons:
                        type: array
                        items:
                          type: object
                      sub_bookings:
                        type: array
                        items:
                          type: object
      responses:
        '200':
          description: >-
            Calculated pricing data including totals, taxes, per-booking
            breakdowns, and resolved quota grants.
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: number
                  gross_amount:
                    type: number
                  is_net_price:
                    type: boolean
                  net_amount:
                    type: number
                  tax_amount:
                    type: number
                  currency:
                    type: string
                  price_hidden:
                    type: boolean
                  items:
                    type: array
                    description: Invoice line items
                    items:
                      type: object
                  vat_breakdown:
                    type: array
                    items:
                      type: object
                  bookings:
                    type: array
                    items:
                      type: object
                      properties:
                        booking_ref:
                          type: string
                        start_date:
                          type: string
                          format: date-time
                        end_date:
                          type: string
                          format: date-time
                        unit:
                          type: string
                        subtotal:
                          type: number
                        total:
                          type: number
                        gross_amount:
                          type: number
                        net_amount:
                          type: number
                        tax_amount:
                          type: number
                        charged_duration:
                          type: number
                        currency:
                          type: string
                        price_hidden:
                          type: boolean
                        tax_rate:
                          type: number
                        is_net_price:
                          type: boolean
                        quantity:
                          type: integer
                        service:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                            is_series:
                              type: boolean
                        resource:
                          type: object
                          nullable: true
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                            slug:
                              type: string
                            cover_image:
                              type: string
                              nullable: true
                              description: URL to the resource cover image (small size)
                            parent:
                              type: object
                              nullable: true
                              properties:
                                id:
                                  type: string
                                name:
                                  type: string
                            category:
                              type: object
                              properties:
                                id:
                                  type: string
                                name:
                                  type: string
                                color:
                                  type: string
                                  nullable: true
                                icon:
                                  type: string
                                  nullable: true
                        booking_add_ons:
                          type: array
                          items:
                            type: object
                            properties:
                              add_on:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  name:
                                    type: string
                                  cover_image:
                                    type: string
                                    nullable: true
                              total:
                                type: number
                              quantity:
                                type: integer
                              currency:
                                type: string
                        sub_bookings:
                          type: array
                          items:
                            type: object
                            properties:
                              total:
                                type: number
                              currency:
                                type: string
                              service:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  name:
                                    type: string
                              resource:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  name:
                                    type: string
                                  slug:
                                    type: string
                                  cover_image:
                                    type: string
                                    nullable: true
                                  category:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                      name:
                                        type: string
                                      color:
                                        type: string
                                        nullable: true
                                      icon:
                                        type: string
                                        nullable: true
                        booking_quota_grants:
                          type: array
                          description: >-
                            All eligible quota grants for this booking, with
                            applicability and usage info.
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                                description: Grant ID
                              name:
                                type: string
                                description: Name of the associated booking quota
                              value:
                                type: number
                                nullable: true
                                description: Total quota value (null for unlimited)
                              used_value:
                                type: number
                                description: Currently consumed value
                              value_type:
                                type: string
                                enum:
                                  - quantity
                                  - monetary
                                  - duration
                              start_date:
                                type: string
                                format: date-time
                              end_date:
                                type: string
                                format: date-time
                              applicable:
                                type: boolean
                                description: >-
                                  Whether this grant can actually be used for
                                  this booking (has remaining capacity)
                              preselected:
                                type: boolean
                                description: >-
                                  Whether this grant is the currently
                                  selected/default grant for this booking
                              usage:
                                type: object
                                nullable: true
                                description: >-
                                  Projected usage if this grant is applied. Null
                                  when not applicable.
                                properties:
                                  value:
                                    type: number
                                    description: Amount that would be consumed
                                  value_type:
                                    type: string
                                  charged_price:
                                    type: number
                                    description: >-
                                      Price charged to the customer after quota
                                      is applied
                                  is_partial:
                                    type: boolean
                                    description: >-
                                      Whether the grant only partially covers
                                      the booking
                                  relative_usage:
                                    type: number
                                    description: >-
                                      Fraction of total grant value consumed
                                      (0-1)
              example:
                total: 25
                gross_amount: 25
                is_net_price: false
                net_amount: 21.01
                tax_amount: 3.99
                currency: EUR
                price_hidden: false
                items: []
                vat_breakdown: []
                bookings:
                  - booking_ref: bk-1
                    start_date: '2026-04-15T09:00:00+02:00'
                    end_date: '2026-04-15T10:00:00+02:00'
                    total: 0
                    gross_amount: 0
                    net_amount: 0
                    tax_amount: 0
                    currency: EUR
                    booking_quota_grants:
                      - id: grant-uuid-1
                        name: 10er Karte
                        value: 10
                        used_value: 3
                        value_type: quantity
                        start_date: '2026-01-01T00:00:00Z'
                        end_date: '2026-12-31T23:59:59Z'
                        applicable: true
                        preselected: true
                        usage:
                          value: 1
                          value_type: quantity
                          charged_price: 0
                          is_partial: false
                          relative_usage: 0.1
components:
  securitySchemes:
    Bearer:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://auth.anny.co/oauth/authorize
          tokenUrl: https://auth.anny.co/oauth/token
          refreshUrl: https://auth.anny.co/oauth/token/refresh
          scopes: {}

````