> ## 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.

# Precalculate a possible booking

> This endpoint allows to precalculate a booking without creating it.



## OpenAPI

````yaml /developers/openapi/customer.openapi.json post /api/v1/order/bookings/calculate
openapi: 3.1.0
info:
  title: customer-api
  version: '1.0'
  contact:
    name: anny GmbH
    url: anny.co
    email: support@anny.co
  description: >-
    The Customer API is the **public booking surface** for end-user facing
    applications. It covers everything a customer can see and do — searching
    availability, placing bookings, managing their account, and more.


    ---


    ## When to use the Customer API


    Use the Customer API when you are **building something your customers
    interact with directly**:


    - **Custom booking flow** — embed a fully branded booking experience inside
    your own app or website instead of redirecting to anny

    - **Headless checkout** — drive the cart, checkout, and payment steps
    entirely from your own frontend

    - **Custom confirmation pages** — retrieve booking and order details after
    checkout to render a tailored confirmation

    - **Opening hours and availability on public pages** — display live schedule
    data on your website with no authentication required

    - **White-label experiences** — build lobby screens, kiosks, or mobile apps
    on top of the Customer API


    Many endpoints work **without any authentication**. For a custom OAuth2
    client to authenticate your own users, contact
    [support@anny.co](mailto:support@anny.co) with your use case.


    ---


    ## Authentication — Optional Auth


    Most Customer API endpoints work without a token. Providing a customer
    bearer token unlocks personal data and additional actions:


    | Auth state | What's accessible |

    |---|---|

    | Anonymous | Availability, public resource/service info, booking lookup by
    number, checkout |

    | Customer token | Own bookings, account data, communities, passes, queue
    tickets |


    ```

    Authorization: Bearer {customer_access_token}

    ```


    To authenticate your own users, you need a custom OAuth2 client — contact
    [support@anny.co](mailto:support@anny.co). See the [Authentication
    guide](/developers/guides/authentication) for the full token flow.


    ---


    ## Customer API vs Admin API


    | Feature | Customer API | Admin API |

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

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

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

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

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


    → [Go to the Admin API](/developers/api-reference/admin)


    ---


    ## Resource Identifiers


    The Customer API uses **human-readable identifiers** that appear in booking
    URLs:


    | Entity | Identifier | Example |

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

    | Resources | Slug | `conference-room-berlin` |

    | Services | Slug | `hourly-desk-booking` |

    | Organizations | Slug | `acme-gmbh` |

    | Bookings | Booking number | `BB123456789` |

    | Orders | Order number | `BO123456789` |


    Use the Admin API if you need immutable internal IDs for storage in external
    systems.


    ---


    ## 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) | Customer token flow,
    OAuth2, anonymous access |

    | [Availability & Booking Search](/developers/guides/availability) | Search
    open slots, filter by service and resource |

    | [Customer Booking
    Lifecycle](/developers/guides/customer/booking-lifecycle) | View, modify,
    and cancel bookings |

    | [Order & Checkout Flow](/developers/guides/customer/checkout) | Cart,
    checkout steps, payment |

    | [Plans & Subscriptions](/developers/guides/customer/plans-subscriptions) |
    Membership plans and recurring billing |

    | [Communities & Access Control](/developers/guides/customer/communities) |
    Community membership and access gates |

    | [Waitlist](/developers/guides/customer/waitlist) | Join and manage
    waitlists |


    ---


    ## Base URLs


    | Environment | URL |

    |---|---|

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

    | Gov-Cloud | `https://b.anny.eu` |
  termsOfService: https://anny.co/terms-of-use
  x-logo:
    url: https://cdn.anny.co/cms/anny_logo_main_colour_blue_4865e76654.svg
    altText: anny logo
    href: https://anny.co
servers:
  - url: https://b.anny.co
    description: Production
  - url: https://b.anny.eu
    description: Gov-Cloud
security: []
tags:
  - name: Account Passes
  - name: Account Skills
  - name: Addresses
  - name: Availability
  - name: Booking Bundles
  - name: Booking Passes
  - name: Booking Quota Grants
  - name: Bookings
  - name: Communities
  - name: Community Accounts
  - name: Community Invites
  - name: Customer Accounts
  - name: Favorites
  - name: Orders
  - name: Organizations
  - name: Plan Subscriptions
  - name: Properties
  - name: Queues
  - name: Queue Tickets
  - name: Resources
  - name: Services
  - name: Waitlist
