This page was automatically generated from tracezilla’s Swagger API documentation 2026-01-26
GET /expenses
Get list of expenses
Description
Returns list of expenses
Parameters (query)
| Name | Required | Description | Values |
|---|---|---|---|
| sortBy | optional | Field to sort by. | Â |
| sortDirection | optional | Direction of sort. | asc, desc |
| lot[eq] | optional | Search for an expense by lot id. Allowed expression(s): eq | Â |
| order[eq] | optional | Search for an expense by order id. Allowed expression(s): eq, in, ne | Â |
| supplier[eq] | optional | Search for an expense by supplier id. Allowed expression(s): eq, in, ne | Â |
| delivery[eq] | optional | Search for an expense by delivery id. Allowed expression(s): eq, in, ne | Â |
| keyword[eq] | optional | Search for an expense by keyword. Allowed expression(s): eq, ct | Â |
| ext_ref_lookup[eq] | optional | Search for an expense by ext_ref_lookup. Allowed expression(s): eq | Â |
| number[eq] | optional | Search for an expense by number. Allowed expression(s): eq, in, ne | Â |
| invoice_date[eq] | optional | Search for an expense by invoice_date. Allowed expression(s): eq, lt, lte, gt, gte | Â |
| only_missing_allocations[eq] | optional | Search for an expense that are missing allocations. Allowed expression(s): eq | Â |
| task_status[eq] | optional | Search for an expense by task status. Allowed expression(s): eq | Â |
| status[eq] | optional | Search for an expense by status. Allowed expression(s): eq, in | Â |
| include | optional | The resources that can be included in this request, delimited by a comma: remark, sub_total, vats_total, attached_lots_expected_cost, attached_lots_expense_cost, credit_note_for, preview_attachments, supplier, supplier_location, 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
{
"properties": {
"data": {
"type": "array",
"items": {
"required": [
"currency",
"supplier_id",
"supplier_location_id",
"exchange_rate",
"invoice_date",
"payment_date"
],
"properties": {
"id": {
"description": "Id of the record",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"acc_approved": {
"description": "If the expense is approved in the accounting system",
"type": "boolean",
"format": "boolean",
"example": true
},
"acc_file_id": {
"description": "External Id of related PDF in external system",
"type": "string",
"format": "string",
"example": "A string"
},
"acc_file_name": {
"description": "Name of file in accounting system",
"type": "string",
"format": "string",
"example": "A string"
},
"acc_ref": {
"description": "Reference for related record in accounting system",
"type": "string",
"format": "string",
"example": "A string"
},
"created_by_id": {
"description": "Id of the user that created the expense",
"type": "integer",
"format": "int32",
"example": 1234
},
"credit_note_for_id": {
"description": "Id of expense that this expense is a creditnote for",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"currency": {
"description": "ISO 4217 Currency Codes 3 letter currency code",
"type": "string",
"format": "string",
"example": "DKK"
},
"default_category": {
"description": "Default cost category for this expense. Individual cost categories can be set on the expense lines",
"type": "string",
"format": "string",
"enum": [
"rental",
"analysis",
"discount",
"packaging",
"freight",
"labour",
"machinery",
"warehouse",
"financial",
"customs_duty",
"return_price",
"purchase_price",
"production",
"overhead",
"commission",
"taxes",
"other"
],
"example": "analysis"
},
"default_gl_account_id": {
"description": "Id of default GlAccount for this expense. Individual GlAccounts can be set on the expense lines",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"exchange_rate": {
"description": "Exchange rate of the expense",
"type": "number",
"format": "double",
"example": 1234.123
},
"expense_sub_total": {
"description": "The sub total of the expense",
"type": "number",
"format": "double",
"example": 1234.123
},
"expense_total": {
"description": "The total of the expense",
"type": "number",
"format": "double",
"example": 1234.123
},
"expense_vats_total": {
"description": "The total vat amount of the expense",
"type": "number",
"format": "double",
"example": 1234.123
},
"ext_ref": {
"description": "Supplier reference",
"type": "string",
"format": "string",
"example": "A string"
},
"ext_ref_count": {
"description": "Count of expenses from the same supplier with the same external reference. If more than one, there is a risk that this is a duplicate",
"format": "",
"example": ""
},
"ext_ref_lookup": {
"description": "Sanitized ext_ref used to lookup duplicates",
"type": "string",
"format": "string",
"example": "A string"
},
"file_id": {
"description": "Id of file in tracezilla",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"file_url": {
"description": "Url of external file",
"type": "string",
"format": "string",
"example": "https://acme-inc.com/expense-file-3454.pdf"
},
"gl_journal_id": {
"description": "Id of GlJournal where this expense have been placed",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"invoice_date": {
"description": "Invoice date of the expense",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"locked": {
"description": "If this expense is locked and cannot be deleted",
"type": "boolean",
"format": "boolean",
"example": true
},
"number": {
"description": "Number of invoice in tracezilla",
"type": "integer",
"format": "int32",
"example": 1234
},
"our_ref": {
"description": "Our reference",
"type": "string",
"format": "string",
"example": "A string"
},
"payment_date": {
"description": "The date the expense should be paid",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"payment_ref": {
"description": "The reference code that should be used to identify the payment",
"type": "string",
"format": "string",
"example": "A string"
},
"source": {
"description": "A source reference of the expense",
"type": "string",
"format": "string",
"example": "A string"
},
"status": {
"description": "The current status of the expense",
"type": "string",
"format": "string",
"enum": [
"internal",
"verify",
"approved",
"partially_paid",
"paid",
"overpaid",
"written_off"
],
"example": "verify"
},
"supplier_country": {
"description": "Supplier country. ISO 3166-1 alpha-2 Country Code",
"type": "string",
"format": "string",
"example": "SE"
},
"supplier_id": {
"description": "Reference to the partner entity of the supplier",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"supplier_location_id": {
"description": "Reference to the location entity of the supplier",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"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"
},
"tag_ids": {
"description": "Tag ids related to the Expense entity. \nNotice that these will only be included if *tags* are included in the include parameter",
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
}
}
},
"type": "object"
}
},
"links": {
"description": "Links",
"properties": {
"first": {
"description": "Link to the first page",
"type": "string"
},
"last": {
"description": "Link to the last page",
"type": "string"
},
"next": {
"description": "Link to the next page",
"type": "string"
},
"prev": {
"description": "Link to the previous page",
"type": "string"
}
},
"type": "object"
},
"meta": {
"description": "Meta with pagination",
"properties": {
"current_page": {
"description": "The current page",
"type": "integer"
},
"from": {
"description": "The starting position of the current page results",
"type": "integer"
},
"last_page": {
"description": "The last page",
"type": "integer"
},
"path": {
"description": "The current path of the request",
"type": "string"
},
"per_page": {
"description": "Records that are displayed pr request",
"type": "integer"
},
"to": {
"description": "The ending position of the current page results",
"type": "integer"
},
"total": {
"description": "Number of records that are matched by the current query",
"type": "integer"
}
},
"type": "object"
}
},
"type": "object"
}
406
not acceptable
500
internal server error
POST /expenses
Create new expense
Description
Create a new expense
Request body
Description
Target Expense.
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
{
"required": [
"currency",
"supplier_id",
"supplier_location_id",
"exchange_rate",
"invoice_date",
"payment_date"
],
"properties": {
"id": {
"description": "Id of the record",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"acc_approved": {
"description": "If the expense is approved in the accounting system",
"type": "boolean",
"format": "boolean",
"example": true
},
"acc_file_id": {
"description": "External Id of related PDF in external system",
"type": "string",
"format": "string",
"example": "A string"
},
"acc_file_name": {
"description": "Name of file in accounting system",
"type": "string",
"format": "string",
"example": "A string"
},
"acc_ref": {
"description": "Reference for related record in accounting system",
"type": "string",
"format": "string",
"example": "A string"
},
"created_by_id": {
"description": "Id of the user that created the expense",
"type": "integer",
"format": "int32",
"example": 1234
},
"credit_note_for_id": {
"description": "Id of expense that this expense is a creditnote for",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"currency": {
"description": "ISO 4217 Currency Codes 3 letter currency code",
"type": "string",
"format": "string",
"example": "DKK"
},
"default_category": {
"description": "Default cost category for this expense. Individual cost categories can be set on the expense lines",
"type": "string",
"format": "string",
"enum": [
"rental",
"analysis",
"discount",
"packaging",
"freight",
"labour",
"machinery",
"warehouse",
"financial",
"customs_duty",
"return_price",
"purchase_price",
"production",
"overhead",
"commission",
"taxes",
"other"
],
"example": "analysis"
},
"default_gl_account_id": {
"description": "Id of default GlAccount for this expense. Individual GlAccounts can be set on the expense lines",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"exchange_rate": {
"description": "Exchange rate of the expense",
"type": "number",
"format": "double",
"example": 1234.123
},
"expense_sub_total": {
"description": "The sub total of the expense",
"type": "number",
"format": "double",
"example": 1234.123
},
"expense_total": {
"description": "The total of the expense",
"type": "number",
"format": "double",
"example": 1234.123
},
"expense_vats_total": {
"description": "The total vat amount of the expense",
"type": "number",
"format": "double",
"example": 1234.123
},
"ext_ref": {
"description": "Supplier reference",
"type": "string",
"format": "string",
"example": "A string"
},
"ext_ref_count": {
"description": "Count of expenses from the same supplier with the same external reference. If more than one, there is a risk that this is a duplicate",
"format": "",
"example": ""
},
"ext_ref_lookup": {
"description": "Sanitized ext_ref used to lookup duplicates",
"type": "string",
"format": "string",
"example": "A string"
},
"file_id": {
"description": "Id of file in tracezilla",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"file_url": {
"description": "Url of external file",
"type": "string",
"format": "string",
"example": "https://acme-inc.com/expense-file-3454.pdf"
},
"gl_journal_id": {
"description": "Id of GlJournal where this expense have been placed",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"invoice_date": {
"description": "Invoice date of the expense",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"locked": {
"description": "If this expense is locked and cannot be deleted",
"type": "boolean",
"format": "boolean",
"example": true
},
"number": {
"description": "Number of invoice in tracezilla",
"type": "integer",
"format": "int32",
"example": 1234
},
"our_ref": {
"description": "Our reference",
"type": "string",
"format": "string",
"example": "A string"
},
"payment_date": {
"description": "The date the expense should be paid",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"payment_ref": {
"description": "The reference code that should be used to identify the payment",
"type": "string",
"format": "string",
"example": "A string"
},
"source": {
"description": "A source reference of the expense",
"type": "string",
"format": "string",
"example": "A string"
},
"status": {
"description": "The current status of the expense",
"type": "string",
"format": "string",
"enum": [
"internal",
"verify",
"approved",
"partially_paid",
"paid",
"overpaid",
"written_off"
],
"example": "verify"
},
"supplier_country": {
"description": "Supplier country. ISO 3166-1 alpha-2 Country Code",
"type": "string",
"format": "string",
"example": "SE"
},
"supplier_id": {
"description": "Reference to the partner entity of the supplier",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"supplier_location_id": {
"description": "Reference to the location entity of the supplier",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"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"
},
"tag_ids": {
"description": "Tag ids related to the Expense entity. \nNotice that these will only be included if *tags* are included in the include parameter",
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
}
}
},
"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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
{
"properties": {
"required": [
"currency",
"supplier_id",
"supplier_location_id",
"exchange_rate",
"invoice_date",
"payment_date"
],
"properties": {
"id": {
"description": "Id of the record",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"acc_approved": {
"description": "If the expense is approved in the accounting system",
"type": "boolean",
"format": "boolean",
"example": true
},
"acc_file_id": {
"description": "External Id of related PDF in external system",
"type": "string",
"format": "string",
"example": "A string"
},
"acc_file_name": {
"description": "Name of file in accounting system",
"type": "string",
"format": "string",
"example": "A string"
},
"acc_ref": {
"description": "Reference for related record in accounting system",
"type": "string",
"format": "string",
"example": "A string"
},
"created_by_id": {
"description": "Id of the user that created the expense",
"type": "integer",
"format": "int32",
"example": 1234
},
"credit_note_for_id": {
"description": "Id of expense that this expense is a creditnote for",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"currency": {
"description": "ISO 4217 Currency Codes 3 letter currency code",
"type": "string",
"format": "string",
"example": "DKK"
},
"default_category": {
"description": "Default cost category for this expense. Individual cost categories can be set on the expense lines",
"type": "string",
"format": "string",
"enum": [
"rental",
"analysis",
"discount",
"packaging",
"freight",
"labour",
"machinery",
"warehouse",
"financial",
"customs_duty",
"return_price",
"purchase_price",
"production",
"overhead",
"commission",
"taxes",
"other"
],
"example": "analysis"
},
"default_gl_account_id": {
"description": "Id of default GlAccount for this expense. Individual GlAccounts can be set on the expense lines",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"exchange_rate": {
"description": "Exchange rate of the expense",
"type": "number",
"format": "double",
"example": 1234.123
},
"expense_sub_total": {
"description": "The sub total of the expense",
"type": "number",
"format": "double",
"example": 1234.123
},
"expense_total": {
"description": "The total of the expense",
"type": "number",
"format": "double",
"example": 1234.123
},
"expense_vats_total": {
"description": "The total vat amount of the expense",
"type": "number",
"format": "double",
"example": 1234.123
},
"ext_ref": {
"description": "Supplier reference",
"type": "string",
"format": "string",
"example": "A string"
},
"ext_ref_count": {
"description": "Count of expenses from the same supplier with the same external reference. If more than one, there is a risk that this is a duplicate",
"format": "",
"example": ""
},
"ext_ref_lookup": {
"description": "Sanitized ext_ref used to lookup duplicates",
"type": "string",
"format": "string",
"example": "A string"
},
"file_id": {
"description": "Id of file in tracezilla",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"file_url": {
"description": "Url of external file",
"type": "string",
"format": "string",
"example": "https://acme-inc.com/expense-file-3454.pdf"
},
"gl_journal_id": {
"description": "Id of GlJournal where this expense have been placed",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"invoice_date": {
"description": "Invoice date of the expense",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"locked": {
"description": "If this expense is locked and cannot be deleted",
"type": "boolean",
"format": "boolean",
"example": true
},
"number": {
"description": "Number of invoice in tracezilla",
"type": "integer",
"format": "int32",
"example": 1234
},
"our_ref": {
"description": "Our reference",
"type": "string",
"format": "string",
"example": "A string"
},
"payment_date": {
"description": "The date the expense should be paid",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"payment_ref": {
"description": "The reference code that should be used to identify the payment",
"type": "string",
"format": "string",
"example": "A string"
},
"source": {
"description": "A source reference of the expense",
"type": "string",
"format": "string",
"example": "A string"
},
"status": {
"description": "The current status of the expense",
"type": "string",
"format": "string",
"enum": [
"internal",
"verify",
"approved",
"partially_paid",
"paid",
"overpaid",
"written_off"
],
"example": "verify"
},
"supplier_country": {
"description": "Supplier country. ISO 3166-1 alpha-2 Country Code",
"type": "string",
"format": "string",
"example": "SE"
},
"supplier_id": {
"description": "Reference to the partner entity of the supplier",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"supplier_location_id": {
"description": "Reference to the location entity of the supplier",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"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"
},
"tag_ids": {
"description": "Tag ids related to the Expense entity. \nNotice that these will only be included if *tags* are included in the include parameter",
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
}
}
},
"type": "object"
},
"type": "object"
}
406
not acceptable
500
internal server error