This page was automatically generated from tracezilla’s Swagger API documentation 2026-01-26

GET /orders/{orderType}/{orderId}/service-lines

Get list of service lines related to order

Description

Returns list of order service lines

Parameters (path)

Name Required Description Values
orderType required Type of order: purchase, sales. purchase, sales
orderId required Target order.  

Parameters (query)

Name Required Description Values
include optional The resources that can be included in this request, delimited by a comma: service, sku, partner_certificate, tags  

Responses

200

successful operation

Response content JSON schema
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
{
  "properties": {
    "type": "array",
    "items": {
      "required": [
        "category",
        "calculation",
        "line_text"
      ],
      "properties": {
        "id": {
          "description": "Id of the Service Line record",
          "type": "string",
          "format": "uuid",
          "readOnly": true,
          "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
        },
        "calculation": {
          "description": "How the price should be calculated for the service line",
          "type": "string",
          "format": "string",
          "enum": [
            "fixed_price",
            "per_unit",
            "percentage"
          ],
          "example": "per_unit"
        },
        "category": {
          "description": "The category of the service line",
          "type": "string",
          "format": "string",
          "enum": [
            "analysis",
            "discount",
            "packaging",
            "freight",
            "labour",
            "machinery",
            "warehouse",
            "financial",
            "customs_duty",
            "purchase_price",
            "production",
            "overhead",
            "commission",
            "taxes",
            "other"
          ],
          "example": "discount"
        },
        "line_text": {
          "description": "The text to be shown on order documents",
          "type": "string",
          "format": "string",
          "example": "Super customer discount"
        },
        "line_type": {
          "description": "The line type",
          "type": "string",
          "format": "string",
          "enum": [
            "default",
            "price_correction_from",
            "price_correction_to"
          ],
          "readOnly": true,
          "example": "default"
        },
        "locked": {
          "description": "If the service line is locked. This is usually the case when the order has been invoiced",
          "type": "boolean",
          "format": "boolean",
          "example": true
        },
        "order_id": {
          "description": "Id of the order",
          "type": "string",
          "format": "uuid",
          "readOnly": true,
          "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
        },
        "percentage": {
          "description": "The percentage to use when *calculation* is set to *percentage*",
          "type": "number",
          "format": "double",
          "example": 1234.123
        },
        "placement": {
          "description": "Currently not implemented",
          "type": "string",
          "format": "string",
          "readOnly": true
        },
        "price": {
          "description": "The total price of the serviceline. Readonly unless *calculation* is set to *fixed_price*",
          "type": "number",
          "format": "double",
          "example": 1234.123
        },
        "quantity": {
          "description": "The quantity when *calculation* is set to *per_unit*",
          "type": "number",
          "format": "double",
          "example": 1234.123
        },
        "service_id": {
          "description": "Id of the service",
          "type": "string",
          "format": "uuid",
          "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
        },
        "sku_id": {
          "description": "If of SKU on the order that this service line should be attached to. \nWill limit percentage calculation to only be based on the total amount of the SKU-lines \nand place service line together with the inventory-lines on order-documents",
          "type": "string",
          "format": "uuid",
          "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
        },
        "source_entity_id": {
          "description": "The id of the entity that created this order, if it is an external source that has been\ncreated by another entity. Eg. AutoServiceLine",
          "type": "string",
          "format": "uuid",
          "readOnly": true,
          "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
        },
        "source_model_name": {
          "description": "The model name of the entity that created this order, if it is an external source that has been\ncreated by another entity. Eg. AutoServiceLine",
          "type": "string",
          "format": "string",
          "readOnly": true,
          "example": "AutoServiceLine"
        },
        "unit": {
          "description": "The unit to used when the calculation is set to *per_unit*",
          "type": "string",
          "format": "string",
          "enum": [
            "pallet",
            "pcs",
            "hr",
            "colli",
            "m",
            "m2",
            "m3",
            "kg",
            "km"
          ],
          "example": "pcs"
        },
        "unit_price": {
          "description": "The unit price in the *currency* used when the calculation is set to *per_unit*",
          "type": "number",
          "format": "double",
          "example": 1234.123
        },
        "distribution_cost": {
          "description": "Cost of distribution. *Only relevant for sales-services*. Creates a budget line on the sales order.\nIf calculation is set to *per_unit* the cost will be multiplied with the quantity.\nThe cost is always in the local currency, and not the order currency",
          "type": "number",
          "format": "double",
          "example": 1234.123
        },
        "tag_ids": {
          "description": "Tag ids related to the Service Line. \nNotice that these will only be included if *tags* are included in the include parameter",
          "type": "array",
          "items": {
            "format": "uuid",
            "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
          }
        },
        "expiry_date": {
          "description": "META information: Expiry date",
          "type": "string",
          "format": "date",
          "readOnly": true,
          "example": "2019-01-01"
        },
        "batch_number": {
          "description": "META information: Batch number",
          "type": "string",
          "format": "string",
          "readOnly": true,
          "example": "ABC123"
        },
        "line_ref": {
          "description": "META information: Line reference",
          "type": "string",
          "format": "string",
          "readOnly": true,
          "example": "ABC123"
        },
        "invoice_ref": {
          "description": "META information: Invoice reference",
          "type": "string",
          "format": "string",
          "readOnly": true,
          "example": "ABC123"
        },
        "transaction_date": {
          "description": "META information: Transaction date",
          "type": "string",
          "format": "date",
          "readOnly": true,
          "example": "2019-01-01"
        },
        "created_at": {
          "description": "The time when the record was created in UTC date & time (Iso8601 ZuluString)",
          "type": "string",
          "format": "date-time",
          "example": "2019-01-01T13:25:32.312Z"
        },
        "updated_at": {
          "description": "The time when the record was last updated in UTC date & time (Iso8601 ZuluString)",
          "type": "string",
          "format": "date-time",
          "example": "2020-01-01T13:25:32.312Z"
        }
      },
      "type": "object"
    }
  },
  "type": "object"
}

