/api/v1/order:
  get:
    summary: Get or create an active order
    operationId: get-order
    parameters:
    - schema:
        type: string
        enum:
        - bookings
        - bookings.booking_add_ons.add_on
        - bookings.resource
        - bookings.resource.parent
        - bookings.resource.settings
        - bookings.service
        - bookings.service.add_ons
        - bookings.sub_bookings.resource
        - bookings.sub_bookings.service
        - bookings.resource.cover_image
        - bookings.cancellation_policy
        - customer
        - customer.address
        - voucher
        - organization
        - organization.logo_image
        - organization.legal_documents
        - invoice
        - invoice.items
        - invoice_history
        - invoice_history.items
        - sub_orders
        - sub_orders.bookings
        - last_payment
        - last_payment.method
        - sub_orders
        - sub_orders.bookings
        - sub_orders.organization
        - sub_orders.organization.legal_documents
      in: query
      name: include
      description: Allows to include allowed resources in the response
      allowEmptyValue: false
    - schema:
        type: string
        enum:
        - number
        - total
        - status
        - created_at
      in: query
      name: sort
    - schema:
        type: string
      in: query
      name: filter[search]
    - schema:
        type: string
      in: query
      name: filter[number]
    - schema:
        type: string
      in: query
      name: filter[status]
    - schema:
        type: string
      in: query
      name: filter[start_date]
    - schema:
        type: string
      in: query
      name: filter[end_date]
    description: 'Auth: optional. This endpoint will return the currently active order (indentified by a cookie). Otherwise, the response
      would be empty.


      Note that orders expire automatically at `expires_at`. This date will be extended with each booking which is added to
      the order.

      An order with `status=draft` represents a cart.'
    tags:
    - Orders
    responses:
      '200':
        description: OK
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  $ref: ../../reference/orders.v1.yaml
            examples:
              Example:
                value:
                  data:
                    type: orders
                    id: '253'
                    attributes:
                      number: BO655735
                      currency: EUR
                      total: 40
                      net_amount: 33.61
                      tax_amount: 6.39
                      discount_amount: 0
                      status: draft
                      access_token: cVVE7ZZ7p3NXHxEdfKM8gAc8qHpq87
                      expires_at: '2020-05-24T17:19:12+00:00'
                      created_at: '2020-05-24T16:51:22+00:00'
                      updated_at: '2020-05-24T17:04:12+00:00'
                    relationships:
                      bookings:
                        data:
                        - type: bookings
                          id: '83'
                        - type: bookings
                          id: '84'
                      customer:
                        data: null
                    links:
                      self: http://bookingbuddy.test/api/v1/orders/253
                    meta:
                      download_url: http://bookingbuddy.test/downloads/order-confirmation/253/cVVE7ZZ7p3NXHxEdfKM8gAc8qHpq87
                      voucher_code: null
                  included:
                  - type: images
                    id: '17'
                    attributes:
                      url: http://bookingbuddy.test/storage/images/default/original/51ajS6dCLReTHVxqm44O5UQkR.jpg
                      copyright: null
                      preview_image_base64: null
                      small_path: http://bookingbuddy.test/storage/images/default/original/51ajS6dCLReTHVxqm44O5UQkR.jpg
                      medium_path: http://bookingbuddy.test/storage/images/default/original/51ajS6dCLReTHVxqm44O5UQkR.jpg
                      large_path: http://bookingbuddy.test/storage/images/default/original/51ajS6dCLReTHVxqm44O5UQkR.jpg
                      created_at: '2020-05-24T12:49:13+00:00'
                  - type: organizations
                    id: '5'
                    attributes:
                      slug: blick-and-sons
                      name: Blick and Sons
                      description: Aliquid dolorem corporis doloremque ut natus. Et eos deserunt ipsum perferendis. Voluptatem
                        repellendus distinctio suscipit ad.
                      plain_description: Aliquid dolorem corporis doloremque ut natus. Et eos deserunt ipsum perferendis.
                        Voluptatem repellendus distinctio suscipit ad.
                      official_name: Blick and Sons
                      support_email: junius.koch@greenholt.info
                      phone: null
                      timezone: Europe/Berlin
                      is_organization: true
                      responsible_for_contents: null
                      ceo: null
                      vat_id: null
                      register_number: null
                      local_court: null
                      financial_office: null
                    relationships:
                      legal_documents:
                        data: []
                  - type: resources
                    id: '24'
                    attributes:
                      slug: blick-and-sons-meeting-room-10
                      name: Meeting room 10
                      cancelable: true
                      auto_accept_bookings: false
                    relationships:
                      cover_image:
                        data:
                          type: images
                          id: '17'
                      organization:
                        data:
                          type: organizations
                          id: '5'
                  - type: bookings
                    id: '83'
                    attributes:
                      number: BB589425
                      status: reserved
                      start_date: '2020-05-27T08:00:00+00:00'
                      end_date: '2020-05-27T09:45:00+00:00'
                      blocker_start_date: '2020-05-27T08:00:00+00:00'
                      blocker_end_date: '2020-05-27T09:45:00+00:00'
                      description: null
                      charged_duration: 105
                      currency: EUR
                      total: 105
                      subtotal: 105
                      charged_total: 105
                      created_at: '2020-05-24T16:52:38+00:00'
                      canceled_at: null
                    relationships:
                      booking_add_ons:
                        data: []
                      resource:
                        data:
                          type: resources
                          id: '24'
                      sub_bookings:
                        data: []
                    meta:
                      ics_link: http://bookingbuddy.test/add-to-calendar/booking/83?type=ics
                      google_link: http://bookingbuddy.test/add-to-calendar/booking/83?type=google
                      outlook_link: http://bookingbuddy.test/add-to-calendar/booking/83?type=webOutlook
                      yahoo_link: http://bookingbuddy.test/add-to-calendar/booking/83?type=yahoo
                  - type: images
                    id: '8'
                    attributes:
                      url: http://bookingbuddy.test/storage/images/default/original/tAfMygvbwyimOMp2NTNcUabuE.jpg
                      copyright: null
                      preview_image_base64: null
                      small_path: http://bookingbuddy.test/storage/images/default/original/tAfMygvbwyimOMp2NTNcUabuE.jpg
                      medium_path: http://bookingbuddy.test/storage/images/default/original/tAfMygvbwyimOMp2NTNcUabuE.jpg
                      large_path: http://bookingbuddy.test/storage/images/default/original/tAfMygvbwyimOMp2NTNcUabuE.jpg
                      created_at: '2020-05-24T12:49:13+00:00'
                  - type: resources
                    id: '15'
                    attributes:
                      slug: blick-and-sons-meeting-room-1
                      name: Meeting room 1
                      cancelable: true
                      auto_accept_bookings: false
                    relationships:
                      cover_image:
                        data:
                          type: images
                          id: '8'
                      organization:
                        data:
                          type: organizations
                          id: '5'
                  - type: bookings
                    id: '84'
                    attributes:
                      number: BB874795
                      status: reserved
                      start_date: '2020-05-26T09:30:00+00:00'
                      end_date: '2020-05-26T10:30:00+00:00'
                      blocker_start_date: '2020-05-26T09:30:00+00:00'
                      blocker_end_date: '2020-05-26T10:30:00+00:00'
                      description: null
                      charged_duration: 60
                      currency: EUR
                      total: 40
                      subtotal: 40
                      charged_total: 40
                      created_at: '2020-05-24T17:04:12+00:00'
                      canceled_at: null
                    relationships:
                      booking_add_ons:
                        data: []
                      resource:
                        data:
                          type: resources
                          id: '15'
                      sub_bookings:
                        data: []
                    meta:
                      ics_link: http://bookingbuddy.test/add-to-calendar/booking/84?type=ics
                      google_link: http://bookingbuddy.test/add-to-calendar/booking/84?type=google
                      outlook_link: http://bookingbuddy.test/add-to-calendar/booking/84?type=webOutlook
                      yahoo_link: http://bookingbuddy.test/add-to-calendar/booking/84?type=yahoo
      '204':
        description: No Content
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties: {}
    security: []
  post:
    summary: Finish an order
    operationId: post-order
    responses:
      '200':
        description: OK
        content:
          application/vnd.api+json:
            schema:
              type: object
              description: ''
              properties:
                data:
                  type: array
                  description: Array of orders; for each involved organization one
                  items:
                    $ref: ../../reference/orders.v1.yaml
            examples:
              default:
                value:
                  meta: []
                  data:
                  - type: orders
                    id: '2010687'
                    attributes:
                      number: BO17499925
                      currency: EUR
                      total: 249
                      net_amount: 209.24
                      tax_amount: 39.76
                      discount_amount: 0
                      status: open
                      access_token: uuzahppQhD7wmJscn8IbwRe9hJb2wq
                      expires_at: null
                      created_at: '2021-09-24T12:18:49+00:00'
                      updated_at: '2021-09-24T12:22:02+00:00'
                    relationships:
                      bookings:
                        data:
                        - type: bookings
                          id: '3713015'
                      customer:
                        data:
                          type: customers
                          id: '408936'
                      last_payment:
                        data: null
                      sub_orders:
                        data: []
                    links:
                      self: https://b.anny.co/api/v1/orders/2010687
                    meta: []
                  included:
                  - type: resources
                    id: '22230'
                    attributes:
                      slug: lc
                      name: Leadership Coach
                      description: null
                      plain_description: ''
                      availabilityMode: null
                      continuous: true
                      color: null
                      auto_accept_bookings: true
                      timezone: Europe/Berlin
                      quantity: 3
                      staggered_quantity: 3
                      max_booking_quantity: 1
                      has_children: true
                      available_from: '2021-08-31T22:00:00+00:00'
                      available_to: null
                    meta:
                      settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: true
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: true
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      meta_settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: true
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: true
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      zoom: false
                  - type: images
                    id: '8685'
                    attributes:
                      url: https://cdn.booking-buddy.de/public/images/gallery/large/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg
                      copyright: ''
                      width: 1920
                      height: 1080
                      order_index: 0
                      preview_image_base64: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2ODApLCBxdWFsaXR5ID0gOTAK/9sAQwADAgIDAgIDAwMDBAMDBAUIBQUEBAUKBwcGCAwKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgWFBgSFBUU/9sAQwEDBAQFBAUJBQUJFA0LDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgACwAUAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A+yrP9pGBfDfirVPsVzIPD7zeYgUZlVTEBs3FRuxL0z26mvnb9mb9tSz8P+GfEumX0N/d3P8AaEurwTXs4l/dSyorRMSQQRuU8A8lz7VtfCu3TWdDstNvgbqxm01zJBKSVfBQjPryAfwFfMvh/wAH6Pa+J/iAkVkqJaqEhUO2EBG4gDPqo/Kvs62VU6jaWh8tgM5dJtVI8yt+p91Xn7Wvw3l1O+S71+e1lilCYQuVcbFO5dp6ZJH4UV+cNvpNrq4ee7jaWXeV3b2Xj8CPWisHl1OOlz1v7YnLVJr5n//Z
                      small_path: https://cdn.booking-buddy.de/public/images/gallery/small/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg
                      medium_path: https://cdn.booking-buddy.de/public/images/gallery/medium/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg
                      large_path: https://cdn.booking-buddy.de/public/images/gallery/large/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg
                      created_at: '2021-09-22T13:37:09+00:00'
                  - type: resources
                    id: '22233'
                    attributes:
                      slug: 6N0sHUrQyfEfDS1ANXNsD05cn3OPxR
                      name: Corina Abt
                      description: null
                      plain_description: ''
                      availabilityMode: null
                      continuous: true
                      color: null
                      auto_accept_bookings: true
                      timezone: Europe/Berlin
                      quantity: 1
                      staggered_quantity: null
                      max_booking_quantity: 1
                      has_children: false
                      available_from: null
                      available_to: null
                    relationships:
                      parent:
                        data:
                          type: resources
                          id: '22230'
                      cover_image:
                        data:
                          type: images
                          id: '8685'
                    meta:
                      settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: true
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: true
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      meta_settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: true
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: true
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      zoom: false
                  - type: services
                    id: '2800'
                    attributes:
                      name: 'Coaching: Leadership - Empower Your Employees'
                      slug: jrekqbe74eo9b7bwmursjki3michwt
                      description: null
                      hidden: false
                      is_rental_option: false
                      has_flexible_duration: false
                      auto_duration: false
                      allow_cross_schedule: false
                      requires_booking_description: false
                      requires_address: true
                      requires_mobile: true
                      allow_customer_notes: true
                      allow_more_bookings: true
                      charge_off_schedule: true
                      booking_interval: 240
                      calculation_interval: 240
                      min_duration: 240
                      max_duration: 240
                      uncharged_duration: 0
                      is_full_day: false
                      lead_time: 10080
                      padding_before: 0
                      padding_after: 0
                      advance_booking_period: 31
                      price: 249
                      starting_fee: 0
                      currency: EUR
                      tax_rate: 19
                      default_weight: 1
                      created_at: '2021-09-22T13:39:17+00:00'
                      updated_at: '2021-09-24T11:57:10+00:00'
                      access_code: null
                    meta:
                      resource_list: Leadership Coach
                      min_duration_total: 249
                  - type: bookings
                    id: '3713015'
                    attributes:
                      number: BB88036740
                      status: accepted
                      is_blocker: false
                      start_date: '2021-10-14T07:00:00+00:00'
                      end_date: '2021-10-14T11:00:00+00:00'
                      blocker_start_date: '2021-10-14T07:00:00+00:00'
                      blocker_end_date: '2021-10-14T11:00:00+00:00'
                      description: ''
                      charged_duration: 240
                      weight: 1
                    relationships:
                      booking_add_ons:
                        data: []
                      resource:
                        data:
                          type: resources
                          id: '22233'
                      service:
                        data:
                          type: services
                          id: '2800'
                      sub_bookings:
                        data: []
                      cancellation_policy:
                        data: null
                    meta: []
                  - type: customers
                    id: '408936'
                    attributes:
                      locale: de
                      title: null
                      given_name: Max
                      family_name: Mustermann
                      full_name: Max Mustermann
                      sex: 0
                      birth_date: null
                      email: max.mustermann@mail.com
                      mobile: '+491701234567'
                      phone: null
                      company: null
                      custom_entry_map:
                        6598dc92-e273-4944-8cfa-4430a397891e:
                          value: Google
                          formatted_value: Google
                          label: Wie bist du auf uns aufmerksam geworden?
                      created_at: '2021-09-24T12:01:08+00:00'
    requestBody:
      content:
        application/vnd.api+json:
          schema:
            type: object
            properties:
              accept_terms:
                type: boolean
              subscribe_newsletter:
                type: boolean
              agreements:
                type: object
                properties:
                  '{organization_slug}':
                    type: boolean
              customer:
                type: object
                properties:
                  given_name:
                    type: string
                  family_name:
                    type: string
                  email:
                    type: string
                  mobile:
                    type:
                      - string
                      - 'null'
                  company:
                    type:
                      - string
                      - 'null'
                  birth_date:
                    type:
                      - string
                      - 'null'
                  sex:
                    type:
                      - string
                      - 'null'
                  phone:
                    type:
                      - string
                      - 'null'
                  title:
                    type:
                      - string
                      - 'null'
              custom_fields:
                type:
                  - object
                  - 'null'
                properties:
                  '{custom_field_id}':
                    type:
                    - string
                    - number
                    - integer
                    - boolean
                    - 'null'
              bookings_custom_fields:
                type:
                  - object
                  - 'null'
                properties:
                  b_{booking_id}:
                    type: object
                    properties:
                      '{custom_field_id}':
                        type:
                        - string
                        - number
                        - integer
                        - boolean
                        - 'null'
              address:
                type: object
                description: Independent address payload. Use address resource keys.
                properties:
                  street_address:
                    type: string
                  address_line_2:
                    type:
                    - string
                    - 'null'
                  zip_code:
                    type: string
                  city:
                    type: string
                  area:
                    type:
                    - string
                    - 'null'
                    description: Region/state/province. For US organizations, use state code (for example CA).
                  country_code:
                    type: string
                    maxLength: 2
              meta:
                type: object
                properties:
                  timezone:
                    type: string
                  timezone_offset:
                    type: integer
                  remember_customer:
                    type: boolean
              verify_guest_email:
                type: object
                properties:
                  state:
                    type: string
                  code:
                    type: string
            required:
            - accept_terms
            - agreements
            - customer
          examples:
            example:
              value:
                accept_terms: true
                subscribe_newsletter: false
                agreements:
                  stadtmitte-buero: true
                customer:
                  given_name: Max
                  family_name: Mustermann
                  email: max.mustermann@mail.com
                  mobile: '+491701234567'
                  company: null
                  birth_date: null
                  sex: null
                  phone: null
                  title: null
                custom_fields:
                  6598dc92-e273-4944-8cfa-4430a397891e: Google
                bookings_custom_fields:
                  b_3711615:
                    55536678-2266-4bb0-99f5-206348244ad2: CTO
                  b_3712360:
                    55536678-2266-4bb0-99f5-206348244ad2: COO
                address:
                  street_address: Jülicher Straße 68
                  address_line_2: Hinterhaus
                  zip_code: '52070'
                  city: Aachen
                  area: NRW
                  country_code: DE
                meta:
                  timezone: Europe/Berlin
                  timezone_offset: -120
                  remember_customer: true
                verify_guest_email:
                  state: fESIyHXND2Yv9SYN
                  code: '166655'
      description: ''
    parameters:
    - schema:
        type: string
      in: query
      name: include
    tags:
    - Orders
    description: 'This endpoint is necessary to complete an order. The response is an array of orders, one for each organization
      involved, since the booked resources may be offered by different organizations.


      A booking is not always accepted automatically, depending on the settings of the resource it still has to be confirmed
      manually by the organization.'
