wflow-api 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wflow_api/__init__.py +20 -0
- wflow_api/auth.py +85 -0
- wflow_api/client.py +130 -0
- wflow_api/errors.py +13 -0
- wflow_api/guards.py +132 -0
- wflow_api/models/__init__.py +128 -0
- wflow_api/models/account.py +127 -0
- wflow_api/models/admin.py +98 -0
- wflow_api/models/common.py +117 -0
- wflow_api/models/documents.py +514 -0
- wflow_api/models/registers.py +165 -0
- wflow_api/models/requests.py +341 -0
- wflow_api/models/storage.py +38 -0
- wflow_api/operation.py +50 -0
- wflow_api/operations/__init__.py +21 -0
- wflow_api/operations/account.py +46 -0
- wflow_api/operations/admin.py +307 -0
- wflow_api/operations/approvals.py +235 -0
- wflow_api/operations/document_files.py +145 -0
- wflow_api/operations/document_properties.py +204 -0
- wflow_api/operations/document_tags.py +60 -0
- wflow_api/operations/documents.py +603 -0
- wflow_api/operations/integrations.py +63 -0
- wflow_api/operations/organization.py +51 -0
- wflow_api/operations/registers.py +2273 -0
- wflow_api/operations/storage_files.py +477 -0
- wflow_api/operations/storage_folders.py +132 -0
- wflow_api/operations/webhooks.py +67 -0
- wflow_api/py.typed +0 -0
- wflow_api-0.1.0.dist-info/METADATA +48 -0
- wflow_api-0.1.0.dist-info/RECORD +33 -0
- wflow_api-0.1.0.dist-info/WHEEL +4 -0
- wflow_api-0.1.0.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,2273 @@
|
|
|
1
|
+
"""Registers: the lookup data documents refer to.
|
|
2
|
+
|
|
3
|
+
Every register GET takes the same five paging arguments and returns a paged
|
|
4
|
+
`{items, totalItems, pageSize, page}` envelope. The response shape is not documented
|
|
5
|
+
upstream; each model here is the item schema that the PUT on the same path documents.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from wflow_api.client import WflowClient
|
|
9
|
+
from wflow_api.guards import query_params, write_body
|
|
10
|
+
from wflow_api.models import (
|
|
11
|
+
BusinessItemUpdateC,
|
|
12
|
+
KindRegister,
|
|
13
|
+
Location,
|
|
14
|
+
OrganizationPerson,
|
|
15
|
+
OrgSlug,
|
|
16
|
+
Page,
|
|
17
|
+
Paged,
|
|
18
|
+
PageSize,
|
|
19
|
+
PartnerFull,
|
|
20
|
+
PartnerPersonUpdateC,
|
|
21
|
+
PaymentMethods,
|
|
22
|
+
Query,
|
|
23
|
+
Register,
|
|
24
|
+
Search,
|
|
25
|
+
Serie,
|
|
26
|
+
Sort,
|
|
27
|
+
VATReturnLine,
|
|
28
|
+
WriteResult,
|
|
29
|
+
)
|
|
30
|
+
from wflow_api.operation import operation
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@operation
|
|
34
|
+
async def list_register_partners(
|
|
35
|
+
client: WflowClient,
|
|
36
|
+
organization: OrgSlug,
|
|
37
|
+
search: Search = None,
|
|
38
|
+
sort: Sort = None,
|
|
39
|
+
query: Query = None,
|
|
40
|
+
pageSize: PageSize = None,
|
|
41
|
+
page: Page = None,
|
|
42
|
+
) -> Paged[PartnerFull]:
|
|
43
|
+
"""Business partners — the suppliers and customers documents are issued to or from.
|
|
44
|
+
|
|
45
|
+
The register every incoming and outgoing invoice points at. Look a partner up here
|
|
46
|
+
when you need its bank accounts, VAT number or payment terms rather than just the
|
|
47
|
+
name printed on a document.
|
|
48
|
+
|
|
49
|
+
Fields:
|
|
50
|
+
|
|
51
|
+
- `name`, `ic`, `vat`, `localVAT`, `businessRegisterRegistration` — trading name, company
|
|
52
|
+
registration number, VAT identification and commercial-register entry
|
|
53
|
+
- `address` as one string, and `mainAddress` broken into parts
|
|
54
|
+
- `customer` / `supplier` — which side of the relationship this partner is on;
|
|
55
|
+
both can be true
|
|
56
|
+
- `accountNo`, `bankCode`, `iban`, `bic`, `currency` — the primary bank account, flat on
|
|
57
|
+
the partner; `mainAccount` and `accounts` repeat those same five names nested per account
|
|
58
|
+
- `peppolIds` — Peppol e-invoicing identifiers
|
|
59
|
+
- `deliveryPeriod`, `minOrderTotal`, `toleranceRate` — the terms wflow applies when
|
|
60
|
+
matching invoices to orders
|
|
61
|
+
- `phoneNo`, `mailAddress`, `language`, `note`
|
|
62
|
+
"""
|
|
63
|
+
payload = (
|
|
64
|
+
await client.request(
|
|
65
|
+
"GET",
|
|
66
|
+
f"/api/{organization}/registers/partners",
|
|
67
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
68
|
+
)
|
|
69
|
+
or {}
|
|
70
|
+
)
|
|
71
|
+
return Paged[PartnerFull].model_validate(payload)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@operation
|
|
75
|
+
async def list_register_accounting_rules(
|
|
76
|
+
client: WflowClient,
|
|
77
|
+
organization: OrgSlug,
|
|
78
|
+
search: Search = None,
|
|
79
|
+
sort: Sort = None,
|
|
80
|
+
query: Query = None,
|
|
81
|
+
pageSize: PageSize = None,
|
|
82
|
+
page: Page = None,
|
|
83
|
+
) -> Paged[KindRegister]:
|
|
84
|
+
"""Accounting rules — how document lines are posted to accounts.
|
|
85
|
+
|
|
86
|
+
Each rule belongs to one document kind, so the same code can post differently on an
|
|
87
|
+
incoming invoice and on a cash receipt. Read this to explain why a document was
|
|
88
|
+
posted the way it was.
|
|
89
|
+
|
|
90
|
+
Fields:
|
|
91
|
+
|
|
92
|
+
- `code` — the rule's identifier as used on documents
|
|
93
|
+
- `description` — what it posts
|
|
94
|
+
- `kind` — the document kind it applies to: IncomingInvoice, OutgoingInvoice,
|
|
95
|
+
ExpenditureCashSlip, SupplierOrder, CustomerOrder, Contract, IncomeCashReceipt
|
|
96
|
+
or Other
|
|
97
|
+
"""
|
|
98
|
+
payload = (
|
|
99
|
+
await client.request(
|
|
100
|
+
"GET",
|
|
101
|
+
f"/api/{organization}/registers/accountingrules",
|
|
102
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
103
|
+
)
|
|
104
|
+
or {}
|
|
105
|
+
)
|
|
106
|
+
return Paged[KindRegister].model_validate(payload)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
@operation
|
|
110
|
+
async def list_register_activities(
|
|
111
|
+
client: WflowClient,
|
|
112
|
+
organization: OrgSlug,
|
|
113
|
+
search: Search = None,
|
|
114
|
+
sort: Sort = None,
|
|
115
|
+
query: Query = None,
|
|
116
|
+
pageSize: PageSize = None,
|
|
117
|
+
page: Page = None,
|
|
118
|
+
) -> Paged[Register]:
|
|
119
|
+
"""Activities — what a cost was incurred doing, as an analytical dimension on document lines.
|
|
120
|
+
|
|
121
|
+
One of the four dimensions a line can be tagged with: an activity says what kind
|
|
122
|
+
of work the money went on, where `list_register_cost_centers` says which part of the
|
|
123
|
+
organization spent it, `list_register_projects` which body of work it fed and
|
|
124
|
+
`list_register_business_cases` which deal it is billed against. A single line may carry all
|
|
125
|
+
four at once, so read this one only for the nature of the work.
|
|
126
|
+
|
|
127
|
+
Fields:
|
|
128
|
+
|
|
129
|
+
- `code` — the activity code as used on document lines
|
|
130
|
+
- `description` — what the code stands for
|
|
131
|
+
"""
|
|
132
|
+
payload = (
|
|
133
|
+
await client.request(
|
|
134
|
+
"GET",
|
|
135
|
+
f"/api/{organization}/registers/activities",
|
|
136
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
137
|
+
)
|
|
138
|
+
or {}
|
|
139
|
+
)
|
|
140
|
+
return Paged[Register].model_validate(payload)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
@operation
|
|
144
|
+
async def list_register_business_cases(
|
|
145
|
+
client: WflowClient,
|
|
146
|
+
organization: OrgSlug,
|
|
147
|
+
search: Search = None,
|
|
148
|
+
sort: Sort = None,
|
|
149
|
+
query: Query = None,
|
|
150
|
+
pageSize: PageSize = None,
|
|
151
|
+
page: Page = None,
|
|
152
|
+
) -> Paged[Register]:
|
|
153
|
+
"""Business cases — the commercial engagements costs and revenues are booked against.
|
|
154
|
+
|
|
155
|
+
A business case is the job or deal whose result is being tracked, so it gathers both the
|
|
156
|
+
revenue invoiced and the costs consumed earning it. Reach for this rather than
|
|
157
|
+
`list_register_projects` when the question is what a single engagement earned; a project
|
|
158
|
+
follows delivery work and need not have a customer at all.
|
|
159
|
+
|
|
160
|
+
Fields:
|
|
161
|
+
|
|
162
|
+
- `code` — the business case code as used on document lines
|
|
163
|
+
- `description` — what the code stands for
|
|
164
|
+
"""
|
|
165
|
+
payload = (
|
|
166
|
+
await client.request(
|
|
167
|
+
"GET",
|
|
168
|
+
f"/api/{organization}/registers/businesscases",
|
|
169
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
170
|
+
)
|
|
171
|
+
or {}
|
|
172
|
+
)
|
|
173
|
+
return Paged[Register].model_validate(payload)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
@operation
|
|
177
|
+
async def list_register_business_item_categories(
|
|
178
|
+
client: WflowClient,
|
|
179
|
+
organization: OrgSlug,
|
|
180
|
+
search: Search = None,
|
|
181
|
+
sort: Sort = None,
|
|
182
|
+
query: Query = None,
|
|
183
|
+
pageSize: PageSize = None,
|
|
184
|
+
page: Page = None,
|
|
185
|
+
) -> Paged[Register]:
|
|
186
|
+
"""Business item categories — the groupings the item catalogue is filed under.
|
|
187
|
+
|
|
188
|
+
A record in `list_register_business_items` points its `category` field at one entry from
|
|
189
|
+
here, so this is the vocabulary behind that field rather than something a document line
|
|
190
|
+
carries itself. Read it to expand a category on an item, or to see how this workspace has
|
|
191
|
+
divided its catalogue up before searching it.
|
|
192
|
+
|
|
193
|
+
Fields:
|
|
194
|
+
|
|
195
|
+
- `code` — the category code business items refer to
|
|
196
|
+
- `description` — what the code stands for
|
|
197
|
+
"""
|
|
198
|
+
payload = (
|
|
199
|
+
await client.request(
|
|
200
|
+
"GET",
|
|
201
|
+
f"/api/{organization}/registers/businessitemcategories",
|
|
202
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
203
|
+
)
|
|
204
|
+
or {}
|
|
205
|
+
)
|
|
206
|
+
return Paged[Register].model_validate(payload)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
@operation
|
|
210
|
+
async def list_register_business_items(
|
|
211
|
+
client: WflowClient,
|
|
212
|
+
organization: OrgSlug,
|
|
213
|
+
search: Search = None,
|
|
214
|
+
sort: Sort = None,
|
|
215
|
+
query: Query = None,
|
|
216
|
+
pageSize: PageSize = None,
|
|
217
|
+
page: Page = None,
|
|
218
|
+
) -> Paged[BusinessItemUpdateC]:
|
|
219
|
+
"""Business items — the catalogue of goods and services that appear on document lines.
|
|
220
|
+
|
|
221
|
+
Reach for this when a document line names an item and you need its list price, VAT
|
|
222
|
+
rate or unit rather than just the text on the line.
|
|
223
|
+
|
|
224
|
+
Fields:
|
|
225
|
+
|
|
226
|
+
- `code`, `description` — the item as it appears on a line
|
|
227
|
+
- `unitPrice`, `currency` — the list price and the currency it is quoted in
|
|
228
|
+
- `vatType` — Exempt, FirstReduced, SecondReduced or Basic
|
|
229
|
+
- `purchase` / `sales` — which side the item may be used on; both can be true
|
|
230
|
+
- `measureUnit`, `category` — links into the measure unit and category registers
|
|
231
|
+
- `partner` — set when the item is specific to one partner
|
|
232
|
+
- `updated` — when the record last changed; sent on a read, absent from the spec's write schema
|
|
233
|
+
"""
|
|
234
|
+
payload = (
|
|
235
|
+
await client.request(
|
|
236
|
+
"GET",
|
|
237
|
+
f"/api/{organization}/registers/businessitems",
|
|
238
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
239
|
+
)
|
|
240
|
+
or {}
|
|
241
|
+
)
|
|
242
|
+
return Paged[BusinessItemUpdateC].model_validate(payload)
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
@operation
|
|
246
|
+
async def list_register_card_document_types(
|
|
247
|
+
client: WflowClient,
|
|
248
|
+
organization: OrgSlug,
|
|
249
|
+
search: Search = None,
|
|
250
|
+
sort: Sort = None,
|
|
251
|
+
query: Query = None,
|
|
252
|
+
pageSize: PageSize = None,
|
|
253
|
+
page: Page = None,
|
|
254
|
+
) -> Paged[Register]:
|
|
255
|
+
"""Card document types — the types a payment made by card may be recorded as.
|
|
256
|
+
|
|
257
|
+
Card spending is captured as its own family of documents, and this is the shortlist a card
|
|
258
|
+
receipt can be filed under. It is the card counterpart of
|
|
259
|
+
`list_register_cash_document_types` and the two are separate lists: a type that appears
|
|
260
|
+
only there is one a card document cannot use.
|
|
261
|
+
|
|
262
|
+
Fields:
|
|
263
|
+
|
|
264
|
+
- `code` — the document type code as used on card documents
|
|
265
|
+
- `description` — what the code stands for
|
|
266
|
+
"""
|
|
267
|
+
payload = (
|
|
268
|
+
await client.request(
|
|
269
|
+
"GET",
|
|
270
|
+
f"/api/{organization}/registers/carddocumenttypes",
|
|
271
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
272
|
+
)
|
|
273
|
+
or {}
|
|
274
|
+
)
|
|
275
|
+
return Paged[Register].model_validate(payload)
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
@operation
|
|
279
|
+
async def list_register_cash_document_types(
|
|
280
|
+
client: WflowClient,
|
|
281
|
+
organization: OrgSlug,
|
|
282
|
+
search: Search = None,
|
|
283
|
+
sort: Sort = None,
|
|
284
|
+
query: Query = None,
|
|
285
|
+
pageSize: PageSize = None,
|
|
286
|
+
page: Page = None,
|
|
287
|
+
) -> Paged[Register]:
|
|
288
|
+
"""Cash document types — the types a document put through a cash register may be recorded as.
|
|
289
|
+
|
|
290
|
+
Covers money in and money out alike, so a receipt and a payout draw on the same list. This
|
|
291
|
+
names the kinds of document; `list_register_cash_registers` names the tills that produce
|
|
292
|
+
them, and the two are usually needed together to read a cash document.
|
|
293
|
+
|
|
294
|
+
Fields:
|
|
295
|
+
|
|
296
|
+
- `code` — the document type code as used on cash documents
|
|
297
|
+
- `description` — what the code stands for
|
|
298
|
+
"""
|
|
299
|
+
payload = (
|
|
300
|
+
await client.request(
|
|
301
|
+
"GET",
|
|
302
|
+
f"/api/{organization}/registers/cashdocumenttypes",
|
|
303
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
304
|
+
)
|
|
305
|
+
or {}
|
|
306
|
+
)
|
|
307
|
+
return Paged[Register].model_validate(payload)
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
@operation
|
|
311
|
+
async def list_register_cash_registers(
|
|
312
|
+
client: WflowClient,
|
|
313
|
+
organization: OrgSlug,
|
|
314
|
+
search: Search = None,
|
|
315
|
+
sort: Sort = None,
|
|
316
|
+
query: Query = None,
|
|
317
|
+
pageSize: PageSize = None,
|
|
318
|
+
page: Page = None,
|
|
319
|
+
) -> Paged[Register]:
|
|
320
|
+
"""Cash registers — the tills the organization moves physical money through.
|
|
321
|
+
|
|
322
|
+
A cash document names the register it was paid into or out of, and a workspace may keep
|
|
323
|
+
several: one per site, or one per currency. Read this to learn which tills exist before
|
|
324
|
+
reconciling cash, not to learn what those documents may be called.
|
|
325
|
+
|
|
326
|
+
Fields:
|
|
327
|
+
|
|
328
|
+
- `code` — the cash register code as used on cash documents
|
|
329
|
+
- `description` — what the code stands for
|
|
330
|
+
"""
|
|
331
|
+
payload = (
|
|
332
|
+
await client.request(
|
|
333
|
+
"GET",
|
|
334
|
+
f"/api/{organization}/registers/cashregisters",
|
|
335
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
336
|
+
)
|
|
337
|
+
or {}
|
|
338
|
+
)
|
|
339
|
+
return Paged[Register].model_validate(payload)
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
@operation
|
|
343
|
+
async def list_register_chart_of_accounts(
|
|
344
|
+
client: WflowClient,
|
|
345
|
+
organization: OrgSlug,
|
|
346
|
+
search: Search = None,
|
|
347
|
+
sort: Sort = None,
|
|
348
|
+
query: Query = None,
|
|
349
|
+
pageSize: PageSize = None,
|
|
350
|
+
page: Page = None,
|
|
351
|
+
) -> Paged[Register]:
|
|
352
|
+
"""Chart of accounts — the ledger accounts documents are posted to.
|
|
353
|
+
|
|
354
|
+
This workspace's own account numbering, as mirrored from its accounting system. Use it to
|
|
355
|
+
turn an account number seen on a posted line into the account's name; when the question is
|
|
356
|
+
instead which account a kind of line lands on, and why, read
|
|
357
|
+
`list_register_accounting_rules`.
|
|
358
|
+
|
|
359
|
+
Fields:
|
|
360
|
+
|
|
361
|
+
- `code` — the account number
|
|
362
|
+
- `description` — the account name
|
|
363
|
+
"""
|
|
364
|
+
payload = (
|
|
365
|
+
await client.request(
|
|
366
|
+
"GET",
|
|
367
|
+
f"/api/{organization}/registers/chartofaccounts",
|
|
368
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
369
|
+
)
|
|
370
|
+
or {}
|
|
371
|
+
)
|
|
372
|
+
return Paged[Register].model_validate(payload)
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
@operation
|
|
376
|
+
async def list_register_contracts(
|
|
377
|
+
client: WflowClient,
|
|
378
|
+
organization: OrgSlug,
|
|
379
|
+
search: Search = None,
|
|
380
|
+
sort: Sort = None,
|
|
381
|
+
query: Query = None,
|
|
382
|
+
pageSize: PageSize = None,
|
|
383
|
+
page: Page = None,
|
|
384
|
+
) -> Paged[Register]:
|
|
385
|
+
"""Contracts — the agreements an invoice or order can be filed under.
|
|
386
|
+
|
|
387
|
+
Documents point here so that recurring billing can be traced back to the agreement that
|
|
388
|
+
authorises it. These are lookup entries, not the contract documents themselves: expect a
|
|
389
|
+
code and a name, and go to the contract's own document for its terms, dates or signatories.
|
|
390
|
+
|
|
391
|
+
Fields:
|
|
392
|
+
|
|
393
|
+
- `code` — the contract code documents refer to
|
|
394
|
+
- `description` — what the contract covers
|
|
395
|
+
"""
|
|
396
|
+
payload = (
|
|
397
|
+
await client.request(
|
|
398
|
+
"GET",
|
|
399
|
+
f"/api/{organization}/registers/contracts",
|
|
400
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
401
|
+
)
|
|
402
|
+
or {}
|
|
403
|
+
)
|
|
404
|
+
return Paged[Register].model_validate(payload)
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
@operation
|
|
408
|
+
async def list_register_cost_centers(
|
|
409
|
+
client: WflowClient,
|
|
410
|
+
organization: OrgSlug,
|
|
411
|
+
search: Search = None,
|
|
412
|
+
sort: Sort = None,
|
|
413
|
+
query: Query = None,
|
|
414
|
+
pageSize: PageSize = None,
|
|
415
|
+
page: Page = None,
|
|
416
|
+
) -> Paged[Register]:
|
|
417
|
+
"""Cost centers — the organizational units that costs are attributed to.
|
|
418
|
+
|
|
419
|
+
An analytical dimension on document lines: a document can be split across several cost
|
|
420
|
+
centers. This is the dimension that says who bore the cost — a department, a branch, a
|
|
421
|
+
team — where `list_register_activities` says what was done and `list_register_projects`
|
|
422
|
+
says what it was done for. Use this to resolve a code seen on a document into its meaning.
|
|
423
|
+
|
|
424
|
+
Fields:
|
|
425
|
+
|
|
426
|
+
- `code` — the cost center code as used on documents
|
|
427
|
+
- `description` — what the code stands for
|
|
428
|
+
"""
|
|
429
|
+
payload = (
|
|
430
|
+
await client.request(
|
|
431
|
+
"GET",
|
|
432
|
+
f"/api/{organization}/registers/costcenters",
|
|
433
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
434
|
+
)
|
|
435
|
+
or {}
|
|
436
|
+
)
|
|
437
|
+
return Paged[Register].model_validate(payload)
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
@operation
|
|
441
|
+
async def list_register_employees(
|
|
442
|
+
client: WflowClient,
|
|
443
|
+
organization: OrgSlug,
|
|
444
|
+
search: Search = None,
|
|
445
|
+
sort: Sort = None,
|
|
446
|
+
query: Query = None,
|
|
447
|
+
pageSize: PageSize = None,
|
|
448
|
+
page: Page = None,
|
|
449
|
+
) -> Paged[Register]:
|
|
450
|
+
"""Employees — the organization's own staff as documents name them.
|
|
451
|
+
|
|
452
|
+
An employee is who requested a purchase, took the trip or drove the vehicle. This register
|
|
453
|
+
is codes and names only; when you need contact details, or who may sign and approve in the
|
|
454
|
+
organization's name, read `list_register_organization_persons` instead — the two are
|
|
455
|
+
separate registers and a person can be in one without the other.
|
|
456
|
+
|
|
457
|
+
Fields:
|
|
458
|
+
|
|
459
|
+
- `code` — the employee code as used on documents
|
|
460
|
+
- `description` — the employee's name
|
|
461
|
+
"""
|
|
462
|
+
payload = (
|
|
463
|
+
await client.request(
|
|
464
|
+
"GET",
|
|
465
|
+
f"/api/{organization}/registers/employees",
|
|
466
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
467
|
+
)
|
|
468
|
+
or {}
|
|
469
|
+
)
|
|
470
|
+
return Paged[Register].model_validate(payload)
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
@operation
|
|
474
|
+
async def list_register_locations(
|
|
475
|
+
client: WflowClient,
|
|
476
|
+
organization: OrgSlug,
|
|
477
|
+
search: Search = None,
|
|
478
|
+
sort: Sort = None,
|
|
479
|
+
query: Query = None,
|
|
480
|
+
pageSize: PageSize = None,
|
|
481
|
+
page: Page = None,
|
|
482
|
+
) -> Paged[Location]:
|
|
483
|
+
"""Locations — the organization's places of business.
|
|
484
|
+
|
|
485
|
+
A document points at a location to say where goods or services were received,
|
|
486
|
+
delivered or consumed. Read this to turn a location code on a document into a street
|
|
487
|
+
address, or to find who to contact at the site.
|
|
488
|
+
|
|
489
|
+
Fields:
|
|
490
|
+
|
|
491
|
+
- `code`, `description` — the location as it appears on a document
|
|
492
|
+
- `address` — the site's address, as one string
|
|
493
|
+
- `contact` — free text naming who to reach there
|
|
494
|
+
"""
|
|
495
|
+
payload = (
|
|
496
|
+
await client.request(
|
|
497
|
+
"GET",
|
|
498
|
+
f"/api/{organization}/registers/locations",
|
|
499
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
500
|
+
)
|
|
501
|
+
or {}
|
|
502
|
+
)
|
|
503
|
+
return Paged[Location].model_validate(payload)
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
@operation
|
|
507
|
+
async def list_register_measure_units(
|
|
508
|
+
client: WflowClient,
|
|
509
|
+
organization: OrgSlug,
|
|
510
|
+
search: Search = None,
|
|
511
|
+
sort: Sort = None,
|
|
512
|
+
query: Query = None,
|
|
513
|
+
pageSize: PageSize = None,
|
|
514
|
+
page: Page = None,
|
|
515
|
+
) -> Paged[Register]:
|
|
516
|
+
"""Measure units — the units a quantity on a document line is counted in.
|
|
517
|
+
|
|
518
|
+
Pieces, hours, kilograms, whatever this workspace trades in. A quantity means nothing
|
|
519
|
+
without one, and an entry in `list_register_business_items` points its `measureUnit` at a
|
|
520
|
+
record from here, so this is the register to read when a unit appears abbreviated on a line
|
|
521
|
+
or on a catalogue item.
|
|
522
|
+
|
|
523
|
+
Fields:
|
|
524
|
+
|
|
525
|
+
- `code` — the unit code as used on document lines
|
|
526
|
+
- `description` — what the unit is
|
|
527
|
+
"""
|
|
528
|
+
payload = (
|
|
529
|
+
await client.request(
|
|
530
|
+
"GET",
|
|
531
|
+
f"/api/{organization}/registers/measureunits",
|
|
532
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
533
|
+
)
|
|
534
|
+
or {}
|
|
535
|
+
)
|
|
536
|
+
return Paged[Register].model_validate(payload)
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
@operation
|
|
540
|
+
async def list_register_organization_persons(
|
|
541
|
+
client: WflowClient,
|
|
542
|
+
organization: OrgSlug,
|
|
543
|
+
search: Search = None,
|
|
544
|
+
sort: Sort = None,
|
|
545
|
+
query: Query = None,
|
|
546
|
+
pageSize: PageSize = None,
|
|
547
|
+
page: Page = None,
|
|
548
|
+
) -> Paged[OrganizationPerson]:
|
|
549
|
+
"""Organization persons — the people on this side of a document.
|
|
550
|
+
|
|
551
|
+
A contract or an order is signed, stamped or approved in the name of a person from
|
|
552
|
+
this register. Reach for it when you need who may act for the organization on a
|
|
553
|
+
document, or that person's address and contact details. These records have no `code`;
|
|
554
|
+
they are identified by name.
|
|
555
|
+
|
|
556
|
+
Fields:
|
|
557
|
+
|
|
558
|
+
- `firstName`, `lastName` — the person's name
|
|
559
|
+
- `street`, `postCode`, `city` — their address
|
|
560
|
+
- `phoneNo`, `mailAddress` — how to reach them
|
|
561
|
+
- `language` — ISO 639-1 code, the language to address them in
|
|
562
|
+
- `contractRole` — what they may do on a contract: Sign, Stamp, Approve,
|
|
563
|
+
SignWithBankId or SignWithCertificate
|
|
564
|
+
"""
|
|
565
|
+
payload = (
|
|
566
|
+
await client.request(
|
|
567
|
+
"GET",
|
|
568
|
+
f"/api/{organization}/registers/organizationpersons",
|
|
569
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
570
|
+
)
|
|
571
|
+
or {}
|
|
572
|
+
)
|
|
573
|
+
return Paged[OrganizationPerson].model_validate(payload)
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
@operation
|
|
577
|
+
async def list_register_partner_persons(
|
|
578
|
+
client: WflowClient,
|
|
579
|
+
organization: OrgSlug,
|
|
580
|
+
search: Search = None,
|
|
581
|
+
sort: Sort = None,
|
|
582
|
+
query: Query = None,
|
|
583
|
+
pageSize: PageSize = None,
|
|
584
|
+
page: Page = None,
|
|
585
|
+
) -> Paged[PartnerPersonUpdateC]:
|
|
586
|
+
"""Partner persons — the contacts at partner companies.
|
|
587
|
+
|
|
588
|
+
The counterparty side of `list_register_organization_persons`: every record names one
|
|
589
|
+
partner it belongs to. Reach for it when you need the person to address at a supplier
|
|
590
|
+
or customer, or who signs on their behalf. These records have no `code`; they are
|
|
591
|
+
identified by name and partner.
|
|
592
|
+
|
|
593
|
+
Fields:
|
|
594
|
+
|
|
595
|
+
- `partner` — the partner from the partners register this person belongs to
|
|
596
|
+
- `firstName`, `lastName` — the person's name
|
|
597
|
+
- `street`, `postCode`, `city` — their address
|
|
598
|
+
- `phoneNo`, `mailAddress` — how to reach them
|
|
599
|
+
- `language` — ISO 639-1 code, the language to address them in
|
|
600
|
+
- `contractRole` — what they may do on a contract: Sign, Stamp, Approve,
|
|
601
|
+
SignWithBankId or SignWithCertificate
|
|
602
|
+
"""
|
|
603
|
+
payload = (
|
|
604
|
+
await client.request(
|
|
605
|
+
"GET",
|
|
606
|
+
f"/api/{organization}/registers/partnerpersons",
|
|
607
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
608
|
+
)
|
|
609
|
+
or {}
|
|
610
|
+
)
|
|
611
|
+
return Paged[PartnerPersonUpdateC].model_validate(payload)
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
@operation
|
|
615
|
+
async def list_register_payment_methods(
|
|
616
|
+
client: WflowClient,
|
|
617
|
+
organization: OrgSlug,
|
|
618
|
+
search: Search = None,
|
|
619
|
+
sort: Sort = None,
|
|
620
|
+
query: Query = None,
|
|
621
|
+
pageSize: PageSize = None,
|
|
622
|
+
page: Page = None,
|
|
623
|
+
) -> Paged[PaymentMethods]:
|
|
624
|
+
"""Payment methods — how a document is settled.
|
|
625
|
+
|
|
626
|
+
Bank transfer, card, cash and whatever else this workspace has configured. Each
|
|
627
|
+
method belongs to one document kind, so what an incoming invoice may carry is not
|
|
628
|
+
what a cash slip may carry.
|
|
629
|
+
|
|
630
|
+
Fields:
|
|
631
|
+
|
|
632
|
+
- `code`, `description` — the method as it appears on a document
|
|
633
|
+
- `kind` — the document kind it applies to: IncomingInvoice, OutgoingInvoice,
|
|
634
|
+
ExpenditureCashSlip, SupplierOrder, CustomerOrder, Contract, IncomeCashReceipt
|
|
635
|
+
or Other
|
|
636
|
+
"""
|
|
637
|
+
payload = (
|
|
638
|
+
await client.request(
|
|
639
|
+
"GET",
|
|
640
|
+
f"/api/{organization}/registers/paymentmethods",
|
|
641
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
642
|
+
)
|
|
643
|
+
or {}
|
|
644
|
+
)
|
|
645
|
+
return Paged[PaymentMethods].model_validate(payload)
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
@operation
|
|
649
|
+
async def list_register_projects(
|
|
650
|
+
client: WflowClient,
|
|
651
|
+
organization: OrgSlug,
|
|
652
|
+
search: Search = None,
|
|
653
|
+
sort: Sort = None,
|
|
654
|
+
query: Query = None,
|
|
655
|
+
pageSize: PageSize = None,
|
|
656
|
+
page: Page = None,
|
|
657
|
+
) -> Paged[Register]:
|
|
658
|
+
"""Projects — the bodies of work that costs and revenues are attributed to.
|
|
659
|
+
|
|
660
|
+
The dimension that follows delivery: a project lasts as long as the work does and collects
|
|
661
|
+
whatever is spent on it, internal work included. Choose `list_register_business_cases` when
|
|
662
|
+
the subject is one deal's result, `list_register_cost_centers` when it is which unit is
|
|
663
|
+
spending, and this when it is which piece of work the money went into.
|
|
664
|
+
|
|
665
|
+
Fields:
|
|
666
|
+
|
|
667
|
+
- `code` — the project code as used on document lines
|
|
668
|
+
- `description` — what the code stands for
|
|
669
|
+
"""
|
|
670
|
+
payload = (
|
|
671
|
+
await client.request(
|
|
672
|
+
"GET",
|
|
673
|
+
f"/api/{organization}/registers/projects",
|
|
674
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
675
|
+
)
|
|
676
|
+
or {}
|
|
677
|
+
)
|
|
678
|
+
return Paged[Register].model_validate(payload)
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
@operation
|
|
682
|
+
async def list_register_series(
|
|
683
|
+
client: WflowClient,
|
|
684
|
+
organization: OrgSlug,
|
|
685
|
+
search: Search = None,
|
|
686
|
+
sort: Sort = None,
|
|
687
|
+
query: Query = None,
|
|
688
|
+
pageSize: PageSize = None,
|
|
689
|
+
page: Page = None,
|
|
690
|
+
) -> Paged[Serie]:
|
|
691
|
+
"""Numbering series — the sequences documents take their numbers from.
|
|
692
|
+
|
|
693
|
+
A series is scoped to one document kind and, on invoices, to one invoice type, so tax
|
|
694
|
+
invoices and credit notes number separately. Read this to see which series a kind can
|
|
695
|
+
use, or to work out which one a document number came from.
|
|
696
|
+
|
|
697
|
+
Fields:
|
|
698
|
+
|
|
699
|
+
- `code`, `description` — the series as it appears on a document
|
|
700
|
+
- `kind` — the document kind it applies to: IncomingInvoice, OutgoingInvoice,
|
|
701
|
+
ExpenditureCashSlip, SupplierOrder, CustomerOrder, Contract, IncomeCashReceipt
|
|
702
|
+
or Other
|
|
703
|
+
- `invoiceType` — the invoice type it numbers: TaxInvoice, CreditNote, DebitNote,
|
|
704
|
+
Proforma or TaxInvoicePayment
|
|
705
|
+
"""
|
|
706
|
+
payload = (
|
|
707
|
+
await client.request(
|
|
708
|
+
"GET",
|
|
709
|
+
f"/api/{organization}/registers/series",
|
|
710
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
711
|
+
)
|
|
712
|
+
or {}
|
|
713
|
+
)
|
|
714
|
+
return Paged[Serie].model_validate(payload)
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
@operation
|
|
718
|
+
async def list_register_vat_control_statement_lines(
|
|
719
|
+
client: WflowClient,
|
|
720
|
+
organization: OrgSlug,
|
|
721
|
+
search: Search = None,
|
|
722
|
+
sort: Sort = None,
|
|
723
|
+
query: Query = None,
|
|
724
|
+
pageSize: PageSize = None,
|
|
725
|
+
page: Page = None,
|
|
726
|
+
) -> Paged[Register]:
|
|
727
|
+
"""VAT control statement lines — the sections a document is itemised in on the control statement.
|
|
728
|
+
|
|
729
|
+
The control statement is filed alongside the VAT return and reports transactions one by one
|
|
730
|
+
rather than in totals, which is why a document carries a section code from here as well as a
|
|
731
|
+
line code from `list_register_vat_return_lines`. Read this when the question is where a
|
|
732
|
+
document will show up in the statement's detail.
|
|
733
|
+
|
|
734
|
+
Fields:
|
|
735
|
+
|
|
736
|
+
- `code` — the statement section code as used on documents
|
|
737
|
+
- `description` — what the section covers
|
|
738
|
+
"""
|
|
739
|
+
payload = (
|
|
740
|
+
await client.request(
|
|
741
|
+
"GET",
|
|
742
|
+
f"/api/{organization}/registers/vatcontrolstatementlines",
|
|
743
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
744
|
+
)
|
|
745
|
+
or {}
|
|
746
|
+
)
|
|
747
|
+
return Paged[Register].model_validate(payload)
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
@operation
|
|
751
|
+
async def list_register_vat_return_lines(
|
|
752
|
+
client: WflowClient,
|
|
753
|
+
organization: OrgSlug,
|
|
754
|
+
search: Search = None,
|
|
755
|
+
sort: Sort = None,
|
|
756
|
+
query: Query = None,
|
|
757
|
+
pageSize: PageSize = None,
|
|
758
|
+
page: Page = None,
|
|
759
|
+
) -> Paged[VATReturnLine]:
|
|
760
|
+
"""VAT return lines — the rows of the VAT return a document's tax is reported on.
|
|
761
|
+
|
|
762
|
+
Read this to see which lines this workspace declares on, and which of them are
|
|
763
|
+
reverse charge, when checking where a document's VAT ends up.
|
|
764
|
+
|
|
765
|
+
Fields:
|
|
766
|
+
|
|
767
|
+
- `code`, `description` — the line as it appears on a document
|
|
768
|
+
- `reverseCharge` — true when the line reports tax the recipient accounts for
|
|
769
|
+
"""
|
|
770
|
+
payload = (
|
|
771
|
+
await client.request(
|
|
772
|
+
"GET",
|
|
773
|
+
f"/api/{organization}/registers/vatreturnlines",
|
|
774
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
775
|
+
)
|
|
776
|
+
or {}
|
|
777
|
+
)
|
|
778
|
+
return Paged[VATReturnLine].model_validate(payload)
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
@operation
|
|
782
|
+
async def list_register_vat_reverse_charge_codes(
|
|
783
|
+
client: WflowClient,
|
|
784
|
+
organization: OrgSlug,
|
|
785
|
+
search: Search = None,
|
|
786
|
+
sort: Sort = None,
|
|
787
|
+
query: Query = None,
|
|
788
|
+
pageSize: PageSize = None,
|
|
789
|
+
page: Page = None,
|
|
790
|
+
) -> Paged[Register]:
|
|
791
|
+
"""VAT reverse charge codes — the supply codes used when the recipient accounts for the tax.
|
|
792
|
+
|
|
793
|
+
Under the reverse charge the supplier invoices without tax and the customer declares it, and
|
|
794
|
+
the law requires the kind of supply to be named by a code; this is the set of codes this
|
|
795
|
+
workspace uses. It answers what makes a transaction reverse charge, where
|
|
796
|
+
`list_register_vat_return_lines` answers where the resulting tax is declared.
|
|
797
|
+
|
|
798
|
+
Fields:
|
|
799
|
+
|
|
800
|
+
- `code` — the statutory supply code
|
|
801
|
+
- `description` — the supply the code covers
|
|
802
|
+
"""
|
|
803
|
+
payload = (
|
|
804
|
+
await client.request(
|
|
805
|
+
"GET",
|
|
806
|
+
f"/api/{organization}/registers/vatreversechargecodes",
|
|
807
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
808
|
+
)
|
|
809
|
+
or {}
|
|
810
|
+
)
|
|
811
|
+
return Paged[Register].model_validate(payload)
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
@operation
|
|
815
|
+
async def list_register_vehicles(
|
|
816
|
+
client: WflowClient,
|
|
817
|
+
organization: OrgSlug,
|
|
818
|
+
search: Search = None,
|
|
819
|
+
sort: Sort = None,
|
|
820
|
+
query: Query = None,
|
|
821
|
+
pageSize: PageSize = None,
|
|
822
|
+
page: Page = None,
|
|
823
|
+
) -> Paged[Register]:
|
|
824
|
+
"""Vehicles — the cars and machines that travel and fuel documents belong to.
|
|
825
|
+
|
|
826
|
+
A fuel receipt, toll or trip report names the vehicle it was incurred on, which is what makes
|
|
827
|
+
the cost attributable at all. Read this to identify a vehicle code on such a document; who
|
|
828
|
+
was driving is a separate reference, into `list_register_employees`.
|
|
829
|
+
|
|
830
|
+
Fields:
|
|
831
|
+
|
|
832
|
+
- `code` — the vehicle code as used on documents, typically its registration
|
|
833
|
+
- `description` — which vehicle it is
|
|
834
|
+
"""
|
|
835
|
+
payload = (
|
|
836
|
+
await client.request(
|
|
837
|
+
"GET",
|
|
838
|
+
f"/api/{organization}/registers/vehicles",
|
|
839
|
+
params=query_params(search=search, sort=sort, query=query, pageSize=pageSize, page=page),
|
|
840
|
+
)
|
|
841
|
+
or {}
|
|
842
|
+
)
|
|
843
|
+
return Paged[Register].model_validate(payload)
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
@operation
|
|
847
|
+
async def update_register_partners(
|
|
848
|
+
client: WflowClient, organization: OrgSlug, partners: list[PartnerFull]
|
|
849
|
+
) -> WriteResult:
|
|
850
|
+
"""Add or update whole partner records — suppliers and customers.
|
|
851
|
+
|
|
852
|
+
A record is matched by `id`, or by `externalId` when you are reconciling against an ERP.
|
|
853
|
+
Sending part of the register retires the rest: any record missing from the payload is marked
|
|
854
|
+
invalid, so send every partner you mean to keep, or use `patch_register_partners`, which
|
|
855
|
+
touches only the records you send. `list_register_partners` returns one page, ten records by
|
|
856
|
+
default, so page through to `totalItems` before building the payload. Each submitted object
|
|
857
|
+
replaces the stored record, so a field you leave out is reset to its default: send the full
|
|
858
|
+
record. That includes `isValid`, which defaults to true, so a payload omitting it revives a
|
|
859
|
+
record you had retired.
|
|
860
|
+
|
|
861
|
+
`peppolIds` is the exception. Omitted, it leaves the partner's existing Peppol IDs alone; sent,
|
|
862
|
+
it replaces them wholesale, so an empty list deletes every one of them.
|
|
863
|
+
|
|
864
|
+
Bank account fields are not reliably stored: `accounts`, `mainAccount` and the flat
|
|
865
|
+
`accountNo`, `bankCode`, `iban`, `bic` and `currency` can be accepted, reported as a success,
|
|
866
|
+
and read back empty while the other fields in the same payload save. Do not rely on this operation
|
|
867
|
+
to write account details — verify against a read before trusting a migration.
|
|
868
|
+
|
|
869
|
+
Fields: on the result —
|
|
870
|
+
|
|
871
|
+
- `action` — "updated"
|
|
872
|
+
- `resource` — "registers/partners"
|
|
873
|
+
"""
|
|
874
|
+
await client.request(
|
|
875
|
+
"PUT",
|
|
876
|
+
f"/api/{organization}/registers/partners",
|
|
877
|
+
json=write_body(partners),
|
|
878
|
+
)
|
|
879
|
+
return WriteResult(action="updated", resource="registers/partners")
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
@operation
|
|
883
|
+
async def update_register_accounting_rules(
|
|
884
|
+
client: WflowClient, organization: OrgSlug, accountingRules: list[KindRegister]
|
|
885
|
+
) -> WriteResult:
|
|
886
|
+
"""Add or update whole accounting rule records — how document lines are posted to accounts.
|
|
887
|
+
|
|
888
|
+
A rule is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
889
|
+
when neither is given. `kind` ties the rule to one document kind, so a code that posts
|
|
890
|
+
differently on an incoming invoice and on a cash receipt is two records, not one. Sending part
|
|
891
|
+
of the register retires the rest: any record missing from the payload is marked invalid, so
|
|
892
|
+
send every rule you mean to keep, or use `patch_register_accounting_rules`, which touches only
|
|
893
|
+
the records you send. `list_register_accounting_rules` returns one page, ten records by
|
|
894
|
+
default, so page through to `totalItems` before building the payload. Each submitted object
|
|
895
|
+
replaces the stored record, so a field you leave out is reset to its default — `isValid`
|
|
896
|
+
included, and it defaults to true, so a payload omitting it revives a record you had retired.
|
|
897
|
+
|
|
898
|
+
Fields: on the result —
|
|
899
|
+
|
|
900
|
+
- `action` — "updated"
|
|
901
|
+
- `resource` — "registers/accountingrules"
|
|
902
|
+
"""
|
|
903
|
+
await client.request(
|
|
904
|
+
"PUT",
|
|
905
|
+
f"/api/{organization}/registers/accountingrules",
|
|
906
|
+
json=write_body(accountingRules),
|
|
907
|
+
)
|
|
908
|
+
return WriteResult(action="updated", resource="registers/accountingrules")
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
@operation
|
|
912
|
+
async def update_register_activities(
|
|
913
|
+
client: WflowClient, organization: OrgSlug, activities: list[Register]
|
|
914
|
+
) -> WriteResult:
|
|
915
|
+
"""Add or update whole activity records — what a cost was incurred doing.
|
|
916
|
+
|
|
917
|
+
A record is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
918
|
+
when neither is given. Sending part of the register retires the rest: any record missing from
|
|
919
|
+
the payload is marked invalid, so send every record you mean to keep, or use
|
|
920
|
+
`patch_register_activities`, which touches only the records you send.
|
|
921
|
+
`list_register_activities` returns one page, ten records by default, so page through to
|
|
922
|
+
`totalItems` before building the payload. Each submitted object replaces the stored record, so
|
|
923
|
+
a field you leave out is reset to its default — `isValid` included, and it defaults to true, so
|
|
924
|
+
a payload omitting it revives a record you had retired.
|
|
925
|
+
|
|
926
|
+
Fields: on the result —
|
|
927
|
+
|
|
928
|
+
- `action` — "updated"
|
|
929
|
+
- `resource` — "registers/activities"
|
|
930
|
+
"""
|
|
931
|
+
await client.request(
|
|
932
|
+
"PUT",
|
|
933
|
+
f"/api/{organization}/registers/activities",
|
|
934
|
+
json=write_body(activities),
|
|
935
|
+
)
|
|
936
|
+
return WriteResult(action="updated", resource="registers/activities")
|
|
937
|
+
|
|
938
|
+
|
|
939
|
+
@operation
|
|
940
|
+
async def update_register_business_cases(
|
|
941
|
+
client: WflowClient, organization: OrgSlug, businessCases: list[Register]
|
|
942
|
+
) -> WriteResult:
|
|
943
|
+
"""Add or update whole business case records — the commercial engagements costs and revenues are booked against.
|
|
944
|
+
|
|
945
|
+
A record is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
946
|
+
when neither is given. Sending part of the register retires the rest: any record missing from
|
|
947
|
+
the payload is marked invalid, so send every record you mean to keep, or use
|
|
948
|
+
`patch_register_business_cases`, which touches only the records you send.
|
|
949
|
+
`list_register_business_cases` returns one page, ten records by default, so page through to
|
|
950
|
+
`totalItems` before building the payload. Each submitted object replaces the stored record, so
|
|
951
|
+
a field you leave out is reset to its default — `isValid` included, and it defaults to true, so
|
|
952
|
+
a payload omitting it revives a record you had retired.
|
|
953
|
+
|
|
954
|
+
Fields: on the result —
|
|
955
|
+
|
|
956
|
+
- `action` — "updated"
|
|
957
|
+
- `resource` — "registers/businesscases"
|
|
958
|
+
"""
|
|
959
|
+
await client.request(
|
|
960
|
+
"PUT",
|
|
961
|
+
f"/api/{organization}/registers/businesscases",
|
|
962
|
+
json=write_body(businessCases),
|
|
963
|
+
)
|
|
964
|
+
return WriteResult(action="updated", resource="registers/businesscases")
|
|
965
|
+
|
|
966
|
+
|
|
967
|
+
@operation
|
|
968
|
+
async def update_register_business_item_categories(
|
|
969
|
+
client: WflowClient, organization: OrgSlug, businessItemCategories: list[Register]
|
|
970
|
+
) -> WriteResult:
|
|
971
|
+
"""Add or update whole business item category records — the groupings the item catalogue is filed under.
|
|
972
|
+
|
|
973
|
+
A record is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
974
|
+
when neither is given. Business items point their `category` at a record from here, so a code
|
|
975
|
+
you rename here is the code those items refer to. Sending part of the register retires the
|
|
976
|
+
rest: any record missing from the payload is marked invalid, so send every record you mean to
|
|
977
|
+
keep, or use `patch_register_business_item_categories`, which touches only the records you
|
|
978
|
+
send. `list_register_business_item_categories` returns one page, ten records by default, so
|
|
979
|
+
page through to `totalItems` before building the payload. Each submitted object replaces the
|
|
980
|
+
stored record, so a field you leave out is reset to its default — `isValid` included, and it
|
|
981
|
+
defaults to true, so a payload omitting it revives a record you had retired.
|
|
982
|
+
|
|
983
|
+
Fields: on the result —
|
|
984
|
+
|
|
985
|
+
- `action` — "updated"
|
|
986
|
+
- `resource` — "registers/businessitemcategories"
|
|
987
|
+
"""
|
|
988
|
+
await client.request(
|
|
989
|
+
"PUT",
|
|
990
|
+
f"/api/{organization}/registers/businessitemcategories",
|
|
991
|
+
json=write_body(businessItemCategories),
|
|
992
|
+
)
|
|
993
|
+
return WriteResult(action="updated", resource="registers/businessitemcategories")
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
@operation
|
|
997
|
+
async def update_register_business_items(
|
|
998
|
+
client: WflowClient, organization: OrgSlug, businessItems: list[BusinessItemUpdateC]
|
|
999
|
+
) -> WriteResult:
|
|
1000
|
+
"""Add or update whole business item records — the catalogue of goods and services on document lines.
|
|
1001
|
+
|
|
1002
|
+
An item is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
1003
|
+
when neither is given. Beyond `code` and `description` it carries `unitPrice`, `currency`,
|
|
1004
|
+
`vatType`, whether it is for `purchase` or `sales`, and its `measureUnit`, `category` and
|
|
1005
|
+
`partner`, each a nested object naming that record by `id` or `externalId` — `measureUnit` and
|
|
1006
|
+
`category` also by `code`. Sending part of the register retires the rest: any record missing
|
|
1007
|
+
from the payload is marked invalid, so send every item you mean to keep, or use
|
|
1008
|
+
`patch_register_business_items`, which touches only the records you send.
|
|
1009
|
+
`list_register_business_items` returns one page, ten records by default, so page through to
|
|
1010
|
+
`totalItems` before building the payload. Each submitted object replaces the stored record, so
|
|
1011
|
+
a price or a link you leave out is reset to its default — `isValid` included, and it defaults
|
|
1012
|
+
to true, so a payload omitting it revives a record you had retired.
|
|
1013
|
+
|
|
1014
|
+
Fields: on the result —
|
|
1015
|
+
|
|
1016
|
+
- `action` — "updated"
|
|
1017
|
+
- `resource` — "registers/businessitems"
|
|
1018
|
+
"""
|
|
1019
|
+
await client.request(
|
|
1020
|
+
"PUT",
|
|
1021
|
+
f"/api/{organization}/registers/businessitems",
|
|
1022
|
+
json=write_body(businessItems),
|
|
1023
|
+
)
|
|
1024
|
+
return WriteResult(action="updated", resource="registers/businessitems")
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
@operation
|
|
1028
|
+
async def update_register_card_document_types(
|
|
1029
|
+
client: WflowClient, organization: OrgSlug, cardDocumentTypes: list[Register]
|
|
1030
|
+
) -> WriteResult:
|
|
1031
|
+
"""Add or update whole card document type records — the types a payment made by card may take.
|
|
1032
|
+
|
|
1033
|
+
A record is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
1034
|
+
when neither is given. This list is the card side only; the cash side is a separate register,
|
|
1035
|
+
written through `update_register_cash_document_types`. Sending part of the register retires the
|
|
1036
|
+
rest: any record missing from the payload is marked invalid, so send every record you mean to
|
|
1037
|
+
keep, or use `patch_register_card_document_types`, which touches only the records you send.
|
|
1038
|
+
`list_register_card_document_types` returns one page, ten records by default, so page through
|
|
1039
|
+
to `totalItems` before building the payload. Each submitted object replaces the stored record,
|
|
1040
|
+
so a field you leave out is reset to its default — `isValid` included, and it defaults to true,
|
|
1041
|
+
so a payload omitting it revives a record you had retired.
|
|
1042
|
+
|
|
1043
|
+
Fields: on the result —
|
|
1044
|
+
|
|
1045
|
+
- `action` — "updated"
|
|
1046
|
+
- `resource` — "registers/carddocumenttypes"
|
|
1047
|
+
"""
|
|
1048
|
+
await client.request(
|
|
1049
|
+
"PUT",
|
|
1050
|
+
f"/api/{organization}/registers/carddocumenttypes",
|
|
1051
|
+
json=write_body(cardDocumentTypes),
|
|
1052
|
+
)
|
|
1053
|
+
return WriteResult(action="updated", resource="registers/carddocumenttypes")
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
@operation
|
|
1057
|
+
async def update_register_cash_document_types(
|
|
1058
|
+
client: WflowClient, organization: OrgSlug, cashDocumentTypes: list[Register]
|
|
1059
|
+
) -> WriteResult:
|
|
1060
|
+
"""Add or update whole cash document type records — the types a cash register document may take.
|
|
1061
|
+
|
|
1062
|
+
Covers money in and money out alike, so a receipt and a payout draw on the records written
|
|
1063
|
+
here. A record is matched by `id`, or by `externalId` when reconciling against an ERP, or by
|
|
1064
|
+
`code` when neither is given. Sending part of the register retires the rest: any record missing
|
|
1065
|
+
from the payload is marked invalid, so send every record you mean to keep, or use
|
|
1066
|
+
`patch_register_cash_document_types`, which touches only the records you send.
|
|
1067
|
+
`list_register_cash_document_types` returns one page, ten records by default, so page through
|
|
1068
|
+
to `totalItems` before building the payload. Each submitted object replaces the stored record,
|
|
1069
|
+
so a field you leave out is reset to its default — `isValid` included, and it defaults to true,
|
|
1070
|
+
so a payload omitting it revives a record you had retired.
|
|
1071
|
+
|
|
1072
|
+
Fields: on the result —
|
|
1073
|
+
|
|
1074
|
+
- `action` — "updated"
|
|
1075
|
+
- `resource` — "registers/cashdocumenttypes"
|
|
1076
|
+
"""
|
|
1077
|
+
await client.request(
|
|
1078
|
+
"PUT",
|
|
1079
|
+
f"/api/{organization}/registers/cashdocumenttypes",
|
|
1080
|
+
json=write_body(cashDocumentTypes),
|
|
1081
|
+
)
|
|
1082
|
+
return WriteResult(action="updated", resource="registers/cashdocumenttypes")
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
@operation
|
|
1086
|
+
async def update_register_cash_registers(
|
|
1087
|
+
client: WflowClient, organization: OrgSlug, cashRegisters: list[Register]
|
|
1088
|
+
) -> WriteResult:
|
|
1089
|
+
"""Add or update whole cash register records — the tills physical money moves through.
|
|
1090
|
+
|
|
1091
|
+
A record is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
1092
|
+
when neither is given. These are the tills themselves, one per site or per currency; what their
|
|
1093
|
+
documents may be called is `update_register_cash_document_types`. Sending part of the register
|
|
1094
|
+
retires the rest: any record missing from the payload is marked invalid, so send every till you
|
|
1095
|
+
mean to keep, or use `patch_register_cash_registers`, which touches only the records you send.
|
|
1096
|
+
`list_register_cash_registers` returns one page, ten records by default, so page through to
|
|
1097
|
+
`totalItems` before building the payload. Each submitted object replaces the stored record, so
|
|
1098
|
+
a field you leave out is reset to its default — `isValid` included, and it defaults to true, so
|
|
1099
|
+
a payload omitting it revives a record you had retired.
|
|
1100
|
+
|
|
1101
|
+
Fields: on the result —
|
|
1102
|
+
|
|
1103
|
+
- `action` — "updated"
|
|
1104
|
+
- `resource` — "registers/cashregisters"
|
|
1105
|
+
"""
|
|
1106
|
+
await client.request(
|
|
1107
|
+
"PUT",
|
|
1108
|
+
f"/api/{organization}/registers/cashregisters",
|
|
1109
|
+
json=write_body(cashRegisters),
|
|
1110
|
+
)
|
|
1111
|
+
return WriteResult(action="updated", resource="registers/cashregisters")
|
|
1112
|
+
|
|
1113
|
+
|
|
1114
|
+
@operation
|
|
1115
|
+
async def update_register_chart_of_accounts(
|
|
1116
|
+
client: WflowClient, organization: OrgSlug, accounts: list[Register]
|
|
1117
|
+
) -> WriteResult:
|
|
1118
|
+
"""Add or update whole ledger account records — the accounts documents are posted to.
|
|
1119
|
+
|
|
1120
|
+
An account is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
1121
|
+
— the account number, with `description` the account name. Sending part of the register retires
|
|
1122
|
+
the rest: any record missing from the payload is marked invalid, so send every account you mean
|
|
1123
|
+
to keep, or use `patch_register_chart_of_accounts`, which touches only the records you send.
|
|
1124
|
+
`list_register_chart_of_accounts` returns one page, ten records by default, so page through to
|
|
1125
|
+
`totalItems` before building the payload. Each submitted object replaces the stored record, so
|
|
1126
|
+
a field you leave out is reset to its default — `isValid` included, and it defaults to true, so
|
|
1127
|
+
a payload omitting it revives a record you had retired.
|
|
1128
|
+
|
|
1129
|
+
Fields: on the result —
|
|
1130
|
+
|
|
1131
|
+
- `action` — "updated"
|
|
1132
|
+
- `resource` — "registers/chartofaccounts"
|
|
1133
|
+
"""
|
|
1134
|
+
await client.request(
|
|
1135
|
+
"PUT",
|
|
1136
|
+
f"/api/{organization}/registers/chartofaccounts",
|
|
1137
|
+
json=write_body(accounts),
|
|
1138
|
+
)
|
|
1139
|
+
return WriteResult(action="updated", resource="registers/chartofaccounts")
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
@operation
|
|
1143
|
+
async def update_register_contracts(
|
|
1144
|
+
client: WflowClient, organization: OrgSlug, contracts: list[Register]
|
|
1145
|
+
) -> WriteResult:
|
|
1146
|
+
"""Add or update whole contract records — the agreements an invoice or order is filed under.
|
|
1147
|
+
|
|
1148
|
+
These are lookup entries, not the contract documents themselves: a record here is the code and
|
|
1149
|
+
name that documents point at. It is matched by `id`, or by `externalId` when reconciling
|
|
1150
|
+
against an ERP, or by `code` when neither is given. Sending part of the register retires the
|
|
1151
|
+
rest: any record missing from the payload is marked invalid, so send every record you mean to
|
|
1152
|
+
keep, or use `patch_register_contracts`, which touches only the records you send.
|
|
1153
|
+
`list_register_contracts` returns one page, ten records by default, so page through to
|
|
1154
|
+
`totalItems` before building the payload. Each submitted object replaces the stored record, so
|
|
1155
|
+
a field you leave out is reset to its default — `isValid` included, and it defaults to true, so
|
|
1156
|
+
a payload omitting it revives a record you had retired.
|
|
1157
|
+
|
|
1158
|
+
Fields: on the result —
|
|
1159
|
+
|
|
1160
|
+
- `action` — "updated"
|
|
1161
|
+
- `resource` — "registers/contracts"
|
|
1162
|
+
"""
|
|
1163
|
+
await client.request(
|
|
1164
|
+
"PUT",
|
|
1165
|
+
f"/api/{organization}/registers/contracts",
|
|
1166
|
+
json=write_body(contracts),
|
|
1167
|
+
)
|
|
1168
|
+
return WriteResult(action="updated", resource="registers/contracts")
|
|
1169
|
+
|
|
1170
|
+
|
|
1171
|
+
@operation
|
|
1172
|
+
async def update_register_cost_centers(
|
|
1173
|
+
client: WflowClient, organization: OrgSlug, costCenters: list[Register]
|
|
1174
|
+
) -> WriteResult:
|
|
1175
|
+
"""Add or update whole cost center records — the organizational units costs are attributed to.
|
|
1176
|
+
|
|
1177
|
+
A record is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
1178
|
+
when neither is given. Sending part of the register retires the rest: any record missing from
|
|
1179
|
+
the payload is marked invalid, so send every record you mean to keep, or use
|
|
1180
|
+
`patch_register_cost_centers`, which touches only the records you send.
|
|
1181
|
+
`list_register_cost_centers` returns one page, ten records by default, so page through to
|
|
1182
|
+
`totalItems` before building the payload. Each submitted object replaces the stored record, so
|
|
1183
|
+
a field you leave out is reset to its default — `isValid` included, and it defaults to true, so
|
|
1184
|
+
a payload omitting it revives a record you had retired.
|
|
1185
|
+
|
|
1186
|
+
Fields: on the result —
|
|
1187
|
+
|
|
1188
|
+
- `action` — "updated"
|
|
1189
|
+
- `resource` — "registers/costcenters"
|
|
1190
|
+
"""
|
|
1191
|
+
await client.request(
|
|
1192
|
+
"PUT",
|
|
1193
|
+
f"/api/{organization}/registers/costcenters",
|
|
1194
|
+
json=write_body(costCenters),
|
|
1195
|
+
)
|
|
1196
|
+
return WriteResult(action="updated", resource="registers/costcenters")
|
|
1197
|
+
|
|
1198
|
+
|
|
1199
|
+
@operation
|
|
1200
|
+
async def update_register_employees(
|
|
1201
|
+
client: WflowClient, organization: OrgSlug, employees: list[Register]
|
|
1202
|
+
) -> WriteResult:
|
|
1203
|
+
"""Add or update whole employee records — the organization's own staff as documents name them.
|
|
1204
|
+
|
|
1205
|
+
A record is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
1206
|
+
when neither is given. This register carries codes and names only; contact details, and who may
|
|
1207
|
+
sign in the organization's name, belong to `update_register_organization_persons`. Sending part
|
|
1208
|
+
of the register retires the rest: any record missing from the payload is marked invalid, so
|
|
1209
|
+
send every employee you mean to keep, or use `patch_register_employees`, which touches only the
|
|
1210
|
+
records you send. `list_register_employees` returns one page, ten records by default, so page
|
|
1211
|
+
through to `totalItems` before building the payload. Each submitted object replaces the stored
|
|
1212
|
+
record, so a field you leave out is reset to its default — `isValid` included, and it defaults
|
|
1213
|
+
to true, so a payload omitting it revives a record you had retired.
|
|
1214
|
+
|
|
1215
|
+
Fields: on the result —
|
|
1216
|
+
|
|
1217
|
+
- `action` — "updated"
|
|
1218
|
+
- `resource` — "registers/employees"
|
|
1219
|
+
"""
|
|
1220
|
+
await client.request(
|
|
1221
|
+
"PUT",
|
|
1222
|
+
f"/api/{organization}/registers/employees",
|
|
1223
|
+
json=write_body(employees),
|
|
1224
|
+
)
|
|
1225
|
+
return WriteResult(action="updated", resource="registers/employees")
|
|
1226
|
+
|
|
1227
|
+
|
|
1228
|
+
@operation
|
|
1229
|
+
async def update_register_locations(
|
|
1230
|
+
client: WflowClient, organization: OrgSlug, locations: list[Location]
|
|
1231
|
+
) -> WriteResult:
|
|
1232
|
+
"""Add or update whole location records — the organization's places of business.
|
|
1233
|
+
|
|
1234
|
+
A location is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
1235
|
+
when neither is given. Beyond `code` and `description` it carries `address`, the whole site
|
|
1236
|
+
address as one string, and `contact`, free text naming who to reach there. Sending part of the
|
|
1237
|
+
register retires the rest: any record missing from the payload is marked invalid, so send every
|
|
1238
|
+
location you mean to keep, or use `patch_register_locations`, which touches only the records
|
|
1239
|
+
you send. `list_register_locations` returns one page, ten records by default, so page through
|
|
1240
|
+
to `totalItems` before building the payload. Each submitted object replaces the stored record,
|
|
1241
|
+
so an address you leave out is reset to its default — `isValid` included, and it defaults to
|
|
1242
|
+
true, so a payload omitting it revives a record you had retired.
|
|
1243
|
+
|
|
1244
|
+
Fields: on the result —
|
|
1245
|
+
|
|
1246
|
+
- `action` — "updated"
|
|
1247
|
+
- `resource` — "registers/locations"
|
|
1248
|
+
"""
|
|
1249
|
+
await client.request(
|
|
1250
|
+
"PUT",
|
|
1251
|
+
f"/api/{organization}/registers/locations",
|
|
1252
|
+
json=write_body(locations),
|
|
1253
|
+
)
|
|
1254
|
+
return WriteResult(action="updated", resource="registers/locations")
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
@operation
|
|
1258
|
+
async def update_register_measure_units(
|
|
1259
|
+
client: WflowClient, organization: OrgSlug, measureUnits: list[Register]
|
|
1260
|
+
) -> WriteResult:
|
|
1261
|
+
"""Add or update whole measure unit records — the units a quantity on a line is counted in.
|
|
1262
|
+
|
|
1263
|
+
A record is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
1264
|
+
when neither is given. Business items point their `measureUnit` at a record from here, so a
|
|
1265
|
+
code you rename here is the code those items refer to. Sending part of the register retires the
|
|
1266
|
+
rest: any record missing from the payload is marked invalid, so send every unit you mean to
|
|
1267
|
+
keep, or use `patch_register_measure_units`, which touches only the records you send.
|
|
1268
|
+
`list_register_measure_units` returns one page, ten records by default, so page through to
|
|
1269
|
+
`totalItems` before building the payload. Each submitted object replaces the stored record, so
|
|
1270
|
+
a field you leave out is reset to its default — `isValid` included, and it defaults to true, so
|
|
1271
|
+
a payload omitting it revives a record you had retired.
|
|
1272
|
+
|
|
1273
|
+
Fields: on the result —
|
|
1274
|
+
|
|
1275
|
+
- `action` — "updated"
|
|
1276
|
+
- `resource` — "registers/measureunits"
|
|
1277
|
+
"""
|
|
1278
|
+
await client.request(
|
|
1279
|
+
"PUT",
|
|
1280
|
+
f"/api/{organization}/registers/measureunits",
|
|
1281
|
+
json=write_body(measureUnits),
|
|
1282
|
+
)
|
|
1283
|
+
return WriteResult(action="updated", resource="registers/measureunits")
|
|
1284
|
+
|
|
1285
|
+
|
|
1286
|
+
@operation
|
|
1287
|
+
async def update_register_organization_persons(
|
|
1288
|
+
client: WflowClient, organization: OrgSlug, persons: list[OrganizationPerson]
|
|
1289
|
+
) -> WriteResult:
|
|
1290
|
+
"""Add or update whole records for the people who act on the organization's behalf.
|
|
1291
|
+
|
|
1292
|
+
These are the persons a contract or an order is signed, stamped or approved in the name of.
|
|
1293
|
+
They have no `code`: a record is matched by `id`, or by `externalId` when reconciling against
|
|
1294
|
+
an ERP, and carries `firstName` and `lastName`, an address, phone and mail, a `language` and
|
|
1295
|
+
the `contractRole` the person may take. Sending part of the register retires the rest: any
|
|
1296
|
+
record missing from the payload is marked invalid, so send every person you mean to keep, or
|
|
1297
|
+
use `patch_register_organization_persons`, which touches only the records you send.
|
|
1298
|
+
`list_register_organization_persons` returns one page, ten records by default, so page through
|
|
1299
|
+
to `totalItems` before building the payload. Each submitted object replaces the stored record,
|
|
1300
|
+
so a field you leave out is reset to its default — `isValid` included, and it defaults to true,
|
|
1301
|
+
so a payload omitting it revives a record you had retired.
|
|
1302
|
+
|
|
1303
|
+
Fields: on the result —
|
|
1304
|
+
|
|
1305
|
+
- `action` — "updated"
|
|
1306
|
+
- `resource` — "registers/organizationpersons"
|
|
1307
|
+
"""
|
|
1308
|
+
await client.request(
|
|
1309
|
+
"PUT",
|
|
1310
|
+
f"/api/{organization}/registers/organizationpersons",
|
|
1311
|
+
json=write_body(persons),
|
|
1312
|
+
)
|
|
1313
|
+
return WriteResult(action="updated", resource="registers/organizationpersons")
|
|
1314
|
+
|
|
1315
|
+
|
|
1316
|
+
@operation
|
|
1317
|
+
async def update_register_partner_persons(
|
|
1318
|
+
client: WflowClient, organization: OrgSlug, persons: list[PartnerPersonUpdateC]
|
|
1319
|
+
) -> WriteResult:
|
|
1320
|
+
"""Add or update whole records for the contacts at partner companies.
|
|
1321
|
+
|
|
1322
|
+
The counterparty side of `update_register_organization_persons`: every record names in
|
|
1323
|
+
`partner` the partner it belongs to, by that partner's `id` or `externalId`. There is no `code`
|
|
1324
|
+
here either — a record is matched by `id`, or by `externalId` when reconciling against an ERP —
|
|
1325
|
+
and it carries the person's name, address, phone and mail, `language` and `contractRole`.
|
|
1326
|
+
Sending part of the register retires the rest, and "the register" means every contact of every
|
|
1327
|
+
partner, not only the partners your payload names: a call carrying one contact of partner X
|
|
1328
|
+
retires partner Y's contacts too. Any record missing from the payload is marked invalid, so
|
|
1329
|
+
send every contact you mean to keep, or use `patch_register_partner_persons`, which touches
|
|
1330
|
+
only the records you send. `list_register_partner_persons` returns one page, ten
|
|
1331
|
+
records by default, so page through to `totalItems` before building the payload. Each submitted
|
|
1332
|
+
object replaces the stored record, so a field you leave out is reset to its default — `isValid`
|
|
1333
|
+
included, and it defaults to true, so a payload omitting it revives a record you had retired.
|
|
1334
|
+
|
|
1335
|
+
Fields: on the result —
|
|
1336
|
+
|
|
1337
|
+
- `action` — "updated"
|
|
1338
|
+
- `resource` — "registers/partnerpersons"
|
|
1339
|
+
"""
|
|
1340
|
+
await client.request(
|
|
1341
|
+
"PUT",
|
|
1342
|
+
f"/api/{organization}/registers/partnerpersons",
|
|
1343
|
+
json=write_body(persons),
|
|
1344
|
+
)
|
|
1345
|
+
return WriteResult(action="updated", resource="registers/partnerpersons")
|
|
1346
|
+
|
|
1347
|
+
|
|
1348
|
+
@operation
|
|
1349
|
+
async def update_register_payment_methods(
|
|
1350
|
+
client: WflowClient, organization: OrgSlug, paymentMethods: list[PaymentMethods]
|
|
1351
|
+
) -> WriteResult:
|
|
1352
|
+
"""Add or update whole payment method records — how a document is settled.
|
|
1353
|
+
|
|
1354
|
+
A method is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
1355
|
+
when neither is given. `kind` ties the method to one document kind, so what an incoming invoice
|
|
1356
|
+
may carry is a different record from what a cash slip may carry. Sending part of the register
|
|
1357
|
+
retires the rest: any record missing from the payload is marked invalid, so send every method
|
|
1358
|
+
you mean to keep, or use `patch_register_payment_methods`, which touches only the records you
|
|
1359
|
+
send. `list_register_payment_methods` returns one page, ten records by default, so page through
|
|
1360
|
+
to `totalItems` before building the payload. Each submitted object replaces the stored record,
|
|
1361
|
+
so a field you leave out is reset to its default — `isValid` included, and it defaults to true,
|
|
1362
|
+
so a payload omitting it revives a record you had retired.
|
|
1363
|
+
|
|
1364
|
+
Fields: on the result —
|
|
1365
|
+
|
|
1366
|
+
- `action` — "updated"
|
|
1367
|
+
- `resource` — "registers/paymentmethods"
|
|
1368
|
+
"""
|
|
1369
|
+
await client.request(
|
|
1370
|
+
"PUT",
|
|
1371
|
+
f"/api/{organization}/registers/paymentmethods",
|
|
1372
|
+
json=write_body(paymentMethods),
|
|
1373
|
+
)
|
|
1374
|
+
return WriteResult(action="updated", resource="registers/paymentmethods")
|
|
1375
|
+
|
|
1376
|
+
|
|
1377
|
+
@operation
|
|
1378
|
+
async def update_register_projects(client: WflowClient, organization: OrgSlug, projects: list[Register]) -> WriteResult:
|
|
1379
|
+
"""Add or update whole project records — the bodies of work costs and revenues are attributed to.
|
|
1380
|
+
|
|
1381
|
+
A record is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
1382
|
+
when neither is given. Sending part of the register retires the rest: any record missing from
|
|
1383
|
+
the payload is marked invalid, so send every record you mean to keep, or use
|
|
1384
|
+
`patch_register_projects`, which touches only the records you send. `list_register_projects`
|
|
1385
|
+
returns one page, ten records by default, so page through to `totalItems` before building the
|
|
1386
|
+
payload. Each submitted object replaces the stored record, so a field you leave out is reset to
|
|
1387
|
+
its default — `isValid` included, and it defaults to true, so a payload omitting it revives a
|
|
1388
|
+
record you had retired.
|
|
1389
|
+
|
|
1390
|
+
Fields: on the result —
|
|
1391
|
+
|
|
1392
|
+
- `action` — "updated"
|
|
1393
|
+
- `resource` — "registers/projects"
|
|
1394
|
+
"""
|
|
1395
|
+
await client.request(
|
|
1396
|
+
"PUT",
|
|
1397
|
+
f"/api/{organization}/registers/projects",
|
|
1398
|
+
json=write_body(projects),
|
|
1399
|
+
)
|
|
1400
|
+
return WriteResult(action="updated", resource="registers/projects")
|
|
1401
|
+
|
|
1402
|
+
|
|
1403
|
+
@operation
|
|
1404
|
+
async def update_register_series(client: WflowClient, organization: OrgSlug, series: list[Serie]) -> WriteResult:
|
|
1405
|
+
"""Add or update whole numbering series records — the sequences documents take their numbers from.
|
|
1406
|
+
|
|
1407
|
+
A series is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
1408
|
+
when neither is given. `kind` scopes it to one document kind and, on invoices, `invoiceType`
|
|
1409
|
+
scopes it further, so tax invoices and credit notes number from separate records. Sending part
|
|
1410
|
+
of the register retires the rest: any record missing from the payload is marked invalid, so
|
|
1411
|
+
send every series you mean to keep, or use `patch_register_series`, which touches only the
|
|
1412
|
+
records you send. `list_register_series` returns one page, ten records by default, so page
|
|
1413
|
+
through to `totalItems` before building the payload. Each submitted object replaces the stored
|
|
1414
|
+
record, so a field you leave out is reset to its default — `isValid` included, and it defaults
|
|
1415
|
+
to true, so a payload omitting it revives a record you had retired.
|
|
1416
|
+
|
|
1417
|
+
Fields: on the result —
|
|
1418
|
+
|
|
1419
|
+
- `action` — "updated"
|
|
1420
|
+
- `resource` — "registers/series"
|
|
1421
|
+
"""
|
|
1422
|
+
await client.request(
|
|
1423
|
+
"PUT",
|
|
1424
|
+
f"/api/{organization}/registers/series",
|
|
1425
|
+
json=write_body(series),
|
|
1426
|
+
)
|
|
1427
|
+
return WriteResult(action="updated", resource="registers/series")
|
|
1428
|
+
|
|
1429
|
+
|
|
1430
|
+
@operation
|
|
1431
|
+
async def update_register_vat_control_statement_lines(
|
|
1432
|
+
client: WflowClient, organization: OrgSlug, lines: list[Register]
|
|
1433
|
+
) -> WriteResult:
|
|
1434
|
+
"""Add or update whole VAT control statement line records — the sections a document is itemised in.
|
|
1435
|
+
|
|
1436
|
+
A record is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
1437
|
+
when neither is given. The control statement reports transactions one by one, which is why its
|
|
1438
|
+
sections are a register of their own alongside `update_register_vat_return_lines`. Sending part
|
|
1439
|
+
of the register retires the rest: any record missing from the payload is marked invalid, so
|
|
1440
|
+
send every line you mean to keep, or use `patch_register_vat_control_statement_lines`, which
|
|
1441
|
+
touches only the records you send. `list_register_vat_control_statement_lines` returns one
|
|
1442
|
+
page, ten records by default, so page through to `totalItems` before building the payload. Each
|
|
1443
|
+
submitted object replaces the stored record, so a field you leave out is reset to its default —
|
|
1444
|
+
`isValid` included, and it defaults to true, so a payload omitting it revives a record you had
|
|
1445
|
+
retired.
|
|
1446
|
+
|
|
1447
|
+
Fields: on the result —
|
|
1448
|
+
|
|
1449
|
+
- `action` — "updated"
|
|
1450
|
+
- `resource` — "registers/vatcontrolstatementlines"
|
|
1451
|
+
"""
|
|
1452
|
+
await client.request(
|
|
1453
|
+
"PUT",
|
|
1454
|
+
f"/api/{organization}/registers/vatcontrolstatementlines",
|
|
1455
|
+
json=write_body(lines),
|
|
1456
|
+
)
|
|
1457
|
+
return WriteResult(action="updated", resource="registers/vatcontrolstatementlines")
|
|
1458
|
+
|
|
1459
|
+
|
|
1460
|
+
@operation
|
|
1461
|
+
async def update_register_vat_return_lines(
|
|
1462
|
+
client: WflowClient, organization: OrgSlug, lines: list[VATReturnLine]
|
|
1463
|
+
) -> WriteResult:
|
|
1464
|
+
"""Add or update whole VAT return line records — the rows a document's tax is reported on.
|
|
1465
|
+
|
|
1466
|
+
A line is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`
|
|
1467
|
+
when neither is given, and `reverseCharge` marks the lines that report tax the recipient
|
|
1468
|
+
accounts for. Sending part of the register retires the rest: any record missing from the
|
|
1469
|
+
payload is marked invalid, so send every line you mean to keep, or use
|
|
1470
|
+
`patch_register_vat_return_lines`, which touches only the records you send.
|
|
1471
|
+
`list_register_vat_return_lines` returns one page, ten records by default, so page through to
|
|
1472
|
+
`totalItems` before building the payload. Each submitted object replaces the stored record, so
|
|
1473
|
+
a field you leave out is reset to its default — `isValid` included, and it defaults to true, so
|
|
1474
|
+
a payload omitting it revives a record you had retired.
|
|
1475
|
+
|
|
1476
|
+
Fields: on the result —
|
|
1477
|
+
|
|
1478
|
+
- `action` — "updated"
|
|
1479
|
+
- `resource` — "registers/vatreturnlines"
|
|
1480
|
+
"""
|
|
1481
|
+
await client.request(
|
|
1482
|
+
"PUT",
|
|
1483
|
+
f"/api/{organization}/registers/vatreturnlines",
|
|
1484
|
+
json=write_body(lines),
|
|
1485
|
+
)
|
|
1486
|
+
return WriteResult(action="updated", resource="registers/vatreturnlines")
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
@operation
|
|
1490
|
+
async def update_register_vat_reverse_charge_codes(
|
|
1491
|
+
client: WflowClient, organization: OrgSlug, codes: list[Register]
|
|
1492
|
+
) -> WriteResult:
|
|
1493
|
+
"""Add or update whole VAT reverse charge code records — the codes naming a reverse charge supply.
|
|
1494
|
+
|
|
1495
|
+
A record is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code` —
|
|
1496
|
+
the supply code the law requires on a reverse charge document, with `description` the supply it
|
|
1497
|
+
covers. Sending part of the register retires the rest: any record missing from the payload is
|
|
1498
|
+
marked invalid, so send every code you mean to keep, or use
|
|
1499
|
+
`patch_register_vat_reverse_charge_codes`, which touches only the records you send.
|
|
1500
|
+
`list_register_vat_reverse_charge_codes` returns one page, ten records by default, so page
|
|
1501
|
+
through to `totalItems` before building the payload. Each submitted object replaces the stored
|
|
1502
|
+
record, so a field you leave out is reset to its default — `isValid` included, and it defaults
|
|
1503
|
+
to true, so a payload omitting it revives a record you had retired.
|
|
1504
|
+
|
|
1505
|
+
Fields: on the result —
|
|
1506
|
+
|
|
1507
|
+
- `action` — "updated"
|
|
1508
|
+
- `resource` — "registers/vatreversechargecodes"
|
|
1509
|
+
"""
|
|
1510
|
+
await client.request(
|
|
1511
|
+
"PUT",
|
|
1512
|
+
f"/api/{organization}/registers/vatreversechargecodes",
|
|
1513
|
+
json=write_body(codes),
|
|
1514
|
+
)
|
|
1515
|
+
return WriteResult(action="updated", resource="registers/vatreversechargecodes")
|
|
1516
|
+
|
|
1517
|
+
|
|
1518
|
+
@operation
|
|
1519
|
+
async def update_register_vehicles(client: WflowClient, organization: OrgSlug, vehicles: list[Register]) -> WriteResult:
|
|
1520
|
+
"""Add or update whole vehicle records — the cars and machines travel and fuel documents name.
|
|
1521
|
+
|
|
1522
|
+
A record is matched by `id`, or by `externalId` when reconciling against an ERP, or by `code`,
|
|
1523
|
+
typically the registration. Sending part of the register retires the rest: any record missing
|
|
1524
|
+
from the payload is marked invalid, so send every vehicle you mean to keep, or use
|
|
1525
|
+
`patch_register_vehicles`, which touches only the records you send. `list_register_vehicles`
|
|
1526
|
+
returns one page, ten records by default, so page through to `totalItems` before building the
|
|
1527
|
+
payload. Each submitted object replaces the stored record, so a field you leave out is reset to
|
|
1528
|
+
its default — `isValid` included, and it defaults to true, so a payload omitting it revives a
|
|
1529
|
+
record you had retired.
|
|
1530
|
+
|
|
1531
|
+
Fields: on the result —
|
|
1532
|
+
|
|
1533
|
+
- `action` — "updated"
|
|
1534
|
+
- `resource` — "registers/vehicles"
|
|
1535
|
+
"""
|
|
1536
|
+
await client.request(
|
|
1537
|
+
"PUT",
|
|
1538
|
+
f"/api/{organization}/registers/vehicles",
|
|
1539
|
+
json=write_body(vehicles),
|
|
1540
|
+
)
|
|
1541
|
+
return WriteResult(action="updated", resource="registers/vehicles")
|
|
1542
|
+
|
|
1543
|
+
|
|
1544
|
+
@operation
|
|
1545
|
+
async def patch_register_partners(
|
|
1546
|
+
client: WflowClient, organization: OrgSlug, partners: list[PartnerFull]
|
|
1547
|
+
) -> WriteResult:
|
|
1548
|
+
"""Add or update partner records, sparing the rest.
|
|
1549
|
+
|
|
1550
|
+
Send `id` or `externalId` to identify the record, plus the record's other fields. wflow
|
|
1551
|
+
validates each item as a whole record, so a field you omit is reset to its default rather than
|
|
1552
|
+
kept — send the whole record, not just what changed. What a patch does leave alone is the
|
|
1553
|
+
records you keep out of the payload: they are not retired, and that is the one difference from
|
|
1554
|
+
`update_register_partners`. Sending a field as `null` is no different from omitting it: the
|
|
1555
|
+
`null` is dropped before the request leaves, and wflow ignores an explicit null in any case. To
|
|
1556
|
+
retire a single record, send it with `isValid: false` — and carry that field in every later
|
|
1557
|
+
payload for it, because `isValid` defaults to true and a write that omits it revives the
|
|
1558
|
+
record.
|
|
1559
|
+
|
|
1560
|
+
`peppolIds` is the exception to all of that. Omitted, it leaves the partner's existing Peppol
|
|
1561
|
+
IDs alone; sent, it is synchronised to match your list, so an ID you did not include is deleted
|
|
1562
|
+
and an empty list deletes every one.
|
|
1563
|
+
|
|
1564
|
+
Bank account fields are not reliably stored: `accounts`, `mainAccount` and the flat
|
|
1565
|
+
`accountNo`, `bankCode`, `iban`, `bic` and `currency` can be accepted, reported as a success,
|
|
1566
|
+
and read back empty while the other fields in the same payload save. Do not rely on this operation
|
|
1567
|
+
to write account details — verify against a read before trusting a migration.
|
|
1568
|
+
|
|
1569
|
+
Fields: on the result —
|
|
1570
|
+
|
|
1571
|
+
- `action` — "patched"
|
|
1572
|
+
- `resource` — "registers/partners"
|
|
1573
|
+
"""
|
|
1574
|
+
await client.request(
|
|
1575
|
+
"PATCH",
|
|
1576
|
+
f"/api/{organization}/registers/partners",
|
|
1577
|
+
json=write_body(partners),
|
|
1578
|
+
)
|
|
1579
|
+
return WriteResult(action="patched", resource="registers/partners")
|
|
1580
|
+
|
|
1581
|
+
|
|
1582
|
+
@operation
|
|
1583
|
+
async def patch_register_accounting_rules(
|
|
1584
|
+
client: WflowClient, organization: OrgSlug, accountingRules: list[KindRegister]
|
|
1585
|
+
) -> WriteResult:
|
|
1586
|
+
"""Add or update accounting rule records, sparing the rest — how document lines are posted to accounts.
|
|
1587
|
+
|
|
1588
|
+
Send `id` or `externalId` to identify the rule, or `code` when neither is given, plus the
|
|
1589
|
+
record's other fields. `kind` ties a rule to one document kind, so a code that posts
|
|
1590
|
+
differently on an incoming invoice and on a cash receipt is two records to patch, not one.
|
|
1591
|
+
wflow validates each item as a whole record, so a field you omit is reset to its default rather
|
|
1592
|
+
than kept — send the whole record, not just what changed. What a patch does leave alone is the
|
|
1593
|
+
rules you keep out of the payload: they are not retired, and that is the one difference from
|
|
1594
|
+
`update_register_accounting_rules`. Sending a field as `null` is no different from omitting it:
|
|
1595
|
+
the `null` is dropped before the request leaves, and wflow ignores an explicit null in any
|
|
1596
|
+
case. To retire a single record, send it with `isValid: false` — and carry that field in every
|
|
1597
|
+
later payload for it, because `isValid` defaults to true and a write that omits it revives the
|
|
1598
|
+
record.
|
|
1599
|
+
|
|
1600
|
+
Fields: on the result —
|
|
1601
|
+
|
|
1602
|
+
- `action` — "patched"
|
|
1603
|
+
- `resource` — "registers/accountingrules"
|
|
1604
|
+
"""
|
|
1605
|
+
await client.request(
|
|
1606
|
+
"PATCH",
|
|
1607
|
+
f"/api/{organization}/registers/accountingrules",
|
|
1608
|
+
json=write_body(accountingRules),
|
|
1609
|
+
)
|
|
1610
|
+
return WriteResult(action="patched", resource="registers/accountingrules")
|
|
1611
|
+
|
|
1612
|
+
|
|
1613
|
+
@operation
|
|
1614
|
+
async def patch_register_activities(
|
|
1615
|
+
client: WflowClient, organization: OrgSlug, activities: list[Register]
|
|
1616
|
+
) -> WriteResult:
|
|
1617
|
+
"""Add or update activity records, sparing the rest — what a cost was incurred doing.
|
|
1618
|
+
|
|
1619
|
+
Send `id` or `externalId` to identify the record, or `code` when neither is given, plus the
|
|
1620
|
+
record's other fields. wflow validates each item as a whole record, so a field you omit is
|
|
1621
|
+
reset to its default rather than kept — send the whole record, not just what changed. What a
|
|
1622
|
+
patch does leave alone is the records you keep out of the payload: they are not retired, and
|
|
1623
|
+
that is the one difference from `update_register_activities`. Sending a field as `null` is no
|
|
1624
|
+
different from omitting it: the `null` is dropped before the request leaves, and wflow ignores
|
|
1625
|
+
an explicit null in any case. To retire a single record, send it with `isValid: false` — and
|
|
1626
|
+
carry that field in every later payload for it, because `isValid` defaults to true and a write
|
|
1627
|
+
that omits it revives the record.
|
|
1628
|
+
|
|
1629
|
+
Fields: on the result —
|
|
1630
|
+
|
|
1631
|
+
- `action` — "patched"
|
|
1632
|
+
- `resource` — "registers/activities"
|
|
1633
|
+
"""
|
|
1634
|
+
await client.request(
|
|
1635
|
+
"PATCH",
|
|
1636
|
+
f"/api/{organization}/registers/activities",
|
|
1637
|
+
json=write_body(activities),
|
|
1638
|
+
)
|
|
1639
|
+
return WriteResult(action="patched", resource="registers/activities")
|
|
1640
|
+
|
|
1641
|
+
|
|
1642
|
+
@operation
|
|
1643
|
+
async def patch_register_business_cases(
|
|
1644
|
+
client: WflowClient, organization: OrgSlug, businessCases: list[Register]
|
|
1645
|
+
) -> WriteResult:
|
|
1646
|
+
"""Add or update business cases, sparing the rest — the commercial engagements costs and revenues are booked against.
|
|
1647
|
+
|
|
1648
|
+
Send `id` or `externalId` to identify the record, or `code` when neither is given, plus the
|
|
1649
|
+
record's other fields. wflow validates each item as a whole record, so a field you omit is
|
|
1650
|
+
reset to its default rather than kept — send the whole record, not just what changed. What a
|
|
1651
|
+
patch does leave alone is the records you keep out of the payload: they are not retired, and
|
|
1652
|
+
that is the one difference from `update_register_business_cases`. Sending a field as `null` is
|
|
1653
|
+
no different from omitting it: the `null` is dropped before the request leaves, and wflow
|
|
1654
|
+
ignores an explicit null in any case. To retire a single record, send it with `isValid: false`
|
|
1655
|
+
— and carry that field in every later payload for it, because `isValid` defaults to true and a
|
|
1656
|
+
write that omits it revives the record.
|
|
1657
|
+
|
|
1658
|
+
Fields: on the result —
|
|
1659
|
+
|
|
1660
|
+
- `action` — "patched"
|
|
1661
|
+
- `resource` — "registers/businesscases"
|
|
1662
|
+
"""
|
|
1663
|
+
await client.request(
|
|
1664
|
+
"PATCH",
|
|
1665
|
+
f"/api/{organization}/registers/businesscases",
|
|
1666
|
+
json=write_body(businessCases),
|
|
1667
|
+
)
|
|
1668
|
+
return WriteResult(action="patched", resource="registers/businesscases")
|
|
1669
|
+
|
|
1670
|
+
|
|
1671
|
+
@operation
|
|
1672
|
+
async def patch_register_business_item_categories(
|
|
1673
|
+
client: WflowClient, organization: OrgSlug, businessItemCategories: list[Register]
|
|
1674
|
+
) -> WriteResult:
|
|
1675
|
+
"""Add or update business item category records, sparing the rest — the groupings the item catalogue is filed under.
|
|
1676
|
+
|
|
1677
|
+
Send `id` or `externalId` to identify the record, or `code` when neither is given, plus the
|
|
1678
|
+
record's other fields. Business items point their `category` at a record from here, so a `code`
|
|
1679
|
+
you patch here is the code those items refer to. wflow validates each item as a whole record,
|
|
1680
|
+
so a field you omit is reset to its default rather than kept — send the whole record, not just
|
|
1681
|
+
what changed. What a patch does leave alone is the records you keep out of the payload: they
|
|
1682
|
+
are not retired, and that is the one difference from
|
|
1683
|
+
`update_register_business_item_categories`. Sending a field as `null` is no different from
|
|
1684
|
+
omitting it: the `null` is dropped before the request leaves, and wflow ignores an explicit
|
|
1685
|
+
null in any case. To retire a single record, send it with `isValid: false` — and carry that
|
|
1686
|
+
field in every later payload for it, because `isValid` defaults to true and a write that omits
|
|
1687
|
+
it revives the record.
|
|
1688
|
+
|
|
1689
|
+
Fields: on the result —
|
|
1690
|
+
|
|
1691
|
+
- `action` — "patched"
|
|
1692
|
+
- `resource` — "registers/businessitemcategories"
|
|
1693
|
+
"""
|
|
1694
|
+
await client.request(
|
|
1695
|
+
"PATCH",
|
|
1696
|
+
f"/api/{organization}/registers/businessitemcategories",
|
|
1697
|
+
json=write_body(businessItemCategories),
|
|
1698
|
+
)
|
|
1699
|
+
return WriteResult(action="patched", resource="registers/businessitemcategories")
|
|
1700
|
+
|
|
1701
|
+
|
|
1702
|
+
@operation
|
|
1703
|
+
async def patch_register_business_items(
|
|
1704
|
+
client: WflowClient, organization: OrgSlug, businessItems: list[BusinessItemUpdateC]
|
|
1705
|
+
) -> WriteResult:
|
|
1706
|
+
"""Add or update business item records, sparing the rest — the catalogue of goods and services on document lines.
|
|
1707
|
+
|
|
1708
|
+
Send `id` or `externalId` to identify the item, or `code` when neither is given, plus the
|
|
1709
|
+
record's other fields — a `unitPrice` change still has to carry the rest of the item with it.
|
|
1710
|
+
`category`, `measureUnit` and `partner` are nested objects naming that record by `id` or
|
|
1711
|
+
`externalId`, and `category` and `measureUnit` also by `code`; a nested object is replaced
|
|
1712
|
+
wholesale too, so re-point one by sending it complete, alongside the rest of the record. wflow
|
|
1713
|
+
validates each item as a whole record, so a field you omit is reset to its default rather than
|
|
1714
|
+
kept — send the whole record, not just what changed. What a patch does leave alone is the items
|
|
1715
|
+
you keep out of the payload: they are not retired, and that is the one difference from
|
|
1716
|
+
`update_register_business_items`. Sending a field as `null` is no different from omitting it:
|
|
1717
|
+
the `null` is dropped before the request leaves, and wflow ignores an explicit null in any
|
|
1718
|
+
case. To retire a single record, send it with `isValid: false` — and carry that field in every
|
|
1719
|
+
later payload for it, because `isValid` defaults to true and a write that omits it revives the
|
|
1720
|
+
record.
|
|
1721
|
+
|
|
1722
|
+
Fields: on the result —
|
|
1723
|
+
|
|
1724
|
+
- `action` — "patched"
|
|
1725
|
+
- `resource` — "registers/businessitems"
|
|
1726
|
+
"""
|
|
1727
|
+
await client.request(
|
|
1728
|
+
"PATCH",
|
|
1729
|
+
f"/api/{organization}/registers/businessitems",
|
|
1730
|
+
json=write_body(businessItems),
|
|
1731
|
+
)
|
|
1732
|
+
return WriteResult(action="patched", resource="registers/businessitems")
|
|
1733
|
+
|
|
1734
|
+
|
|
1735
|
+
@operation
|
|
1736
|
+
async def patch_register_card_document_types(
|
|
1737
|
+
client: WflowClient, organization: OrgSlug, cardDocumentTypes: list[Register]
|
|
1738
|
+
) -> WriteResult:
|
|
1739
|
+
"""Add or update card document type records, sparing the rest — the types a payment made by card may take.
|
|
1740
|
+
|
|
1741
|
+
Send `id` or `externalId` to identify the record, or `code` when neither is given, plus the
|
|
1742
|
+
record's other fields. This is the card side only; the cash side is a separate register,
|
|
1743
|
+
patched through `patch_register_cash_document_types`. wflow validates each item as a whole
|
|
1744
|
+
record, so a field you omit is reset to its default rather than kept — send the whole record,
|
|
1745
|
+
not just what changed. What a patch does leave alone is the records you keep out of the
|
|
1746
|
+
payload: they are not retired, and that is the one difference from
|
|
1747
|
+
`update_register_card_document_types`. Sending a field as `null` is no different from omitting
|
|
1748
|
+
it: the `null` is dropped before the request leaves, and wflow ignores an explicit null in any
|
|
1749
|
+
case. To retire a single record, send it with `isValid: false` — and carry that field in every
|
|
1750
|
+
later payload for it, because `isValid` defaults to true and a write that omits it revives the
|
|
1751
|
+
record.
|
|
1752
|
+
|
|
1753
|
+
Fields: on the result —
|
|
1754
|
+
|
|
1755
|
+
- `action` — "patched"
|
|
1756
|
+
- `resource` — "registers/carddocumenttypes"
|
|
1757
|
+
"""
|
|
1758
|
+
await client.request(
|
|
1759
|
+
"PATCH",
|
|
1760
|
+
f"/api/{organization}/registers/carddocumenttypes",
|
|
1761
|
+
json=write_body(cardDocumentTypes),
|
|
1762
|
+
)
|
|
1763
|
+
return WriteResult(action="patched", resource="registers/carddocumenttypes")
|
|
1764
|
+
|
|
1765
|
+
|
|
1766
|
+
@operation
|
|
1767
|
+
async def patch_register_cash_document_types(
|
|
1768
|
+
client: WflowClient, organization: OrgSlug, cashDocumentTypes: list[Register]
|
|
1769
|
+
) -> WriteResult:
|
|
1770
|
+
"""Add or update cash document type records, sparing the rest — the types a cash register document may take.
|
|
1771
|
+
|
|
1772
|
+
Covers money in and money out alike, so a receipt and a payout are separate records here. Send
|
|
1773
|
+
`id` or `externalId` to identify one, or `code` when neither is given, plus the record's other
|
|
1774
|
+
fields. wflow validates each item as a whole record, so a field you omit is reset to its
|
|
1775
|
+
default rather than kept — send the whole record, not just what changed. What a patch does
|
|
1776
|
+
leave alone is the records you keep out of the payload: they are not retired, and that is the
|
|
1777
|
+
one difference from `update_register_cash_document_types`. Sending a field as `null` is no
|
|
1778
|
+
different from omitting it: the `null` is dropped before the request leaves, and wflow ignores
|
|
1779
|
+
an explicit null in any case. To retire a single record, send it with `isValid: false` — and
|
|
1780
|
+
carry that field in every later payload for it, because `isValid` defaults to true and a write
|
|
1781
|
+
that omits it revives the record.
|
|
1782
|
+
|
|
1783
|
+
Fields: on the result —
|
|
1784
|
+
|
|
1785
|
+
- `action` — "patched"
|
|
1786
|
+
- `resource` — "registers/cashdocumenttypes"
|
|
1787
|
+
"""
|
|
1788
|
+
await client.request(
|
|
1789
|
+
"PATCH",
|
|
1790
|
+
f"/api/{organization}/registers/cashdocumenttypes",
|
|
1791
|
+
json=write_body(cashDocumentTypes),
|
|
1792
|
+
)
|
|
1793
|
+
return WriteResult(action="patched", resource="registers/cashdocumenttypes")
|
|
1794
|
+
|
|
1795
|
+
|
|
1796
|
+
@operation
|
|
1797
|
+
async def patch_register_cash_registers(
|
|
1798
|
+
client: WflowClient, organization: OrgSlug, cashRegisters: list[Register]
|
|
1799
|
+
) -> WriteResult:
|
|
1800
|
+
"""Add or update cash register records, sparing the rest — the tills physical money moves through.
|
|
1801
|
+
|
|
1802
|
+
These are the tills themselves, one per site or per currency; what their documents may be
|
|
1803
|
+
called is `patch_register_cash_document_types`. Send `id` or `externalId` to identify a till,
|
|
1804
|
+
or `code` when neither is given, plus the record's other fields. wflow validates each item as a
|
|
1805
|
+
whole record, so a field you omit is reset to its default rather than kept — send the whole
|
|
1806
|
+
record, not just what changed. What a patch does leave alone is the tills you keep out of the
|
|
1807
|
+
payload: they are not retired, and that is the one difference from
|
|
1808
|
+
`update_register_cash_registers`. Sending a field as `null` is no different from omitting it:
|
|
1809
|
+
the `null` is dropped before the request leaves, and wflow ignores an explicit null in any
|
|
1810
|
+
case. To retire a single record, send it with `isValid: false` — and carry that field in every
|
|
1811
|
+
later payload for it, because `isValid` defaults to true and a write that omits it revives the
|
|
1812
|
+
record.
|
|
1813
|
+
|
|
1814
|
+
Fields: on the result —
|
|
1815
|
+
|
|
1816
|
+
- `action` — "patched"
|
|
1817
|
+
- `resource` — "registers/cashregisters"
|
|
1818
|
+
"""
|
|
1819
|
+
await client.request(
|
|
1820
|
+
"PATCH",
|
|
1821
|
+
f"/api/{organization}/registers/cashregisters",
|
|
1822
|
+
json=write_body(cashRegisters),
|
|
1823
|
+
)
|
|
1824
|
+
return WriteResult(action="patched", resource="registers/cashregisters")
|
|
1825
|
+
|
|
1826
|
+
|
|
1827
|
+
@operation
|
|
1828
|
+
async def patch_register_chart_of_accounts(
|
|
1829
|
+
client: WflowClient, organization: OrgSlug, accounts: list[Register]
|
|
1830
|
+
) -> WriteResult:
|
|
1831
|
+
"""Add or update ledger account records, sparing the rest — the accounts documents are posted to.
|
|
1832
|
+
|
|
1833
|
+
Send `id` or `externalId` to identify the account, or `code` — the account number — when
|
|
1834
|
+
neither is given, plus the record's other fields; renaming an account changes `description`,
|
|
1835
|
+
sent with the rest. wflow validates each item as a whole record, so a field you omit is reset to its default
|
|
1836
|
+
rather than kept — send the whole record, not just what changed. What a patch does leave alone
|
|
1837
|
+
is the accounts you keep out of the payload: they are not retired, and that is the one
|
|
1838
|
+
difference from `update_register_chart_of_accounts`. Sending a field as `null` is no different
|
|
1839
|
+
from omitting it: the `null` is dropped before the request leaves, and wflow ignores an
|
|
1840
|
+
explicit null in any case. To retire a single record, send it with `isValid: false` — and carry
|
|
1841
|
+
that field in every later payload for it, because `isValid` defaults to true and a write that
|
|
1842
|
+
omits it revives the record.
|
|
1843
|
+
|
|
1844
|
+
Fields: on the result —
|
|
1845
|
+
|
|
1846
|
+
- `action` — "patched"
|
|
1847
|
+
- `resource` — "registers/chartofaccounts"
|
|
1848
|
+
"""
|
|
1849
|
+
await client.request(
|
|
1850
|
+
"PATCH",
|
|
1851
|
+
f"/api/{organization}/registers/chartofaccounts",
|
|
1852
|
+
json=write_body(accounts),
|
|
1853
|
+
)
|
|
1854
|
+
return WriteResult(action="patched", resource="registers/chartofaccounts")
|
|
1855
|
+
|
|
1856
|
+
|
|
1857
|
+
@operation
|
|
1858
|
+
async def patch_register_contracts(
|
|
1859
|
+
client: WflowClient, organization: OrgSlug, contracts: list[Register]
|
|
1860
|
+
) -> WriteResult:
|
|
1861
|
+
"""Add or update contract records, sparing the rest — the agreements an invoice or order is filed under.
|
|
1862
|
+
|
|
1863
|
+
These are lookup entries, not the contract documents themselves: a record here is the code and
|
|
1864
|
+
name that documents point at. Send `id` or `externalId` to identify one, or `code` when neither
|
|
1865
|
+
is given, plus the record's other fields. wflow validates each item as a whole record, so a
|
|
1866
|
+
field you omit is reset to its default rather than kept — send the whole record, not just what
|
|
1867
|
+
changed. What a patch does leave alone is the records you keep out of the payload: they are not
|
|
1868
|
+
retired, and that is the one difference from `update_register_contracts`. Sending a field as
|
|
1869
|
+
`null` is no different from omitting it: the `null` is dropped before the request leaves, and
|
|
1870
|
+
wflow ignores an explicit null in any case. To retire a single record, send it with `isValid:
|
|
1871
|
+
false` — and carry that field in every later payload for it, because `isValid` defaults to true
|
|
1872
|
+
and a write that omits it revives the record.
|
|
1873
|
+
|
|
1874
|
+
Fields: on the result —
|
|
1875
|
+
|
|
1876
|
+
- `action` — "patched"
|
|
1877
|
+
- `resource` — "registers/contracts"
|
|
1878
|
+
"""
|
|
1879
|
+
await client.request(
|
|
1880
|
+
"PATCH",
|
|
1881
|
+
f"/api/{organization}/registers/contracts",
|
|
1882
|
+
json=write_body(contracts),
|
|
1883
|
+
)
|
|
1884
|
+
return WriteResult(action="patched", resource="registers/contracts")
|
|
1885
|
+
|
|
1886
|
+
|
|
1887
|
+
@operation
|
|
1888
|
+
async def patch_register_cost_centers(
|
|
1889
|
+
client: WflowClient, organization: OrgSlug, costCenters: list[Register]
|
|
1890
|
+
) -> WriteResult:
|
|
1891
|
+
"""Add or update cost center records, sparing the rest — the organizational units costs are attributed to.
|
|
1892
|
+
|
|
1893
|
+
Send `id` or `externalId` to identify the record, or `code` when neither is given, plus the
|
|
1894
|
+
record's other fields. wflow validates each item as a whole record, so a field you omit is
|
|
1895
|
+
reset to its default rather than kept — send the whole record, not just what changed. What a
|
|
1896
|
+
patch does leave alone is the records you keep out of the payload: they are not retired, and
|
|
1897
|
+
that is the one difference from `update_register_cost_centers`. Sending a field as `null` is no
|
|
1898
|
+
different from omitting it: the `null` is dropped before the request leaves, and wflow ignores
|
|
1899
|
+
an explicit null in any case. To retire a single record, send it with `isValid: false` — and
|
|
1900
|
+
carry that field in every later payload for it, because `isValid` defaults to true and a write
|
|
1901
|
+
that omits it revives the record.
|
|
1902
|
+
|
|
1903
|
+
Fields: on the result —
|
|
1904
|
+
|
|
1905
|
+
- `action` — "patched"
|
|
1906
|
+
- `resource` — "registers/costcenters"
|
|
1907
|
+
"""
|
|
1908
|
+
await client.request(
|
|
1909
|
+
"PATCH",
|
|
1910
|
+
f"/api/{organization}/registers/costcenters",
|
|
1911
|
+
json=write_body(costCenters),
|
|
1912
|
+
)
|
|
1913
|
+
return WriteResult(action="patched", resource="registers/costcenters")
|
|
1914
|
+
|
|
1915
|
+
|
|
1916
|
+
@operation
|
|
1917
|
+
async def patch_register_employees(
|
|
1918
|
+
client: WflowClient, organization: OrgSlug, employees: list[Register]
|
|
1919
|
+
) -> WriteResult:
|
|
1920
|
+
"""Add or update employee records, sparing the rest — the organization's own staff as documents name them.
|
|
1921
|
+
|
|
1922
|
+
This register carries codes and names only; contact details, and who may sign in the
|
|
1923
|
+
organization's name, belong to `patch_register_organization_persons`. Send `id` or `externalId`
|
|
1924
|
+
to identify an employee, or `code` when neither is given, plus the record's other fields. wflow
|
|
1925
|
+
validates each item as a whole record, so a field you omit is reset to its default rather than
|
|
1926
|
+
kept — send the whole record, not just what changed. What a patch does leave alone is the
|
|
1927
|
+
employees you keep out of the payload: they are not retired, and that is the one difference
|
|
1928
|
+
from `update_register_employees`. Sending a field as `null` is no different from omitting it:
|
|
1929
|
+
the `null` is dropped before the request leaves, and wflow ignores an explicit null in any
|
|
1930
|
+
case. To retire a single record, send it with `isValid: false` — and carry that field in every
|
|
1931
|
+
later payload for it, because `isValid` defaults to true and a write that omits it revives the
|
|
1932
|
+
record.
|
|
1933
|
+
|
|
1934
|
+
Fields: on the result —
|
|
1935
|
+
|
|
1936
|
+
- `action` — "patched"
|
|
1937
|
+
- `resource` — "registers/employees"
|
|
1938
|
+
"""
|
|
1939
|
+
await client.request(
|
|
1940
|
+
"PATCH",
|
|
1941
|
+
f"/api/{organization}/registers/employees",
|
|
1942
|
+
json=write_body(employees),
|
|
1943
|
+
)
|
|
1944
|
+
return WriteResult(action="patched", resource="registers/employees")
|
|
1945
|
+
|
|
1946
|
+
|
|
1947
|
+
@operation
|
|
1948
|
+
async def patch_register_locations(
|
|
1949
|
+
client: WflowClient, organization: OrgSlug, locations: list[Location]
|
|
1950
|
+
) -> WriteResult:
|
|
1951
|
+
"""Add or update location records, sparing the rest — the organization's places of business.
|
|
1952
|
+
|
|
1953
|
+
Send `id` or `externalId` to identify the site, or `code` when neither is given, plus the
|
|
1954
|
+
record's other fields: `address` is the whole site address as one string, so a move changes that
|
|
1955
|
+
one field but still sends the others, and `contact` is free text naming who to reach there. wflow validates each item as a
|
|
1956
|
+
whole record, so a field you omit is reset to its default rather than kept — send the whole
|
|
1957
|
+
record, not just what changed. What a patch does leave alone is the sites you keep out of the
|
|
1958
|
+
payload: they are not retired, and that is the one difference from `update_register_locations`.
|
|
1959
|
+
Sending a field as `null` is no different from omitting it: the `null` is dropped before the
|
|
1960
|
+
request leaves, and wflow ignores an explicit null in any case. To retire a single record, send
|
|
1961
|
+
it with `isValid: false` — and carry that field in every later payload for it, because
|
|
1962
|
+
`isValid` defaults to true and a write that omits it revives the record.
|
|
1963
|
+
|
|
1964
|
+
Fields: on the result —
|
|
1965
|
+
|
|
1966
|
+
- `action` — "patched"
|
|
1967
|
+
- `resource` — "registers/locations"
|
|
1968
|
+
"""
|
|
1969
|
+
await client.request(
|
|
1970
|
+
"PATCH",
|
|
1971
|
+
f"/api/{organization}/registers/locations",
|
|
1972
|
+
json=write_body(locations),
|
|
1973
|
+
)
|
|
1974
|
+
return WriteResult(action="patched", resource="registers/locations")
|
|
1975
|
+
|
|
1976
|
+
|
|
1977
|
+
@operation
|
|
1978
|
+
async def patch_register_measure_units(
|
|
1979
|
+
client: WflowClient, organization: OrgSlug, measureUnits: list[Register]
|
|
1980
|
+
) -> WriteResult:
|
|
1981
|
+
"""Add or update measure unit records, sparing the rest — the units a quantity on a line is counted in.
|
|
1982
|
+
|
|
1983
|
+
Send `id` or `externalId` to identify the unit, or `code` when neither is given, plus the
|
|
1984
|
+
record's other fields. Business items point their `measureUnit` at a record from here, so a
|
|
1985
|
+
`code` you patch here is the code those items refer to. wflow validates each item as a whole
|
|
1986
|
+
record, so a field you omit is reset to its default rather than kept — send the whole record,
|
|
1987
|
+
not just what changed. What a patch does leave alone is the units you keep out of the payload:
|
|
1988
|
+
they are not retired, and that is the one difference from `update_register_measure_units`.
|
|
1989
|
+
Sending a field as `null` is no different from omitting it: the `null` is dropped before the
|
|
1990
|
+
request leaves, and wflow ignores an explicit null in any case. To retire a single record, send
|
|
1991
|
+
it with `isValid: false` — and carry that field in every later payload for it, because
|
|
1992
|
+
`isValid` defaults to true and a write that omits it revives the record.
|
|
1993
|
+
|
|
1994
|
+
Fields: on the result —
|
|
1995
|
+
|
|
1996
|
+
- `action` — "patched"
|
|
1997
|
+
- `resource` — "registers/measureunits"
|
|
1998
|
+
"""
|
|
1999
|
+
await client.request(
|
|
2000
|
+
"PATCH",
|
|
2001
|
+
f"/api/{organization}/registers/measureunits",
|
|
2002
|
+
json=write_body(measureUnits),
|
|
2003
|
+
)
|
|
2004
|
+
return WriteResult(action="patched", resource="registers/measureunits")
|
|
2005
|
+
|
|
2006
|
+
|
|
2007
|
+
@operation
|
|
2008
|
+
async def patch_register_organization_persons(
|
|
2009
|
+
client: WflowClient, organization: OrgSlug, persons: list[OrganizationPerson]
|
|
2010
|
+
) -> WriteResult:
|
|
2011
|
+
"""Add or update records, sparing the rest, for the people who act on the organization's behalf.
|
|
2012
|
+
|
|
2013
|
+
These are the persons a contract or an order is signed, stamped or approved in the name of.
|
|
2014
|
+
They have no `code`: send `id` or `externalId` to identify one, plus the record's other fields
|
|
2015
|
+
— a new `phoneNo`, `mailAddress` or `contractRole` travels with the rest of them. wflow validates each
|
|
2016
|
+
item as a whole record, so a field you omit is reset to its default rather than kept — send the
|
|
2017
|
+
whole record, not just what changed. What a patch does leave alone is the people you keep out
|
|
2018
|
+
of the payload: they are not retired, and that is the one difference from
|
|
2019
|
+
`update_register_organization_persons`. Sending a field as `null` is no different from omitting
|
|
2020
|
+
it: the `null` is dropped before the request leaves, and wflow ignores an explicit null in any
|
|
2021
|
+
case. To retire a single record, send it with `isValid: false` — and carry that field in every
|
|
2022
|
+
later payload for it, because `isValid` defaults to true and a write that omits it revives the
|
|
2023
|
+
record.
|
|
2024
|
+
|
|
2025
|
+
Fields: on the result —
|
|
2026
|
+
|
|
2027
|
+
- `action` — "patched"
|
|
2028
|
+
- `resource` — "registers/organizationpersons"
|
|
2029
|
+
"""
|
|
2030
|
+
await client.request(
|
|
2031
|
+
"PATCH",
|
|
2032
|
+
f"/api/{organization}/registers/organizationpersons",
|
|
2033
|
+
json=write_body(persons),
|
|
2034
|
+
)
|
|
2035
|
+
return WriteResult(action="patched", resource="registers/organizationpersons")
|
|
2036
|
+
|
|
2037
|
+
|
|
2038
|
+
@operation
|
|
2039
|
+
async def patch_register_partner_persons(
|
|
2040
|
+
client: WflowClient, organization: OrgSlug, persons: list[PartnerPersonUpdateC]
|
|
2041
|
+
) -> WriteResult:
|
|
2042
|
+
"""Add or update records, sparing the rest, for the contacts at partner companies.
|
|
2043
|
+
|
|
2044
|
+
The counterparty side of `patch_register_organization_persons`. There is no `code` here either:
|
|
2045
|
+
send `id` or `externalId` to identify the contact, plus the record's other fields — a name, an
|
|
2046
|
+
address, `phoneNo`, `mailAddress`, `language` or `contractRole`. `partner` names the partner
|
|
2047
|
+
the contact belongs to, by that partner's `id` or `externalId`. Send it on every call, not only
|
|
2048
|
+
when moving a contact: a payload omitting it is rejected. wflow validates each item as a
|
|
2049
|
+
whole record,
|
|
2050
|
+
so a field you omit is reset to its default rather than kept — send the whole record, not just
|
|
2051
|
+
what changed. What a patch does leave alone is the contacts you keep out of the payload: they
|
|
2052
|
+
are not retired, and that is the one difference from `update_register_partner_persons`. Sending
|
|
2053
|
+
a field as `null` is no different from omitting it: the `null` is dropped before the request
|
|
2054
|
+
leaves, and wflow ignores an explicit null in any case. To retire a single record, send it with
|
|
2055
|
+
`isValid: false` — and carry that field in every later payload for it, because `isValid`
|
|
2056
|
+
defaults to true and a write that omits it revives the record.
|
|
2057
|
+
|
|
2058
|
+
Fields: on the result —
|
|
2059
|
+
|
|
2060
|
+
- `action` — "patched"
|
|
2061
|
+
- `resource` — "registers/partnerpersons"
|
|
2062
|
+
"""
|
|
2063
|
+
await client.request(
|
|
2064
|
+
"PATCH",
|
|
2065
|
+
f"/api/{organization}/registers/partnerpersons",
|
|
2066
|
+
json=write_body(persons),
|
|
2067
|
+
)
|
|
2068
|
+
return WriteResult(action="patched", resource="registers/partnerpersons")
|
|
2069
|
+
|
|
2070
|
+
|
|
2071
|
+
@operation
|
|
2072
|
+
async def patch_register_payment_methods(
|
|
2073
|
+
client: WflowClient, organization: OrgSlug, paymentMethods: list[PaymentMethods]
|
|
2074
|
+
) -> WriteResult:
|
|
2075
|
+
"""Add or update payment method records, sparing the rest — how a document is settled.
|
|
2076
|
+
|
|
2077
|
+
Send `id` or `externalId` to identify the method, or `code` when neither is given, plus the
|
|
2078
|
+
record's other fields. `kind` ties a method to one document kind, so what an incoming invoice
|
|
2079
|
+
may carry is a separate record from what a cash slip may carry, and each is patched on its own.
|
|
2080
|
+
wflow validates each item as a whole record, so a field you omit is reset to its default rather
|
|
2081
|
+
than kept — send the whole record, not just what changed. What a patch does leave alone is the
|
|
2082
|
+
methods you keep out of the payload: they are not retired, and that is the one difference from
|
|
2083
|
+
`update_register_payment_methods`. Sending a field as `null` is no different from omitting it:
|
|
2084
|
+
the `null` is dropped before the request leaves, and wflow ignores an explicit null in any
|
|
2085
|
+
case. To retire a single record, send it with `isValid: false` — and carry that field in every
|
|
2086
|
+
later payload for it, because `isValid` defaults to true and a write that omits it revives the
|
|
2087
|
+
record.
|
|
2088
|
+
|
|
2089
|
+
Fields: on the result —
|
|
2090
|
+
|
|
2091
|
+
- `action` — "patched"
|
|
2092
|
+
- `resource` — "registers/paymentmethods"
|
|
2093
|
+
"""
|
|
2094
|
+
await client.request(
|
|
2095
|
+
"PATCH",
|
|
2096
|
+
f"/api/{organization}/registers/paymentmethods",
|
|
2097
|
+
json=write_body(paymentMethods),
|
|
2098
|
+
)
|
|
2099
|
+
return WriteResult(action="patched", resource="registers/paymentmethods")
|
|
2100
|
+
|
|
2101
|
+
|
|
2102
|
+
@operation
|
|
2103
|
+
async def patch_register_projects(client: WflowClient, organization: OrgSlug, projects: list[Register]) -> WriteResult:
|
|
2104
|
+
"""Add or update project records, sparing the rest — the bodies of work costs and revenues are attributed to.
|
|
2105
|
+
|
|
2106
|
+
Send `id` or `externalId` to identify the record, or `code` when neither is given, plus the
|
|
2107
|
+
record's other fields. wflow validates each item as a whole record, so a field you omit is
|
|
2108
|
+
reset to its default rather than kept — send the whole record, not just what changed. What a
|
|
2109
|
+
patch does leave alone is the records you keep out of the payload: they are not retired, and
|
|
2110
|
+
that is the one difference from `update_register_projects`. Sending a field as `null` is no
|
|
2111
|
+
different from omitting it: the `null` is dropped before the request leaves, and wflow ignores
|
|
2112
|
+
an explicit null in any case. To retire a single record, send it with `isValid: false` — and
|
|
2113
|
+
carry that field in every later payload for it, because `isValid` defaults to true and a write
|
|
2114
|
+
that omits it revives the record.
|
|
2115
|
+
|
|
2116
|
+
Fields: on the result —
|
|
2117
|
+
|
|
2118
|
+
- `action` — "patched"
|
|
2119
|
+
- `resource` — "registers/projects"
|
|
2120
|
+
"""
|
|
2121
|
+
await client.request(
|
|
2122
|
+
"PATCH",
|
|
2123
|
+
f"/api/{organization}/registers/projects",
|
|
2124
|
+
json=write_body(projects),
|
|
2125
|
+
)
|
|
2126
|
+
return WriteResult(action="patched", resource="registers/projects")
|
|
2127
|
+
|
|
2128
|
+
|
|
2129
|
+
@operation
|
|
2130
|
+
async def patch_register_series(client: WflowClient, organization: OrgSlug, series: list[Serie]) -> WriteResult:
|
|
2131
|
+
"""Add or update numbering series records, sparing the rest — the sequences documents take their numbers from.
|
|
2132
|
+
|
|
2133
|
+
Send `id` or `externalId` to identify the series, or `code` when neither is given, plus the
|
|
2134
|
+
record's other fields. `kind` scopes a series to one document kind and, on invoices,
|
|
2135
|
+
`invoiceType` scopes it further, so tax invoices and credit notes are separate records to
|
|
2136
|
+
patch. wflow validates each item as a whole record, so a field you omit is reset to its default
|
|
2137
|
+
rather than kept — send the whole record, not just what changed. What a patch does leave alone
|
|
2138
|
+
is the series you keep out of the payload: they are not retired, and that is the one difference
|
|
2139
|
+
from `update_register_series`. Sending a field as `null` is no different from omitting it: the
|
|
2140
|
+
`null` is dropped before the request leaves, and wflow ignores an explicit null in any case. To
|
|
2141
|
+
retire a single record, send it with `isValid: false` — and carry that field in every later
|
|
2142
|
+
payload for it, because `isValid` defaults to true and a write that omits it revives the
|
|
2143
|
+
record.
|
|
2144
|
+
|
|
2145
|
+
Fields: on the result —
|
|
2146
|
+
|
|
2147
|
+
- `action` — "patched"
|
|
2148
|
+
- `resource` — "registers/series"
|
|
2149
|
+
"""
|
|
2150
|
+
await client.request(
|
|
2151
|
+
"PATCH",
|
|
2152
|
+
f"/api/{organization}/registers/series",
|
|
2153
|
+
json=write_body(series),
|
|
2154
|
+
)
|
|
2155
|
+
return WriteResult(action="patched", resource="registers/series")
|
|
2156
|
+
|
|
2157
|
+
|
|
2158
|
+
@operation
|
|
2159
|
+
async def patch_register_vat_control_statement_lines(
|
|
2160
|
+
client: WflowClient, organization: OrgSlug, lines: list[Register]
|
|
2161
|
+
) -> WriteResult:
|
|
2162
|
+
"""Add or update VAT control statement line records, sparing the rest — the sections a document is itemised in.
|
|
2163
|
+
|
|
2164
|
+
The control statement reports transactions one by one, which is why its sections are a register
|
|
2165
|
+
of their own alongside `patch_register_vat_return_lines`. Send `id` or `externalId` to identify
|
|
2166
|
+
a section, or `code` when neither is given, plus the record's other fields. wflow validates
|
|
2167
|
+
each item as a whole record, so a field you omit is reset to its default rather than kept —
|
|
2168
|
+
send the whole record, not just what changed. What a patch does leave alone is the sections you
|
|
2169
|
+
keep out of the payload: they are not retired, and that is the one difference from
|
|
2170
|
+
`update_register_vat_control_statement_lines`. Sending a field as `null` is no different from
|
|
2171
|
+
omitting it: the `null` is dropped before the request leaves, and wflow ignores an explicit
|
|
2172
|
+
null in any case. To retire a single record, send it with `isValid: false` — and carry that
|
|
2173
|
+
field in every later payload for it, because `isValid` defaults to true and a write that omits
|
|
2174
|
+
it revives the record.
|
|
2175
|
+
|
|
2176
|
+
Fields: on the result —
|
|
2177
|
+
|
|
2178
|
+
- `action` — "patched"
|
|
2179
|
+
- `resource` — "registers/vatcontrolstatementlines"
|
|
2180
|
+
"""
|
|
2181
|
+
await client.request(
|
|
2182
|
+
"PATCH",
|
|
2183
|
+
f"/api/{organization}/registers/vatcontrolstatementlines",
|
|
2184
|
+
json=write_body(lines),
|
|
2185
|
+
)
|
|
2186
|
+
return WriteResult(action="patched", resource="registers/vatcontrolstatementlines")
|
|
2187
|
+
|
|
2188
|
+
|
|
2189
|
+
@operation
|
|
2190
|
+
async def patch_register_vat_return_lines(
|
|
2191
|
+
client: WflowClient, organization: OrgSlug, lines: list[VATReturnLine]
|
|
2192
|
+
) -> WriteResult:
|
|
2193
|
+
"""Add or update VAT return line records, sparing the rest — the rows a document's tax is reported on.
|
|
2194
|
+
|
|
2195
|
+
Send `id` or `externalId` to identify the line, or `code` when neither is given, plus the
|
|
2196
|
+
record's other fields; `reverseCharge` marks the lines that report tax the recipient accounts
|
|
2197
|
+
for, and sending it `false` is a change, not a clearing. wflow validates each item as a whole
|
|
2198
|
+
record, so a field you omit is reset to its default rather than kept — send the whole record,
|
|
2199
|
+
not just what changed. What a patch does leave alone is the lines you keep out of the payload:
|
|
2200
|
+
they are not retired, and that is the one difference from `update_register_vat_return_lines`.
|
|
2201
|
+
Sending a field as `null` is no different from omitting it: the `null` is dropped before the
|
|
2202
|
+
request leaves, and wflow ignores an explicit null in any case. To retire a single record, send
|
|
2203
|
+
it with `isValid: false` — and carry that field in every later payload for it, because
|
|
2204
|
+
`isValid` defaults to true and a write that omits it revives the record.
|
|
2205
|
+
|
|
2206
|
+
Fields: on the result —
|
|
2207
|
+
|
|
2208
|
+
- `action` — "patched"
|
|
2209
|
+
- `resource` — "registers/vatreturnlines"
|
|
2210
|
+
"""
|
|
2211
|
+
await client.request(
|
|
2212
|
+
"PATCH",
|
|
2213
|
+
f"/api/{organization}/registers/vatreturnlines",
|
|
2214
|
+
json=write_body(lines),
|
|
2215
|
+
)
|
|
2216
|
+
return WriteResult(action="patched", resource="registers/vatreturnlines")
|
|
2217
|
+
|
|
2218
|
+
|
|
2219
|
+
@operation
|
|
2220
|
+
async def patch_register_vat_reverse_charge_codes(
|
|
2221
|
+
client: WflowClient, organization: OrgSlug, codes: list[Register]
|
|
2222
|
+
) -> WriteResult:
|
|
2223
|
+
"""Add or update VAT reverse charge code records, sparing the rest — the codes naming a reverse charge supply.
|
|
2224
|
+
|
|
2225
|
+
Send `id` or `externalId` to identify the record, or `code` — the supply code the law requires
|
|
2226
|
+
on a reverse charge document — when neither is given, plus the record's other fields; restating
|
|
2227
|
+
the supply changes `description`, sent with the rest. wflow validates each item as a whole record, so a field
|
|
2228
|
+
you omit is reset to its default rather than kept — send the whole record, not just what
|
|
2229
|
+
changed. What a patch does leave alone is the codes you keep out of the payload: they are not
|
|
2230
|
+
retired, and that is the one difference from `update_register_vat_reverse_charge_codes`.
|
|
2231
|
+
Sending a field as `null` is no different from omitting it: the `null` is dropped before the
|
|
2232
|
+
request leaves, and wflow ignores an explicit null in any case. To retire a single record, send
|
|
2233
|
+
it with `isValid: false` — and carry that field in every later payload for it, because
|
|
2234
|
+
`isValid` defaults to true and a write that omits it revives the record.
|
|
2235
|
+
|
|
2236
|
+
Fields: on the result —
|
|
2237
|
+
|
|
2238
|
+
- `action` — "patched"
|
|
2239
|
+
- `resource` — "registers/vatreversechargecodes"
|
|
2240
|
+
"""
|
|
2241
|
+
await client.request(
|
|
2242
|
+
"PATCH",
|
|
2243
|
+
f"/api/{organization}/registers/vatreversechargecodes",
|
|
2244
|
+
json=write_body(codes),
|
|
2245
|
+
)
|
|
2246
|
+
return WriteResult(action="patched", resource="registers/vatreversechargecodes")
|
|
2247
|
+
|
|
2248
|
+
|
|
2249
|
+
@operation
|
|
2250
|
+
async def patch_register_vehicles(client: WflowClient, organization: OrgSlug, vehicles: list[Register]) -> WriteResult:
|
|
2251
|
+
"""Add or update vehicle records, sparing the rest — the cars and machines travel and fuel documents name.
|
|
2252
|
+
|
|
2253
|
+
Send `id` or `externalId` to identify the vehicle, or `code` — typically the registration —
|
|
2254
|
+
when neither is given, plus the record's other fields. wflow validates each item as a whole
|
|
2255
|
+
record, so a field you omit is reset to its default rather than kept — send the whole record,
|
|
2256
|
+
not just what changed. What a patch does leave alone is the vehicles you keep out of the
|
|
2257
|
+
payload: they are not retired, and that is the one difference from `update_register_vehicles`.
|
|
2258
|
+
Sending a field as `null` is no different from omitting it: the `null` is dropped before the
|
|
2259
|
+
request leaves, and wflow ignores an explicit null in any case. To retire a single record, send
|
|
2260
|
+
it with `isValid: false` — and carry that field in every later payload for it, because
|
|
2261
|
+
`isValid` defaults to true and a write that omits it revives the record.
|
|
2262
|
+
|
|
2263
|
+
Fields: on the result —
|
|
2264
|
+
|
|
2265
|
+
- `action` — "patched"
|
|
2266
|
+
- `resource` — "registers/vehicles"
|
|
2267
|
+
"""
|
|
2268
|
+
await client.request(
|
|
2269
|
+
"PATCH",
|
|
2270
|
+
f"/api/{organization}/registers/vehicles",
|
|
2271
|
+
json=write_body(vehicles),
|
|
2272
|
+
)
|
|
2273
|
+
return WriteResult(action="patched", resource="registers/vehicles")
|