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

# Add a new product

> A product your POS sells and XFaster doesn't have yet. It is created switched off; the store adds a picture and switches it on. Without `stock`, a market product starts at 999.



## OpenAPI

````yaml POST /items
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:
  /items:
    post:
      tags:
        - Market
      summary: Add a new product
      description: >-
        A product your POS sells and XFaster doesn't have yet. It is created
        switched off; the store adds a picture and switches it on. Without
        `stock`, a market product starts at 999.
      operationId: createItem
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - price
              properties:
                name:
                  oneOf:
                    - type: string
                    - type: object
                      properties:
                        he:
                          type: string
                        ar:
                          type: string
                        en:
                          type: string
                price:
                  type: integer
                  minimum: 1
                  description: Agorot, VAT included
                barcode:
                  type: string
                external_id:
                  type: string
                category_id:
                  type: integer
                  description: From GET /menu
                stock:
                  type: integer
                  minimum: 0
                by_weight:
                  type: boolean
            example:
              name:
                he: במבה 80 גרם
                ar: بامبا 80 غرام
              price: 590
              barcode: '7290000066318'
              external_id: CMX-66318
              category_id: 1201
              stock: 40
      responses:
        '201':
          description: The new product (switched off)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Item'
              examples:
                example:
                  $ref: '#/components/examples/Item'
        '422':
          $ref: '#/components/responses/Invalid'
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:
    Item:
      type: object
      properties:
        id:
          type: integer
          example: 3062
        external_id:
          type:
            - string
            - 'null'
        category_id:
          type:
            - integer
            - 'null'
        name:
          type: string
        price:
          type: integer
          example: 6000
        discount:
          type:
            - object
            - 'null'
        sale_price:
          type:
            - integer
            - 'null'
          example: 5500
        available:
          type: boolean
        off_until:
          type:
            - string
            - 'null'
          format: date-time
        barcode:
          type:
            - string
            - 'null'
        unit:
          type:
            - string
            - 'null'
        by_weight:
          type: boolean
        stock:
          type:
            - integer
            - 'null'
          description: null where the store doesn't count stock (restaurants)
        option_groups:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              type:
                type: string
                enum:
                  - single
                  - multi
              min:
                type: integer
              max:
                type: integer
              options:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    price:
                      type: integer
        addon_ids:
          type: array
          items:
            type: integer
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type:
                - object
                - 'null'
  examples:
    Item:
      value:
        id: 3062
        external_id: BURG-SMASH
        category_id: 1201
        name: סמאש בורגר
        price: 6000
        discount:
          type: amount
          value: 500
        sale_price: 5500
        available: true
        off_until: null
        barcode: null
        unit: null
        by_weight: false
        stock: null
        option_groups:
          - name: מידת עשייה
            type: single
            min: 1
            max: 1
            options:
              - name: מדיום
                price: 0
              - name: וול דאן
                price: 0
        addon_ids:
          - 412
          - 413
  responses:
    Invalid:
      description: A value is missing or breaks a rule
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: prep_time_out_of_range
              message: Preparation time must be between 5 and 120 minutes.
              details:
                min: 5
                max: 120
  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.