@usethrottle/api-client 2.18.0 → 3.2.0

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.
Files changed (30) hide show
  1. package/dist/generated/services/CartsService.d.ts +12 -0
  2. package/dist/generated/services/CartsService.d.ts.map +1 -1
  3. package/dist/generated/services/CartsService.js.map +1 -1
  4. package/dist/generated/services/CustomersService.d.ts +6 -0
  5. package/dist/generated/services/CustomersService.d.ts.map +1 -1
  6. package/dist/generated/services/CustomersService.js.map +1 -1
  7. package/dist/generated/services/EmbedService.d.ts +5 -0
  8. package/dist/generated/services/EmbedService.d.ts.map +1 -1
  9. package/dist/generated/services/EmbedService.js.map +1 -1
  10. package/dist/generated/services/OrdersService.d.ts +475 -24
  11. package/dist/generated/services/OrdersService.d.ts.map +1 -1
  12. package/dist/generated/services/OrdersService.js +75 -5
  13. package/dist/generated/services/OrdersService.js.map +1 -1
  14. package/dist/generated/services/PaymentsService.d.ts +59 -1
  15. package/dist/generated/services/PaymentsService.d.ts.map +1 -1
  16. package/dist/generated/services/PaymentsService.js +22 -0
  17. package/dist/generated/services/PaymentsService.js.map +1 -1
  18. package/dist/generated/services/SubscriptionsService.d.ts +14 -0
  19. package/dist/generated/services/SubscriptionsService.d.ts.map +1 -1
  20. package/dist/generated/services/SubscriptionsService.js +3 -0
  21. package/dist/generated/services/SubscriptionsService.js.map +1 -1
  22. package/dist/generated/services/WebhooksOutboundService.d.ts +6 -4
  23. package/dist/generated/services/WebhooksOutboundService.d.ts.map +1 -1
  24. package/dist/generated/services/WebhooksOutboundService.js +5 -1
  25. package/dist/generated/services/WebhooksOutboundService.js.map +1 -1
  26. package/package.json +11 -11
  27. package/dist/generated/models/ClientContext.d.ts +0 -25
  28. package/dist/generated/models/ClientContext.d.ts.map +0 -1
  29. package/dist/generated/models/ClientContext.js +0 -2
  30. package/dist/generated/models/ClientContext.js.map +0 -1