/api/v1/orders/{order_number}:
  parameters:
  - schema:
      type: string
    name: order_number
    in: path
    required: true
    description: number (not the id!) of the order
  get:
    summary: Get an order after ordering
    tags:
    - Orders
    responses:
      '200':
        description: OK
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  $ref: ../../reference/orders.v1.yaml
            examples:
              default:
                value:
                  data:
                    type: orders
                    id: '2008375'
                    attributes:
                      number: BO85985688
                      currency: EUR
                      total: 249
                      net_amount: 209.24
                      tax_amount: 39.76
                      discount_amount: 0
                      status: open
                      access_token: tQZT6eecWtCcpBRotLiuDhedMc04Uz
                      expires_at: null
                      created_at: '2021-09-24T09:45:37+00:00'
                      updated_at: '2021-09-24T09:46:09+00:00'
                    links:
                      self: https://b.anny.co/api/v1/orders/2008375
                    meta:
                      download_url: https://b.anny.co/downloads/order-confirmation/2008375?access_token=tQZT6eecWtCcpBRotLiuDhedMc04Uz
                      voucher_code: null
                      is_base_order: false
                      payment_flow: pay-offline
              with relationships:
                value:
                  data:
                    type: orders
                    id: '2008375'
                    attributes:
                      number: BO85985688
                      currency: EUR
                      total: 249
                      net_amount: 209.24
                      tax_amount: 39.76
                      discount_amount: 0
                      status: open
                      access_token: tQZT6eecWtCcpBRotLiuDhedMc04Uz
                      expires_at: null
                      created_at: '2021-09-24T09:45:37+00:00'
                      updated_at: '2021-09-24T09:46:09+00:00'
                    relationships:
                      bookings:
                        data:
                        - type: bookings
                          id: '3705932'
                      customer:
                        data:
                          type: customers
                          id: '405278'
                      invoice_history:
                        data:
                        - type: invoices
                          id: '1167111'
                      organization:
                        data:
                          type: organizations
                          id: '734'
                      last_payment:
                        data: null
                      sub_orders:
                        data: []
                    links:
                      self: https://b.anny.co/api/v1/orders/2008375
                    meta:
                      download_url: https://b.anny.co/downloads/order-confirmation/2008375?access_token=tQZT6eecWtCcpBRotLiuDhedMc04Uz
                      voucher_code: null
                      is_base_order: false
                      payment_flow: pay-offline
                  included:
                  - type: images
                    id: '8685'
                    attributes:
                      url: https://cdn.booking-buddy.de/public/images/gallery/large/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg
                      copyright: ''
                      width: 1920
                      height: 1080
                      order_index: 0
                      preview_image_base64: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2ODApLCBxdWFsaXR5ID0gOTAK/9sAQwADAgIDAgIDAwMDBAMDBAUIBQUEBAUKBwcGCAwKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgWFBgSFBUU/9sAQwEDBAQFBAUJBQUJFA0LDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgACwAUAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A+yrP9pGBfDfirVPsVzIPD7zeYgUZlVTEBs3FRuxL0z26mvnb9mb9tSz8P+GfEumX0N/d3P8AaEurwTXs4l/dSyorRMSQQRuU8A8lz7VtfCu3TWdDstNvgbqxm01zJBKSVfBQjPryAfwFfMvh/wAH6Pa+J/iAkVkqJaqEhUO2EBG4gDPqo/Kvs62VU6jaWh8tgM5dJtVI8yt+p91Xn7Wvw3l1O+S71+e1lilCYQuVcbFO5dp6ZJH4UV+cNvpNrq4ee7jaWXeV3b2Xj8CPWisHl1OOlz1v7YnLVJr5n//Z
                      small_path: https://cdn.booking-buddy.de/public/images/gallery/small/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg
                      medium_path: https://cdn.booking-buddy.de/public/images/gallery/medium/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg
                      large_path: https://cdn.booking-buddy.de/public/images/gallery/large/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg
                      created_at: '2021-09-22T13:37:09+00:00'
                  - type: resources
                    id: '22230'
                    attributes:
                      slug: lc
                      name: Leadership Coach
                      description: null
                      plain_description: ''
                      availabilityMode: null
                      continuous: true
                      color: null
                      auto_accept_bookings: true
                      timezone: Europe/Berlin
                      quantity: 3
                      staggered_quantity: 3
                      max_booking_quantity: 1
                      has_children: true
                      available_from: '2021-08-31T22:00:00+00:00'
                      available_to: null
                    relationships:
                      cover_image:
                        data:
                          type: images
                          id: '8685'
                    meta:
                      settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: true
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: false
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      meta_settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: true
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: false
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      zoom: false
                  - type: resources
                    id: '22232'
                    attributes:
                      slug: airLK81OPAI6mzwPE6CmSlNSUjcDJy
                      name: Heinrich Simmon
                      description: null
                      plain_description: ''
                      availabilityMode: null
                      continuous: true
                      color: null
                      auto_accept_bookings: true
                      timezone: Europe/Berlin
                      quantity: 1
                      staggered_quantity: null
                      max_booking_quantity: 1
                      has_children: false
                      available_from: null
                      available_to: null
                    relationships:
                      parent:
                        data:
                          type: resources
                          id: '22230'
                      cover_image:
                        data: null
                    meta:
                      settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: true
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: false
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      meta_settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: true
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: false
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      zoom: false
                  - type: services
                    id: '2800'
                    attributes:
                      name: 'Coaching: Leadership - Empower Your Employees'
                      slug: jrekqbe74eo9b7bwmursjki3michwt
                      description: null
                      hidden: false
                      is_rental_option: false
                      has_flexible_duration: false
                      auto_duration: false
                      allow_cross_schedule: false
                      requires_booking_description: false
                      requires_address: true
                      requires_mobile: true
                      allow_customer_notes: true
                      allow_more_bookings: true
                      charge_off_schedule: true
                      booking_interval: 240
                      calculation_interval: 240
                      min_duration: 240
                      max_duration: 240
                      uncharged_duration: 0
                      is_full_day: false
                      lead_time: 10080
                      padding_before: 0
                      padding_after: 0
                      advance_booking_period: 31
                      price: 249
                      starting_fee: 0
                      currency: EUR
                      tax_rate: 19
                      default_weight: 1
                      created_at: '2021-09-22T13:39:17+00:00'
                      updated_at: '2021-09-22T13:47:07+00:00'
                      access_code: null
                    meta:
                      resource_list: Leadership Coach
                      min_duration_total: 249
                  - type: bookings
                    id: '3705932'
                    attributes:
                      number: BB53057994
                      status: accepted
                      is_blocker: false
                      start_date: '2021-10-01T11:00:00+00:00'
                      end_date: '2021-10-01T15:00:00+00:00'
                      blocker_start_date: '2021-10-01T11:00:00+00:00'
                      blocker_end_date: '2021-10-01T15:00:00+00:00'
                      description: 'Florian Schmitt - Coaching: Leadership - Empower Your Employees'
                      charged_duration: 240
                      weight: 1
                      currency: EUR
                      total: 249
                      code: PpWb076kUjC4d6v5
                      subtotal: 249
                      charged_total: 249
                      charged_subtotal: 249
                      starting_fee: 0
                      customer_note: null
                      created_at: '2021-09-24T09:45:37+00:00'
                      canceled_at: null
                      check_in_date: null
                      check_out_date: null
                      custom_entry_map: {}
                    relationships:
                      booking_add_ons:
                        data: []
                      resource:
                        data:
                          type: resources
                          id: '22232'
                      service:
                        data:
                          type: services
                          id: '2800'
                      sub_bookings:
                        data: []
                      cancellation_policy:
                        data: null
                    meta: []
                  - type: customers
                    id: '405278'
                    attributes:
                      locale: de
                      title: null
                      given_name: Florian
                      family_name: Schmitt
                      full_name: Florian Schmitt
                      sex: 0
                      birth_date: null
                      email: florian.schmitt@anny.co
                      mobile: '+491701234567'
                      phone: null
                      company: null
                      custom_entry_map: {}
                      created_at: '2021-09-22T10:14:01+00:00'
                  - type: items
                    id: '2545789'
                    attributes:
                      title: 'Coaching: Leadership - Empower Your Employees, Leadership Coach (Heinrich Simmon): 01.10.2021
                        13:00 - 01.10.2021 17:00 (CET)'
                      subtitle: null
                      quantity: 1
                      single_gross_amount: 249
                      single_net_amount: 209.24
                      single_tax_amount: 39.76
                      gross_amount: 249
                      net_amount: 209.24
                      tax_amount: 39.76
                      tax_rate: 19
                      currency: EUR
                      created_at: '2021-09-24T09:45:37+00:00'
                      updated_at: '2021-09-24T09:45:37+00:00'
                    relationships:
                      document: []
                      product: []
                  - type: invoices
                    id: '1167111'
                    attributes:
                      number: null
                      currency: EUR
                      is_cancellation: false
                      is_credit: false
                      has_payment: false
                      recipient: 'Florian Schmitt

                        Jülicher Straße 68

                        52070 Aachen

                        DE'
                      invoicing_party: 'Workspace GmbH

                        Jülicher Straße 68

                        52070 Aachen

                        DE'
                      total: 249
                      net_amount: 209.24
                      tax_amount: 39.76
                      status: draft
                      access_token: K5y0mAeNeeHoniWZ4t9KAk0pJhcs25
                      locked: false
                      issued_at: '2021-10-01T15:00:00+00:00'
                      due_date: '2021-10-15T15:00:00+00:00'
                      created_at: '2021-09-24T09:45:37+00:00'
                      updated_at: '2021-09-24T09:46:09+00:00'
                    relationships:
                      items:
                        data:
                        - type: items
                          id: '2545789'
                      reference: []
                    meta:
                      download_url: https://b.anny.co/accounting/invoices/1167111?access_token=K5y0mAeNeeHoniWZ4t9KAk0pJhcs25&locale=en
                  - type: organizations
                    id: '734'
                    attributes:
                      slug: stadtmitte-buero
                      name: Stadtmitte Büro
                      live: true
                      description: null
                      plain_description: ''
                      official_name: Workspace GmbH
                      support_email: florian.schmitt@anny.co
                      phone: null
                      currency: EUR
                      timezone: Europe/Berlin
                      is_organization: true
                      responsible_for_contents: Florian Schmitt
                      ceo: null
                      vat_id: null
                      register_number: null
                      local_court: null
                      financial_office: null
                    relationships:
                      logo_image:
                        data: null
                    meta:
                      settings:
                        organizeResourcesBy: category
                        checkout:
                          additionalFields: []
                          additionalRequiredFields: []
                        preferFormalSalutation: false
                      meta_settings:
                        organizeResourcesBy: category
                        checkout:
                          additionalFields: []
                          additionalRequiredFields: []
                        preferFormalSalutation: false
    operationId: get-orders-record
    parameters:
    - schema:
        type: string
      in: query
      name: access_token
      description: Access token to access an order anonymously
      required: true
    - schema:
        type: string
        enum:
        - bookings
        - bookings.booking_add_ons.add_on
        - bookings.resource
        - bookings.resource.parent
        - bookings.resource.parent.cover_image
        - bookings.resource.settings
        - bookings.service
        - bookings.service.add_ons
        - bookings.sub_bookings.resource
        - bookings.sub_bookings.service
        - bookings.resource.cover_image
        - bookings.cancellation_policy
        - customer
        - customer.address
        - voucher
        - organization
        - organization.logo_image
        - organization.legal_documents
        - invoice
        - invoice.items
        - invoice_history
        - invoice_history.items
        - sub_orders
        - sub_orders.bookings
        - last_payment
        - last_payment.method
        - sub_orders
        - sub_orders.bookings
        - sub_orders.organization
        - sub_orders.organization.legal_documents
      in: query
      name: include
      explode: false
    - schema:
        type: string
      in: query
      name: sort
    - schema:
        type: string
      in: query
      name: filter[search]
    - schema:
        type: string
      in: query
      name: filter[number]
    - schema:
        type: string
      in: query
      name: filter[status]
    - schema:
        type: string
      in: query
      name: filter[start_date]
    - schema:
        type: string
      in: query
      name: filter[end_date]
    description: 'Auth: optional. This endpoint allows a customer to access an order via the **order number** after placing
      it. This can be authenticated either anonymously via the order `access_token` or via customer login.'
    security: []
