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

# Create products in the workspace catalog

> Create up to 100 products in the catalog of your workspace in one call. Every product is checked before anything is created: if one is invalid, the call answers 400 with the position of the product in the issue path (products.2.countries.0...) and nothing is created. The valid products are then created one after the other; a product that fails is reported in errors with its index, and the others are still created. Each product gets one variant carrying its SKU reference, with the price excluding VAT and the delivery delay of every country. Prices are in cents. Only accessible with a Workspace API key, for a workspace that sets its own custom catalog: any other workspace gets a 403.

Key: WriteScope: Workspace


## OpenAPI

````yaml https://api.getprimo.com/openapi.json post /workspace/catalog/products/batch
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /workspace/catalog/products/batch:
    post:
      tags:
        - WorkspaceCatalog
      summary: Create products in the workspace catalog
      description: >-
        Create up to 100 products in the catalog of your workspace in one call.
        Every product is checked before anything is created: if one is invalid,
        the call answers 400 with the position of the product in the issue path
        (products.2.countries.0...) and nothing is created. The valid products
        are then created one after the other; a product that fails is reported
        in errors with its index, and the others are still created. Each product
        gets one variant carrying its SKU reference, with the price excluding
        VAT and the delivery delay of every country. Prices are in cents. Only
        accessible with a Workspace API key, for a workspace that sets its own
        custom catalog: any other workspace gets a 403.
      operationId: createWorkspaceCatalogProducts
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkspaceCatalogProductsBody'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CreateWorkspaceCatalogProductsResponse_Output
components:
  schemas:
    CreateWorkspaceCatalogProductsBody:
      type: object
      properties:
        products:
          description: Products to create, from 1 to 100
          minItems: 1
          maxItems: 100
          type: array
          items:
            type: object
            properties:
              name:
                description: Product name shown in the catalog
                type: string
                minLength: 1
              brand:
                description: Brand of the product, e.g. Lenovo
                type: string
                minLength: 1
              type:
                description: >-
                  Product type. laptop, tablet and smartphone are devices; every
                  other type is an accessory
                type: string
                enum:
                  - laptop
                  - tablet
                  - smartphone
                  - cable_adapter
                  - charger
                  - headset
                  - hub
                  - keyboard
                  - laptop_case
                  - monitor
                  - mouse
                  - other
              reference:
                description: Your SKU reference of the product
                type: string
                minLength: 1
              specifications:
                description: >-
                  Specifications as free text, keyed by specification name, e.g.
                  { "ram": "16GB", "storage": "512GB" }. A key that does not
                  apply to the product type is ignored
                type: object
                propertyNames:
                  type: string
                  enum:
                    - cableLength
                    - color
                    - connectivity
                    - inputConnectors
                    - interfaces
                    - keyboardLayout
                    - notebookSupportedSizes
                    - npu
                    - operatingSystem
                    - position
                    - power
                    - processor
                    - ram
                    - resolution
                    - screenSize
                    - storage
                additionalProperties:
                  type: string
              countries:
                description: >-
                  Countries the product is sold in, with the price and delivery
                  delay of each. A country appears once
                minItems: 1
                type: array
                items:
                  type: object
                  properties:
                    countryCode:
                      description: >-
                        Lowercase ISO 3166-1 alpha-2 code of the country the
                        product is sold in
                      type: string
                      enum:
                        - af
                        - al
                        - dz
                        - ad
                        - ao
                        - ag
                        - ar
                        - am
                        - au
                        - at
                        - az
                        - bs
                        - bh
                        - bd
                        - bb
                        - by
                        - be
                        - bz
                        - bj
                        - bt
                        - bo
                        - ba
                        - bw
                        - br
                        - bn
                        - bg
                        - bf
                        - bi
                        - cv
                        - kh
                        - cm
                        - ca
                        - cf
                        - td
                        - cl
                        - cn
                        - co
                        - km
                        - cg
                        - cr
                        - hr
                        - cu
                        - cy
                        - cz
                        - cd
                        - dk
                        - dj
                        - dm
                        - do
                        - ec
                        - eg
                        - sv
                        - gq
                        - er
                        - ee
                        - sz
                        - et
                        - fj
                        - fi
                        - fr
                        - ga
                        - gm
                        - ge
                        - de
                        - gh
                        - gr
                        - gd
                        - gt
                        - gn
                        - gw
                        - gy
                        - ht
                        - hn
                        - hu
                        - is
                        - in
                        - id
                        - ir
                        - iq
                        - ie
                        - il
                        - it
                        - jm
                        - jp
                        - jo
                        - kz
                        - ke
                        - ki
                        - kw
                        - kg
                        - la
                        - lv
                        - lb
                        - ls
                        - lr
                        - ly
                        - li
                        - lt
                        - lu
                        - mg
                        - mw
                        - my
                        - mv
                        - ml
                        - mt
                        - mh
                        - mr
                        - mu
                        - mx
                        - fm
                        - md
                        - mc
                        - mn
                        - me
                        - ma
                        - mz
                        - mm
                        - na
                        - nr
                        - np
                        - nl
                        - nz
                        - ni
                        - ne
                        - ng
                        - kp
                        - mk
                        - 'no'
                        - om
                        - pk
                        - pw
                        - pa
                        - pg
                        - py
                        - pe
                        - ph
                        - pl
                        - pt
                        - qa
                        - ro
                        - ru
                        - rw
                        - kn
                        - lc
                        - vc
                        - ws
                        - sm
                        - st
                        - sa
                        - sn
                        - rs
                        - sc
                        - sl
                        - sg
                        - sk
                        - si
                        - sb
                        - so
                        - za
                        - kr
                        - ss
                        - es
                        - lk
                        - sd
                        - sr
                        - se
                        - ch
                        - sy
                        - tw
                        - tj
                        - tz
                        - th
                        - tl
                        - tg
                        - to
                        - tt
                        - tn
                        - tr
                        - tm
                        - tv
                        - ug
                        - ua
                        - ae
                        - gb
                        - us
                        - uy
                        - uz
                        - vu
                        - va
                        - ve
                        - vn
                        - ye
                        - zm
                        - zw
                    price:
                      description: Selling price excluding VAT
                      type: object
                      properties:
                        amount:
                          description: >-
                            Price excluding VAT, in cents of the currency:
                            129900 stands for 1299.00
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                        currency:
                          description: >-
                            Currency of the price. France must use EUR, the
                            United Kingdom GBP, the United States USD and
                            Switzerland CHF
                          type: string
                          enum:
                            - USD
                            - EUR
                            - GBP
                            - CHF
                            - CAD
                      required:
                        - amount
                        - currency
                    daysToDelivery:
                      description: Delivery delay promised in this country, in days
                      type: integer
                      minimum: 0
                      maximum: 9007199254740991
                  required:
                    - countryCode
                    - price
                    - daysToDelivery
              published:
                description: Whether the product is visible in the catalog
                type: boolean
            required:
              - name
              - brand
              - type
              - reference
              - specifications
              - countries
              - published
      required:
        - products
    CreateWorkspaceCatalogProductsResponse_Output:
      type: object
      properties:
        data:
          type: array
          description: Products that were created
          items:
            type: object
            properties:
              index:
                description: Position of the product in the request, starting at 0
                type: integer
                minimum: 0
                maximum: 9007199254740991
              productId:
                description: Identifier of the created product
                type: string
              variantId:
                description: Identifier of the variant created for the product
                type: string
            required:
              - index
              - productId
              - variantId
            additionalProperties: false
        errors:
          type: array
          description: >-
            Products that could not be created. The other products of the batch
            are not affected
          items:
            type: object
            properties:
              index:
                description: Position of the product in the request, starting at 0
                type: integer
                minimum: 0
                maximum: 9007199254740991
              message:
                description: Why this product could not be created
                type: string
            required:
              - index
              - message
            additionalProperties: false
      required:
        - data
        - errors
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````

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