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

GET /expenses/{expenseId}/lines

Get expense lines

Description

Returns expense resource

Parameters (path)

Name Required Description Values
expenseId required Target expense.  

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
{
  "properties": {
    "type": "array",
    "items": {
      "properties": {
        "id": {
          "description": "Id of the record",
          "type": "string",
          "format": "uuid",
          "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
        },
        "amount": {
          "description": "Amount including vat",
          "type": "number",
          "format": "double",
          "example": 1234.123
        },
        "vats_total": {
          "description": "Total vat",
          "type": "number",
          "format": "double",
          "example": 1234.123
        },
        "attach_to": {
          "description": "What type of entities this line should be attached to.",
          "type": "string",
          "format": "string",
          "enum": [
            "order.purchase",
            "order.supplierreturn",
            "order.production",
            "order.warehouse",
            "order.sales",
            "delivery",
            "lot"
          ],
          "example": "order.purchase"
        },
        "category": {
          "description": "Cost category",
          "type": "string",
          "format": "string",
          "enum": [
            "analysis",
            "discount",
            "packaging",
            "freight",
            "labour",
            "machinery",
            "warehouse",
            "financial",
            "customs_duty",
            "purchase_price",
            "production",
            "overhead",
            "commission",
            "taxes",
            "other"
          ],
          "example": "freight"
        },
        "expense_id": {
          "description": "No description is available",
          "type": "string",
          "format": "uuid",
          "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
        },
        "memo": {
          "description": "No description is available",
          "type": "string",
          "format": "string",
          "example": "A string"
        },
        "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 ExpenseLine 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

PUT /expenses/{expenseId}/lines

Update lines of expense

Description

Update lines of expense. Any lines not in the request will be deleted.

Parameters (path)

Name Required Description Values
expenseId required Target expense.  

Request body

Description

Data to store.

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
{
  "properties": {
    "close_expense": {
      "description": "If the expense should be closed after the lines have been updated",
      "type": "boolean",
      "format": "boolean",
      "default": false,
      "example": true
    },
    "lines": {
      "type": "array",
      "items": {
        "required": [
          "id",
          "category",
          "attach_to",
          "memo",
          "amount",
          "vats_total"
        ],
        "properties": {
          "id": {
            "description": "Id of line. A v4 UUID can be created locally. If a line with this id already exists",
            "format": "uuid",
            "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
          },
          "memo": {
            "description": "Memo text to go with the line",
            "format": "string",
            "example": "Bill for xyz"
          },
          "gl_account_id": {
            "description": "Id of GlAccount.",
            "format": "uuid",
            "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
          },
          "category": {
            "description": "Cost category.",
            "type": "string",
            "format": "string",
            "enum": [
              "analysis",
              "discount",
              "packaging",
              "freight",
              "labour",
              "machinery",
              "warehouse",
              "financial",
              "customs_duty",
              "purchase_price",
              "production",
              "overhead",
              "commission",
              "taxes",
              "other"
            ],
            "example": "freight"
          },
          "amount": {
            "description": "Amount of the line in the currency of the expense. The amount should be inclusive of vat.",
            "format": "double",
            "example": 1234.123
          },
          "vats_total": {
            "description": "VAT included in the amount. Will be deducted from *amount* when calculating the cost",
            "format": "double",
            "example": 1234.123
          },
          "attach_to": {
            "description": "What type of entities this line should be attached to",
            "type": "string",
            "format": "string",
            "enum": [
              "order.purchase",
              "order.supplierreturn",
              "order.production",
              "order.warehouse",
              "order.sales",
              "delivery",
              "lot"
            ],
            "example": "order.purchase"
          },
          "purchase_order_ids": {
            "description": "Id of purchase orders if *attach_to* = *order.purchase*",
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
            }
          },
          "supplierreturn_order_ids": {
            "description": "Id of supplier return orders if *attach_to* = *order.supplierreturn*",
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
            }
          },
          "production_order_ids": {
            "description": "Id of supplier return orders if *attach_to* = *order.production*",
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
            }
          },
          "warehouse_order_ids": {
            "description": "Id of warehouse orders if *attach_to* = *order.warehouse*",
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
            }
          },
          "sales_order_ids": {
            "description": "Id of sales orders if *attach_to* = *order.sales*",
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
            }
          },
          "lot_ids": {
            "description": "Id of lots if *attach_to* = *lot*",
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
            }
          },
          "delivery_id": {
            "description": "Id of delivery if *attach_to* = *delivery*",
            "type": "string",
            "format": "uuid",
            "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
          },
          "tag_ids": {
            "description": "Tag ids of tags related to the line",
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
            }
          }
        },
        "type": "object"
      }
    }
  },
  "type": "object"
}

Responses

403

Unauthorized request

406

not acceptable

500

Internal server error