/api/v1/orders/{order_number}/cancel:
  parameters:
  - schema:
      type: string
    name: order_number
    in: path
    required: true
    description: number (not the id!) of the order
  get:
    summary: Cancel an order
    tags:
    - Orders
    responses:
      '200':
        description: OK
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  $ref: ../../reference/orders.v1.yaml
            examples:
              default:
                value:
                  data:
                    type: orders
                    id: '2010985'
                    attributes:
                      number: BO66236921
                      currency: EUR
                      total: 0
                      net_amount: 0
                      tax_amount: 0
                      discount_amount: 0
                      status: canceled
                      access_token: VGcIMIwStxojwlkTYVeM0tCYgsx0xz
                      expires_at: null
                      created_at: '2021-09-24T12:33:50+00:00'
                      updated_at: '2021-09-24T12:34:43+00:00'
                    links:
                      self: https://b.anny.co/api/v1/orders/2010985
                    meta:
                      download_url: https://b.anny.co/downloads/order-confirmation/2010985?access_token=VGcIMIwStxojwlkTYVeM0tCYgsx0xz
                      voucher_code: null
                      is_base_order: false
                      payment_flow: pay-offline
      '403':
        description: Forbidden
      '404':
        description: Not Found
    operationId: get-orders-record-cancel
    description: 'Auth: optional. This endpoint allows a customer to cancel an order via the **order number**. This can be
      done either anonymously via the access token or via the customer login.

      Canceling the order will also cancel all related bookings.'
    parameters:
    - schema:
        type: string
      in: query
      name: access_token
      description: Access token to access an order anonymously
    security: []
