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

# Set the opening hours

> Replaces the store's whole week. A range that closes before it opens runs past midnight (`friday 18:00-02:00`), saved as the store app saves it. Works only if the store owner allowed store control (open/close and hours) for this key, otherwise `403`. All or nothing.

Send the whole week: it replaces the hours the store had. A range that closes before it opens runs past midnight, so `friday 18:00 - 02:00` is one line. [Get the store](/restaurant/store/get) shows it the same way.

The store owner must allow **store control** for your key (the same permission as open/close). Otherwise you get `403 open_close_not_allowed`.


## OpenAPI

````yaml PUT /store/hours
openapi: 3.1.0
info:
  title: XFaster Partner API
  version: '1.0'
  description: >
    Receive XFaster orders in your POS, send their status back, and keep the
    menu, stock and prices in sync.

    One API key per store, or one integrator key for all your stores (it names
    the store in X-XFaster-Store). Money is in agorot (integers, VAT included).
    Times are ISO 8601 with the Israel offset.
servers:
  - url: https://staging2.xfaster.net/api/partner/v1
    description: Sandbox (test keys, xfp_test_…)
  - url: https://apps.xfaster.net/api/partner/v1
    description: Live (live keys, xfp_live_…)
security:
  - apiKey: []
  - apiKey: []
    storeHeader: []
tags:
  - name: Store
  - name: Orders
  - name: Menu
  - name: Market
  - name: Reports
  - name: Sandbox
paths:
  /store/hours:
    put:
      tags:
        - Store
      summary: Set the opening hours
      description: >-
        Replaces the store's whole week. A range that closes before it opens
        runs past midnight (`friday 18:00-02:00`), saved as the store app saves
        it. Works only if the store owner allowed store control (open/close and
        hours) for this key, otherwise `403`. All or nothing.
      operationId: setHours
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - hours
              properties:
                hours:
                  type: array
                  minItems: 1
                  maxItems: 50
                  items:
                    type: object
                    required:
                      - day
                      - open
                      - close
                    properties:
                      day:
                        type: string
                        enum:
                          - sunday
                          - monday
                          - tuesday
                          - wednesday
                          - thursday
                          - friday
                          - saturday
                      open:
                        type: string
                        pattern: ^\d{2}:\d{2}$
                        example: '11:00'
                      close:
                        type: string
                        pattern: ^\d{2}:\d{2}$
                        example: '23:00'
            example:
              hours:
                - day: sunday
                  open: '11:00'
                  close: '23:00'
                - day: thursday
                  open: '11:00'
                  close: '23:30'
                - day: friday
                  open: '18:00'
                  close: '02:00'
      responses:
        '200':
          description: The store
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Store'
              examples:
                example:
                  $ref: '#/components/examples/Store'
        '403':
          description: The owner did not allow store control for this key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: open_close_not_allowed
                  message: >-
                    The store owner did not allow this key to control the store
                    (open/close and hours).
                  details: null
        '422':
          description: A bad day or time, or two ranges that overlap; nothing was changed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: invalid_hours
                  message: monday 15:00-20:00 overlaps another range of the store.
                  details: null
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      description: >-
        Any unique string. Repeating a request with the same key within 24 hours
        returns the first answer instead of acting twice.
      schema:
        type: string
        example: 5f0c3d1e-8b6a-4e1f-9c2d-7a1b0e4f6d21
  schemas:
    Store:
      type: object
      properties:
        id:
          type: integer
          example: 64
        name:
          type: string
          example: TABOON Plus
        accepting_orders:
          type: boolean
          example: false
        reason:
          type:
            - string
            - 'null'
          enum:
            - busy
            - closed
            - outside_hours
            - null
          example: busy
        open:
          type: boolean
        busy_until:
          type:
            - string
            - 'null'
          format: date-time
        delivery:
          type: boolean
        pickup:
          type: boolean
        invoices:
          type: string
          enum:
            - xfaster
            - store
          description: >-
            xfaster = the store's PayPlus already issues the customer's invoice;
            store = your POS issues the receipt
        hours:
          type: array
          items:
            type: object
            properties:
              day:
                type: string
                example: friday
              open:
                type: string
                example: '11:00'
              close:
                type: string
                example: '01:00'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type:
                - object
                - 'null'
  examples:
    Store:
      value:
        id: 64
        name: TABOON Plus
        accepting_orders: true
        reason: null
        open: true
        busy_until: null
        delivery: true
        pickup: true
        invoices: xfaster
        hours:
          - day: sunday
            open: '11:00'
            close: '23:00'
          - day: friday
            open: '11:00'
            close: '01:00'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        The store's API key (xfp_test_… on the sandbox, xfp_live_… on live).
        XFaster creates it and shows it once. An integrator key (one key for a
        POS company) also sends X-XFaster-Store.
    storeHeader:
      type: apiKey
      in: header
      name: X-XFaster-Store
      description: >-
        Integrator keys only: the XFaster store id this request is for. It must
        be linked to your key (else 403 store_not_linked); without it 400
        store_header_required. Store keys don't send it.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.