This page was automatically generated from tracezilla’s Swagger API documentation 2026-09-22
PUT /orders/purchase
Create new purchase order or update existing order by supplier and external reference
Description
Look for an order with the same external reference. If it doesn’t exist create
Request body
Description
Data to store.
Required
This parameter is required.
Request body JSON schema
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
{
"properties": {
"order_header": {
"required": [
"partners",
"ext_ref",
"currency",
"exchange_rate",
"delivery_date",
"pickup_date",
"owned_by_id",
"status"
],
"allOf": [
{
"properties": {
"id": {
"description": "Id of the Order record",
"type": "string",
"format": "uuid",
"readOnly": true,
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"automation": {
"description": "A custom text that can be used for automation purposes",
"type": "string",
"format": "string",
"example": "A string"
},
"availability_date": {
"description": "The date when the goods will be disposable. Must be the same or after *delivery_date*",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"contact_id": {
"description": "Id of the partner contact",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"created_by_id": {
"description": "Id of the user that created the order",
"type": "integer",
"format": "int32",
"readOnly": true,
"example": 1234
},
"currency": {
"description": "ISO 4217 Currency Codes 3 letter currency code",
"type": "string",
"format": "string",
"example": "DKK"
},
"delivery_date": {
"description": "The date when the order will be delivered",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"req_delivery_date": {
"description": "The date when the order was requested to be delivered",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"delivery_term_incoterm": {
"description": "Incoterm on the order.",
"type": "string",
"format": "string",
"enum": [
"Ex Works",
"FCA",
"FAS",
"FOB",
"CFR",
"CIF",
"CPT",
"CIP",
"DAT",
"DAP",
"DDP"
],
"example": "FOB"
},
"delivery_term_text": {
"description": "A standalone delivery term text or a text to displayed with the selected incoterm",
"type": "string",
"format": "string",
"example": "Hamburg"
},
"exchange_rate": {
"description": "Exchange rate. How much it costs to aquire 100 of the forein currency",
"type": "number",
"format": "double",
"example": 100
},
"ext_ref": {
"description": "The order reference of the supplier.\nWhen upserting a purchase order this value will be used to look for any existing purchase orders.\nIt can be a good idea to give this value a supplier prefix to avoid that the the same value is used across two different suppliers.",
"type": "string",
"format": "string",
"example": "CANDYWORLD-123456"
},
"locked": {
"description": "If the order is locked",
"type": "boolean",
"format": "boolean",
"readOnly": true,
"example": true
},
"lock_picking_until_confirmed": {
"description": "If lots can be chosen for the order before it has been confirmed (when it is no longer a draft or a quote)",
"type": "boolean",
"format": "boolean",
"example": true
},
"marking": {
"description": "A marking to be shown with the order",
"type": "string",
"format": "string",
"example": "A string"
},
"number": {
"description": "Auto incrementing number assigned by the system",
"type": "integer",
"format": "int32",
"readOnly": true,
"example": 1234
},
"order_date": {
"description": "The date when the order was placed",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"owned_by_id": {
"description": "Id of the user that owns the order.",
"type": "integer",
"format": "int32",
"example": 1234
},
"payment_date": {
"description": "The due date of the order",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"payment_term_days": {
"description": "Days of credit",
"type": "integer",
"format": "int32",
"example": 1234
},
"payment_term_method": {
"description": "The payment term on the order\n- *days*: Days from the *delivery date* of the order (*pickup date* for *Ex Works* orders)\n- *month_days*: Days from beginning of next month\n- *week_mon_days*: Days from coming week (week starting on mondays)\n- *week_sun_days*: Days from coming week (week starting on sundays)\n- *pia*: Payment in advance - specify a due date\n- *custom*: A due date will need to be specified manualle each time an order or invoice is created",
"type": "string",
"format": "string",
"default": "custom",
"enum": [
"days",
"month_days",
"week_mon_days",
"week_sun_days",
"pia",
"custom"
],
"example": "days"
},
"payment_term_text": {
"description": "Text to use when the *payment_term_method* is set to custom",
"type": "string",
"format": "string",
"example": "A string"
},
"pickup_date": {
"description": "The date when the goods will be picked up",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"posting_date": {
"description": "The posting date of the order",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"recalculate_service_lines": {
"description": "If automatic service lines should be recalculated when the order changes",
"type": "boolean",
"format": "boolean",
"default": true,
"example": true
},
"remark": {
"description": "A remark for the order. Notice that *remark* have to be in the *include* parameter, for this data to be loaded\nwith the request",
"type": "string",
"format": "string",
"example": "A comment on the order"
},
"retrace_finished_at": {
"description": "When the last retracing of lots on the order has finished",
"type": "string",
"format": "date-time",
"readOnly": true,
"example": "2019-01-01T13:25:32.312Z"
},
"retrace_is_needed": {
"description": "If the order should be retraced",
"type": "boolean",
"format": "boolean",
"default": false,
"readOnly": true,
"example": true
},
"retrace_is_running": {
"description": "If the order is currently being retraced",
"type": "boolean",
"format": "boolean",
"readOnly": true,
"example": true
},
"retrace_started_at": {
"description": "When the current retrace was started",
"type": "string",
"format": "date-time",
"readOnly": true,
"example": "2019-01-01T13:25:32.312Z"
},
"source_message_id": {
"description": "Id of the message that this order is created from. Used when the order has arrived from another tracezilla loaded",
"type": "string",
"format": "uuid",
"readOnly": true,
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"status": {
"description": "Status of the order",
"type": "string",
"format": "string",
"enum": [
"from_edi",
"draft",
"quote",
"order"
],
"example": "order"
},
"type": {
"description": "No description is available",
"type": "string",
"format": "string",
"enum": [
"sales"
],
"readOnly": true,
"example": "sales"
},
"partners": {
"description": "Partners\nNotice that these will only be included if *partners* have been passed to the include parameter",
"properties": {
"supplier": {
"description": "The supplier of the order. Required for orders of type: *sales*, *return*",
"properties": {
"partner_id": {
"type": "string",
"format": "uuid"
},
"partner": {
"$ref": "#/components/schemas/Partner"
},
"location_id": {
"type": "string",
"format": "uuid"
},
"location": {
"$ref": "#/components/schemas/PartnerLocation"
}
},
"type": "object"
},
"forwarder": {
"description": "Optional for all order types",
"properties": {
"partner_id": {
"type": "string",
"format": "uuid"
},
"partner": {
"$ref": "#/components/schemas/Partner"
},
"location_id": {
"description": "Location object on order (NOT IN WRITE MCP)",
"type": "string",
"format": "uuid"
},
"location": {
"$ref": "#/components/schemas/PartnerLocation"
}
},
"type": "object"
},
"pickup_from": {
"description": "The pickup location.",
"properties": {
"partner_id": {
"type": "string",
"format": "uuid"
},
"partner": {
"$ref": "#/components/schemas/Partner"
},
"location_id": {
"type": "string",
"format": "uuid"
},
"location": {
"$ref": "#/components/schemas/PartnerLocation"
}
},
"type": "object"
},
"deliver_to": {
"description": "The warehouse that the goods should be delivered to. Required for all order types",
"properties": {
"partner_id": {
"type": "string",
"format": "uuid"
},
"partner": {
"$ref": "#/components/schemas/Partner"
},
"location_id": {
"type": "string",
"format": "uuid"
},
"location": {
"$ref": "#/components/schemas/PartnerLocation"
}
},
"type": "object"
}
},
"type": "object"
},
"tag_ids": {
"description": "Tag ids related to the Order entity.\nNotice that these will only be included if *tags* are included in the include parameter",
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
}
},
"created_at": {
"description": "The time when the record was created in UTC date & time (Iso8601 ZuluString)",
"type": "string",
"format": "date-time",
"readOnly": true,
"example": "2019-01-01T13:25:32.312Z"
},
"updated_at": {
"description": "The time when the record was last updated in UTC date & time (Iso8601 ZuluString)",
"type": "string",
"format": "date-time",
"readOnly": true,
"example": "2020-01-01T13:25:32.312Z"
}
}
},
{
"$ref": "#/components/schemas/Order"
}
]
},
"inbound_lots": {
"type": "array",
"items": {
"required": [
"quantity"
],
"properties": {
"sku_id": {
"description": "Either *sku_id* or *sku_code* must be present! Combination of SKU and traceable must be unique",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"sku_code": {
"description": "Either *sku_id* or *sku_code* must be present!",
"format": "string",
"example": "ABC123"
},
"batch_number": {
"description": "Batch number",
"format": "string",
"example": "ABC123"
},
"expiry_date": {
"description": "Expiry Date",
"type": "string",
"format": "date",
"example": "2030-01-01"
},
"origin_country": {
"description": "The origin country (ISO 3166-1 alpha-2 country code)",
"type": "string",
"format": "country",
"example": "ES"
},
"lot_status": {
"description": "Lot Status",
"type": "string",
"format": "string",
"default": "expected",
"enum": [
"draft",
"expected",
"confirmed",
"minor_defect",
"quarantined",
"damaged"
],
"example": "damaged"
},
"quantity": {
"format": "int32",
"example": 10
},
"line_text": {
"format": "string",
"example": "Needs extra care"
},
"traceable": {
"format": "boolean",
"example": true
},
"unit_price": {
"format": "double",
"example": 20.22
},
"price_per": {
"description": "*stock_unit*: price per UoM, *lot_unit*: price per *lot_unit* ",
"type": "string",
"format": "string",
"enum": [
"stock_unit",
"lot_unit"
],
"example": "stock_unit"
},
"set_default_lot_attributes": {
"description": "If this is set to *true* default lot attributes will be looked up and applied to the lot. Notice that if *lot_attributes* is filled out default attributes will always be looked up as a fallback, regardless of what *set_default_lot_attributes* is set to,",
"type": "boolean",
"format": "boolean",
"default": false,
"example": true
},
"lot_attributes": {
"description": "Array of attributes that should be attached to the lot. Remember that lots are identified by the batch number and only one attribute value for a specific batch will be used",
"type": "array",
"items": {
"properties": {
"attribute_key": {
"description": "The attribute that should be set",
"format": "string",
"example": "vessel_country"
},
"value_ref": {
"description": "Reference code of the attribute value (not needed if *value_text* is present)",
"format": "string",
"example": "NO"
},
"value_text": {
"description": "Attribute value (not needed if *value_ref* is present and the attribute value has already been registered)",
"format": "string",
"example": "Norway"
}
},
"type": "object"
}
},
"lot_traces": {
"description": "Array of traces that should be attached to the lot. The traces are identified by the combination of the key and system - if *ref* is also present, this will also be considered a part of the compund key",
"type": "array",
"items": {
"properties": {
"system": {
"description": "The trace system",
"format": "string",
"example": "container_number"
},
"key": {
"description": "The key of the trace",
"format": "string",
"example": "ABC12345"
},
"key2": {
"description": "Secondary key",
"format": "string",
"example": "DEF6789"
},
"ref": {
"description": "Reference that helps identifiy the type of trace",
"format": "string",
"example": "FAOSUB"
},
"label": {
"description": "Label to put on documents before key",
"format": "string",
"example": "CONTAINER NUMBER"
},
"trace_date": {
"description": "Date to put on trace",
"format": "date",
"example": "2026-12-12"
},
"quantity": {
"description": "Quantity",
"format": "int32",
"example": 200
},
"bring_forward": {
"description": "If the trace should be brought forward to successors of the lot",
"format": "bool",
"example": false
}
},
"type": "object"
}
}
},
"type": "object"
}
},
"service_lines": {
"type": "array",
"items": {
"required": [
"quantity"
],
"properties": {
"service_id": {
"description": "The service line will be linked to a service if *service_id* or *service_ref* is present. Any missing fields on the service line will be taken from the Service.",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"service_ref": {
"description": "See service_id description!",
"format": "string",
"example": "ABC123"
},
"sku_id": {
"description": "The service line will be linked to a sku line if *sku_id* or *sku_code* is present",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"sku_code": {
"description": "See sku_id description",
"type": "string",
"format": "string",
"example": "ABC123"
},
"calculation": {
"description": "How the price should be calculated for the service line",
"type": "string",
"format": "string",
"enum": [
"fixed_price",
"per_unit",
"percentage"
],
"example": "per_unit"
},
"category": {
"description": "The category of the service line",
"type": "string",
"format": "string",
"enum": [
"analysis",
"discount",
"packaging",
"freight",
"labour",
"machinery",
"warehouse",
"financial",
"customs_duty",
"purchase_price",
"production",
"overhead",
"commission",
"taxes",
"other"
],
"example": "discount"
},
"line_text": {
"description": "The text to be shown on order documents",
"format": "string",
"example": "Super supplier discount"
},
"percentage": {
"description": "The percentage to use when *calculation* is set to *percentage*",
"format": "double",
"example": 1234.123
},
"price": {
"description": "The total price of the serviceline. Used then *calculation* is set to *fixed_price*",
"format": "double",
"example": 1234.123
},
"quantity": {
"description": "The quantity when *calculation* is set to *per_unit*",
"format": "double",
"example": 1234.123
},
"unit": {
"description": "The unit to used when the calculation is set to *per_unit*",
"type": "string",
"format": "string",
"enum": [
"pallet",
"pcs",
"hr",
"colli",
"m",
"m2",
"m3",
"kg",
"km"
],
"example": "pcs"
},
"unit_price": {
"description": "The unit price in the *currency* used when the calculation is set to *per_unit*",
"format": "double",
"example": 1234.123
},
"distribution_cost": {
"description": "Cost of distribution. Will create a budget line in local currency.",
"format": "double",
"example": 1234.123
}
},
"type": "object"
}
},
"price_logic": {
"description": "How the price logic should be handled. *suggest* will look for prices in price lists and contracts. *check* will look for prices in price lists and compare them to the given prices. If a difference occurs the order will fail.",
"type": "string",
"format": "string",
"default": "none",
"enum": [
"none",
"suggest",
"check"
],
"example": "none"
},
"post_save_action": {
"description": "Action to perform after the order has been updated/created.",
"type": "string",
"format": "string",
"default": "none",
"enum": [
"none",
"receive"
],
"example": "none"
},
"ignore_order_state": {
"description": "If this is set to true, the current order state will be ignored and changes will be allowed even if the order is confirmed",
"type": "boolean",
"format": "boolean",
"default": false,
"example": true
},
"ignore_missing_skus": {
"description": "Lines with SKU codes that does not exist in the system will be ignored",
"type": "boolean",
"format": "boolean",
"default": false,
"example": true
},
"lookup_partner_relations": {
"description": "If the order should be forced to lookup partner relations for deliver_to-role if these have not been set on the order",
"type": "boolean",
"format": "boolean",
"default": false,
"example": true
},
"apply_discounts": {
"description": "If discounts from the supplier price lists should be applied after creating the order",
"type": "boolean",
"format": "boolean",
"default": false,
"example": true
},
"alternative_order_refs": {
"description": "If this is set to true, the current order state will be ignored and changes will be allowed even if the order is confirmed",
"type": "array",
"items": {
"format": "string",
"example": "SO123"
}
},
"response_include": {
"description": "What to include in the response",
"type": "string",
"format": "string",
"default": "tags,remark,partners",
"example": "tags,remark,partners"
}
},
"type": "object"
}
Responses
200
order was updated
Response content JSON schema
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
{
"properties": {
"required": [
"partners",
"ext_ref",
"currency",
"exchange_rate",
"delivery_date",
"pickup_date",
"owned_by_id",
"status"
],
"allOf": [
{
"properties": {
"id": {
"description": "Id of the Order record",
"type": "string",
"format": "uuid",
"readOnly": true,
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"automation": {
"description": "A custom text that can be used for automation purposes",
"type": "string",
"format": "string",
"example": "A string"
},
"availability_date": {
"description": "The date when the goods will be disposable. Must be the same or after *delivery_date*",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"contact_id": {
"description": "Id of the partner contact",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"created_by_id": {
"description": "Id of the user that created the order",
"type": "integer",
"format": "int32",
"readOnly": true,
"example": 1234
},
"currency": {
"description": "ISO 4217 Currency Codes 3 letter currency code",
"type": "string",
"format": "string",
"example": "DKK"
},
"delivery_date": {
"description": "The date when the order will be delivered",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"req_delivery_date": {
"description": "The date when the order was requested to be delivered",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"delivery_term_incoterm": {
"description": "Incoterm on the order.",
"type": "string",
"format": "string",
"enum": [
"Ex Works",
"FCA",
"FAS",
"FOB",
"CFR",
"CIF",
"CPT",
"CIP",
"DAT",
"DAP",
"DDP"
],
"example": "FOB"
},
"delivery_term_text": {
"description": "A standalone delivery term text or a text to displayed with the selected incoterm",
"type": "string",
"format": "string",
"example": "Hamburg"
},
"exchange_rate": {
"description": "Exchange rate. How much it costs to aquire 100 of the forein currency",
"type": "number",
"format": "double",
"example": 100
},
"ext_ref": {
"description": "The order reference of the supplier.\nWhen upserting a purchase order this value will be used to look for any existing purchase orders.\nIt can be a good idea to give this value a supplier prefix to avoid that the the same value is used across two different suppliers.",
"type": "string",
"format": "string",
"example": "CANDYWORLD-123456"
},
"locked": {
"description": "If the order is locked",
"type": "boolean",
"format": "boolean",
"readOnly": true,
"example": true
},
"lock_picking_until_confirmed": {
"description": "If lots can be chosen for the order before it has been confirmed (when it is no longer a draft or a quote)",
"type": "boolean",
"format": "boolean",
"example": true
},
"marking": {
"description": "A marking to be shown with the order",
"type": "string",
"format": "string",
"example": "A string"
},
"number": {
"description": "Auto incrementing number assigned by the system",
"type": "integer",
"format": "int32",
"readOnly": true,
"example": 1234
},
"order_date": {
"description": "The date when the order was placed",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"owned_by_id": {
"description": "Id of the user that owns the order.",
"type": "integer",
"format": "int32",
"example": 1234
},
"payment_date": {
"description": "The due date of the order",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"payment_term_days": {
"description": "Days of credit",
"type": "integer",
"format": "int32",
"example": 1234
},
"payment_term_method": {
"description": "The payment term on the order\n- *days*: Days from the *delivery date* of the order (*pickup date* for *Ex Works* orders)\n- *month_days*: Days from beginning of next month\n- *week_mon_days*: Days from coming week (week starting on mondays)\n- *week_sun_days*: Days from coming week (week starting on sundays)\n- *pia*: Payment in advance - specify a due date\n- *custom*: A due date will need to be specified manualle each time an order or invoice is created",
"type": "string",
"format": "string",
"default": "custom",
"enum": [
"days",
"month_days",
"week_mon_days",
"week_sun_days",
"pia",
"custom"
],
"example": "days"
},
"payment_term_text": {
"description": "Text to use when the *payment_term_method* is set to custom",
"type": "string",
"format": "string",
"example": "A string"
},
"pickup_date": {
"description": "The date when the goods will be picked up",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"posting_date": {
"description": "The posting date of the order",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"recalculate_service_lines": {
"description": "If automatic service lines should be recalculated when the order changes",
"type": "boolean",
"format": "boolean",
"default": true,
"example": true
},
"remark": {
"description": "A remark for the order. Notice that *remark* have to be in the *include* parameter, for this data to be loaded\nwith the request",
"type": "string",
"format": "string",
"example": "A comment on the order"
},
"retrace_finished_at": {
"description": "When the last retracing of lots on the order has finished",
"type": "string",
"format": "date-time",
"readOnly": true,
"example": "2019-01-01T13:25:32.312Z"
},
"retrace_is_needed": {
"description": "If the order should be retraced",
"type": "boolean",
"format": "boolean",
"default": false,
"readOnly": true,
"example": true
},
"retrace_is_running": {
"description": "If the order is currently being retraced",
"type": "boolean",
"format": "boolean",
"readOnly": true,
"example": true
},
"retrace_started_at": {
"description": "When the current retrace was started",
"type": "string",
"format": "date-time",
"readOnly": true,
"example": "2019-01-01T13:25:32.312Z"
},
"source_message_id": {
"description": "Id of the message that this order is created from. Used when the order has arrived from another tracezilla loaded",
"type": "string",
"format": "uuid",
"readOnly": true,
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"status": {
"description": "Status of the order",
"type": "string",
"format": "string",
"enum": [
"from_edi",
"draft",
"quote",
"order"
],
"example": "order"
},
"type": {
"description": "No description is available",
"type": "string",
"format": "string",
"enum": [
"sales"
],
"readOnly": true,
"example": "sales"
},
"partners": {
"description": "Partners\nNotice that these will only be included if *partners* have been passed to the include parameter",
"properties": {
"supplier": {
"description": "The supplier of the order. Required for orders of type: *sales*, *return*",
"properties": {
"partner_id": {
"type": "string",
"format": "uuid"
},
"partner": {
"$ref": "#/components/schemas/Partner"
},
"location_id": {
"type": "string",
"format": "uuid"
},
"location": {
"$ref": "#/components/schemas/PartnerLocation"
}
},
"type": "object"
},
"forwarder": {
"description": "Optional for all order types",
"properties": {
"partner_id": {
"type": "string",
"format": "uuid"
},
"partner": {
"$ref": "#/components/schemas/Partner"
},
"location_id": {
"description": "Location object on order (NOT IN WRITE MCP)",
"type": "string",
"format": "uuid"
},
"location": {
"$ref": "#/components/schemas/PartnerLocation"
}
},
"type": "object"
},
"pickup_from": {
"description": "The pickup location.",
"properties": {
"partner_id": {
"type": "string",
"format": "uuid"
},
"partner": {
"$ref": "#/components/schemas/Partner"
},
"location_id": {
"type": "string",
"format": "uuid"
},
"location": {
"$ref": "#/components/schemas/PartnerLocation"
}
},
"type": "object"
},
"deliver_to": {
"description": "The warehouse that the goods should be delivered to. Required for all order types",
"properties": {
"partner_id": {
"type": "string",
"format": "uuid"
},
"partner": {
"$ref": "#/components/schemas/Partner"
},
"location_id": {
"type": "string",
"format": "uuid"
},
"location": {
"$ref": "#/components/schemas/PartnerLocation"
}
},
"type": "object"
}
},
"type": "object"
},
"tag_ids": {
"description": "Tag ids related to the Order entity.\nNotice that these will only be included if *tags* are included in the include parameter",
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
}
},
"created_at": {
"description": "The time when the record was created in UTC date & time (Iso8601 ZuluString)",
"type": "string",
"format": "date-time",
"readOnly": true,
"example": "2019-01-01T13:25:32.312Z"
},
"updated_at": {
"description": "The time when the record was last updated in UTC date & time (Iso8601 ZuluString)",
"type": "string",
"format": "date-time",
"readOnly": true,
"example": "2020-01-01T13:25:32.312Z"
}
}
},
{
"$ref": "#/components/schemas/Order"
}
]
},
"type": "object"
}
201
order was created
Response content JSON schema
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
{
"properties": {
"required": [
"partners",
"ext_ref",
"currency",
"exchange_rate",
"delivery_date",
"pickup_date",
"owned_by_id",
"status"
],
"allOf": [
{
"properties": {
"id": {
"description": "Id of the Order record",
"type": "string",
"format": "uuid",
"readOnly": true,
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"automation": {
"description": "A custom text that can be used for automation purposes",
"type": "string",
"format": "string",
"example": "A string"
},
"availability_date": {
"description": "The date when the goods will be disposable. Must be the same or after *delivery_date*",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"contact_id": {
"description": "Id of the partner contact",
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"created_by_id": {
"description": "Id of the user that created the order",
"type": "integer",
"format": "int32",
"readOnly": true,
"example": 1234
},
"currency": {
"description": "ISO 4217 Currency Codes 3 letter currency code",
"type": "string",
"format": "string",
"example": "DKK"
},
"delivery_date": {
"description": "The date when the order will be delivered",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"req_delivery_date": {
"description": "The date when the order was requested to be delivered",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"delivery_term_incoterm": {
"description": "Incoterm on the order.",
"type": "string",
"format": "string",
"enum": [
"Ex Works",
"FCA",
"FAS",
"FOB",
"CFR",
"CIF",
"CPT",
"CIP",
"DAT",
"DAP",
"DDP"
],
"example": "FOB"
},
"delivery_term_text": {
"description": "A standalone delivery term text or a text to displayed with the selected incoterm",
"type": "string",
"format": "string",
"example": "Hamburg"
},
"exchange_rate": {
"description": "Exchange rate. How much it costs to aquire 100 of the forein currency",
"type": "number",
"format": "double",
"example": 100
},
"ext_ref": {
"description": "The order reference of the supplier.\nWhen upserting a purchase order this value will be used to look for any existing purchase orders.\nIt can be a good idea to give this value a supplier prefix to avoid that the the same value is used across two different suppliers.",
"type": "string",
"format": "string",
"example": "CANDYWORLD-123456"
},
"locked": {
"description": "If the order is locked",
"type": "boolean",
"format": "boolean",
"readOnly": true,
"example": true
},
"lock_picking_until_confirmed": {
"description": "If lots can be chosen for the order before it has been confirmed (when it is no longer a draft or a quote)",
"type": "boolean",
"format": "boolean",
"example": true
},
"marking": {
"description": "A marking to be shown with the order",
"type": "string",
"format": "string",
"example": "A string"
},
"number": {
"description": "Auto incrementing number assigned by the system",
"type": "integer",
"format": "int32",
"readOnly": true,
"example": 1234
},
"order_date": {
"description": "The date when the order was placed",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"owned_by_id": {
"description": "Id of the user that owns the order.",
"type": "integer",
"format": "int32",
"example": 1234
},
"payment_date": {
"description": "The due date of the order",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"payment_term_days": {
"description": "Days of credit",
"type": "integer",
"format": "int32",
"example": 1234
},
"payment_term_method": {
"description": "The payment term on the order\n- *days*: Days from the *delivery date* of the order (*pickup date* for *Ex Works* orders)\n- *month_days*: Days from beginning of next month\n- *week_mon_days*: Days from coming week (week starting on mondays)\n- *week_sun_days*: Days from coming week (week starting on sundays)\n- *pia*: Payment in advance - specify a due date\n- *custom*: A due date will need to be specified manualle each time an order or invoice is created",
"type": "string",
"format": "string",
"default": "custom",
"enum": [
"days",
"month_days",
"week_mon_days",
"week_sun_days",
"pia",
"custom"
],
"example": "days"
},
"payment_term_text": {
"description": "Text to use when the *payment_term_method* is set to custom",
"type": "string",
"format": "string",
"example": "A string"
},
"pickup_date": {
"description": "The date when the goods will be picked up",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"posting_date": {
"description": "The posting date of the order",
"type": "string",
"format": "date",
"example": "2019-01-01"
},
"recalculate_service_lines": {
"description": "If automatic service lines should be recalculated when the order changes",
"type": "boolean",
"format": "boolean",
"default": true,
"example": true
},
"remark": {
"description": "A remark for the order. Notice that *remark* have to be in the *include* parameter, for this data to be loaded\nwith the request",
"type": "string",
"format": "string",
"example": "A comment on the order"
},
"retrace_finished_at": {
"description": "When the last retracing of lots on the order has finished",
"type": "string",
"format": "date-time",
"readOnly": true,
"example": "2019-01-01T13:25:32.312Z"
},
"retrace_is_needed": {
"description": "If the order should be retraced",
"type": "boolean",
"format": "boolean",
"default": false,
"readOnly": true,
"example": true
},
"retrace_is_running": {
"description": "If the order is currently being retraced",
"type": "boolean",
"format": "boolean",
"readOnly": true,
"example": true
},
"retrace_started_at": {
"description": "When the current retrace was started",
"type": "string",
"format": "date-time",
"readOnly": true,
"example": "2019-01-01T13:25:32.312Z"
},
"source_message_id": {
"description": "Id of the message that this order is created from. Used when the order has arrived from another tracezilla loaded",
"type": "string",
"format": "uuid",
"readOnly": true,
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
},
"status": {
"description": "Status of the order",
"type": "string",
"format": "string",
"enum": [
"from_edi",
"draft",
"quote",
"order"
],
"example": "order"
},
"type": {
"description": "No description is available",
"type": "string",
"format": "string",
"enum": [
"sales"
],
"readOnly": true,
"example": "sales"
},
"partners": {
"description": "Partners\nNotice that these will only be included if *partners* have been passed to the include parameter",
"properties": {
"supplier": {
"description": "The supplier of the order. Required for orders of type: *sales*, *return*",
"properties": {
"partner_id": {
"type": "string",
"format": "uuid"
},
"partner": {
"$ref": "#/components/schemas/Partner"
},
"location_id": {
"type": "string",
"format": "uuid"
},
"location": {
"$ref": "#/components/schemas/PartnerLocation"
}
},
"type": "object"
},
"forwarder": {
"description": "Optional for all order types",
"properties": {
"partner_id": {
"type": "string",
"format": "uuid"
},
"partner": {
"$ref": "#/components/schemas/Partner"
},
"location_id": {
"description": "Location object on order (NOT IN WRITE MCP)",
"type": "string",
"format": "uuid"
},
"location": {
"$ref": "#/components/schemas/PartnerLocation"
}
},
"type": "object"
},
"pickup_from": {
"description": "The pickup location.",
"properties": {
"partner_id": {
"type": "string",
"format": "uuid"
},
"partner": {
"$ref": "#/components/schemas/Partner"
},
"location_id": {
"type": "string",
"format": "uuid"
},
"location": {
"$ref": "#/components/schemas/PartnerLocation"
}
},
"type": "object"
},
"deliver_to": {
"description": "The warehouse that the goods should be delivered to. Required for all order types",
"properties": {
"partner_id": {
"type": "string",
"format": "uuid"
},
"partner": {
"$ref": "#/components/schemas/Partner"
},
"location_id": {
"type": "string",
"format": "uuid"
},
"location": {
"$ref": "#/components/schemas/PartnerLocation"
}
},
"type": "object"
}
},
"type": "object"
},
"tag_ids": {
"description": "Tag ids related to the Order entity.\nNotice that these will only be included if *tags* are included in the include parameter",
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
}
},
"created_at": {
"description": "The time when the record was created in UTC date & time (Iso8601 ZuluString)",
"type": "string",
"format": "date-time",
"readOnly": true,
"example": "2019-01-01T13:25:32.312Z"
},
"updated_at": {
"description": "The time when the record was last updated in UTC date & time (Iso8601 ZuluString)",
"type": "string",
"format": "date-time",
"readOnly": true,
"example": "2020-01-01T13:25:32.312Z"
}
}
},
{
"$ref": "#/components/schemas/Order"
}
]
},
"type": "object"
}
406
not acceptable
490
The order is currently in a locked state and cannot be updated!
491
{skuCodes} / An available lot for the sku(s) could not be found at the requested pickup date!
492
{skuCodes} / Available inventory for the sku(s) could not be met at the requested pickup date!
493
{skuCodes} / Prices given deviates from prices in price lists!
494
The SKU {skuCode} does not allow the selected operation! (Inactive or missing permission)
500
internal server error