/api/v1/orders/{order_number}/resend-mail:
  parameters:
  - schema:
      type: string
    name: order_number
    in: path
    required: true
    description: number (not the id!) of the order
  get:
    summary: Cancel an order
    tags:
    - Orders
    responses:
      '204':
        description: No Content
      '401':
        description: Unauthorized
      '403':
        description: Forbidden
      '404':
        description: Not Found
    operationId: get-orders-record-resend-mail
    description: 'Auth: optional. This endpoint allows a customer to resend the booking confirmation via the **order number**.
      This can be done either anonymously via the access token or via customer login.

      This only re-sends the confirmation email and does not modify the order.'
    parameters:
    - schema:
        type: string
      in: query
      name: access_token
      description: Access token to access an order anonymously
      required: true
    - schema:
        type: string
        format: email
      in: query
      name: email
    security: []
/api/v1/order/bookings:
  post:
    summary: Add booking to order
    operationId: post-order-bookings
    parameters:
    - schema:
        type: string
        enum:
        - customer
        - customer.address
        - invoice
        - invoice.items
        - customer
        - voucher
        - bookings
        - bookings.service
        - bookings.booking_add_ons.add_on
        - bookings.sub_bookings.resource
        - bookings.sub_bookings.service
        - bookings.resource.organization
        - bookings.resource
        - bookings.resource.cover_image
        - bookings.resource.organization.legal_documents
      in: query
      name: include
      description: Allows to include allowed resources in the response
    responses:
      '200':
        description: OK
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  $ref: ../../reference/orders.v1.yaml
            examples:
              Full example:
                value:
                  data:
                    type: orders
                    id: '2012707'
                    attributes:
                      number: BO39099858
                      currency: EUR
                      total: 277
                      net_amount: 232.77
                      tax_amount: 44.23
                      discount_amount: 0
                      status: draft
                      access_token: fCbsam8YHC4Ant65vQ7VCOkY3mFA4D
                      expires_at: '2021-09-24T14:20:50+00:00'
                      created_at: '2021-09-24T14:05:50+00:00'
                      updated_at: '2021-09-24T14:05:51+00:00'
                    relationships:
                      bookings:
                        data:
                        - type: bookings
                          id: '3717324'
                      customer:
                        data: null
                      sub_orders:
                        data:
                        - type: orders
                          id: '2012708'
                    links:
                      self: https://b.anny.co/api/v1/orders/2012707
                    meta:
                      download_url: https://b.anny.co/downloads/order-confirmation/2012707?access_token=fCbsam8YHC4Ant65vQ7VCOkY3mFA4D
                      voucher_code: null
                      is_base_order: true
                      payment_flow: pay-offline
                      pay_now_amount: 0
                  included:
                  - type: add-ons
                    id: '239'
                    attributes:
                      name: Vegan Food
                      description: <p>We will ensure all snacks offered will be vegan.</p>
                      plain_description: We will ensure all snacks offered will be vegan.
                      customer_notice: 'Select # of vegan attendees'
                      lead_time: 0
                      is_third_party: false
                      currency: EUR
                      tax_rate: 19
                      price: 0
                  - type: booking-add-ons
                    id: '795'
                    attributes:
                      quantity: 3
                      total: 0
                    relationships:
                      add_on:
                        data:
                          type: add-ons
                          id: '239'
                  - type: resources
                    id: '22230'
                    attributes:
                      slug: lc
                      name: Leadership Coach
                      description: null
                      plain_description: ''
                      availabilityMode: null
                      continuous: true
                      color: null
                      auto_accept_bookings: true
                      timezone: Europe/Berlin
                      quantity: 3
                      staggered_quantity: 3
                      max_booking_quantity: 1
                      has_children: true
                      available_from: '2021-08-31T22:00:00+00:00'
                      available_to: null
                    meta:
                      settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: true
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: false
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      meta_settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: true
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: false
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      zoom: false
                  - type: images
                    id: '8685'
                    attributes:
                      url: https://cdn.booking-buddy.de/public/images/gallery/large/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg
                      copyright: ''
                      width: 1920
                      height: 1080
                      order_index: 0
                      preview_image_base64: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2ODApLCBxdWFsaXR5ID0gOTAK/9sAQwADAgIDAgIDAwMDBAMDBAUIBQUEBAUKBwcGCAwKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgWFBgSFBUU/9sAQwEDBAQFBAUJBQUJFA0LDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgACwAUAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A+yrP9pGBfDfirVPsVzIPD7zeYgUZlVTEBs3FRuxL0z26mvnb9mb9tSz8P+GfEumX0N/d3P8AaEurwTXs4l/dSyorRMSQQRuU8A8lz7VtfCu3TWdDstNvgbqxm01zJBKSVfBQjPryAfwFfMvh/wAH6Pa+J/iAkVkqJaqEhUO2EBG4gDPqo/Kvs62VU6jaWh8tgM5dJtVI8yt+p91Xn7Wvw3l1O+S71+e1lilCYQuVcbFO5dp6ZJH4UV+cNvpNrq4ee7jaWXeV3b2Xj8CPWisHl1OOlz1v7YnLVJr5n//Z
                      small_path: https://cdn.booking-buddy.de/public/images/gallery/small/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg
                      medium_path: https://cdn.booking-buddy.de/public/images/gallery/medium/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg
                      large_path: https://cdn.booking-buddy.de/public/images/gallery/large/hW89Tc5fjhp0SBpR7PIzkTNOe.jpg
                      created_at: '2021-09-22T13:37:09+00:00'
                  - type: resources
                    id: '22233'
                    attributes:
                      slug: 6N0sHUrQyfEfDS1ANXNsD05cn3OPxR
                      name: Corina Abt
                      description: null
                      plain_description: ''
                      availabilityMode: null
                      continuous: true
                      color: null
                      auto_accept_bookings: true
                      timezone: Europe/Berlin
                      quantity: 1
                      staggered_quantity: null
                      max_booking_quantity: 1
                      has_children: false
                      available_from: null
                      available_to: null
                    relationships:
                      parent:
                        data:
                          type: resources
                          id: '22230'
                      cover_image:
                        data:
                          type: images
                          id: '8685'
                    meta:
                      settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: true
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: false
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      meta_settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: true
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: false
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      zoom: false
                  - type: services
                    id: '2800'
                    attributes:
                      name: 'Coaching: Leadership - Empower Your Employees'
                      slug: jrekqbe74eo9b7bwmursjki3michwt
                      description: null
                      hidden: false
                      is_rental_option: false
                      has_flexible_duration: false
                      auto_duration: false
                      allow_cross_schedule: false
                      requires_booking_description: false
                      requires_address: true
                      requires_mobile: true
                      allow_customer_notes: true
                      allow_more_bookings: true
                      charge_off_schedule: true
                      booking_interval: 240
                      calculation_interval: 240
                      min_duration: 240
                      max_duration: 240
                      uncharged_duration: 0
                      is_full_day: false
                      lead_time: 10080
                      padding_before: 0
                      padding_after: 0
                      advance_booking_period: 31
                      price: 249
                      starting_fee: 0
                      currency: EUR
                      tax_rate: 19
                      default_weight: 1
                      created_at: '2021-09-22T13:39:17+00:00'
                      updated_at: '2021-09-24T12:34:10+00:00'
                      access_code: null
                    meta:
                      resource_list: Leadership Coach
                      min_duration_total: 249
                  - type: resources
                    id: '21888'
                    attributes:
                      slug: c01
                      name: C01 - London
                      description: <p>Testbeschreibung C01</p>
                      plain_description: Testbeschreibung C01
                      availabilityMode: null
                      continuous: true
                      color: null
                      auto_accept_bookings: true
                      timezone: Europe/Berlin
                      quantity: 1
                      staggered_quantity: null
                      max_booking_quantity: 1
                      has_children: false
                      available_from: '2021-08-31T22:00:00+00:00'
                      available_to: null
                    meta:
                      settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: false
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: true
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      meta_settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: false
                          requiresLogin: false
                          requiresLoginReason: null
                          verifyGuestEmail: true
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      zoom: false
                  - type: services
                    id: '2777'
                    attributes:
                      name: Basic
                      slug: mvwps18k7e0lifyxl7icid4znqdcwq
                      description: null
                      hidden: false
                      is_rental_option: true
                      has_flexible_duration: true
                      auto_duration: false
                      allow_cross_schedule: false
                      requires_booking_description: false
                      requires_address: true
                      requires_mobile: true
                      allow_customer_notes: true
                      allow_more_bookings: true
                      charge_off_schedule: true
                      booking_interval: 15
                      calculation_interval: 30
                      min_duration: 30
                      max_duration: 480
                      uncharged_duration: 60
                      is_full_day: false
                      lead_time: 60
                      padding_before: 15
                      padding_after: 15
                      advance_booking_period: 31
                      price: 3
                      starting_fee: 10
                      currency: EUR
                      tax_rate: 19
                      default_weight: 1
                      created_at: '2021-09-20T13:42:16+00:00'
                      updated_at: '2021-09-22T10:48:45+00:00'
                      access_code: null
                    meta:
                      resource_list: C01 - London, M01 - Aachen, M02 - Köln
                      min_duration_total: 10
                  - type: bookings
                    id: '3717325'
                    attributes:
                      number: BB23455895
                      status: reserved
                      is_blocker: false
                      start_date: '2021-10-05T11:00:00+00:00'
                      end_date: '2021-10-05T15:00:00+00:00'
                      blocker_start_date: '2021-10-05T11:00:00+00:00'
                      blocker_end_date: '2021-10-05T15:00:00+00:00'
                      description: null
                      charged_duration: 240
                      weight: 1
                      currency: EUR
                      total: 28
                      code: IZSZSvmiV6bo7sIt
                      subtotal: 28
                      charged_total: 28
                      charged_subtotal: 28
                      starting_fee: 10
                      customer_note: null
                      created_at: '2021-09-24T14:05:50+00:00'
                      canceled_at: null
                      check_in_date: null
                      check_out_date: null
                      custom_entry_map: {}
                    relationships:
                      resource:
                        data:
                          type: resources
                          id: '21888'
                      service:
                        data:
                          type: services
                          id: '2777'
                    meta: []
                  - type: bookings
                    id: '3717324'
                    attributes:
                      number: BB93911074
                      status: reserved
                      is_blocker: false
                      start_date: '2021-10-05T11:00:00+00:00'
                      end_date: '2021-10-05T15:00:00+00:00'
                      blocker_start_date: '2021-10-05T11:00:00+00:00'
                      blocker_end_date: '2021-10-05T15:00:00+00:00'
                      description: null
                      charged_duration: 240
                      weight: 1
                      currency: EUR
                      total: 277
                      code: bmLbbkY9Ulrs9dHg
                      subtotal: 249
                      charged_total: 277
                      charged_subtotal: 249
                      starting_fee: 0
                      customer_note: null
                      created_at: '2021-09-24T14:05:50+00:00'
                      canceled_at: null
                      check_in_date: null
                      check_out_date: null
                      custom_entry_map: {}
                    relationships:
                      booking_add_ons:
                        data:
                        - type: booking-add-ons
                          id: '795'
                      resource:
                        data:
                          type: resources
                          id: '22233'
                      service:
                        data:
                          type: services
                          id: '2800'
                      sub_bookings:
                        data:
                        - type: bookings
                          id: '3717325'
                      cancellation_policy:
                        data: null
                    meta: []
                  - type: legal-documents
                    id: '311'
                    attributes:
                      title: T&C Test
                      content: <p>T&amp;C Test</p>
                      document_type: terms_and_conditions
                  - type: legal-documents
                    id: '312'
                    attributes:
                      title: Privacy Test
                      content: <p>Privacy Test</p>
                      document_type: privacy_policy
                  - type: organizations
                    id: '734'
                    attributes:
                      slug: stadtmitte-buero
                      name: Stadtmitte Büro
                      live: true
                      description: null
                      plain_description: ''
                      official_name: Workspace GmbH
                      support_email: florian.schmitt@anny.co
                      phone: null
                      currency: EUR
                      timezone: Europe/Berlin
                      is_organization: true
                      responsible_for_contents: Florian Schmitt
                      ceo: null
                      vat_id: null
                      register_number: null
                      local_court: null
                      financial_office: null
                    relationships:
                      legal_documents:
                        data:
                        - type: legal-documents
                          id: '311'
                        - type: legal-documents
                          id: '312'
                    meta:
                      settings:
                        organizeResourcesBy: category
                        checkout:
                          additionalFields: []
                          additionalRequiredFields: []
                        preferFormalSalutation: false
                      meta_settings:
                        organizeResourcesBy: category
                        checkout:
                          additionalFields: []
                          additionalRequiredFields: []
                        preferFormalSalutation: false
                  - type: orders
                    id: '2012708'
                    attributes:
                      number: BO99655285
                      currency: EUR
                      total: 277
                      net_amount: 232.77
                      tax_amount: 44.23
                      discount_amount: 0
                      status: draft
                      access_token: pdEQU9LZBqKB7nQnhkbVBBypQJOkXB
                      expires_at: null
                      created_at: '2021-09-24T14:05:50+00:00'
                      updated_at: '2021-09-24T14:05:51+00:00'
                    relationships:
                      bookings:
                        data:
                        - type: bookings
                          id: '3717324'
                      organization:
                        data:
                          type: organizations
                          id: '734'
                    meta: []
    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: Id of the service which should be booked. 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
                description: 'The description which will be associated with the bookings resource. It is conditionally required.

                  '
              customer_note:
                type: string
                description: 'A note from the customer which is attented to the booking

                  '
              booking_add_ons:
                type: array
                description: List of add ons
                items:
                  type: object
                  properties:
                    add_on_id:
                      type: string
                    quantity:
                      type: number
                  required:
                  - add_on_id
                  - quantity
              sub_bookings:
                type: array
                uniqueItems: true
                description: 'List of sub bookings

                  '
                items:
                  type: object
                  properties:
                    resource_id:
                      type: string
                    service_id:
                      type: string
                      description: This is optional. When nothing is sent, the default service will be taken.
                    quantity:
                      type: number
              quantity:
                type: number
            required:
            - resource_id
            - start_date
            - end_date
          examples:
            default:
              value:
                resource_id: '22233'
                service_id: '2800'
                start_date: '2021-10-15T09:00:00+02:00'
                end_date: '2021-10-15T13:00:00+02:00'
                description: ''
                customer_note: ''
                booking_add_ons:
                - add_on_id: '239'
                  quantity: 3
                sub_bookings:
                - resource_id: '21888'
                  service_id: '2777'
                  quantity: 1
                quantity: 1
                custom_fields: {}
      description: ''
    tags:
    - Orders
    description: This endpoint allows to add bookings to an order with status "draft". After the booking has changed the status,
      no more changes are possible from the customer side. There does not have to exist an order beforehand, because it is
      created as soon as the first booking is added.
    security: []
