> ## Documentation Index
> Fetch the complete documentation index at: https://docs.now-os.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Import a floor plan (one-shot onboarding)

> Push your canvas; NowOS creates the DRAFT (the operator reviews and publishes in the backoffice) and returns the `externalTableId → tableId` mapping — persist it as your `pos_table_id` column, there is no manual mapping anywhere. Refused once the location has a draft (unless `replaceDraft`) and always after the first publish.



## OpenAPI

````yaml /api-reference/openapi.json post /api/provider/v1/floorplan/import
openapi: 3.1.0
info:
  title: NowOS Reservations Provider API
  version: 1.0.0
  description: >-
    Integration surface for reservation providers (EatNow is the reference
    implementation). Read the published floor plan, write reservations keyed by
    your own ids, push a one-shot floor plan import, and consume signed webhooks
    for table lifecycle and spend. Every error body is `{ "error": { "code",
    "message", "occupiedBy" } }` — branch on `code` only.
servers:
  - url: https://api.now-os.app
security:
  - providerApiKey: []
paths:
  /api/provider/v1/floorplan/import:
    post:
      summary: Import a floor plan (one-shot onboarding)
      description: >-
        Push your canvas; NowOS creates the DRAFT (the operator reviews and
        publishes in the backoffice) and returns the `externalTableId → tableId`
        mapping — persist it as your `pos_table_id` column, there is no manual
        mapping anywhere. Refused once the location has a draft (unless
        `replaceDraft`) and always after the first publish.
      operationId: importFloorplan
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                rooms:
                  minItems: 1
                  maxItems: 20
                  type: array
                  items:
                    type: object
                    properties:
                      externalId:
                        type: string
                        minLength: 1
                        maxLength: 128
                      name:
                        type: string
                        minLength: 1
                        maxLength: 60
                      order:
                        default: null
                        anyOf:
                          - type: integer
                            minimum: 0
                            maximum: 2147483647
                          - type: 'null'
                      canvasWidth:
                        default: 1000
                        type: integer
                        exclusiveMinimum: 0
                        maximum: 2147483647
                      canvasHeight:
                        default: 1000
                        type: integer
                        exclusiveMinimum: 0
                        maximum: 2147483647
                      tables:
                        type: array
                        items:
                          type: object
                          properties:
                            externalId:
                              type: string
                              minLength: 1
                              maxLength: 128
                            label:
                              type: string
                              minLength: 1
                              maxLength: 12
                            shape:
                              type: string
                              enum:
                                - round
                                - square
                                - rectangle
                                - bar
                            seatCount:
                              type: integer
                              exclusiveMinimum: 0
                              maximum: 2147483647
                            minCovers:
                              default: null
                              anyOf:
                                - type: integer
                                  exclusiveMinimum: 0
                                  maximum: 2147483647
                                - type: 'null'
                            maxCovers:
                              default: null
                              anyOf:
                                - type: integer
                                  exclusiveMinimum: 0
                                  maximum: 2147483647
                                - type: 'null'
                            x:
                              type: number
                            'y':
                              type: number
                            rotation:
                              default: 0
                              type: number
                          required:
                            - externalId
                            - label
                            - shape
                            - seatCount
                            - x
                            - 'y'
                      decorations:
                        default: []
                        type: array
                        items:
                          type: object
                          properties:
                            model:
                              type: string
                              enum:
                                - wall
                                - wall-corner
                                - wall-u
                                - wall-t
                                - column
                                - block
                            text:
                              default: null
                              anyOf:
                                - type: string
                                  minLength: 1
                                  maxLength: 60
                                - type: 'null'
                            color:
                              default: null
                              anyOf:
                                - type: string
                                  minLength: 1
                                  maxLength: 32
                                - type: 'null'
                            x:
                              type: number
                            'y':
                              type: number
                            rotation:
                              default: 0
                              type: number
                            width:
                              type: number
                              exclusiveMinimum: 0
                            height:
                              type: number
                              exclusiveMinimum: 0
                          required:
                            - model
                            - x
                            - 'y'
                            - width
                            - height
                    required:
                      - externalId
                      - name
                      - tables
                replaceDraft:
                  default: false
                  type: boolean
              required:
                - rooms
      responses:
        '200':
          description: Draft created; persist the mapping.
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  rooms:
                    type: array
                    items:
                      type: object
                      properties:
                        externalRoomId:
                          type: string
                          minLength: 1
                        roomId:
                          type: string
                          minLength: 1
                        name:
                          type: string
                          minLength: 1
                      required:
                        - externalRoomId
                        - roomId
                        - name
                      additionalProperties: false
                  mapping:
                    type: array
                    items:
                      type: object
                      properties:
                        externalTableId:
                          type: string
                          minLength: 1
                        tableId:
                          type: string
                          minLength: 1
                        label:
                          type: string
                          minLength: 1
                      required:
                        - externalTableId
                        - tableId
                        - label
                      additionalProperties: false
                required:
                  - rooms
                  - mapping
                additionalProperties: false
        '409':
          description: '`draft_not_empty`.'
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - unauthorized
                          - unknown_reservation
                          - duplicate_reservation
                          - unknown_table_id
                          - table_occupied
                          - floorplan_not_published
                          - draft_not_empty
                          - validation_failed
                      message:
                        type: string
                        minLength: 1
                      occupiedBy:
                        default: null
                        anyOf:
                          - type: object
                            properties:
                              orderId:
                                anyOf:
                                  - type: string
                                    minLength: 1
                                  - type: 'null'
                              reservationExternalId:
                                anyOf:
                                  - type: string
                                    minLength: 1
                                  - type: 'null'
                            required:
                              - orderId
                              - reservationExternalId
                            additionalProperties: false
                          - type: 'null'
                    required:
                      - code
                      - message
                      - occupiedBy
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
      security:
        - providerApiKey: []
components:
  securitySchemes:
    providerApiKey:
      type: http
      scheme: bearer
      description: >-
        Location-scoped API key (`nowos_sk_live_…`), issued at registration. The
        key identifies the location — URLs carry no location id.

````