paths:
  /api/v1/order/bookings/calculate:
    post:
      tags:
        - Orders
      summary: Precalculate a possible booking
      description: This endpoint allows to precalculate a booking without creating it.
      operationId: post-order-bookings-calculate
      parameters:
        - schema:
            type: boolean
          in: query
          description: >-
            If true, the specified dates will be extended to the next possible
            interval
          name: auto-correct-intervals
        - schema:
            type: boolean
          in: query
          name: check_availability
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                resource_id:
                  type: string
                  description: id of the resource that should be booked
                service_id:
                  type: string
                  description: When no id is provided, the default service is taken.
                start_date:
                  type: string
                  format: date
                  description: atomic date time string
                end_date:
                  type: string
                  format: date-time
                  description: atomic date time string
                description:
                  type: string
                customer_note:
                  type: string
                booking_add_ons:
                  type: array
                  items:
                    type: object
                    properties:
                      add_on_id:
                        type: string
                      quantity:
                        type: number
                    required:
                      - add_on_id
                      - quantity
                sub_bookings:
                  type: array
                  items:
                    type: object
                    properties:
                      resource_id:
                        type: string
                        description: Resource id of the sub resource for the sub booking.
                      service_id:
                        type: string
                        description: >-
                          Id of the service which should be booked. When no id
                          is provided, the default service is taken.
                      quantity:
                        type: number
                    required:
                      - resource_id
                quantity:
                  type: number
              required:
                - resource_id
                - service_id
                - start_date
                - end_date
            examples:
              default:
                value:
                  resource_id: '22230'
                  service_id: '2800'
                  start_date: '2021-10-04T13:00:00+02:00'
                  end_date: '2021-10-04T17:00:00+02:00'
                  description: ''
                  customer_note: ''
                  booking_add_ons:
                    - add_on_id: '239'
                      quantity: 2
                  sub_bookings:
                    - resource_id: '21888'
                      service_id: '2777'
                      quantity: 1
                  quantity: 1
                  custom_fields: {}
        description: ''
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  start_date:
                    type: string
                    format: date-time
                  end_date:
                    type: string
                    format: date-time
                  unit:
                    type: string
                    description: Pricing unit (e.g. hourly, daily)
                  subtotal:
                    type: number
                    description: Subtotal before tax
                  total:
                    type: number
                    description: Total amount including tax
                  gross_amount:
                    type: number
                    description: Gross total amount
                  net_amount:
                    type: number
                    description: Net amount excluding tax
                  tax_amount:
                    type: number
                    description: Tax amount
                  charged_duration:
                    type: number
                    description: Duration in minutes that is charged
                  currency:
                    type: string
                  price_hidden:
                    type: boolean
                    description: Whether the price should be hidden from the customer
                  tax_rate:
                    type: number
                    description: Applied tax rate (e.g. 19)
                  is_net_price:
                    type: boolean
                    description: >-
                      Whether the configured price is net (tax calculated on
                      top)
                  service:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      is_series:
                        type: boolean
                  resource:
                    type: object
                    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:
                            name:
                              type: string
                            id:
                              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
                  quantity:
                    type: number
                  booking_quota_grants:
                    type: array
                    description: >-
                      Eligible quota grants for this booking with applicability
                      and usage info.
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        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 be used for this booking
                        preselected:
                          type: boolean
                          description: Whether this grant is the default selection
                        usage:
                          type: object
                          nullable: true
                          description: Projected usage if this grant is applied
                          properties:
                            value:
                              type: number
                            value_type:
                              type: string
                            charged_price:
                              type: number
                            is_partial:
                              type: boolean
                            relative_usage:
                              type: number
              examples:
                default:
                  value:
                    start_date: '2021-10-06T07:00:00+00:00'
                    end_date: '2021-10-06T11:00:00+00:00'
                    subtotal: 249
                    total: 277
                    gross_amount: 277
                    net_amount: 232.77
                    tax_amount: 44.23
                    charged_duration: 240
                    currency: EUR
                    service:
                      id: 2800
                      name: 'Coaching: Leadership - Empower Your Employees'
                    resource:
                      id: 22230
                      name: Leadership Coach
                    booking_add_ons:
                      - add_on:
                          id: 239
                          name: Vegan Food
                        total: 0
                        quantity: 3
                        currency: EUR
                    sub_bookings:
                      - total: 28
                        currency: EUR
                        service:
                          id: 2777
                          name: Basic
                        resource:
                          id: 21888
                          name: C01 - London
                    quantity: 1
      security: []

````