openapi: 3.1.0
jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema
info:
  title: Fiest Partner API
  version: 0.2.0
  summary: Restaurant and accounting data for approved Fiest integrations.
  description: The Fiest Partner API gives reviewed integrations scoped read access to restaurants
    explicitly approved by a Fiest owner or administrator. Access uses OAuth 2.1 authorization code
    with PKCE and audience-bound bearer tokens.
  termsOfService: https://fiest.io/terms
  contact:
    name: Fiest integrations
    email: support@fiest.io
    url: https://docs.fiest.io/api
  license:
    name: Proprietary
    url: https://fiest.io/terms
externalDocs:
  description: Fiest API guides
  url: https://docs.fiest.io/api
servers:
  - url: https://api-sandbox.fiest.io
    description: Current environment
tags:
  - name: Restaurants
    description: Restaurants included in the current restaurant or Management organization authorization.
  - name: Accounting
    description: Bounded accounting summaries with sales, VAT, refunds, payment methods, and reconciliation.
security:
  - fiestOAuth:
      - fiest.restaurant.read
      - fiest.accounting.read
paths:
  /v1/restaurants:
    get:
      x-fiest-visibility: public
      x-fiest-conditional-scopes:
        organization:
          - fiest.organization.read
      operationId: listRestaurants
      summary: List authorized restaurants
      description: Returns one restaurant for a restaurant authorization or the reviewed restaurant
        snapshot for a Management organization authorization. Organization responses report whether
        newly added restaurants require reauthorization and organization-boundary tokens also
        require fiest.organization.read.
      tags:
        - Restaurants
      externalDocs:
        description: Authorize a Partner API connection
        url: https://docs.fiest.io/api/quickstart
      security:
        - fiestOAuth:
            - fiest.restaurant.read
            - fiest.accounting.read
      responses:
        "200":
          description: The restaurants currently covered by the authorization.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RestaurantListResponse"
              examples:
                restaurantAuthorization:
                  summary: Single-restaurant authorization
                  value:
                    data:
                      - restaurantId: 11111111-1111-4111-8111-111111111111
                        restaurantName: Fiest Sandbox Helsinki
                        role: owner
                    meta:
                      authorization_boundary: restaurant
                organizationAuthorization:
                  summary: Management organization authorization
                  value:
                    data:
                      - restaurantId: 11111111-1111-4111-8111-111111111111
                        restaurantName: Fiest Sandbox Helsinki
                        businessIdentity:
                          registeredName: Fiest Sandbox Restaurants Oy
                          businessId: 1234567-8
                      - restaurantId: 22222222-2222-4222-8222-222222222222
                        restaurantName: Fiest Sandbox Tampere
                        businessIdentity:
                          registeredName: Fiest Sandbox Tampere Oy
                          businessId: 2345678-9
                    meta:
                      authorization_boundary: organization
                      restaurants_truncated: false
                      authorization_coverage:
                        authorized_restaurant_count: 2
                        current_restaurant_count: 2
                        additional_restaurant_count: 0
                        reauthorization_available: false
        "401":
          description: The access token is missing, invalid, or expired.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
            WWW-Authenticate:
              schema:
                type: string
              description: OAuth bearer challenge and protected-resource metadata. Present for token and scope
                failures; other responses with the same status can omit it.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                invalidToken:
                  summary: Missing or invalid access token
                  value:
                    error: invalid_token
                    error_description: The access token is invalid.
                    request_id: req_sandbox_invalid_token
        "403":
          description: The authorization has expired or does not include the required scope.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
            WWW-Authenticate:
              schema:
                type: string
              description: OAuth bearer challenge and protected-resource metadata. Present for token and scope
                failures; other responses with the same status can omit it.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                insufficientScope:
                  summary: Required scope is missing
                  value:
                    error: insufficient_scope
                    error_description: Restaurant and accounting read access are required.
                    request_id: req_sandbox_insufficient_scope
                organizationScopeMissing:
                  summary: Organization scope is missing
                  value:
                    error: insufficient_scope
                    error_description: Organization read access is required.
                    request_id: req_sandbox_organization_scope_missing
                authorizationExpired:
                  summary: Authorization no longer resolves an accessible restaurant
                  value:
                    error: authorization_expired
                    request_id: req_sandbox_authorization_expired
        "429":
          description: The partner request limit has been exceeded.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
            Retry-After:
              schema:
                type: integer
                minimum: 1
              description: Seconds to wait before retrying.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                rateLimited:
                  summary: Partner request limit exceeded
                  value:
                    error: rate_limited
                    request_id: req_sandbox_rate_limited
        "503":
          description: The API or one of its required services is unavailable.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                serviceUnavailable:
                  summary: Temporary service failure
                  value:
                    error: service_unavailable
                    request_id: req_sandbox_service_unavailable
  /v1/restaurants/{restaurantId}:
    get:
      x-fiest-visibility: public
      x-fiest-conditional-scopes:
        organization:
          - fiest.organization.read
      operationId: getRestaurant
      summary: Get a restaurant profile
      description: Returns general restaurant information. A restaurant outside the current authorization
        is returned as not found. Organization-boundary tokens also require fiest.organization.read.
      tags:
        - Restaurants
      externalDocs:
        description: Authorize a Partner API connection
        url: https://docs.fiest.io/api/quickstart
      security:
        - fiestOAuth:
            - fiest.restaurant.read
            - fiest.accounting.read
      parameters:
        - $ref: "#/components/parameters/RestaurantId"
      responses:
        "200":
          description: The authorized restaurant profile.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/RestaurantProfile"
              example:
                data:
                  restaurantId: 11111111-1111-4111-8111-111111111111
                  restaurantName: Fiest Sandbox Helsinki
                  businessIdentity:
                    registeredName: Fiest Sandbox Restaurants Oy
                    businessId: 1234567-8
                  countryCode: FI
                  joinedAt: 2025-01-15T09:00:00.000Z
                  firstCompletedOrderAt: 2025-01-16T10:32:00.000Z
                  lastCompletedOrderAt: 2026-07-30T18:42:00.000Z
                  timeZone: Europe/Helsinki
                  businessDayStartHour: 4
                  scheduleEnabled: true
                  openingHours:
                    - day: monday
                      isClosed: false
                      shifts:
                        - openTime: 10:30
                          closeTime: 22:00
                          spansNextDay: false
                    - day: tuesday
                      isClosed: false
                      shifts:
                        - openTime: 10:30
                          closeTime: 22:00
                          spansNextDay: false
                    - day: wednesday
                      isClosed: false
                      shifts:
                        - openTime: 10:30
                          closeTime: 22:00
                          spansNextDay: false
                    - day: thursday
                      isClosed: false
                      shifts:
                        - openTime: 10:30
                          closeTime: 23:00
                          spansNextDay: false
                    - day: friday
                      isClosed: false
                      shifts:
                        - openTime: 10:30
                          closeTime: 01:00
                          spansNextDay: true
                    - day: saturday
                      isClosed: false
                      shifts:
                        - openTime: 12:00
                          closeTime: 01:00
                          spansNextDay: true
                    - day: sunday
                      isClosed: true
                      shifts: []
                  openingHoursTruncated: false
                  paymentProviders:
                    - provider: sumup
                      connectedAt: 2025-01-15T10:00:00.000Z
                      activeForPos: true
                      preferredForOnline: false
                  paymentProvidersTruncated: false
        "400":
          description: The request parameters are invalid.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                invalidRequest:
                  summary: Invalid request parameters
                  value:
                    error: invalid_request
                    message: The requested date range is invalid.
                    request_id: req_sandbox_invalid_request
        "401":
          description: The access token is missing, invalid, or expired.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
            WWW-Authenticate:
              schema:
                type: string
              description: OAuth bearer challenge and protected-resource metadata. Present for token and scope
                failures; other responses with the same status can omit it.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                invalidToken:
                  summary: Missing or invalid access token
                  value:
                    error: invalid_token
                    error_description: The access token is invalid.
                    request_id: req_sandbox_invalid_token
        "403":
          description: The authorization has expired or does not include the required scope.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
            WWW-Authenticate:
              schema:
                type: string
              description: OAuth bearer challenge and protected-resource metadata. Present for token and scope
                failures; other responses with the same status can omit it.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                insufficientScope:
                  summary: Required scope is missing
                  value:
                    error: insufficient_scope
                    error_description: Restaurant and accounting read access are required.
                    request_id: req_sandbox_insufficient_scope
                organizationScopeMissing:
                  summary: Organization scope is missing
                  value:
                    error: insufficient_scope
                    error_description: Organization read access is required.
                    request_id: req_sandbox_organization_scope_missing
        "404":
          description: The restaurant does not exist or is outside the authorization.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                notFound:
                  summary: Resource is outside the authorization
                  value:
                    error: not_found
                    request_id: req_sandbox_not_found
        "429":
          description: The partner request limit has been exceeded.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
            Retry-After:
              schema:
                type: integer
                minimum: 1
              description: Seconds to wait before retrying.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                rateLimited:
                  summary: Partner request limit exceeded
                  value:
                    error: rate_limited
                    request_id: req_sandbox_rate_limited
        "503":
          description: The API or one of its required services is unavailable.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                serviceUnavailable:
                  summary: Temporary service failure
                  value:
                    error: service_unavailable
                    request_id: req_sandbox_service_unavailable
  /v1/restaurants/{restaurantId}/accounting-summary:
    get:
      x-fiest-visibility: public
      x-fiest-conditional-scopes:
        organization:
          - fiest.organization.read
      operationId: getAccountingSummary
      summary: Get an accounting summary
      description: Returns a reconciled accounting summary for an inclusive business-date range of at most
        31 days. All monetary values use integer euro cents. Organization-boundary tokens also
        require fiest.organization.read.
      tags:
        - Accounting
      externalDocs:
        description: Authorize a Partner API connection
        url: https://docs.fiest.io/api/quickstart
      security:
        - fiestOAuth:
            - fiest.restaurant.read
            - fiest.accounting.read
      parameters:
        - $ref: "#/components/parameters/RestaurantId"
        - name: start_date
          in: query
          required: true
          description: First restaurant business date, inclusive.
          schema:
            type: string
            format: date
          example: 2026-07-01
        - name: end_date
          in: query
          required: true
          description: Last restaurant business date, inclusive. It cannot be in the future, and the range may
            contain at most 31 days.
          schema:
            type: string
            format: date
          example: 2026-07-27
      responses:
        "200":
          description: The reconciled accounting summary.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/AccountingSummary"
              example:
                data:
                  restaurantId: 11111111-1111-4111-8111-111111111111
                  period:
                    startDate: 2026-01-01
                    endDate: 2026-01-31
                    timeZone: Europe/Helsinki
                    dayStartHour: 4
                  currency: EUR
                  totals:
                    grossBeforeRefundsMinor: 4417630
                    refundsMinor: 9630
                    grossSalesMinor: 4408000
                    netSalesMinor: 3769568
                    vatMinor: 638432
                    discountsMinor: 21400
                    tipsMinor: 12800
                    deferredGiftCardSalesMinor: 65000
                    orderCount: 728
                    paymentTransactionCount: 728
                  paymentMethods:
                    - key: card
                      label: Card
                      transactionCount: 459
                      grossBeforeRefundsMinor: 2800000
                      refundsMinor: 5000
                      grossSalesMinor: 2795000
                      netSalesMinor: 2390000
                      vatMinor: 405000
                    - key: cash
                      label: Cash
                      transactionCount: 132
                      grossBeforeRefundsMinor: 800000
                      refundsMinor: 1630
                      grossSalesMinor: 798370
                      netSalesMinor: 690000
                      vatMinor: 108370
                    - key: online
                      label: Online
                      transactionCount: 90
                      grossBeforeRefundsMinor: 600000
                      refundsMinor: 3000
                      grossSalesMinor: 597000
                      netSalesMinor: 510000
                      vatMinor: 87000
                    - key: edenred
                      label: Edenred
                      transactionCount: 47
                      grossBeforeRefundsMinor: 217630
                      refundsMinor: 0
                      grossSalesMinor: 217630
                      netSalesMinor: 179568
                      vatMinor: 38062
                  vatBreakdown:
                    - category: reduced
                      label: 14%
                      rateBasisPoints: 1400
                      grossSalesMinor: 3200000
                      netSalesMinor: 2807018
                      vatMinor: 392982
                    - category: standard
                      label: 25.5%
                      rateBasisPoints: 2550
                      grossSalesMinor: 1208000
                      netSalesMinor: 962550
                      vatMinor: 245450
                  reconciliation:
                    paymentGrossMinor: 4408000
                    salesGrossMinor: 4408000
                    differenceMinor: 0
                    paymentVatMinor: 638432
                    salesVatMinor: 638432
                    vatDifferenceMinor: 0
                    balanced: true
                    exactTenderRefundsMinor: 9630
                    proportionallyAllocatedRefundsMinor: 0
                    unattributedPaymentGrossMinor: 0
                    attributionComplete: true
        "400":
          description: The request parameters are invalid.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                invalidRequest:
                  summary: Invalid request parameters
                  value:
                    error: invalid_request
                    message: The requested date range is invalid.
                    request_id: req_sandbox_invalid_request
        "401":
          description: The access token is missing, invalid, or expired.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
            WWW-Authenticate:
              schema:
                type: string
              description: OAuth bearer challenge and protected-resource metadata. Present for token and scope
                failures; other responses with the same status can omit it.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                invalidToken:
                  summary: Missing or invalid access token
                  value:
                    error: invalid_token
                    error_description: The access token is invalid.
                    request_id: req_sandbox_invalid_token
        "403":
          description: The authorization has expired or does not include the required scope.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
            WWW-Authenticate:
              schema:
                type: string
              description: OAuth bearer challenge and protected-resource metadata. Present for token and scope
                failures; other responses with the same status can omit it.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                insufficientScope:
                  summary: Required scope is missing
                  value:
                    error: insufficient_scope
                    error_description: Restaurant and accounting read access are required.
                    request_id: req_sandbox_insufficient_scope
                organizationScopeMissing:
                  summary: Organization scope is missing
                  value:
                    error: insufficient_scope
                    error_description: Organization read access is required.
                    request_id: req_sandbox_organization_scope_missing
        "404":
          description: The restaurant does not exist or is outside the authorization.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                notFound:
                  summary: Resource is outside the authorization
                  value:
                    error: not_found
                    request_id: req_sandbox_not_found
        "429":
          description: The partner request limit has been exceeded.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
            Retry-After:
              schema:
                type: integer
                minimum: 1
              description: Seconds to wait before retrying.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                rateLimited:
                  summary: Partner request limit exceeded
                  value:
                    error: rate_limited
                    request_id: req_sandbox_rate_limited
        "503":
          description: The API or one of its required services is unavailable.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Correlation identifier to retain when contacting Fiest support.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiError"
              examples:
                serviceUnavailable:
                  summary: Temporary service failure
                  value:
                    error: service_unavailable
                    request_id: req_sandbox_service_unavailable
