---
title: Products and materials
description: "Here we go through how you can create products and materials and how you can attach them to you orders with the Skyplanner-API. We will also show you how to create default process steps for your products and how to…"
url: "https://skyplanner.ai/docs/api-products-and-materials/"
updated: "2025-03-07"
category: Integrations
tags:
  - API
  - Integration
---

# Products and materials

Here we go through how you can create products and materials and how you can attach them to you orders with the Skyplanner-API. We will also show you how to create default process steps for your products and how to create order items using those defaults.

#### Creating a product/material

Creating and updating both products and materials is done through the same API-endpoint: /products. The type of the product is set by the **type**-attribute: 'product' or 'material'

![](https://skyplanner.ai/wp-content/uploads/2025/03/image-14.png)
**Fig 1.** Creating a product

![](https://skyplanner.ai/wp-content/uploads/2025/03/image-11.png)
**Fig 2.** Creating a material

When creating products and materials make sure you set the **is_active** value as true if you want the product/material shown as being active in the product listing. Also note that you can set the available stock quantity with the **free_amount** attribute.

#### Creating default process steps for a product

Before adding default process steps for a product you need to have the appropriate workstages. Workstages can be created either through the Skyplanner UI or the /workstages-endpoint.

Adding default process steps is done from the /products/jobs/{productId}-endpoint.

So for example if you want to add a default step to the product with the id 22220 you would do a POST-request like this:

![](https://skyplanner.ai/wp-content/uploads/2025/03/image-16.png)
**Fig 3.** Adding a default process step

Some notable fields:

- order_number
  - This is an index number telling Skyplanner in which order the process steps are meant to be completed
  - For example: first step gets value 1, second step gets value 3, third step gets value 3 and so on...
- workstations
  - This is a list of workstations this process step can be scheduled to
  - Give here workstation ids as an comma separated list, like this: "61,62,63"
- time_variation
  - Possible values: time_per_pcs, pcs_per_time, fixed_time
- duration, settingtime, settletime
  - Give these values in *seconds*

#### Updating a default process step

When updating a default process step you have to use the **order_number** attribute to specify which step to update.

For example, the first process step (**order_number 1**) in this product is done with a PUT-request like this:

![](https://skyplanner.ai/wp-content/uploads/2025/03/image-19.png)
**Fig 4.** Updating a default process step

#### Deleting default process steps

Deleting default process steps is also done by using the **order_number** values.

Order_numbers are given in an array like this:

![](https://skyplanner.ai/wp-content/uploads/2025/03/image-21.png)
**Fig 5.** Deleting default process steps

##### Adding a material/sub product to a product

To attach a material or sub product we need to use the /sub-products endpoint.

The process is pretty straightforward: we put the id of the material or sub product to the **production_planning_product_id** attribute and the id of the product we want the material/sub product to be attached to into the **production_planning_product_parent_id** attribute.

![](https://skyplanner.ai/wp-content/uploads/2025/03/image-22.png)
**Fig 6.** Attaching a material to a product

##### Adding a material to order item

You can also attach materials directly to an order item by using the /row-materials endpoint. This way you can attach extra materials or use a completely different list of materials in an order item from the default materials set to the products. Note that you can have only one row-material entity for an order item for each material. So in effect you can not create two entities with the same **production_planning_product_id**to the same **phaser_order_row_id**.

![](https://skyplanner.ai/wp-content/uploads/2025/03/image-24.png)
**Fig 7.** Adding a material to an order item

#### Updating the stock level

You can update the product or material stock level by sending a PUT-request with the **free_amount** attribute.

![](https://skyplanner.ai/wp-content/uploads/2025/03/image-40.png)
**Fig 8.** Updating the stock level