406

not acceptable

500

internal server error

POST /orders/{orderType}/{orderId}/service-lines

Create new order service line

Description

Create a new order service line

Parameters (path)

Name Required Description Values
orderType required Type of order: purchase, sales. purchase, sales
orderId required Target order.  

Request body

Description

Target order.

Required

This parameter is required.

Request body JSON schema
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
{
  "required": [
    "category",
    "calculation",
    "line_text"
  ],
  "properties": {
    "id": {
      "description": "Id of the Service Line record",
      "type": "string",
      "format": "uuid",
      "readOnly": true,
      "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
    },
    "calculation": {
      "description": "How the price should be calculated for the service line",
      "type": "string",
      "format": "string",
      "enum": [
        "fixed_price",
        "per_unit",
        "percentage"
      ],
      "example": "per_unit"
    },
    "category": {
      "description": "The category of the service line",
      "type": "string",
      "format": "string",
      "enum": [
        "analysis",
        "discount",
        "packaging",
        "freight",
        "labour",
        "machinery",
        "warehouse",
        "financial",
        "customs_duty",
        "purchase_price",
        "production",
        "overhead",
        "commission",
        "taxes",
        "other"
      ],
      "example": "discount"
    },
    "line_text": {
      "description": "The text to be shown on order documents",
      "type": "string",
      "format": "string",
      "example": "Super customer discount"
    },
    "line_type": {
      "description": "The line type",
      "type": "string",
      "format": "string",
      "enum": [
        "default",
        "price_correction_from",
        "price_correction_to"
      ],
      "readOnly": true,
      "example": "default"
    },
    "locked": {
      "description": "If the service line is locked. This is usually the case when the order has been invoiced",
      "type": "boolean",
      "format": "boolean",
      "example": true
    },
    "order_id": {
      "description": "Id of the order",
      "type": "string",
      "format": "uuid",
      "readOnly": true,
      "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
    },
    "percentage": {
      "description": "The percentage to use when *calculation* is set to *percentage*",
      "type": "number",
      "format": "double",
      "example": 1234.123
    },
    "placement": {
      "description": "Currently not implemented",
      "type": "string",
      "format": "string",
      "readOnly": true
    },
    "price": {
      "description": "The total price of the serviceline. Readonly unless *calculation* is set to *fixed_price*",
      "type": "number",
      "format": "double",
      "example": 1234.123
    },
    "quantity": {
      "description": "The quantity when *calculation* is set to *per_unit*",
      "type": "number",
      "format": "double",
      "example": 1234.123
    },
    "service_id": {
      "description": "Id of the service",
      "type": "string",
      "format": "uuid",
      "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
    },
    "sku_id": {
      "description": "If of SKU on the order that this service line should be attached to. \nWill limit percentage calculation to only be based on the total amount of the SKU-lines \nand place service line together with the inventory-lines on order-documents",
      "type": "string",
      "format": "uuid",
      "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
    },
    "source_entity_id": {
      "description": "The id of the entity that created this order, if it is an external source that has been\ncreated by another entity. Eg. AutoServiceLine",
      "type": "string",
      "format": "uuid",
      "readOnly": true,
      "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
    },
    "source_model_name": {
      "description": "The model name of the entity that created this order, if it is an external source that has been\ncreated by another entity. Eg. AutoServiceLine",
      "type": "string",
      "format": "string",
      "readOnly": true,
      "example": "AutoServiceLine"
    },
    "unit": {
      "description": "The unit to used when the calculation is set to *per_unit*",
      "type": "string",
      "format": "string",
      "enum": [
        "pallet",
        "pcs",
        "hr",
        "colli",
        "m",
        "m2",
        "m3",
        "kg",
        "km"
      ],
      "example": "pcs"
    },
    "unit_price": {
      "description": "The unit price in the *currency* used when the calculation is set to *per_unit*",
      "type": "number",
      "format": "double",
      "example": 1234.123
    },
    "distribution_cost": {
      "description": "Cost of distribution. *Only relevant for sales-services*. Creates a budget line on the sales order.\nIf calculation is set to *per_unit* the cost will be multiplied with the quantity.\nThe cost is always in the local currency, and not the order currency",
      "type": "number",
      "format": "double",
      "example": 1234.123
    },
    "tag_ids": {
      "description": "Tag ids related to the Service Line. \nNotice that these will only be included if *tags* are included in the include parameter",
      "type": "array",
      "items": {
        "format": "uuid",
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      }
    },
    "expiry_date": {
      "description": "META information: Expiry date",
      "type": "string",
      "format": "date",
      "readOnly": true,
      "example": "2019-01-01"
    },
    "batch_number": {
      "description": "META information: Batch number",
      "type": "string",
      "format": "string",
      "readOnly": true,
      "example": "ABC123"
    },
    "line_ref": {
      "description": "META information: Line reference",
      "type": "string",
      "format": "string",
      "readOnly": true,
      "example": "ABC123"
    },
    "invoice_ref": {
      "description": "META information: Invoice reference",
      "type": "string",
      "format": "string",
      "readOnly": true,
      "example": "ABC123"
    },
    "transaction_date": {
      "description": "META information: Transaction date",
      "type": "string",
      "format": "date",
      "readOnly": true,
      "example": "2019-01-01"
    },
    "created_at": {
      "description": "The time when the record was created in UTC date & time (Iso8601 ZuluString)",
      "type": "string",
      "format": "date-time",
      "example": "2019-01-01T13:25:32.312Z"
    },
    "updated_at": {
      "description": "The time when the record was last updated in UTC date & time (Iso8601 ZuluString)",
      "type": "string",
      "format": "date-time",
      "example": "2020-01-01T13:25:32.312Z"
    }
  },
  "type": "object"
}

