-
Notifications
You must be signed in to change notification settings - Fork 0
/
order-edit.ts
1683 lines (1681 loc) · 44.7 KB
/
order-edit.ts
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
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
* Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
* For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
*/
import {
CustomLineItemPriceMode,
ExternalLineItemTotalPrice,
ExternalTaxAmountDraft,
ExternalTaxRateDraft,
ItemShippingDetailsDraft,
RoundingMode,
ShippingRateInputDraft,
TaxCalculationMode,
TaxedPrice,
TaxMode,
TaxPortionDraft,
} from './cart.js'
import { ChannelResourceIdentifier } from './channel.js'
import { BaseResource, CreatedBy, LastModifiedBy, LocalizedString, TypedMoney, _BaseAddress, _Money } from './common.js'
import { CustomerGroupResourceIdentifier } from './customer-group.js'
import { DiscountCodeReference } from './discount-code.js'
import { ErrorObject } from './error.js'
import { MessagePayload } from './message.js'
import {
DeliveryItem,
ItemState,
Order,
OrderReference,
OrderState,
ParcelDraft,
ParcelMeasurements,
PaymentState,
ReturnInfoDraft,
ReturnItemDraft,
ReturnPaymentState,
ReturnShipmentState,
ShipmentState,
StagedOrderUpdateAction,
TrackingData,
} from './order.js'
import { PaymentResourceIdentifier } from './payment.js'
import { ShippingMethodResourceIdentifier, ShippingRateDraft } from './shipping-method.js'
import { ShoppingListResourceIdentifier } from './shopping-list.js'
import { StateResourceIdentifier } from './state.js'
import { TaxCategoryResourceIdentifier } from './tax-category.js'
import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type.js'
export interface OrderEdit extends BaseResource {
/**
* Unique identifier of the OrderEdit.
*
*/
readonly id: string
/**
* The current version of the OrderEdit.
*
*/
readonly version: number
/**
*
*/
readonly createdAt: string
/**
*
*/
readonly lastModifiedAt: string
/**
* Present on resources created after 1 February 2019 except for [events not tracked](/client-logging#events-tracked).
*
*
*/
readonly lastModifiedBy?: LastModifiedBy
/**
* Present on resources created after 1 February 2019 except for [events not tracked](/client-logging#events-tracked).
*
*
*/
readonly createdBy?: CreatedBy
/**
* User-defined unique identifier of the OrderEdit.
*
*/
readonly key?: string
/**
* The order to be updated with this edit.
*
*/
readonly resource: OrderReference
/**
* The actions to apply to the Order.
* Cannot be updated after the edit has been applied.
*
*/
readonly stagedActions: StagedOrderUpdateAction[]
/**
*
*/
readonly custom?: CustomFields
/**
* Contains a preview of the changes in case of unapplied edit.
* For applied edits, it contains the summary of the changes.
*
*/
readonly result: OrderEditResult
/**
* This field can be used to add textual information regarding the edit.
*
*/
readonly comment?: string
}
export interface OrderEditApply {
/**
*
*/
readonly editVersion: number
/**
*
*/
readonly resourceVersion: number
}
export interface OrderEditDraft {
/**
* User-defined unique identifier for the OrderEdit.
*
*/
readonly key?: string
/**
* The order to be updated with this edit.
*
*/
readonly resource: OrderReference
/**
* The actions to apply to `resource`.
*
*/
readonly stagedActions?: StagedOrderUpdateAction[]
/**
* The custom fields.
*
*/
readonly custom?: CustomFieldsDraft
/**
* This field can be used to add additional textual information regarding the edit.
*
*/
readonly comment?: string
/**
* When set to `true` the edit is applied on the Order without persisting it.
*
*/
readonly dryRun?: boolean
}
export interface OrderEditPagedQueryResponse {
/**
* Number of [results requested](/../api/general-concepts#limit).
*
*
*/
readonly limit: number
/**
*
*/
readonly count: number
/**
*
*/
readonly total?: number
/**
* Number of [elements skipped](/../api/general-concepts#offset).
*
*
*/
readonly offset: number
/**
*
*/
readonly results: OrderEdit[]
}
/**
* [Reference](ctp:api:type:Reference) to an [OrderEdit](ctp:api:type:OrderEdit).
*
*/
export interface OrderEditReference {
readonly typeId: 'order-edit'
/**
* Unique identifier of the referenced [OrderEdit](ctp:api:type:OrderEdit).
*
*
*/
readonly id: string
/**
* Contains the representation of the expanded OrderEdit. Only present in responses to requests with [Reference Expansion](/../api/general-concepts#reference-expansion) for OrderEdits.
*
*
*/
readonly obj?: OrderEdit
}
/**
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to an [OrderEdit](ctp:api:type:OrderEdit).
*
*/
export interface OrderEditResourceIdentifier {
readonly typeId: 'order-edit'
/**
* Unique identifier of the referenced [OrderEdit](ctp:api:type:OrderEdit). Either `id` or `key` is required.
*
*
*/
readonly id?: string
/**
* User-defined unique identifier of the referenced [OrderEdit](ctp:api:type:OrderEdit). Either `id` or `key` is required.
*
*
*/
readonly key?: string
}
export type OrderEditResult =
| OrderEditApplied
| OrderEditNotProcessed
| OrderEditPreviewFailure
| OrderEditPreviewSuccess
export interface OrderEditApplied {
readonly type: 'Applied'
/**
*
*/
readonly appliedAt: string
/**
*
*/
readonly excerptBeforeEdit: OrderExcerpt
/**
*
*/
readonly excerptAfterEdit: OrderExcerpt
}
export interface OrderEditNotProcessed {
readonly type: 'NotProcessed'
}
export interface OrderEditPreviewFailure {
readonly type: 'PreviewFailure'
/**
*
*/
readonly errors: ErrorObject[]
}
export interface OrderEditPreviewSuccess {
readonly type: 'PreviewSuccess'
/**
*
*/
readonly preview: StagedOrder
/**
*
*/
readonly messagePayloads: MessagePayload[]
}
export interface OrderEditUpdate {
/**
*
*/
readonly version: number
/**
*
*/
readonly actions: OrderEditUpdateAction[]
/**
*
*/
readonly dryRun?: boolean
}
export type OrderEditUpdateAction =
| OrderEditAddStagedActionAction
| OrderEditSetCommentAction
| OrderEditSetCustomFieldAction
| OrderEditSetCustomTypeAction
| OrderEditSetKeyAction
| OrderEditSetStagedActionsAction
export interface OrderExcerpt {
/**
*
*/
readonly totalPrice: TypedMoney
/**
*
*/
readonly taxedPrice?: TaxedPrice
/**
*
*/
readonly version: number
}
export interface StagedOrder extends Order {}
export interface OrderEditAddStagedActionAction {
readonly action: 'addStagedAction'
/**
*
*/
readonly stagedAction: StagedOrderUpdateAction
}
export interface OrderEditSetCommentAction {
readonly action: 'setComment'
/**
*
*/
readonly comment?: string
}
export interface OrderEditSetCustomFieldAction {
readonly action: 'setCustomField'
/**
* Name of the [Custom Field](/../api/projects/custom-fields).
*
*
*/
readonly name: string
/**
* If `value` is absent or `null`, this field will be removed if it exists.
* Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
* If `value` is provided, it is set for the field defined by `name`.
*
*
*/
readonly value?: any
}
export interface OrderEditSetCustomTypeAction {
readonly action: 'setCustomType'
/**
* Defines the [Type](ctp:api:type:Type) that extends the OrderEdit with [Custom Fields](/../api/projects/custom-fields).
* If absent, any existing Type and Custom Fields are removed from the OrderEdit.
*
*
*/
readonly type?: TypeResourceIdentifier
/**
* Sets the [Custom Fields](/../api/projects/custom-fields) fields for the OrderEdit.
*
*
*/
readonly fields?: FieldContainer
}
export interface OrderEditSetKeyAction {
readonly action: 'setKey'
/**
* If `key` is absent or `null`, this field will be removed if it exists.
*
*/
readonly key?: string
}
export interface OrderEditSetStagedActionsAction {
readonly action: 'setStagedActions'
/**
* The actions to edit the `resource`.
*
*/
readonly stagedActions: StagedOrderUpdateAction[]
}
export interface StagedOrderAddCustomLineItemAction {
readonly action: 'addCustomLineItem'
/**
* Draft type that stores amounts only in cent precision for the specified currency.
*
*
*/
readonly money: _Money
/**
* JSON object where the keys are of type [Locale](ctp:api:type:Locale), and the values are the strings used for the corresponding language.
*
*
*/
readonly name: LocalizedString
/**
*
*/
readonly quantity?: number
/**
*
*/
readonly slug: string
/**
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to a [TaxCategory](ctp:api:type:TaxCategory).
*
*
*/
readonly taxCategory?: TaxCategoryResourceIdentifier
/**
* The representation used when creating or updating a [customizable data type](/../api/projects/types#list-of-customizable-data-types) with Custom Fields.
*
*
*/
readonly custom?: CustomFieldsDraft
/**
* Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in [Cart tax calculation](ctp:api:type:CartTaxCalculation).
*
*
*/
readonly externalTaxRate?: ExternalTaxRateDraft
/**
* - If `Standard`, Cart Discounts with a matching [CartDiscountCustomLineItemsTarget](ctp:api:type:CartDiscountCustomLineItemsTarget)
* are applied to the Custom Line Item.
* - If `External`, Cart Discounts are not considered on the Custom Line Item.
*
*
*/
readonly priceMode?: CustomLineItemPriceMode
}
export interface StagedOrderAddDeliveryAction {
readonly action: 'addDelivery'
/**
*
*/
readonly items?: DeliveryItem[]
/**
* Polymorphic base type that represents a postal address and contact details.
* Depending on the read or write action, it can be either [Address](ctp:api:type:Address) or [AddressDraft](ctp:api:type:AddressDraft) that
* only differ in the data type for the optional `custom` field.
*
*
*/
readonly address?: _BaseAddress
/**
*
*/
readonly parcels?: ParcelDraft[]
/**
* Custom Fields for the Transaction.
*
*/
readonly custom?: CustomFieldsDraft
}
export interface StagedOrderAddDiscountCodeAction {
readonly action: 'addDiscountCode'
/**
*
*/
readonly code: string
}
export interface StagedOrderAddItemShippingAddressAction {
readonly action: 'addItemShippingAddress'
/**
* Polymorphic base type that represents a postal address and contact details.
* Depending on the read or write action, it can be either [Address](ctp:api:type:Address) or [AddressDraft](ctp:api:type:AddressDraft) that
* only differ in the data type for the optional `custom` field.
*
*
*/
readonly address: _BaseAddress
}
export interface StagedOrderAddLineItemAction {
readonly action: 'addLineItem'
/**
* The representation used when creating or updating a [customizable data type](/../api/projects/types#list-of-customizable-data-types) with Custom Fields.
*
*
*/
readonly custom?: CustomFieldsDraft
/**
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to a [Channel](ctp:api:type:Channel).
*
*
*/
readonly distributionChannel?: ChannelResourceIdentifier
/**
* Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in [Cart tax calculation](ctp:api:type:CartTaxCalculation).
*
*
*/
readonly externalTaxRate?: ExternalTaxRateDraft
/**
*
*/
readonly productId?: string
/**
*
*/
readonly variantId?: number
/**
*
*/
readonly sku?: string
/**
*
*/
readonly quantity?: number
/**
*
*/
readonly addedAt?: string
/**
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to a [Channel](ctp:api:type:Channel).
*
*
*/
readonly supplyChannel?: ChannelResourceIdentifier
/**
* Draft type that stores amounts only in cent precision for the specified currency.
*
*
*/
readonly externalPrice?: _Money
/**
*
*/
readonly externalTotalPrice?: ExternalLineItemTotalPrice
/**
* For order creation and updates, the sum of the `targets` must match the quantity of the Line Items or Custom Line Items.
*
*
*/
readonly shippingDetails?: ItemShippingDetailsDraft
}
export interface StagedOrderAddParcelToDeliveryAction {
readonly action: 'addParcelToDelivery'
/**
*
*/
readonly deliveryId: string
/**
*
*/
readonly measurements?: ParcelMeasurements
/**
*
*/
readonly trackingData?: TrackingData
/**
*
*/
readonly items?: DeliveryItem[]
}
export interface StagedOrderAddPaymentAction {
readonly action: 'addPayment'
/**
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) of a [Payment](ctp:api:type:Payment).
*
*
*/
readonly payment: PaymentResourceIdentifier
}
export interface StagedOrderAddReturnInfoAction {
readonly action: 'addReturnInfo'
/**
*
*/
readonly returnTrackingId?: string
/**
*
*/
readonly items: ReturnItemDraft[]
/**
*
*/
readonly returnDate?: string
}
export interface StagedOrderAddShoppingListAction {
readonly action: 'addShoppingList'
/**
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to a [ShoppingList](ctp:api:type:ShoppingList).
*
*
*/
readonly shoppingList: ShoppingListResourceIdentifier
/**
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to a [Channel](ctp:api:type:Channel).
*
*
*/
readonly supplyChannel?: ChannelResourceIdentifier
/**
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to a [Channel](ctp:api:type:Channel).
*
*
*/
readonly distributionChannel?: ChannelResourceIdentifier
}
export interface StagedOrderChangeCustomLineItemMoneyAction {
readonly action: 'changeCustomLineItemMoney'
/**
*
*/
readonly customLineItemId: string
/**
* Draft type that stores amounts only in cent precision for the specified currency.
*
*
*/
readonly money: _Money
}
export interface StagedOrderChangeCustomLineItemQuantityAction {
readonly action: 'changeCustomLineItemQuantity'
/**
*
*/
readonly customLineItemId: string
/**
*
*/
readonly quantity: number
}
export interface StagedOrderChangeLineItemQuantityAction {
readonly action: 'changeLineItemQuantity'
/**
*
*/
readonly lineItemId: string
/**
*
*/
readonly quantity: number
/**
* Draft type that stores amounts only in cent precision for the specified currency.
*
*
*/
readonly externalPrice?: _Money
/**
*
*/
readonly externalTotalPrice?: ExternalLineItemTotalPrice
}
export interface StagedOrderChangeOrderStateAction {
readonly action: 'changeOrderState'
/**
*
*/
readonly orderState: OrderState
}
export interface StagedOrderChangePaymentStateAction {
readonly action: 'changePaymentState'
/**
*
*/
readonly paymentState?: PaymentState
}
export interface StagedOrderChangeShipmentStateAction {
readonly action: 'changeShipmentState'
/**
*
*/
readonly shipmentState?: ShipmentState
}
export interface StagedOrderChangeTaxCalculationModeAction {
readonly action: 'changeTaxCalculationMode'
/**
* Determines in which [Tax calculation mode](/carts-orders-overview#tax-calculation-mode) taxed prices are calculated.
*
*
*/
readonly taxCalculationMode: TaxCalculationMode
}
export interface StagedOrderChangeTaxModeAction {
readonly action: 'changeTaxMode'
/**
* Indicates how taxes are set on the Cart.
*
*
*/
readonly taxMode: TaxMode
}
export interface StagedOrderChangeTaxRoundingModeAction {
readonly action: 'changeTaxRoundingMode'
/**
* Determines how monetary values are rounded.
*
*
*/
readonly taxRoundingMode: RoundingMode
}
export interface StagedOrderImportCustomLineItemStateAction {
readonly action: 'importCustomLineItemState'
/**
*
*/
readonly customLineItemId: string
/**
*
*/
readonly state: ItemState[]
}
export interface StagedOrderImportLineItemStateAction {
readonly action: 'importLineItemState'
/**
*
*/
readonly lineItemId: string
/**
*
*/
readonly state: ItemState[]
}
export interface StagedOrderRemoveCustomLineItemAction {
readonly action: 'removeCustomLineItem'
/**
*
*/
readonly customLineItemId: string
}
export interface StagedOrderRemoveDeliveryAction {
readonly action: 'removeDelivery'
/**
*
*/
readonly deliveryId: string
}
export interface StagedOrderRemoveDiscountCodeAction {
readonly action: 'removeDiscountCode'
/**
* [Reference](ctp:api:type:Reference) to a [DiscountCode](ctp:api:type:DiscountCode).
*
*
*/
readonly discountCode: DiscountCodeReference
}
export interface StagedOrderRemoveItemShippingAddressAction {
readonly action: 'removeItemShippingAddress'
/**
*
*/
readonly addressKey: string
}
export interface StagedOrderRemoveLineItemAction {
readonly action: 'removeLineItem'
/**
*
*/
readonly lineItemId: string
/**
*
*/
readonly quantity?: number
/**
* Draft type that stores amounts only in cent precision for the specified currency.
*
*
*/
readonly externalPrice?: _Money
/**
*
*/
readonly externalTotalPrice?: ExternalLineItemTotalPrice
/**
* For order creation and updates, the sum of the `targets` must match the quantity of the Line Items or Custom Line Items.
*
*
*/
readonly shippingDetailsToRemove?: ItemShippingDetailsDraft
}
export interface StagedOrderRemoveParcelFromDeliveryAction {
readonly action: 'removeParcelFromDelivery'
/**
*
*/
readonly parcelId: string
}
export interface StagedOrderRemovePaymentAction {
readonly action: 'removePayment'
/**
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) of a [Payment](ctp:api:type:Payment).
*
*
*/
readonly payment: PaymentResourceIdentifier
}
export interface StagedOrderSetBillingAddressAction {
readonly action: 'setBillingAddress'
/**
* Polymorphic base type that represents a postal address and contact details.
* Depending on the read or write action, it can be either [Address](ctp:api:type:Address) or [AddressDraft](ctp:api:type:AddressDraft) that
* only differ in the data type for the optional `custom` field.
*
*
*/
readonly address?: _BaseAddress
}
export interface StagedOrderSetBillingAddressCustomFieldAction {
readonly action: 'setBillingAddressCustomField'
/**
* Name of the [Custom Field](/../api/projects/custom-fields).
*
*
*/
readonly name: string
/**
* If `value` is absent or `null`, this field will be removed if it exists.
* Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
* If `value` is provided, it is set for the field defined by `name`.
*
*
*/
readonly value?: any
}
export interface StagedOrderSetBillingAddressCustomTypeAction {
readonly action: 'setBillingAddressCustomType'
/**
* Defines the [Type](ctp:api:type:Type) that extends the `billingAddress` with [Custom Fields](/../api/projects/custom-fields).
* If absent, any existing Type and Custom Fields are removed from the `billingAddress`.
*
*
*/
readonly type?: TypeResourceIdentifier
/**
* Sets the [Custom Fields](/../api/projects/custom-fields) fields for the `billingAddress`.
*
*
*/
readonly fields?: FieldContainer
}
export interface StagedOrderSetCountryAction {
readonly action: 'setCountry'
/**
*
*/
readonly country?: string
}
export interface StagedOrderSetCustomFieldAction {
readonly action: 'setCustomField'
/**
* Name of the [Custom Field](/../api/projects/custom-fields).
*
*
*/
readonly name: string
/**
* If `value` is absent or `null`, this field will be removed if it exists.
* Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
* If `value` is provided, it is set for the field defined by `name`.
*
*
*/
readonly value?: any
}
export interface StagedOrderSetCustomLineItemCustomFieldAction {
readonly action: 'setCustomLineItemCustomField'
/**
*
*/
readonly customLineItemId: string
/**
* Name of the [Custom Field](/../api/projects/custom-fields).
*
*
*/
readonly name: string
/**
* If `value` is absent or `null`, this field will be removed if it exists.
* Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
* If `value` is provided, it is set for the field defined by `name`.
*
*
*/
readonly value?: any
}
export interface StagedOrderSetCustomLineItemCustomTypeAction {
readonly action: 'setCustomLineItemCustomType'
/**
*
*/
readonly customLineItemId: string
/**
* Defines the [Type](ctp:api:type:Type) that extends the CustomLineItem with [Custom Fields](/../api/projects/custom-fields).
* If absent, any existing Type and Custom Fields are removed from the CustomLineItem.
*
*
*/
readonly type?: TypeResourceIdentifier
/**
* Sets the [Custom Fields](/../api/projects/custom-fields) fields for the CustomLineItem.
*
*
*/
readonly fields?: FieldContainer
}
export interface StagedOrderSetCustomLineItemShippingDetailsAction {
readonly action: 'setCustomLineItemShippingDetails'
/**
*
*/
readonly customLineItemId: string
/**
* For order creation and updates, the sum of the `targets` must match the quantity of the Line Items or Custom Line Items.
*
*
*/
readonly shippingDetails?: ItemShippingDetailsDraft
}
export interface StagedOrderSetCustomLineItemTaxAmountAction {
readonly action: 'setCustomLineItemTaxAmount'
/**
*
*/
readonly customLineItemId: string
/**
* Cannot be used in [LineItemDraft](ctp:api:type:LineItemDraft) or [CustomLineItemDraft](ctp:api:type:CustomLineItemDraft).
*
* Can only be set by these update actions:
*
* - [Set LineItem TaxAmount](ctp:api:type:CartSetLineItemTaxAmountAction), [Set CustomLineItem TaxAmount](ctp:api:type:CartSetCustomLineItemTaxAmountAction), or [Set ShippingMethod TaxAmount](ctp:api:type:CartSetShippingMethodTaxAmountAction) on Carts
* - [Set LineItem TaxAmount](ctp:api:type:OrderEditSetLineItemTaxAmountAction), [Set CustomLineItem TaxAmount](ctp:api:type:OrderEditSetCustomLineItemTaxAmountAction), or [Set ShippingMethod TaxAmount](ctp:api:type:OrderEditSetShippingMethodTaxAmountAction) on Order Edits
*
*
*/
readonly externalTaxAmount?: ExternalTaxAmountDraft
}
export interface StagedOrderSetCustomLineItemTaxRateAction {
readonly action: 'setCustomLineItemTaxRate'
/**
*
*/
readonly customLineItemId: string
/**
* Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in [Cart tax calculation](ctp:api:type:CartTaxCalculation).
*
*
*/
readonly externalTaxRate?: ExternalTaxRateDraft
}
export interface StagedOrderSetCustomShippingMethodAction {
readonly action: 'setCustomShippingMethod'
/**
*
*/
readonly shippingMethodName: string
/**
*
*/
readonly shippingRate: ShippingRateDraft
/**
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to a [TaxCategory](ctp:api:type:TaxCategory).
*
*
*/
readonly taxCategory?: TaxCategoryResourceIdentifier
/**
* Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in [Cart tax calculation](ctp:api:type:CartTaxCalculation).
*
*
*/
readonly externalTaxRate?: ExternalTaxRateDraft
}
export interface StagedOrderSetCustomTypeAction {
readonly action: 'setCustomType'
/**
* Defines the [Type](ctp:api:type:Type) that extends the StagedOrder with [Custom Fields](/../api/projects/custom-fields).
* If absent, any existing Type and Custom Fields are removed from the StagedOrder.
*
*
*/
readonly type?: TypeResourceIdentifier
/**
* Sets the [Custom Fields](/../api/projects/custom-fields) fields for the StagedOrder.
*
*
*/
readonly fields?: FieldContainer
}
export interface StagedOrderSetCustomerEmailAction {
readonly action: 'setCustomerEmail'
/**
*
*/
readonly email?: string
}
export interface StagedOrderSetCustomerGroupAction {
readonly action: 'setCustomerGroup'
/**
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to a [CustomerGroup](ctp:api:type:CustomerGroup).
*
*
*/
readonly customerGroup?: CustomerGroupResourceIdentifier
}
export interface StagedOrderSetCustomerIdAction {
readonly action: 'setCustomerId'
/**
*
*/
readonly customerId?: string
}
export interface StagedOrderSetDeliveryAddressAction {
readonly action: 'setDeliveryAddress'
/**
*
*/
readonly deliveryId: string
/**
* Polymorphic base type that represents a postal address and contact details.
* Depending on the read or write action, it can be either [Address](ctp:api:type:Address) or [AddressDraft](ctp:api:type:AddressDraft) that
* only differ in the data type for the optional `custom` field.
*
*
*/
readonly address?: _BaseAddress
}
export interface StagedOrderSetDeliveryAddressCustomFieldAction {
readonly action: 'setDeliveryAddressCustomField'
/**
*
*/
readonly deliveryId: string