---
title: Creating an order
description: "Here you can find a comprehensive guide on how to create an order into Skyplanner with all related data. Some of this has been covered in the integration [tutorial](https://skyplanner.ai/docs/integration-tutorial/), but here we go through the Skyplanner data structure and integration…"
url: "https://skyplanner.ai/docs/api-creating-an-order/"
updated: "2025-05-13"
category: Integrations
tags:
  - API
  - Integration
---

# Creating an order

Here you can find a comprehensive guide on how to create an order into Skyplanner with all related data. Some of this has been covered in the integration [tutorial](https://skyplanner.ai/docs/integration-tutorial/), but here we go through the Skyplanner data structure and integration process in more detail.

#### Data structure

First we will go through how a Skyplanner order is structured. The [API-endpoints](https://integration.skyplanner.app/api/swagger) for the data entities mentioned here are highlighted like this: /phaser-orders

On the top level we have the **order** (/phaser-orders)

Each **order** *must*have a **customer** (/customers).

Each **order** can have multiple **order-items** (/phaser-order-rows)

Each **order-item** *can* have a **product** (/products) attached to it, but it is not mandatory. Each **product** has one **stock** (/saldos). Note that the stock entity is created automatically when a product is created with the API.

Each **order-item** can have multiple **jobs** (aka process steps) (/phaser-jobs).

Each **job** *must*have a **workstage** (/workstages).

![](https://skyplanner.ai/wp-content/uploads/2025/02/phaser-order.drawio-1-655x1024.png)
**Fig. 1** Structure of order and related data

#### Integration workflow

Here is a step by step example of how you could structure your integration from your ERP-system to Skyplanner.

1. Fetch sales/workorder from ERP
2. Create **customer**(get customer id in response)
3. Create **order** with customer id (get order id in response)
4. Fetch sales/workorder order item data from ERP
5. Create **product** (get product id in response)
6. Create **order item** with order id & other data (get order item id in response)
7. Fetch process step data from ERP
8. Create **workstage** (get workstage id in response)
9. Create **job** with workstage id and other data

#### Extra tips

##### On deleting

Deleting phaser-orders, phaser-order-items or phaser-jobs through the API (and from the UI) is done in a *soft delete* manner. This means that the data is not actually deleted from the database, but it is marked as *archived*. In effect the **is_archive** attribute of the entity is set to true when it is deleted. The archived/deleted entities can still be accessed with the API using the **include_archived** parameter. When include_archived=true, a GET-request will retrieve the entity even if it is archived.

**Note that soft deleting is not available in every API endpoint! So you need to be careful as deleting for example customers, people etc. is permanent!**

##### Using default process steps for you order item

If you have created some default process steps for the product your order item is producing you can tell the system to bring the defaults to the order item with the API using the **get_default_steps** attribute.

![](https://skyplanner.ai/wp-content/uploads/2025/02/image-158.png)
**Fig 2.** Creating a new order item with default process steps

##### Adding materials to order item

If you have attached materials to the produced product they are automatically attached to the order row.

However, if you do not want to use the materials attached to the product (for example, if the item is a special order and you want to use different materials etc) you can use the **use_custom_materials** attribute.

![](https://skyplanner.ai/wp-content/uploads/2025/02/image-159.png)
**Fig 3.** Creating an order item without using the default materials