Responses

200

successful operation

Response content JSON schema
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
{
  "properties": {
    "required": [
      "category",
      "calculation",
      "line_text"
    ],
    "properties": {
      "id": {
        "description": "Id of the Service Line record",
        "type": "string",
        "format": "uuid",
        "readOnly": true,
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      },
      "calculation": {
        "description": "How the price should be calculated for the service line",
        "type": "string",
        "format": "string",
        "enum": [
          "fixed_price",
          "per_unit",
          "percentage"
        ],
        "example": "per_unit"
      },
      "category": {
        "description": "The category of the service line",
        "type": "string",
        "format": "string",
        "enum": [
          "analysis",
          "discount",
          "packaging",
          "freight",
          "labour",
          "machinery",
          "warehouse",
          "financial",
          "customs_duty",
          "purchase_price",
          "production",
          "overhead",
          "commission",
          "taxes",
          "other"
        ],
        "example": "discount"
      },
      "line_text": {
        "description": "The text to be shown on order documents",
        "type": "string",
        "format": "string",
        "example": "Super customer discount"
      },
      "line_type": {
        "description": "The line type",
        "type": "string",
        "format": "string",
        "enum": [
          "default",
          "price_correction_from",
          "price_correction_to"
        ],
        "readOnly": true,
        "example": "default"
      },
      "locked": {
        "description": "If the service line is locked. This is usually the case when the order has been invoiced",
        "type": "boolean",
        "format": "boolean",
        "example": true
      },
      "order_id": {
        "description": "Id of the order",
        "type": "string",
        "format": "uuid",
        "readOnly": true,
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      },
      "percentage": {
        "description": "The percentage to use when *calculation* is set to *percentage*",
        "type": "number",
        "format": "double",
        "example": 1234.123
      },
      "placement": {
        "description": "Currently not implemented",
        "type": "string",
        "format": "string",
        "readOnly": true
      },
      "price": {
        "description": "The total price of the serviceline. Readonly unless *calculation* is set to *fixed_price*",
        "type": "number",
        "format": "double",
        "example": 1234.123
      },
      "quantity": {
        "description": "The quantity when *calculation* is set to *per_unit*",
        "type": "number",
        "format": "double",
        "example": 1234.123
      },
      "service_id": {
        "description": "Id of the service",
        "type": "string",
        "format": "uuid",
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      },
      "sku_id": {
        "description": "If of SKU on the order that this service line should be attached to. \nWill limit percentage calculation to only be based on the total amount of the SKU-lines \nand place service line together with the inventory-lines on order-documents",
        "type": "string",
        "format": "uuid",
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      },
      "source_entity_id": {
        "description": "The id of the entity that created this order, if it is an external source that has been\ncreated by another entity. Eg. AutoServiceLine",
        "type": "string",
        "format": "uuid",
        "readOnly": true,
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      },
      "source_model_name": {
        "description": "The model name of the entity that created this order, if it is an external source that has been\ncreated by another entity. Eg. AutoServiceLine",
        "type": "string",
        "format": "string",
        "readOnly": true,
        "example": "AutoServiceLine"
      },
      "unit": {
        "description": "The unit to used when the calculation is set to *per_unit*",
        "type": "string",
        "format": "string",
        "enum": [
          "pallet",
          "pcs",
          "hr",
          "colli",
          "m",
          "m2",
          "m3",
          "kg",
          "km"
        ],
        "example": "pcs"
      },
      "unit_price": {
        "description": "The unit price in the *currency* used when the calculation is set to *per_unit*",
        "type": "number",
        "format": "double",
        "example": 1234.123
      },
      "distribution_cost": {
        "description": "Cost of distribution. *Only relevant for sales-services*. Creates a budget line on the sales order.\nIf calculation is set to *per_unit* the cost will be multiplied with the quantity.\nThe cost is always in the local currency, and not the order currency",
        "type": "number",
        "format": "double",
        "example": 1234.123
      },
      "tag_ids": {
        "description": "Tag ids related to the Service Line. \nNotice that these will only be included if *tags* are included in the include parameter",
        "type": "array",
        "items": {
          "format": "uuid",
          "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
        }
      },
      "expiry_date": {
        "description": "META information: Expiry date",
        "type": "string",
        "format": "date",
        "readOnly": true,
        "example": "2019-01-01"
      },
      "batch_number": {
        "description": "META information: Batch number",
        "type": "string",
        "format": "string",
        "readOnly": true,
        "example": "ABC123"
      },
      "line_ref": {
        "description": "META information: Line reference",
        "type": "string",
        "format": "string",
        "readOnly": true,
        "example": "ABC123"
      },
      "invoice_ref": {
        "description": "META information: Invoice reference",
        "type": "string",
        "format": "string",
        "readOnly": true,
        "example": "ABC123"
      },
      "transaction_date": {
        "description": "META information: Transaction date",
        "type": "string",
        "format": "date",
        "readOnly": true,
        "example": "2019-01-01"
      },
      "created_at": {
        "description": "The time when the record was created in UTC date & time (Iso8601 ZuluString)",
        "type": "string",
        "format": "date-time",
        "example": "2019-01-01T13:25:32.312Z"
      },
      "updated_at": {
        "description": "The time when the record was last updated in UTC date & time (Iso8601 ZuluString)",
        "type": "string",
        "format": "date-time",
        "example": "2020-01-01T13:25:32.312Z"
      }
    },
    "type": "object"
  },
  "type": "object"
}

406

not acceptable

500

internal server error

DELETE /orders/{orderType}/{orderId}/service-lines

Delete lines specified

Description

Deletes all service lines with the ids specified by the variable ids

Parameters (path)

Name Required Description Values
orderType required Type of order: production, sales, warehouse. production, warehouse, sales
orderId required Target order.  

Responses

204

Operation was succesfull

403

Unauthorized request

406

not acceptable

500

Internal server error