/api/v1/order/bookings/{booking_id}:
  parameters:
  - schema:
      type: integer
    name: booking_id
    in: path
    required: true
    description: id of the booking
  delete:
    summary: Delete a booking from an order
    operationId: delete-order-bookings-record
    responses:
      '200':
        description: OK
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  $ref: ../../reference/orders.v1.yaml
            examples:
              default:
                value:
                  data:
                    type: orders
                    id: '2012917'
                    attributes:
                      number: BO36265293
                      currency: EUR
                      total: 199
                      net_amount: 167.23
                      tax_amount: 31.77
                      discount_amount: 0
                      status: draft
                      access_token: NK5EtluiM2L3nJlDs9sV5LhMaoPaRy
                      expires_at: '2021-09-24T14:30:19+00:00'
                      created_at: '2021-09-24T14:15:09+00:00'
                      updated_at: '2021-09-24T14:15:28+00:00'
                    relationships:
                      bookings:
                        data:
                        - type: bookings
                          id: '3717554'
                      customer:
                        data: null
                      sub_orders:
                        data:
                        - type: orders
                          id: '2012918'
                    links:
                      self: https://b.anny.co/api/v1/orders/2012917
                    meta:
                      download_url: https://b.anny.co/downloads/order-confirmation/2012917?access_token=NK5EtluiM2L3nJlDs9sV5LhMaoPaRy
                      voucher_code: null
                      is_base_order: true
                      payment_flow: pay-offline
                      pay_now_amount: 0
                  included:
                  - type: images
                    id: '8654'
                    attributes:
                      url: https://cdn.booking-buddy.de/public/images/gallery/large/GaRTAuUgqj6v9a6oAi6n6his8.jpg
                      copyright: ''
                      width: 500
                      height: 347
                      order_index: 0
                      preview_image_base64: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2ODApLCBxdWFsaXR5ID0gOTAK/9sAQwADAgIDAgIDAwMDBAMDBAUIBQUEBAUKBwcGCAwKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgWFBgSFBUU/9sAQwEDBAQFBAUJBQUJFA0LDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgADgAUAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A+n/i7+0NqHhS/mPg6yhki8O6rB/arZjb7bZ7ZUuVRW2kNE6rn5gclTyuaw9P+K+uwJo+l2Xhmfwt4h1TXIrg28gVUWx/dmYc5RCwBBHJGXbG4gnif2kNJvNM+KfhnxTYW+nNYXLzR6jbTiRXlbysGQbCAzbFA+bjKjOa6vSGt/iv4u0zS9RnvlgkMuwxSLHJDNgMsqvg5KiJcZXPJ5PFcil0kdVlZOK0PeNK+IviO9N6sFhItvbXL28c05QCdVx+8TG47Cc4zgnBOAMUV0Xw58PW3g/w4NLtZrm7EUhaS6vHDzTuVUl3IAGTnoAAMAAAUVsm+pyNK+h//9k=
                      small_path: https://cdn.booking-buddy.de/public/images/gallery/small/GaRTAuUgqj6v9a6oAi6n6his8.jpg
                      medium_path: https://cdn.booking-buddy.de/public/images/gallery/medium/GaRTAuUgqj6v9a6oAi6n6his8.jpg
                      large_path: https://cdn.booking-buddy.de/public/images/gallery/large/GaRTAuUgqj6v9a6oAi6n6his8.jpg
                      created_at: '2021-09-21T09:37:11+00:00'
                  - type: resources
                    id: '22153'
                    attributes:
                      slug: ctc
                      name: Certified Team Coach
                      description: <p>Book a certified team coach to get you team's collaboration to the next level.</p>
                      plain_description: Book a certified team coach to get you team's collaboration to the next level.
                      availabilityMode: null
                      continuous: true
                      color: null
                      auto_accept_bookings: true
                      timezone: Europe/Berlin
                      quantity: 1
                      staggered_quantity: null
                      max_booking_quantity: 1
                      has_children: false
                      available_from: '2021-08-31T22:00:00+00:00'
                      available_to: null
                    relationships:
                      parent:
                        data: null
                      cover_image:
                        data:
                          type: images
                          id: '8654'
                    meta:
                      settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: false
                          requiresLogin: false
                          requiresLoginReason: ''
                          verifyGuestEmail: false
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      meta_settings:
                        showAvailabilityCalendar: true
                        showAvailabilityCount: true
                        checkout:
                          customerCanPickChildren: false
                          requiresLogin: false
                          requiresLoginReason: ''
                          verifyGuestEmail: false
                        checkIn:
                          isEnabled: false
                        selfCheckIn:
                          isEnabled: false
                          disabledUntil: 15
                          geoCheckEnabled: true
                          geoCheckMaxDelta: 997
                          allowedOverrunTime: 60
                      zoom: false
                  - type: services
                    id: '2783'
                    attributes:
                      name: 'Coaching: Effective Communication & Collaboration'
                      slug: stjymkaryfeu3zpdrjkipxbracoe4x
                      description: <p>Learn how to effectively communicate to enable and maximize collaboration. Our coach provides
                        you with 3 simple guidelines to venture off into new dimensions of collaboration.</p>
                      hidden: false
                      is_rental_option: false
                      has_flexible_duration: false
                      auto_duration: false
                      allow_cross_schedule: false
                      requires_booking_description: false
                      requires_address: true
                      requires_mobile: true
                      allow_customer_notes: true
                      allow_more_bookings: true
                      charge_off_schedule: true
                      booking_interval: 15
                      calculation_interval: 180
                      min_duration: 180
                      max_duration: 180
                      uncharged_duration: 0
                      is_full_day: false
                      lead_time: 10080
                      padding_before: 15
                      padding_after: 15
                      advance_booking_period: 31
                      price: 199
                      starting_fee: 0
                      currency: EUR
                      tax_rate: 19
                      default_weight: 1
                      created_at: '2021-09-21T09:53:34+00:00'
                      updated_at: '2021-09-22T12:31:16+00:00'
                      access_code: null
                    meta:
                      resource_list: Certified Team Coach
                      min_duration_total: 199
                  - type: bookings
                    id: '3717554'
                    attributes:
                      number: BB66568081
                      status: reserved
                      is_blocker: false
                      start_date: '2021-10-22T07:00:00+00:00'
                      end_date: '2021-10-22T10:00:00+00:00'
                      blocker_start_date: '2021-10-22T06:45:00+00:00'
                      blocker_end_date: '2021-10-22T10:15:00+00:00'
                      description: null
                      charged_duration: 180
                      weight: 1
                      currency: EUR
                      total: 199
                      code: mYDM4cbnIeooDRRN
                      subtotal: 199
                      charged_total: 199
                      charged_subtotal: 199
                      starting_fee: 0
                      customer_note: null
                      created_at: '2021-09-24T14:15:19+00:00'
                      canceled_at: null
                      check_in_date: null
                      check_out_date: null
                      custom_entry_map: {}
                    relationships:
                      booking_add_ons:
                        data: []
                      resource:
                        data:
                          type: resources
                          id: '22153'
                      service:
                        data:
                          type: services
                          id: '2783'
                      sub_bookings:
                        data: []
                      cancellation_policy:
                        data: null
                    meta: []
                  - type: legal-documents
                    id: '311'
                    attributes:
                      title: T&C Test
                      content: <p>T&amp;C Test</p>
                      document_type: terms_and_conditions
                  - type: legal-documents
                    id: '312'
                    attributes:
                      title: Privacy Test
                      content: <p>Privacy Test</p>
                      document_type: privacy_policy
                  - type: organizations
                    id: '734'
                    attributes:
                      slug: stadtmitte-buero
                      name: Stadtmitte Büro
                      live: true
                      description: null
                      plain_description: ''
                      official_name: Workspace GmbH
                      support_email: florian.schmitt@anny.co
                      phone: null
                      currency: EUR
                      timezone: Europe/Berlin
                      is_organization: true
                      responsible_for_contents: Florian Schmitt
                      ceo: null
                      vat_id: null
                      register_number: null
                      local_court: null
                      financial_office: null
                    relationships:
                      legal_documents:
                        data:
                        - type: legal-documents
                          id: '311'
                        - type: legal-documents
                          id: '312'
                    meta:
                      settings:
                        organizeResourcesBy: category
                        checkout:
                          additionalFields: []
                          additionalRequiredFields: []
                        preferFormalSalutation: false
                      meta_settings:
                        organizeResourcesBy: category
                        checkout:
                          additionalFields: []
                          additionalRequiredFields: []
                        preferFormalSalutation: false
                  - type: orders
                    id: '2012918'
                    attributes:
                      number: BO89972352
                      currency: EUR
                      total: 199
                      net_amount: 167.23
                      tax_amount: 31.77
                      discount_amount: 0
                      status: draft
                      access_token: wyW93yQdteN83w6d7UYlDSGRhDGpI0
                      expires_at: null
                      created_at: '2021-09-24T14:15:09+00:00'
                      updated_at: '2021-09-24T14:15:28+00:00'
                    relationships:
                      bookings:
                        data:
                        - type: bookings
                          id: '3717554'
                      organization:
                        data:
                          type: organizations
                          id: '734'
                    meta: []
      '204':
        description: No Content
    description: This endpoint allows to delete the booking of an order that is still in status "draft". After the booking
      has changed the status, no more changes are possible from the customer side.  If there are no more bookings in the order,
      the entire order is deleted.
    tags:
    - Orders
    parameters:
    - schema:
        type: string
        enum:
        - customer
        - voucher
        - bookings.booking_add_ons.add_on
        - bookings.sub_bookings.resource
        - bookings.sub_bookings.service
        - bookings.service
        - bookings.cancellation_policy
        - bookings.resource.cover_image
        - bookings.resource.parent
        - sub_orders.bookings
        - sub_orders.organization.legal_documents
      in: query
      name: include
    - schema:
        type: string
      in: query
      name: field[voucher]
