Create a product

POST /products

Create a new product record with specified attributes and receive the details of the newly created product in the response.

Headers

application/json

Body Required

Request Body for creating a new product

  • name string Required

    The name of the product.

    Maximum length is 150.

  • number string | null

    The alternative user-defined product number.

    Maximum length is 100.

  • type string

    Specifies whether the product is defined as a regular or structure product.

    Values are default or structure. Default value is default.

  • status string

    Specifies whether the product's status is active or inactive (expired).

    Values are active or inactive. Default value is active.

  • description string | null

    The description of the product.

    Maximum length is 500.

  • costPrice number | null

    The cost of buying the product from the supplier.

    Default value is 0.

  • salesPrice number | null

    The selling price of the product.

    Default value is 0.

  • indirectCost number | null

    The sum of indirect costs related to the product.

    Default value is 0.

  • stock object

    Stock information for the product.

    Hide stock attributes Show stock attributes
    • isManaged boolean

      A flag variable indicating whether a product should handle adjusting product quantity.

      Default value is false.

    • quantity number

      The quantity of products that are in stock.

      Default value is 0.

    • location string | null

      The location identifier for the product, like a shelf or a facility number for inventory management.

  • ean string | null

    The product's 13-digit European Article Number (EAN).

    Maximum length is 13.

  • eanAlternative string | null

    An alternative article number field, supporting up to 25 digits.

    Maximum length is 25.

  • units object

    Information about the units of measurement for the product.

    Hide units attribute Show units attribute
    • id number | null

      The ID of the units of measurement. Product units can be retrieved from the separate /productunits endpoint.

  • category object Required

    Information about the category to which the product belongs.

    Hide category attribute Show category attribute
    • id number

      A reference by ID to the category the product belongs to. Product categories can be retrieved from the separate /productcategories endpoint.

  • supplier object

    Information about the supplier of the product.

    Hide supplier attribute Show supplier attribute
    • id number | null

      The ID of the supplier. Product suppliers can be retrieved from the separate /customers endpoint (suppliers are customers with a flag variable "isSupplier" set to "true").

Responses

  • 201 application/json

    Created

    Hide headers attributes Show headers attributes
    Hide response attributes Show response attributes object

    A single product

    • id number

      A unique identifier for the product within 24SevenOffice ERP-modules.

    • name string

      The name of the product.

      Maximum length is 150.

    • number string | null

      The alternative user-defined product number.

      Maximum length is 100.

    • type string

      Specifies whether the product is defined as a regular or structure product.

      Values are default or structure. Default value is default.

    • status string

      Specifies whether the product's status is active or inactive (expired).

      Values are active or inactive. Default value is active.

    • description string | null

      The description of the product.

      Maximum length is 500.

    • costPrice number | null

      The cost of buying the product from the supplier.

      Default value is 0.

    • salesPrice number | null

      The selling price of the product.

      Default value is 0.

    • indirectCost number | null

      The sum of indirect costs related to the product.

      Default value is 0.

    • stock object

      Stock information for the product.

      Hide stock attributes Show stock attributes
      • isManaged boolean

        A flag variable indicating whether a product should handle adjusting product quantity.

        Default value is false.

      • quantity number

        The quantity of products that are in stock.

        Default value is 0.

      • location string | null

        The location identifier for the product, like a shelf or a facility number for inventory management.

    • ean string | null

      The product's 13-digit European Article Number (EAN).

      Maximum length is 13.

    • eanAlternative string | null

      An alternative article number field, supporting up to 25 digits.

      Maximum length is 25.

    • units object

      Information about the units of measurement for the product.

      Hide units attributes Show units attributes
      • id number | null

        The ID of the units of measurement. Product units can be retrieved from the separate /productunits endpoint.

      • name string | null

        The name of the units of measurement.

      • symbol string | null

        The symbol of the units of measurement.

    • category object

      Information about the category to which the product belongs.

      Hide category attributes Show category attributes
      • id number

        A reference by ID to the category the product belongs to. Product categories can be retrieved from the separate /productcategories endpoint.

      • name string

        The category that the product belongs to.

    • supplier object

      Information about the supplier of the product.

      Hide supplier attributes Show supplier attributes
      • id number | null

        The ID of the supplier. Product suppliers can be retrieved from the separate /customers endpoint (suppliers are customers with a flag variable "isSupplier" set to "true").

      • name string | null

        The name of the supplier.

    • A timestamp for when a record was created, in ISO 8601 format.

    • A timestamp for when one of the properties of a record was last modified, in ISO 8601 format.

POST /products
curl \
 -X POST https://rest.api.24sevenoffice.com/v1/products \
 -H "Content-Type: application/json" \
 -H "Authorization: string" \
 -d '{"name":"White shoe laces","number":"SH-1234567","type":"default","status":"active","description":"1 meter long shoe laces - white","costPrice":50,"salesPrice":400,"indirectCost":12.77,"stock":{"isManaged":true,"quantity":146,"location":"A-313"},"ean":"0123456789000","eanAlternative":"0123456789012345678901234","units":{"id":2},"category":{"id":12},"supplier":{"id":67890}}'
Request examples
# Headers
Authorization: string

# Payload
{
  "name": "White shoe laces",
  "number": "SH-1234567",
  "type": "default",
  "status": "active",
  "description": "1 meter long shoe laces - white",
  "costPrice": 50,
  "salesPrice": 400,
  "indirectCost": 12.77,
  "stock": {
    "isManaged": true,
    "quantity": 146,
    "location": "A-313"
  },
  "ean": "0123456789000",
  "eanAlternative": "0123456789012345678901234",
  "units": {
    "id": 2
  },
  "category": {
    "id": 12
  },
  "supplier": {
    "id": 67890
  }
}
Response examples (201)
# Headers
Access-Control-Allow-Origin: string
Access-Control-Allow-Credentials: string
X-Trace-Id: string

# Payload
{
  "id": 123,
  "name": "White shoe laces",
  "number": "SH-1234567",
  "type": "default",
  "status": "active",
  "description": "1 meter long shoe laces - white",
  "costPrice": 50,
  "salesPrice": 400,
  "indirectCost": 12.77,
  "stock": {
    "isManaged": true,
    "quantity": 146,
    "location": "A-313"
  },
  "ean": "0123456789000",
  "eanAlternative": "0123456789012345678901234",
  "units": {
    "id": 2,
    "name": "Meter",
    "symbol": "m"
  },
  "category": {
    "id": 12,
    "name": "Shoe accessories"
  },
  "supplier": {
    "id": 67890,
    "name": "XYZ Inc."
  },
  "createdAt": "2022-01-01 18:00:00.000Z",
  "modifiedAt": "2023-12-31 18:00:00.000Z"
}