@@ -79,6 +79,10 @@ export declare class OrdersService {
79
79
  * Product image. Accepts an absolute http(s) URL or a relative path (e.g. "/images/x.png"); relative paths are resolved against the application storefront base URL (PUT /v1/embed-config { storefrontBaseUrl }, falling back to the first allowedOrigin).
80
80
  */
81
81
  imageUrl?: string;
82
+ /**
83
+ * What this item needs before it counts as delivered. Omit to resolve from `type` and `metadata`. `digital` and `access_grant` are delivered automatically on payment capture; `none` means there is nothing to deliver.
84
+ */
85
+ deliveryMethod?: 'shipment' | 'digital' | 'access_grant' | 'service' | 'in_person' | 'custom' | 'none';
82
86
  /**
83
87
  * Arbitrary key-value metadata
84
88
  */
@@ -91,10 +95,15 @@ export declare class OrdersService {
91
95
  discountId?: string | null;
92
96
  discountCode?: string | null;
93
97
  orderNumber?: string;
94
- status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'completed' | 'cancelled' | 'closed';
98
+ status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed';
99
+ displayStatus?: string;
100
+ fulfillmentSummary?: {
101
+ itemsTotal?: number;
102
+ itemsFulfilled?: number;
103
+ itemsRemaining?: number;
104
+ } | null;
95
105
  type?: 'one_time' | 'recurring' | 'mixed';
96
106
  paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided';
97
- fulfillmentStatus?: 'unfulfilled' | 'partially_fulfilled' | 'fulfilled' | 'not_applicable';
98
107
  source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine';
99
108
  currency?: string;
100
109
  /**
@@ -119,6 +128,13 @@ export declare class OrdersService {
119
128
  * Amount in cents (e.g. 1999 = $19.99)
120
129
  */
121
130
  total?: number;
131
+ /**
132
+ * Amount in cents (e.g. 1999 = $19.99)
133
+ */
134
+ compAmount?: number;
135
+ compReason?: string | null;
136
+ compedAt?: string | null;
137
+ compedBy?: string | null;
122
138
  /**
123
139
  * Arbitrary key-value metadata
124
140
  */
@@ -167,7 +183,11 @@ export declare class OrdersService {
167
183
  email?: string;
168
184
  firstName?: string | null;
169
185
  lastName?: string | null;
186
+ company?: string | null;
170
187
  } | null;
188
+ cancelledAt?: string | null;
189
+ completedAt?: string | null;
190
+ closedAt?: string | null;
171
191
  createdAt?: string;
172
192
  updatedAt?: string;
173
193
  };
@@ -190,22 +210,28 @@ export declare class OrdersService {
190
210
  * @param source
191
211
  * @param q Search order id, number, source, status, or metadata.
192
212
  * @param customerId
213
+ * @param subscriptionId Return only the orders this subscription billed (exact match on the order metadata `subscription_id` pointer). Covers renewals, plan-change charges and the signup order.
193
214
  * @param createdAfter ISO 8601 lower bound on creation time, EXCLUSIVE (created_at > value).
194
215
  * @param createdBefore ISO 8601 upper bound on creation time, EXCLUSIVE (created_at < value).
195
216
  * @returns any Default Response
196
217
  * @throws ApiError
197
218
  */
198
- static getApiV1Orders(xThrottleEnvironmentId?: string, cursor?: string, limit?: number, status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'completed' | 'cancelled' | 'closed', paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided', type?: 'one_time' | 'recurring' | 'mixed', source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine', q?: string, customerId?: string, createdAfter?: string, createdBefore?: string): CancelablePromise<{
219
+ static getApiV1Orders(xThrottleEnvironmentId?: string, cursor?: string, limit?: number, status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed', paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided', type?: 'one_time' | 'recurring' | 'mixed', source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine', q?: string, customerId?: string, subscriptionId?: string, createdAfter?: string, createdBefore?: string): CancelablePromise<{
199
220
  data?: Array<{
200
221
  id?: string;
201
222
  workspaceId?: string;
202
223
  discountId?: string | null;
203
224
  discountCode?: string | null;
204
225
  orderNumber?: string;
205
- status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'completed' | 'cancelled' | 'closed';
226
+ status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed';
227
+ displayStatus?: string;
228
+ fulfillmentSummary?: {
229
+ itemsTotal?: number;
230
+ itemsFulfilled?: number;
231
+ itemsRemaining?: number;
232
+ } | null;
206
233
  type?: 'one_time' | 'recurring' | 'mixed';
207
234
  paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided';
208
- fulfillmentStatus?: 'unfulfilled' | 'partially_fulfilled' | 'fulfilled' | 'not_applicable';
209
235
  source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine';
210
236
  currency?: string;
211
237
  /**
@@ -230,6 +256,13 @@ export declare class OrdersService {
230
256
  * Amount in cents (e.g. 1999 = $19.99)
231
257
  */
232
258
  total?: number;
259
+ /**
260
+ * Amount in cents (e.g. 1999 = $19.99)
261
+ */
262
+ compAmount?: number;
263
+ compReason?: string | null;
264
+ compedAt?: string | null;
265
+ compedBy?: string | null;
233
266
  /**
234
267
  * Arbitrary key-value metadata
235
268
  */
@@ -278,7 +311,11 @@ export declare class OrdersService {
278
311
  email?: string;
279
312
  firstName?: string | null;
280
313
  lastName?: string | null;
314
+ company?: string | null;
281
315
  } | null;
316
+ cancelledAt?: string | null;
317
+ completedAt?: string | null;
318
+ closedAt?: string | null;
282
319
  createdAt?: string;
283
320
  updatedAt?: string;
284
321
  }>;
@@ -311,10 +348,15 @@ export declare class OrdersService {
311
348
  discountId?: string | null;
312
349
  discountCode?: string | null;
313
350
  orderNumber?: string;
314
- status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'completed' | 'cancelled' | 'closed';
351
+ status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed';
352
+ displayStatus?: string;
353
+ fulfillmentSummary?: {
354
+ itemsTotal?: number;
355
+ itemsFulfilled?: number;
356
+ itemsRemaining?: number;
357
+ } | null;
315
358
  type?: 'one_time' | 'recurring' | 'mixed';
316
359
  paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided';
317
- fulfillmentStatus?: 'unfulfilled' | 'partially_fulfilled' | 'fulfilled' | 'not_applicable';
318
360
  source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine';
319
361
  currency?: string;
320
362
  /**
@@ -339,6 +381,13 @@ export declare class OrdersService {
339
381
  * Amount in cents (e.g. 1999 = $19.99)
340
382
  */
341
383
  total?: number;
384
+ /**
385
+ * Amount in cents (e.g. 1999 = $19.99)
386
+ */
387
+ compAmount?: number;
388
+ compReason?: string | null;
389
+ compedAt?: string | null;
390
+ compedBy?: string | null;
342
391
  /**
343
392
  * Arbitrary key-value metadata
344
393
  */
@@ -387,7 +436,11 @@ export declare class OrdersService {
387
436
  email?: string;
388
437
  firstName?: string | null;
389
438
  lastName?: string | null;
439
+ company?: string | null;
390
440
  } | null;
441
+ cancelledAt?: string | null;
442
+ completedAt?: string | null;
443
+ closedAt?: string | null;
391
444
  createdAt?: string;
392
445
  updatedAt?: string;
393
446
  };
@@ -458,10 +511,15 @@ export declare class OrdersService {
458
511
  discountId?: string | null;
459
512
  discountCode?: string | null;
460
513
  orderNumber?: string;
461
- status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'completed' | 'cancelled' | 'closed';
514
+ status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed';
515
+ displayStatus?: string;
516
+ fulfillmentSummary?: {
517
+ itemsTotal?: number;
518
+ itemsFulfilled?: number;
519
+ itemsRemaining?: number;
520
+ } | null;
462
521
  type?: 'one_time' | 'recurring' | 'mixed';
463
522
  paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided';
464
- fulfillmentStatus?: 'unfulfilled' | 'partially_fulfilled' | 'fulfilled' | 'not_applicable';
465
523
  source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine';
466
524
  currency?: string;
467
525
  /**
@@ -486,6 +544,13 @@ export declare class OrdersService {
486
544
  * Amount in cents (e.g. 1999 = $19.99)
487
545
  */
488
546
  total?: number;
547
+ /**
548
+ * Amount in cents (e.g. 1999 = $19.99)
549
+ */
550
+ compAmount?: number;
551
+ compReason?: string | null;
552
+ compedAt?: string | null;
553
+ compedBy?: string | null;
489
554
  /**
490
555
  * Arbitrary key-value metadata
491
556
  */
@@ -534,7 +599,11 @@ export declare class OrdersService {
534
599
  email?: string;
535
600
  firstName?: string | null;
536
601
  lastName?: string | null;
602
+ company?: string | null;
537
603
  } | null;
604
+ cancelledAt?: string | null;
605
+ completedAt?: string | null;
606
+ closedAt?: string | null;
538
607
  createdAt?: string;
539
608
  updatedAt?: string;
540
609
  };
@@ -560,10 +629,15 @@ export declare class OrdersService {
560
629
  discountId?: string | null;
561
630
  discountCode?: string | null;
562
631
  orderNumber?: string;
563
- status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'completed' | 'cancelled' | 'closed';
632
+ status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed';
633
+ displayStatus?: string;
634
+ fulfillmentSummary?: {
635
+ itemsTotal?: number;
636
+ itemsFulfilled?: number;
637
+ itemsRemaining?: number;
638
+ } | null;
564
639
  type?: 'one_time' | 'recurring' | 'mixed';
565
640
  paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided';
566
- fulfillmentStatus?: 'unfulfilled' | 'partially_fulfilled' | 'fulfilled' | 'not_applicable';
567
641
  source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine';
568
642
  currency?: string;
569
643
  /**
@@ -588,6 +662,13 @@ export declare class OrdersService {
588
662
  * Amount in cents (e.g. 1999 = $19.99)
589
663
  */
590
664
  total?: number;
665
+ /**
666
+ * Amount in cents (e.g. 1999 = $19.99)
667
+ */
668
+ compAmount?: number;
669
+ compReason?: string | null;
670
+ compedAt?: string | null;
671
+ compedBy?: string | null;
591
672
  /**
592
673
  * Arbitrary key-value metadata
593
674
  */
@@ -636,7 +717,11 @@ export declare class OrdersService {
636
717
  email?: string;
637
718
  firstName?: string | null;
638
719
  lastName?: string | null;
720
+ company?: string | null;
639
721
  } | null;
722
+ cancelledAt?: string | null;
723
+ completedAt?: string | null;
724
+ closedAt?: string | null;
640
725
  createdAt?: string;
641
726
  updatedAt?: string;
642
727
  };
@@ -665,10 +750,15 @@ export declare class OrdersService {
665
750
  discountId?: string | null;
666
751
  discountCode?: string | null;
667
752
  orderNumber?: string;
668
- status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'completed' | 'cancelled' | 'closed';
753
+ status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed';
754
+ displayStatus?: string;
755
+ fulfillmentSummary?: {
756
+ itemsTotal?: number;
757
+ itemsFulfilled?: number;
758
+ itemsRemaining?: number;
759
+ } | null;
669
760
  type?: 'one_time' | 'recurring' | 'mixed';
670
761
  paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided';
671
- fulfillmentStatus?: 'unfulfilled' | 'partially_fulfilled' | 'fulfilled' | 'not_applicable';
672
762
  source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine';
673
763
  currency?: string;
674
764
  /**
@@ -693,6 +783,13 @@ export declare class OrdersService {
693
783
  * Amount in cents (e.g. 1999 = $19.99)
694
784
  */
695
785
  total?: number;
786
+ /**
787
+ * Amount in cents (e.g. 1999 = $19.99)
788
+ */
789
+ compAmount?: number;
790
+ compReason?: string | null;
791
+ compedAt?: string | null;
792
+ compedBy?: string | null;
696
793
  /**
697
794
  * Arbitrary key-value metadata
698
795
  */
@@ -741,7 +838,11 @@ export declare class OrdersService {
741
838
  email?: string;
742
839
  firstName?: string | null;
743
840
  lastName?: string | null;
841
+ company?: string | null;
744
842
  } | null;
843
+ cancelledAt?: string | null;
844
+ completedAt?: string | null;
845
+ closedAt?: string | null;
745
846
  createdAt?: string;
746
847
  updatedAt?: string;
747
848
  };
@@ -770,10 +871,15 @@ export declare class OrdersService {
770
871
  discountId?: string | null;
771
872
  discountCode?: string | null;
772
873
  orderNumber?: string;
773
- status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'completed' | 'cancelled' | 'closed';
874
+ status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed';
875
+ displayStatus?: string;
876
+ fulfillmentSummary?: {
877
+ itemsTotal?: number;
878
+ itemsFulfilled?: number;
879
+ itemsRemaining?: number;
880
+ } | null;
774
881
  type?: 'one_time' | 'recurring' | 'mixed';
775
882
  paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided';
776
- fulfillmentStatus?: 'unfulfilled' | 'partially_fulfilled' | 'fulfilled' | 'not_applicable';
777
883
  source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine';
778
884
  currency?: string;
779
885
  /**
@@ -798,6 +904,13 @@ export declare class OrdersService {
798
904
  * Amount in cents (e.g. 1999 = $19.99)
799
905
  */
800
906
  total?: number;
907
+ /**
908
+ * Amount in cents (e.g. 1999 = $19.99)
909
+ */
910
+ compAmount?: number;
911
+ compReason?: string | null;
912
+ compedAt?: string | null;
913
+ compedBy?: string | null;
801
914
  /**
802
915
  * Arbitrary key-value metadata
803
916
  */
@@ -846,7 +959,11 @@ export declare class OrdersService {
846
959
  email?: string;
847
960
  firstName?: string | null;
848
961
  lastName?: string | null;
962
+ company?: string | null;
849
963
  } | null;
964
+ cancelledAt?: string | null;
965
+ completedAt?: string | null;
966
+ closedAt?: string | null;
850
967
  createdAt?: string;
851
968
  updatedAt?: string;
852
969
  };
@@ -876,10 +993,15 @@ export declare class OrdersService {
876
993
  discountId?: string | null;
877
994
  discountCode?: string | null;
878
995
  orderNumber?: string;
879
- status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'completed' | 'cancelled' | 'closed';
996
+ status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed';
997
+ displayStatus?: string;
998
+ fulfillmentSummary?: {
999
+ itemsTotal?: number;
1000
+ itemsFulfilled?: number;
1001
+ itemsRemaining?: number;
1002
+ } | null;
880
1003
  type?: 'one_time' | 'recurring' | 'mixed';
881
1004
  paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided';
882
- fulfillmentStatus?: 'unfulfilled' | 'partially_fulfilled' | 'fulfilled' | 'not_applicable';
883
1005
  source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine';
884
1006
  currency?: string;
885
1007
  /**
@@ -904,6 +1026,13 @@ export declare class OrdersService {
904
1026
  * Amount in cents (e.g. 1999 = $19.99)
905
1027
  */
906
1028
  total?: number;
1029
+ /**
1030
+ * Amount in cents (e.g. 1999 = $19.99)
1031
+ */
1032
+ compAmount?: number;
1033
+ compReason?: string | null;
1034
+ compedAt?: string | null;
1035
+ compedBy?: string | null;
907
1036
  /**
908
1037
  * Arbitrary key-value metadata
909
1038
  */
@@ -952,7 +1081,11 @@ export declare class OrdersService {
952
1081
  email?: string;
953
1082
  firstName?: string | null;
954
1083
  lastName?: string | null;
1084
+ company?: string | null;
955
1085
  } | null;
1086
+ cancelledAt?: string | null;
1087
+ completedAt?: string | null;
1088
+ closedAt?: string | null;
956
1089
  createdAt?: string;
957
1090
  updatedAt?: string;
958
1091
  /**
@@ -974,23 +1107,280 @@ export declare class OrdersService {
974
1107
  };
975
1108
  }>;
976
1109
  /**
977
- * Complete an order (processing -> completed)
1110
+ * Move an order to any lifecycle status. Both directions are allowed — this is the merchant override, not a state-machine step. Side effects already applied are never rewound. Moving to `cancelled` additionally requires the `order_cancellations:write` scope and voids the order's live authorizations, exactly as `POST /orders/{id}/cancel` does; captured payments are left alone.
1111
+ * @param id
1112
+ * @param requestBody
1113
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
1114
+ * @returns any Default Response
1115
+ * @throws ApiError
1116
+ */
1117
+ static postApiV1OrdersStatus(id: string, requestBody: {
1118
+ status: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed';
1119
+ reason?: string;
1120
+ }, xThrottleEnvironmentId?: string): CancelablePromise<{
1121
+ data?: {
1122
+ id?: string;
1123
+ workspaceId?: string;
1124
+ discountId?: string | null;
1125
+ discountCode?: string | null;
1126
+ orderNumber?: string;
1127
+ status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed';
1128
+ displayStatus?: string;
1129
+ fulfillmentSummary?: {
1130
+ itemsTotal?: number;
1131
+ itemsFulfilled?: number;
1132
+ itemsRemaining?: number;
1133
+ } | null;
1134
+ type?: 'one_time' | 'recurring' | 'mixed';
1135
+ paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided';
1136
+ source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine';
1137
+ currency?: string;
1138
+ /**
1139
+ * Amount in cents (e.g. 1999 = $19.99)
1140
+ */
1141
+ subtotal?: number;
1142
+ /**
1143
+ * Amount in cents (e.g. 1999 = $19.99)
1144
+ */
1145
+ taxTotal?: number;
1146
+ buyerVatNumber?: string | null;
1147
+ taxReverseCharge?: boolean;
1148
+ /**
1149
+ * Amount in cents (e.g. 1999 = $19.99)
1150
+ */
1151
+ discountTotal?: number;
1152
+ /**
1153
+ * Amount in cents (e.g. 1999 = $19.99)
1154
+ */
1155
+ shippingTotal?: number;
1156
+ /**
1157
+ * Amount in cents (e.g. 1999 = $19.99)
1158
+ */
1159
+ total?: number;
1160
+ /**
1161
+ * Amount in cents (e.g. 1999 = $19.99)
1162
+ */
1163
+ compAmount?: number;
1164
+ compReason?: string | null;
1165
+ compedAt?: string | null;
1166
+ compedBy?: string | null;
1167
+ /**
1168
+ * Arbitrary key-value metadata
1169
+ */
1170
+ metadata?: Record<string, any>;
1171
+ billingAddress?: {
1172
+ firstName?: string;
1173
+ lastName?: string;
1174
+ /**
1175
+ * Optional. Business name for B2B addresses.
1176
+ */
1177
+ company?: string;
1178
+ addressLine1?: string;
1179
+ addressLine2?: string;
1180
+ city?: string;
1181
+ stateProvince?: string;
1182
+ postalCode?: string;
1183
+ /**
1184
+ * ISO 3166-1 alpha-2
1185
+ */
1186
+ countryCode?: string;
1187
+ phone?: string;
1188
+ email?: string;
1189
+ } | null;
1190
+ shippingAddress?: {
1191
+ firstName?: string;
1192
+ lastName?: string;
1193
+ /**
1194
+ * Optional. Business name for B2B addresses.
1195
+ */
1196
+ company?: string;
1197
+ addressLine1?: string;
1198
+ addressLine2?: string;
1199
+ city?: string;
1200
+ stateProvince?: string;
1201
+ postalCode?: string;
1202
+ /**
1203
+ * ISO 3166-1 alpha-2
1204
+ */
1205
+ countryCode?: string;
1206
+ phone?: string;
1207
+ email?: string;
1208
+ } | null;
1209
+ customerId?: string | null;
1210
+ customer?: {
1211
+ id?: string;
1212
+ email?: string;
1213
+ firstName?: string | null;
1214
+ lastName?: string | null;
1215
+ company?: string | null;
1216
+ } | null;
1217
+ cancelledAt?: string | null;
1218
+ completedAt?: string | null;
1219
+ closedAt?: string | null;
1220
+ createdAt?: string;
1221
+ updatedAt?: string;
1222
+ };
1223
+ meta?: {
1224
+ requestId?: string;
1225
+ pagination?: {
1226
+ cursor?: string | null;
1227
+ hasMore?: boolean;
1228
+ };
1229
+ };
1230
+ }>;
1231
+ /**
1232
+ * Write off the order's remaining balance. Money already captured stays captured; the buyer is never charged and no processor is contacted. `compAmount` is set to the balance outstanding and `total` drops by the same amount, so `paymentStatus` settles at `captured` and `displayStatus` reads "… · Comped".
1233
+ * @param id
1234
+ * @param requestBody
1235
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
1236
+ * @returns any Default Response
1237
+ * @throws ApiError
1238
+ */
1239
+ static postApiV1OrdersComp(id: string, requestBody: {
1240
+ reason: string;
1241
+ }, xThrottleEnvironmentId?: string): CancelablePromise<{
1242
+ data?: {
1243
+ id?: string;
1244
+ workspaceId?: string;
1245
+ discountId?: string | null;
1246
+ discountCode?: string | null;
1247
+ orderNumber?: string;
1248
+ status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed';
1249
+ displayStatus?: string;
1250
+ fulfillmentSummary?: {
1251
+ itemsTotal?: number;
1252
+ itemsFulfilled?: number;
1253
+ itemsRemaining?: number;
1254
+ } | null;
1255
+ type?: 'one_time' | 'recurring' | 'mixed';
1256
+ paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided';
1257
+ source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine';
1258
+ currency?: string;
1259
+ /**
1260
+ * Amount in cents (e.g. 1999 = $19.99)
1261
+ */
1262
+ subtotal?: number;
1263
+ /**
1264
+ * Amount in cents (e.g. 1999 = $19.99)
1265
+ */
1266
+ taxTotal?: number;
1267
+ buyerVatNumber?: string | null;
1268
+ taxReverseCharge?: boolean;
1269
+ /**
1270
+ * Amount in cents (e.g. 1999 = $19.99)
1271
+ */
1272
+ discountTotal?: number;
1273
+ /**
1274
+ * Amount in cents (e.g. 1999 = $19.99)
1275
+ */
1276
+ shippingTotal?: number;
1277
+ /**
1278
+ * Amount in cents (e.g. 1999 = $19.99)
1279
+ */
1280
+ total?: number;
1281
+ /**
1282
+ * Amount in cents (e.g. 1999 = $19.99)
1283
+ */
1284
+ compAmount?: number;
1285
+ compReason?: string | null;
1286
+ compedAt?: string | null;
1287
+ compedBy?: string | null;
1288
+ /**
1289
+ * Arbitrary key-value metadata
1290
+ */
1291
+ metadata?: Record<string, any>;
1292
+ billingAddress?: {
1293
+ firstName?: string;
1294
+ lastName?: string;
1295
+ /**
1296
+ * Optional. Business name for B2B addresses.
1297
+ */
1298
+ company?: string;
1299
+ addressLine1?: string;
1300
+ addressLine2?: string;
1301
+ city?: string;
1302
+ stateProvince?: string;
1303
+ postalCode?: string;
1304
+ /**
1305
+ * ISO 3166-1 alpha-2
1306
+ */
1307
+ countryCode?: string;
1308
+ phone?: string;
1309
+ email?: string;
1310
+ } | null;
1311
+ shippingAddress?: {
1312
+ firstName?: string;
1313
+ lastName?: string;
1314
+ /**
1315
+ * Optional. Business name for B2B addresses.
1316
+ */
1317
+ company?: string;
1318
+ addressLine1?: string;
1319
+ addressLine2?: string;
1320
+ city?: string;
1321
+ stateProvince?: string;
1322
+ postalCode?: string;
1323
+ /**
1324
+ * ISO 3166-1 alpha-2
1325
+ */
1326
+ countryCode?: string;
1327
+ phone?: string;
1328
+ email?: string;
1329
+ } | null;
1330
+ customerId?: string | null;
1331
+ customer?: {
1332
+ id?: string;
1333
+ email?: string;
1334
+ firstName?: string | null;
1335
+ lastName?: string | null;
1336
+ company?: string | null;
1337
+ } | null;
1338
+ cancelledAt?: string | null;
1339
+ completedAt?: string | null;
1340
+ closedAt?: string | null;
1341
+ createdAt?: string;
1342
+ updatedAt?: string;
1343
+ /**
1344
+ * Payment settlement performed by the comp: voids of anything still claiming the waived balance — open authorizations, and unpaid Net-N invoices, whose buyers are also emailed. Captured money is never touched. Failures never undo the comp.
1345
+ */
1346
+ paymentActions?: Array<{
1347
+ paymentId?: string;
1348
+ action?: 'void';
1349
+ status?: 'succeeded' | 'failed';
1350
+ error?: string;
1351
+ }>;
1352
+ };
1353
+ meta?: {
1354
+ requestId?: string;
1355
+ pagination?: {
1356
+ cursor?: string | null;
1357
+ hasMore?: boolean;
1358
+ };
1359
+ };
1360
+ }>;
1361
+ /**
1362
+ * Undo a comp. The order owes what it owed again: `compAmount` returns to 0, `total` is restored, and `paymentStatus` falls back out of `captured` on its own. Side effects of the comp are NOT rewound: an authorization voided at the processor cannot be un-voided, so collecting the restored balance needs a new payment, and a tax document voided or returned at the provider needs a manual re-file (`POST /v1/tax-documents/{id}/retry`).
978
1363
  * @param id
979
1364
  * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
980
1365
  * @returns any Default Response
981
1366
  * @throws ApiError
982
1367
  */
983
- static postApiV1OrdersComplete(id: string, xThrottleEnvironmentId?: string): CancelablePromise<{
1368
+ static postApiV1OrdersCompReverse(id: string, xThrottleEnvironmentId?: string): CancelablePromise<{
984
1369
  data?: {
985
1370
  id?: string;
986
1371
  workspaceId?: string;
987
1372
  discountId?: string | null;
988
1373
  discountCode?: string | null;
989
1374
  orderNumber?: string;
990
- status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'completed' | 'cancelled' | 'closed';
1375
+ status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed';
1376
+ displayStatus?: string;
1377
+ fulfillmentSummary?: {
1378
+ itemsTotal?: number;
1379
+ itemsFulfilled?: number;
1380
+ itemsRemaining?: number;
1381
+ } | null;
991
1382
  type?: 'one_time' | 'recurring' | 'mixed';
992
1383
  paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided';
993
- fulfillmentStatus?: 'unfulfilled' | 'partially_fulfilled' | 'fulfilled' | 'not_applicable';
994
1384
  source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine';
995
1385
  currency?: string;
996
1386
  /**
@@ -1015,6 +1405,13 @@ export declare class OrdersService {
1015
1405
  * Amount in cents (e.g. 1999 = $19.99)
1016
1406
  */
1017
1407
  total?: number;
1408
+ /**
1409
+ * Amount in cents (e.g. 1999 = $19.99)
1410
+ */
1411
+ compAmount?: number;
1412
+ compReason?: string | null;
1413
+ compedAt?: string | null;
1414
+ compedBy?: string | null;
1018
1415
  /**
1019
1416
  * Arbitrary key-value metadata
1020
1417
  */
@@ -1063,7 +1460,11 @@ export declare class OrdersService {
1063
1460
  email?: string;
1064
1461
  firstName?: string | null;
1065
1462
  lastName?: string | null;
1463
+ company?: string | null;
1066
1464
  } | null;
1465
+ cancelledAt?: string | null;
1466
+ completedAt?: string | null;
1467
+ closedAt?: string | null;
1067
1468
  createdAt?: string;
1068
1469
  updatedAt?: string;
1069
1470
  };
@@ -1076,7 +1477,33 @@ export declare class OrdersService {
1076
1477
  };
1077
1478
  }>;
1078
1479
  /**
1079
- * Close a completed order
1480
+ * Append-only record of every status change on this order, oldest first.
1481
+ * @param id
1482
+ * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
1483
+ * @returns any Default Response
1484
+ * @throws ApiError
1485
+ */
1486
+ static getApiV1OrdersStatusHistory(id: string, xThrottleEnvironmentId?: string): CancelablePromise<{
1487
+ data?: Array<{
1488
+ id?: string;
1489
+ fromStatus?: string | null;
1490
+ toStatus?: string;
1491
+ actorType?: 'user' | 'system' | 'integration';
1492
+ actorId?: string | null;
1493
+ reason?: string | null;
1494
+ source?: 'manual' | 'state_machine' | 'fulfillment' | 'payment' | 'migration';
1495
+ createdAt?: string;
1496
+ }>;
1497
+ meta?: {
1498
+ requestId?: string;
1499
+ pagination?: {
1500
+ cursor?: string | null;
1501
+ hasMore?: boolean;
1502
+ };
1503
+ };
1504
+ }>;
1505
+ /**
1506
+ * Close a fulfilled order (archive it from active views)
1080
1507
  * @param id
1081
1508
  * @param xThrottleEnvironmentId Optional workspace environment id for dashboard-session, Clerk JWT, and extension-session requests. API keys are already pinned to one workspace environment.
1082
1509
  * @returns any Default Response
@@ -1089,10 +1516,15 @@ export declare class OrdersService {
1089
1516
  discountId?: string | null;
1090
1517
  discountCode?: string | null;
1091
1518
  orderNumber?: string;
1092
- status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'completed' | 'cancelled' | 'closed';
1519
+ status?: 'draft' | 'pending' | 'processing' | 'partially_fulfilled' | 'fulfilled' | 'cancelled' | 'closed';
1520
+ displayStatus?: string;
1521
+ fulfillmentSummary?: {
1522
+ itemsTotal?: number;
1523
+ itemsFulfilled?: number;
1524
+ itemsRemaining?: number;
1525
+ } | null;
1093
1526
  type?: 'one_time' | 'recurring' | 'mixed';
1094
1527
  paymentStatus?: 'pending' | 'authorized' | 'captured' | 'partially_paid' | 'partially_refunded' | 'refunded' | 'failed' | 'voided';
1095
- fulfillmentStatus?: 'unfulfilled' | 'partially_fulfilled' | 'fulfilled' | 'not_applicable';
1096
1528
  source?: 'web' | 'mobile' | 'pos' | 'api' | 'subscription_engine';
1097
1529
  currency?: string;
1098
1530
  /**
@@ -1117,6 +1549,13 @@ export declare class OrdersService {
1117
1549
  * Amount in cents (e.g. 1999 = $19.99)
1118
1550
  */
1119
1551
  total?: number;
1552
+ /**
1553
+ * Amount in cents (e.g. 1999 = $19.99)
1554
+ */
1555
+ compAmount?: number;
1556
+ compReason?: string | null;
1557
+ compedAt?: string | null;
1558
+ compedBy?: string | null;
1120
1559
  /**
1121
1560
  * Arbitrary key-value metadata
1122
1561
  */
@@ -1165,7 +1604,11 @@ export declare class OrdersService {
1165
1604
  email?: string;
1166
1605
  firstName?: string | null;
1167
1606
  lastName?: string | null;
1607
+ company?: string | null;
1168
1608
  } | null;
1609
+ cancelledAt?: string | null;
1610
+ completedAt?: string | null;
1611
+ closedAt?: string | null;
1169
1612
  createdAt?: string;
1170
1613
  updatedAt?: string;
1171
1614
  };
@@ -1246,6 +1689,14 @@ export declare class OrdersService {
1246
1689
  unitPrice: number;
1247
1690
  quantity: number;
1248
1691
  type?: string;
1692
+ /**
1693
+ * What this item needs before it counts as delivered. Omit to resolve from `type` and `metadata`. `digital` and `access_grant` are delivered automatically on payment capture; `none` means there is nothing to deliver.
1694
+ */
1695
+ deliveryMethod?: 'shipment' | 'digital' | 'access_grant' | 'service' | 'in_person' | 'custom' | 'none';
1696
+ /**
1697
+ * Arbitrary key-value metadata
1698
+ */
1699
+ metadata?: Record<string, any>;
1249
1700
  }>;
1250
1701
  update?: Array<{
1251
1702
  lineItemId: string;