/api/v1/order/bookings/calculate:
  post:
    summary: Precalculate a possible booking
    operationId: post-order-bookings-calculate
    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:
                          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
                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
    tags:
    - Orders
    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: ''
    description: This endpoint allows to precalculate a booking without creating it.
    security: []
    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
/api/v1/order/voucher:
  post:
    summary: Apply voucher
    operationId: post-order-voucher
    responses:
      '200':
        description: OK
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  $ref: ../../reference/orders.v1.yaml
            examples:
              full example:
                value:
                  data:
                    type: orders
                    id: '2013266'
                    attributes:
                      number: BO95786261
                      currency: EUR
                      total: 277
                      net_amount: 232.77
                      tax_amount: 44.23
                      discount_amount: 0
                      status: draft
                      access_token: e04NrT789XmaGvYopaflM5Kp1byLt0
                      expires_at: '2021-09-24T14:48:51+00:00'
                      created_at: '2021-09-24T14:33:51+00:00'
                      updated_at: '2021-09-24T14:34:08+00:00'
                    relationships:
                      bookings:
                        data:
                        - type: bookings
                          id: '3718347'
                      customer:
                        data: null
                      sub_orders:
                        data:
                        - type: orders
                          id: '2013267'
                    links:
                      self: https://b.anny.co/api/v1/orders/2013266
                    meta:
                      download_url: https://b.anny.co/downloads/order-confirmation/2013266?access_token=e04NrT789XmaGvYopaflM5Kp1byLt0
                      voucher_code: 20OFF
                      is_base_order: true
                      payment_flow: pay-offline
                      pay_now_amount: 0
      '404':
        description: Not Found
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                errors:
                  type: array
                  items:
                    type: object
                    properties:
                      status:
                        type: string
                      code:
                        type: string
                      title:
                        type: string
                      detail:
                        type: string
            examples:
              default:
                value:
                  errors:
                  - status: '404'
                    code: voucher_not_found
                    title: Gutschein nicht gefunden
                    detail: Der Gutschein konnte nicht gefunden werden
    description: This endpoint allows to apply a voucher code to an order. The server side will validate this voucher and
      return error messages if needed.
    requestBody:
      content:
        application/vnd.api+json:
          schema:
            type: object
            properties:
              voucher_code:
                type: string
          examples:
            Example:
              value:
                voucher_code: 20OFF
      description: ''
    tags:
    - Orders
    security: []
  delete:
    summary: Delete voucher
    operationId: delete-order-voucher
    responses:
      '200':
        description: OK
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  $ref: ../../reference/orders.v1.yaml
            examples: {}
    description: This endpoint allows to delete a voucher code from an order.
    tags:
    - Orders
