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

# Resolve booking quota grants for from-config cart bookings

> Resolves eligible booking quota grants for each booking in an admin from-config payload.

The response is grouped by `booking_ref` so the client can map grants back to each cart line.

Selection behavior:
- If `booking_quota_grant_id` is provided, it must be applicable for that booking context.
- If no explicit selection is provided and `prevent_applying_default_quota=true`, no preselection is returned.
- If `booking_code` is present, pass-based grants are used as the source (customer/account grants are not merged).




## OpenAPI

````yaml /developers/openapi/admin-internal.openapi.json post /api/v1/orders/from-config/booking-quota-grants
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 Edit](/developers/guides/admin/booking-edit) | Edit
    resource, dates, fields, add-ons, and sub-bookings |

    | [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: Booking Quotas
  - name: Orders
  - name: Organizations
  - name: Table Configuration
  - name: Test-Results
  - name: User Settings
  - name: Terminal Locations
  - name: Terminal Readers
  - name: Connection Tokens
  - name: Views
  - name: Voice Integration
paths:
  /api/v1/orders/from-config/booking-quota-grants:
    post:
      tags:
        - Booking Quotas
      summary: Resolve booking quota grants for from-config cart bookings
      description: >
        Resolves eligible booking quota grants for each booking in an admin
        from-config payload.


        The response is grouped by `booking_ref` so the client can map grants
        back to each cart line.


        Selection behavior:

        - If `booking_quota_grant_id` is provided, it must be applicable for
        that booking context.

        - If no explicit selection is provided and
        `prevent_applying_default_quota=true`, no preselection is returned.

        - If `booking_code` is present, pass-based grants are used as the source
        (customer/account grants are not merged).
      operationId: post-internal-orders-from-config-booking-quota-grants
      parameters:
        - schema:
            type: string
          in: header
          name: Authorization
          description: Bearer Token
          required: true
        - schema:
            type: string
          in: query
          name: o
          description: Organization ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - bookings
              properties:
                booking_code:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Optional booking pass code used as grant source for all
                    bookings.
                order_customer_id:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Fallback customer id when a booking does not provide
                    `customer_id`.
                bookings:
                  type: array
                  minItems: 1
                  items:
                    type: object
                    required:
                      - booking_ref
                      - resource_id
                      - service_id
                      - start_date
                      - end_date
                    properties:
                      booking_ref:
                        type: string
                        description: >-
                          Stable client-side reference used to correlate
                          response entries.
                      customer_id:
                        type:
                          - string
                          - 'null'
                        description: Optional booking-level customer id.
                      booking_quota_grant_id:
                        description: Optional explicit grant selection.
                        oneOf:
                          - type: string
                          - type: integer
                          - type: array
                      prevent_applying_default_quota:
                        type:
                          - boolean
                          - 'null'
                        description: >-
                          If true and no explicit selection is provided, default
                          preselection is skipped.
                      resource_id:
                        description: Resource id for the booking context.
                        oneOf:
                          - type: string
                          - type: integer
                          - type: array
                      service_id:
                        type: object
                        description: >-
                          Service id to quantity map used for effective quantity
                          calculation.
                        additionalProperties:
                          type: integer
                      start_date:
                        type: string
                        format: date-time
                      end_date:
                        type: string
                        format: date-time
                      timezone:
                        type:
                          - string
                          - 'null'
                        description: >-
                          Optional IANA timezone; organization timezone is used
                          if omitted.
            examples:
              by-order-customer:
                value:
                  order_customer_id: '1723'
                  bookings:
                    - booking_ref: bk-1
                      resource_id: '10'
                      service_id:
                        '5': 1
                      start_date: '2026-04-06T09:00:00+02:00'
                      end_date: '2026-04-06T10:00:00+02:00'
                    - booking_ref: bk-2
                      resource_id: '10'
                      service_id:
                        '5': 1
                      start_date: '2026-04-06T11:00:00+02:00'
                      end_date: '2026-04-06T12:00:00+02:00'
                      prevent_applying_default_quota: true
              by-booking-pass:
                value:
                  booking_code: PASSCODE1
                  bookings:
                    - booking_ref: bk-pass
                      resource_id: '10'
                      service_id:
                        '5': 1
                      start_date: '2026-04-06T09:00:00+02:00'
                      end_date: '2026-04-06T10:00:00+02:00'
      responses:
        '200':
          description: Grants resolved per booking reference.
          content:
            application/json:
              schema:
                type: object
                properties:
                  by_booking_ref:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        data:
                          type: array
                          items:
                            $ref: '#/components/schemas/booking-quota-grants.v1'
                        meta:
                          type: object
                          properties:
                            applicable_grant_ids:
                              type: array
                              items:
                                type: string
                            usage_by_grant_id:
                              type: object
                              additionalProperties:
                                type: object
                                properties:
                                  value:
                                    type: number
                                  value_type:
                                    type: string
                                  is_net_total:
                                    type: boolean
                                  currency:
                                    type: string
                                  tax_rate:
                                    type: number
                                  is_partial:
                                    type: boolean
                                  charged_price:
                                    type: number
                                  relativ_usage:
                                    type: number
                            requires_quota:
                              type: boolean
                            booking_allowed:
                              type: boolean
                            preselected_booking_quota_grant_id:
                              type:
                                - string
                                - 'null'
              examples:
                default:
                  value:
                    by_booking_ref:
                      bk-1:
                        data:
                          - type: booking-quota-grants
                            id: '381'
                            attributes:
                              label: Morning quota
                              start_date: '2026-04-01T00:00:00+00:00'
                              end_date: '2026-04-30T23:59:59+00:00'
                              expired_at: null
                              recurring_unit: none
                              recurring_period: 0
                              value: 10
                              value_type: quantity
                              used_value: 3
                              current_value: 7
                              created_at: '2026-04-01T08:00:00+00:00'
                              updated_at: '2026-04-04T09:15:00+00:00'
                            meta:
                              formatted_value: 7
                              current_progress: 30
                              used_up_label: 7 of 10 left
                              short_label: 7 left
                        meta:
                          applicable_grant_ids:
                            - '381'
                          usage_by_grant_id:
                            '381':
                              value: 1
                              value_type: quantity
                              is_net_total: false
                              currency: EUR
                              tax_rate: 19
                              is_partial: false
                              charged_price: 0
                              relativ_usage: 0.1
                          requires_quota: true
                          booking_allowed: true
                          preselected_booking_quota_grant_id: '381'
        '400':
          description: Invalid booking pass or selected grant is not applicable.
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '422':
          description: Validation error
      security:
        - Bearer: []
components:
  schemas:
    booking-quota-grants.v1:
      $schema: https://json-schema.org/draft/2020-12/schema
      x-version: 1.1.0
      title: BookingQuotaGrant
      type: object
      description: A granted quota allowance for a customer, tracking usage.
      x-tags:
        - Models
      properties:
        id:
          type: string
        type:
          type: string
          default: booking-quota-grants
        attributes:
          type: object
          properties:
            label:
              type: string
              description: Display label
            start_date:
              type: string
              description: Grant start date
            end_date:
              type: string
              description: Grant end date
            expired_at:
              type:
                - string
                - 'null'
              description: Expiration timestamp
            recurring_unit:
              type: string
              description: Recurring unit
            recurring_period:
              type: integer
              description: Recurring period
            value:
              type: number
              description: Granted value
            value_type:
              type: string
              description: Value type
            used_value:
              type: number
              description: Used amount
            current_value:
              type: number
              description: Remaining value
            created_at:
              type: string
              description: Creation timestamp
            updated_at:
              type: string
              description: Last update timestamp
        links:
          $ref: '#/components/schemas/links.v1'
        relationships:
          type: object
          properties:
            booking_quota:
              type: object
              properties:
                data:
                  type:
                    - object
                    - 'null'
                  properties:
                    id:
                      type: string
                    type:
                      type: string
                links:
                  $ref: '#/components/schemas/links.v1'
              description: The quota definition
            granted_through:
              type: object
              properties:
                data:
                  type:
                    - object
                    - 'null'
                  properties:
                    id:
                      type: string
                    type:
                      type: string
                links:
                  $ref: '#/components/schemas/links.v1'
              description: Source (subscription, pass, manual)
        meta:
          type: object
          properties:
            formatted_value:
              type: string
              description: Formatted value
            current_progress:
              type: number
              description: Usage percentage
            used_up_label:
              type: string
              description: Usage label
            short_label:
              type: string
              description: Short label
    links.v1:
      $schema: https://json-schema.org/draft/2020-12/schema
      x-version: 1.1.0
      title: ResourceLinks
      x-tags:
        - Models
      type: object
      description: JSON:API self-link object
      properties:
        self:
          type: string
          format: uri
  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: {}

````