components:
  securitySchemes:
    fiestOAuth:
      type: oauth2
      description: OAuth 2.1 authorization code with PKCE. Partner clients and redirect URIs must be
        approved by Fiest before use.
      flows:
        authorizationCode:
          authorizationUrl: https://auth-sandbox.fiest.io/api/auth/oauth2/authorize
          tokenUrl: https://auth-sandbox.fiest.io/api/auth/oauth2/token
          refreshUrl: https://auth-sandbox.fiest.io/api/auth/oauth2/token
          scopes:
            offline_access: Keep the approved connection active with rotating refresh tokens.
            fiest.restaurant.read: List and identify the restaurants covered by the authorization.
            fiest.accounting.read: Read bounded accounting summaries for authorized restaurants.
            fiest.organization.read: Use the reviewed restaurant snapshot from a Management organization authorization.
  parameters:
    RestaurantId:
      name: restaurantId
      in: path
      required: true
      description: A restaurant identifier returned by the authorized restaurant list.
      schema:
        type: string
        format: uuid
      example: 11111111-1111-4111-8111-111111111111
  schemas:
    ApiError:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: string
          enum:
            - authorization_expired
            - capability_disabled
            - conflict
            - idempotency_conflict
            - insufficient_scope
            - invalid_request
            - invalid_token
            - not_found
            - managed_externally
            - payload_too_large
            - precondition_failed
            - rate_limited
            - service_unavailable
            - write_in_progress
          description: Stable machine-readable error code.
        message:
          type: string
          description: Safe human-readable error description.
        error_description:
          type: string
          description: OAuth bearer error description.
        request_id:
          type: string
          description: Correlation identifier to include when contacting Fiest support.
    RestaurantBusinessIdentity:
      type: object
      properties:
        registeredName:
          anyOf:
            - type: string
              minLength: 1
              maxLength: 200
            - type: "null"
        businessId:
          anyOf:
            - type: string
              minLength: 1
              maxLength: 50
            - type: "null"
      required:
        - registeredName
        - businessId
      additionalProperties: false
    RestaurantSummary:
      type: object
      additionalProperties: false
      required:
        - restaurantId
        - restaurantName
      properties:
        restaurantId:
          type: string
          format: uuid
        restaurantName:
          type: string
          minLength: 1
        role:
          type: string
          enum:
            - owner
            - admin
          description: Present for a single-restaurant authorization. Organization results omit this field.
        businessIdentity:
          $ref: "#/components/schemas/RestaurantBusinessIdentity"
          description: Present for a Management organization authorization. Informational legal-entity data;
            never use it as an authorization key.
    RestaurantListResponse:
      type: object
      additionalProperties: false
      required:
        - data
        - meta
      properties:
        data:
          type: array
          maxItems: 100
          items:
            $ref: "#/components/schemas/RestaurantSummary"
        meta:
          type: object
          additionalProperties: false
          required:
            - authorization_boundary
          properties:
            authorization_boundary:
              type: string
              enum:
                - restaurant
                - organization
            restaurants_truncated:
              type: boolean
              description: Organization grants only. True when the reviewed authorization snapshot exceeds the
                100-restaurant response bound.
            authorization_coverage:
              type: object
              additionalProperties: false
              required:
                - authorized_restaurant_count
                - current_restaurant_count
                - additional_restaurant_count
                - reauthorization_available
              properties:
                authorized_restaurant_count:
                  type: integer
                  minimum: 0
                current_restaurant_count:
                  type: integer
                  minimum: 0
                additional_restaurant_count:
                  type: integer
                  minimum: 0
                reauthorization_available:
                  type: boolean
              description: Organization grants only. Describes the reviewed restaurant snapshot and whether the
                customer should authorize again.
    RestaurantProfile:
      type: object
      properties:
        restaurantId:
          type: string
          format: uuid
          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        restaurantName:
          type: string
          minLength: 1
        businessIdentity:
          type: object
          properties:
            registeredName:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 200
                - type: "null"
            businessId:
              anyOf:
                - type: string
                  minLength: 1
                  maxLength: 50
                - type: "null"
          required:
            - registeredName
            - businessId
          additionalProperties: false
        countryCode:
          anyOf:
            - type: string
              pattern: ^[A-Z]{2}$
            - type: "null"
        joinedAt:
          type: string
          format: date-time
          pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        firstCompletedOrderAt:
          anyOf:
            - type: string
              format: date-time
              pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: "null"
        lastCompletedOrderAt:
          anyOf:
            - type: string
              format: date-time
              pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: "null"
        timeZone:
          type: string
          minLength: 1
          maxLength: 50
        businessDayStartHour:
          type: integer
          minimum: 0
          maximum: 23
        scheduleEnabled:
          type: boolean
        openingHours:
          minItems: 7
          maxItems: 7
          type: array
          items:
            type: object
            properties:
              day:
                type: string
                enum:
                  - monday
                  - tuesday
                  - wednesday
                  - thursday
                  - friday
                  - saturday
                  - sunday
              isClosed:
                type: boolean
              shifts:
                maxItems: 4
                type: array
                items:
                  type: object
                  properties:
                    openTime:
                      type: string
                      pattern: ^([01]\d|2[0-3]):[0-5]\d$
                    closeTime:
                      type: string
                      pattern: ^([01]\d|2[0-3]):[0-5]\d$
                    spansNextDay:
                      type: boolean
                  required:
                    - openTime
                    - closeTime
                    - spansNextDay
                  additionalProperties: false
            required:
              - day
              - isClosed
              - shifts
            additionalProperties: false
        openingHoursTruncated:
          type: boolean
        paymentProviders:
          maxItems: 10
          type: array
          items:
            type: object
            properties:
              provider:
                type: string
                minLength: 1
                maxLength: 50
              connectedAt:
                anyOf:
                  - type: string
                    format: date-time
                    pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                  - type: "null"
              activeForPos:
                type: boolean
              preferredForOnline:
                type: boolean
            required:
              - provider
              - connectedAt
              - activeForPos
              - preferredForOnline
            additionalProperties: false
        paymentProvidersTruncated:
          type: boolean
      required:
        - restaurantId
        - restaurantName
        - businessIdentity
        - countryCode
        - joinedAt
        - firstCompletedOrderAt
        - lastCompletedOrderAt
        - timeZone
        - businessDayStartHour
        - scheduleEnabled
        - openingHours
        - openingHoursTruncated
        - paymentProviders
        - paymentProvidersTruncated
      additionalProperties: false
    AccountingSummary:
      type: object
      properties:
        restaurantId:
          type: string
          format: uuid
          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        period:
          type: object
          properties:
            startDate:
              type: string
              format: date
              pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
            endDate:
              type: string
              format: date
              pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
            timeZone:
              type: string
              minLength: 1
            dayStartHour:
              type: integer
              minimum: 0
              maximum: 23
          required:
            - startDate
            - endDate
            - timeZone
            - dayStartHour
          additionalProperties: false
        currency:
          type: string
          const: EUR
        totals:
          type: object
          properties:
            grossBeforeRefundsMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            refundsMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            grossSalesMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            netSalesMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            vatMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            discountsMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            tipsMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            deferredGiftCardSalesMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            orderCount:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            paymentTransactionCount:
              type: integer
              minimum: 0
              maximum: 9007199254740991
          required:
            - grossBeforeRefundsMinor
            - refundsMinor
            - grossSalesMinor
            - netSalesMinor
            - vatMinor
            - discountsMinor
            - tipsMinor
            - deferredGiftCardSalesMinor
            - orderCount
            - paymentTransactionCount
          additionalProperties: false
        paymentMethods:
          maxItems: 30
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                minLength: 1
              label:
                type: string
                minLength: 1
              transactionCount:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              grossBeforeRefundsMinor:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              refundsMinor:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              grossSalesMinor:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              netSalesMinor:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              vatMinor:
                type: integer
                minimum: 0
                maximum: 9007199254740991
            required:
              - key
              - label
              - transactionCount
              - grossBeforeRefundsMinor
              - refundsMinor
              - grossSalesMinor
              - netSalesMinor
              - vatMinor
            additionalProperties: false
        vatBreakdown:
          maxItems: 5
          type: array
          items:
            type: object
            properties:
              category:
                type: string
                enum:
                  - zero
                  - special
                  - reduced
                  - standard
                  - unknown
              label:
                type: string
                minLength: 1
              rateBasisPoints:
                anyOf:
                  - type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  - type: "null"
              grossSalesMinor:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              netSalesMinor:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              vatMinor:
                type: integer
                minimum: 0
                maximum: 9007199254740991
            required:
              - category
              - label
              - rateBasisPoints
              - grossSalesMinor
              - netSalesMinor
              - vatMinor
            additionalProperties: false
        reconciliation:
          type: object
          properties:
            paymentGrossMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            salesGrossMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            differenceMinor:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            paymentVatMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            salesVatMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            vatDifferenceMinor:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            balanced:
              type: boolean
            exactTenderRefundsMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            proportionallyAllocatedRefundsMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            unattributedPaymentGrossMinor:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            attributionComplete:
              type: boolean
          required:
            - paymentGrossMinor
            - salesGrossMinor
            - differenceMinor
            - paymentVatMinor
            - salesVatMinor
            - vatDifferenceMinor
            - balanced
            - exactTenderRefundsMinor
            - proportionallyAllocatedRefundsMinor
            - unattributedPaymentGrossMinor
            - attributionComplete
          additionalProperties: false
      required:
        - restaurantId
        - period
        - currency
        - totals
        - paymentMethods
        - vatBreakdown
        - reconciliation
      additionalProperties: false