/api/v1/order/payment-methods:
  get:
    operationId: order-payment-methods
    summary: Get available payment methods for the current order
    tags:
    - Orders
    responses:
      '200':
        description: Array of available payment methods
        content:
          application/json:
            schema:
              type: object
/api/v1/order/request-email-verification:
  post:
    operationId: order-request-email-verification
    summary: Request an email verification code for checkout
    tags:
    - Orders
    requestBody:
      content:
        application/json:
          schema:
            type: object
            properties:
              email:
                type: string
                format: email
              remember_token:
                type: string
            required:
            - email
    responses:
      '200':
        description: Verification code sent
        content:
          application/json:
            schema:
              type: object
/api/v1/order/check-email:
  get:
    operationId: order-check-email
    summary: Check email availability for checkout
    description: Validates whether the email can be used for checkout or if the user needs to log in.
    tags:
    - Orders
    parameters:
    - name: email
      in: query
      description: Email address to check
      schema:
        type: string
      required: true
    responses:
      '200':
        description: Email validation result
        content:
          application/json:
            schema:
              type: object
/api/v1/order/check-guest-email:
  get:
    operationId: order-check-guest-email
    summary: Check if a guest email is verified
    tags:
    - Orders
    parameters:
    - name: email
      in: query
      description: Email address to check
      schema:
        type: string
      required: true
    responses:
      '200':
        description: Object with verified boolean
        content:
          application/json:
            schema:
              type: object
/api/v1/order/remember-customer:
  post:
    operationId: order-remember-customer
    summary: Save customer data for checkout
    description: Stores customer data temporarily and returns a remember token for subsequent requests.
    tags:
    - Orders
    requestBody:
      content:
        application/json:
          schema:
            type: object
            description: Dynamic fields based on checkout form configuration.
    responses:
      '200':
        description: Remember token
        content:
          application/json:
            schema:
              type: object
/api/v1/order/remembered-customer:
  get:
    operationId: order-remembered-customer
    summary: Get saved customer data
    tags:
    - Orders
    parameters:
    - name: rct
      in: query
      description: Remember customer token
      schema:
        type: string
    responses:
      '200':
        description: Cached customer and address data
        content:
          application/json:
            schema:
              type: object
/api/v1/order/bookings/delete-multiple:
  delete:
    operationId: order-delete-multiple-bookings
    summary: Delete multiple bookings from the cart
    tags:
    - Orders
    requestBody:
      content:
        application/json:
          schema:
            type: object
            properties:
              filter:
                type: object
                properties:
                  id:
                    type: array
                    items:
                      type: string
                      format: uuid
    responses:
      '204':
        description: Bookings removed from cart
/api/v1/order/bookings/{booking_id}/edit-addons:
  post:
    operationId: order-edit-booking-addons
    summary: Edit add-ons for a booking in the cart
    tags:
    - Orders
    parameters:
    - schema:
        type: string
        format: uuid
      name: booking_id
      in: path
      required: true
      description: Booking UUID
    requestBody:
      content:
        application/json:
          schema:
            type: object
            properties:
              add_ons:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                    quantity:
                      type: integer
    responses:
      '200':
        description: Updated booking with add-ons
        content:
          application/json:
            schema:
              type: object
/api/v1/order/bookings/delete-all:
  get:
    operationId: order-clear-cart
    summary: Clear all bookings from the cart
    tags:
    - Orders
    responses:
      '204':
        description: Cart cleared
/api/v1/order/recommendations:
  get:
    operationId: order-recommendations
    summary: Get booking recommendations for the current order
    tags:
    - Orders
    responses:
      '200':
        description: Array of recommended services/resources
        content:
          application/json:
            schema:
              type: object
/api/v1/order/last-succeeded:
  get:
    operationId: order-last-succeeded
    summary: Get recently completed orders
    tags:
    - Orders
    parameters:
    - name: oids[]
      in: query
      required: true
      description: Authorized order ids. Must be paired index-wise with `oats[]`.
      schema:
        type: array
        items:
          type: integer
      style: form
      explode: true
    - name: oats[]
      in: query
      required: true
      description: Access tokens for the corresponding `oids[]` values.
      schema:
        type: array
        items:
          type: string
      style: form
      explode: true
    responses:
      '200':
        description: Recent successfully completed orders
        content:
          application/json:
            schema:
              type: object