x-fiest-contract:
  audience: https://api-sandbox.fiest.io
  defaultDocumentationVisibility: private
  partnerAccess: allowlisted
  tokenTransport: authorization-header
  playground: internal-only
x-fiest-error-codes:
  authorization_expired:
    status:
      - 403
    retryable: false
    description: The authenticated authorization no longer resolves an accessible restaurant. Ask the
      customer to authorize the integration again.
  capability_disabled:
    status:
      - 503
    retryable: true
    description: The capability is documented but is not enabled in the current Fiest environment.
  conflict:
    status:
      - 409
    retryable: false
    description: The requested change conflicts with the current restaurant state or a platform limit.
  idempotency_conflict:
    status:
      - 409
    retryable: false
    description: The supplied idempotency key was already used for a different request.
  insufficient_scope:
    status:
      - 403
    retryable: false
    description: The access token does not include every scope required by the operation.
  invalid_request:
    status:
      - 400
    retryable: false
    description: A path or query parameter is missing, malformed, or outside its supported bounds.
  invalid_token:
    status:
      - 401
    retryable: false
    description: The bearer token, approved client, consent, membership, organization grant, or
      authorizer role is missing, expired, revoked, or invalid for this API.
  not_found:
    status:
      - 404
    retryable: false
    description: The resource does not exist or is outside the current authorization boundary.
  managed_externally:
    status:
      - 409
    retryable: false
    description: The requested setting is managed by an active external integration and cannot be
      changed through this API.
  payload_too_large:
    status:
      - 413
    retryable: false
    description: The JSON request body exceeds the documented size limit.
  precondition_failed:
    status:
      - 409
    retryable: false
    description: The restaurant state changed after it was reviewed. Fetch the latest state and build a
      new request.
  rate_limited:
    status:
      - 429
    retryable: true
    description: The partner request limit was exceeded. Wait for the Retry-After duration before retrying.
  service_unavailable:
    status:
      - 503
    retryable: true
    description: Fiest or a required downstream service is temporarily unavailable.
  write_in_progress:
    status:
      - 409
    retryable: true
    description: An idempotent write is still processing. Retry the exact request with the same
      idempotency key after Retry-After.
