@epcc-sdk/sdks-cart-checkout-order 0.0.7 → 0.0.8

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.
package/README.md CHANGED
@@ -208,112 +208,1524 @@ const product = await getACart({
208
208
  ## Available Operations
209
209
 
210
210
 
211
+ ### **`getCarts`**
211
212
 
212
- - **`getCarts`** (`GET /v2/carts`)
213
+ **Endpoint:** `GET /v2/carts`
213
214
 
214
- - **`createACart`** (`POST /v2/carts`)
215
+ **Summary:** Get Shopper Carts
215
216
 
216
- - **`deleteACart`** (`DELETE /v2/carts/{cartID}`)
217
+ **Description:** GET operation
217
218
 
218
- - **`getACart`** (`GET /v2/carts/{cartID}`)
219
+ **TypeScript Example:**
219
220
 
220
- - **`updateACart`** (`PUT /v2/carts/{cartID}`)
221
+ ```typescript
222
+ import { getCarts, type GetCartsData, type GetCartsResponse } from "@epcc-sdk/sdks-cart-checkout-order";
221
223
 
222
- - **`deleteAllCartItems`** (`DELETE /v2/carts/{cartID}/items`)
224
+ const params: GetCartsData = {
225
+ headers: {
226
+ "x-moltin-customer-token": "header-value", // OPTIONAL
227
+ },
228
+ };
229
+
230
+ const result: GetCartsResponse = await getCarts(params);
231
+ ```
232
+
233
+ ---
234
+
235
+ ### **`createACart`**
236
+
237
+ **Endpoint:** `POST /v2/carts`
238
+
239
+ **Summary:** Create a Cart
240
+
241
+ **Description:** POST operation
242
+
243
+ **TypeScript Example:**
244
+
245
+ ```typescript
246
+ import { createACart, type CreateACartData, type CreateACartResponse } from "@epcc-sdk/sdks-cart-checkout-order";
247
+
248
+ const params: CreateACartData = {
249
+ headers: {
250
+ "x-moltin-customer-token": "header-value", // OPTIONAL
251
+ },
252
+ body: {
253
+ data: {
254
+ type: "cart_item",
255
+ quantity: 1,
256
+ sku: "PRODUCT-SKU-001"
257
+ }
258
+ },
259
+ };
260
+
261
+ const result: CreateACartResponse = await createACart(params);
262
+ ```
263
+
264
+ ---
265
+
266
+ ### **`deleteACart`**
267
+
268
+ **Endpoint:** `DELETE /v2/carts/{cartID}`
269
+
270
+ **Summary:** Delete a Cart
271
+
272
+ **Description:** DELETE operation
273
+
274
+ **TypeScript Example:**
275
+
276
+ ```typescript
277
+ import { deleteACart, type DeleteACartData, type DeleteACartResponse } from "@epcc-sdk/sdks-cart-checkout-order";
278
+
279
+ const params: DeleteACartData = {
280
+ path: {
281
+ cartID: "cartID",
282
+ },
283
+ };
284
+
285
+ const result: DeleteACartResponse = await deleteACart(params);
286
+ ```
287
+
288
+ ---
289
+
290
+ ### **`getACart`**
291
+
292
+ **Endpoint:** `GET /v2/carts/{cartID}`
293
+
294
+ **Summary:** Get a Cart
295
+
296
+ **Description:** GET operation
297
+
298
+ **TypeScript Example:**
299
+
300
+ ```typescript
301
+ import { getACart, type GetACartData, type GetACartResponse } from "@epcc-sdk/sdks-cart-checkout-order";
302
+
303
+ const params: GetACartData = {
304
+ path: {
305
+ cartID: "cartID",
306
+ },
307
+ };
308
+
309
+ const result: GetACartResponse = await getACart(params);
310
+ ```
311
+
312
+ ---
313
+
314
+ ### **`updateACart`**
315
+
316
+ **Endpoint:** `PUT /v2/carts/{cartID}`
317
+
318
+ **Summary:** Update a Cart
319
+
320
+ **Description:** PUT operation
321
+
322
+ **TypeScript Example:**
323
+
324
+ ```typescript
325
+ import { updateACart, type UpdateACartData, type UpdateACartResponse } from "@epcc-sdk/sdks-cart-checkout-order";
326
+
327
+ const params: UpdateACartData = {
328
+ path: {
329
+ cartID: "cartID",
330
+ },
331
+ body: {
332
+ data: {
333
+ type: "cart_item",
334
+ quantity: 1,
335
+ sku: "PRODUCT-SKU-001"
336
+ }
337
+ },
338
+ };
339
+
340
+ const result: UpdateACartResponse = await updateACart(params);
341
+ ```
342
+
343
+ ---
344
+
345
+ ### **`deleteAllCartItems`**
346
+
347
+ **Endpoint:** `DELETE /v2/carts/{cartID}/items`
348
+
349
+ **Summary:** Delete all Cart Items
350
+
351
+ **Description:** DELETE operation
352
+
353
+ **TypeScript Example:**
354
+
355
+ ```typescript
356
+ import { deleteAllCartItems, type DeleteAllCartItemsData, type DeleteAllCartItemsResponse } from "@epcc-sdk/sdks-cart-checkout-order";
357
+
358
+ const params: DeleteAllCartItemsData = {
359
+ path: {
360
+ cartID: "cartID",
361
+ },
362
+ };
363
+
364
+ const result: DeleteAllCartItemsResponse = await deleteAllCartItems(params);
365
+ ```
366
+
367
+ ---
368
+
369
+ ### **`getCartItems`**
370
+
371
+ **Endpoint:** `GET /v2/carts/{cartID}/items`
372
+
373
+ **Summary:** Get Cart Items
374
+
375
+ **Description:** GET operation
376
+
377
+ **TypeScript Example:**
378
+
379
+ ```typescript
380
+ import { getCartItems, type GetCartItemsData, type GetCartItemsResponse } from "@epcc-sdk/sdks-cart-checkout-order";
381
+
382
+ const params: GetCartItemsData = {
383
+ path: {
384
+ cartID: "cartID",
385
+ },
386
+ };
387
+
388
+ const result: GetCartItemsResponse = await getCartItems(params);
389
+ ```
390
+
391
+ ---
392
+
393
+ ### **`manageCarts`**
394
+
395
+ **Endpoint:** `POST /v2/carts/{cartID}/items`
396
+
397
+ **Summary:** Add Items to Cart
398
+
399
+ **Description:** POST operation
400
+
401
+ **TypeScript Example:**
402
+
403
+ ```typescript
404
+ import { manageCarts, type ManageCartsData, type ManageCartsResponse } from "@epcc-sdk/sdks-cart-checkout-order";
405
+
406
+ const params: ManageCartsData = {
407
+ path: {
408
+ cartID: "cartID",
409
+ },
410
+ body: {
411
+ data: {
412
+ type: "cart_item",
413
+ quantity: 1,
414
+ sku: "PRODUCT-SKU-001"
415
+ }
416
+ },
417
+ };
418
+
419
+ const result: ManageCartsResponse = await manageCarts(params);
420
+ ```
421
+
422
+ ---
423
+
424
+ ### **`bulkUpdateItemsInCart`**
425
+
426
+ **Endpoint:** `PUT /v2/carts/{cartID}/items`
427
+
428
+ **Summary:** Bulk Update Items in Cart
429
+
430
+ **Description:** PUT operation
431
+
432
+ **TypeScript Example:**
433
+
434
+ ```typescript
435
+ import { bulkUpdateItemsInCart, type BulkUpdateItemsInCartData, type BulkUpdateItemsInCartResponse } from "@epcc-sdk/sdks-cart-checkout-order";
436
+
437
+ const params: BulkUpdateItemsInCartData = {
438
+ path: {
439
+ cartID: "cartID",
440
+ },
441
+ body: {
442
+ data: [
443
+ {
444
+ type: "cart_item",
445
+ quantity: 2,
446
+ sku: "PRODUCT-SKU-001"
447
+ }
448
+ ]
449
+ },
450
+ };
451
+
452
+ const result: BulkUpdateItemsInCartResponse = await bulkUpdateItemsInCart(params);
453
+ ```
454
+
455
+ ---
456
+
457
+ ### **`deleteACartItem`**
458
+
459
+ **Endpoint:** `DELETE /v2/carts/{cartID}/items/{cartitemID}`
460
+
461
+ **Summary:** Delete a Cart Item
462
+
463
+ **Description:** Use this endpoint to delete a cart item.
464
+
465
+ **TypeScript Example:**
466
+
467
+ ```typescript
468
+ import { deleteACartItem, type DeleteACartItemData, type DeleteACartItemResponse } from "@epcc-sdk/sdks-cart-checkout-order";
469
+
470
+ const params: DeleteACartItemData = {
471
+ path: {
472
+ cartID: "cartID",
473
+ cartitemID: "cartitemID",
474
+ },
475
+ };
476
+
477
+ const result: DeleteACartItemResponse = await deleteACartItem(params);
478
+ ```
479
+
480
+ ---
481
+
482
+ ### **`updateACartItem`**
483
+
484
+ **Endpoint:** `PUT /v2/carts/{cartID}/items/{cartitemID}`
485
+
486
+ **Summary:** Update a Cart Item
487
+
488
+ **Description:** You can easily update a cart item. A successful update returns the cart items.
489
+
490
+ **TypeScript Example:**
491
+
492
+ ```typescript
493
+ import { updateACartItem, type UpdateACartItemData, type UpdateACartItemResponse } from "@epcc-sdk/sdks-cart-checkout-order";
494
+
495
+ const params: UpdateACartItemData = {
496
+ path: {
497
+ cartID: "cartID",
498
+ cartitemID: "cartitemID",
499
+ },
500
+ body: {
501
+ data: {
502
+ type: "cart_item",
503
+ quantity: 1,
504
+ sku: "PRODUCT-SKU-001"
505
+ }
506
+ },
507
+ };
508
+
509
+ const result: UpdateACartItemResponse = await updateACartItem(params);
510
+ ```
511
+
512
+ ---
513
+
514
+ ### **`deleteAccountCartAssociation`**
515
+
516
+ **Endpoint:** `DELETE /v2/carts/{cartID}/relationships/accounts`
517
+
518
+ **Summary:** Delete Account Cart Association
519
+
520
+ **Description:** You can delete an association between an account and a cart.
521
+
522
+ **TypeScript Example:**
523
+
524
+ ```typescript
525
+ import { deleteAccountCartAssociation, type DeleteAccountCartAssociationData, type DeleteAccountCartAssociationResponse } from "@epcc-sdk/sdks-cart-checkout-order";
526
+
527
+ const params: DeleteAccountCartAssociationData = {
528
+ path: {
529
+ cartID: "cartID",
530
+ },
531
+ };
532
+
533
+ const result: DeleteAccountCartAssociationResponse = await deleteAccountCartAssociation(params);
534
+ ```
535
+
536
+ ---
537
+
538
+ ### **`createAccountCartAssociation`**
539
+
540
+ **Endpoint:** `POST /v2/carts/{cartID}/relationships/accounts`
541
+
542
+ **Summary:** Create an Account Cart Association
543
+
544
+ **Description:** POST operation
545
+
546
+ **TypeScript Example:**
547
+
548
+ ```typescript
549
+ import { createAccountCartAssociation, type CreateAccountCartAssociationData, type CreateAccountCartAssociationResponse } from "@epcc-sdk/sdks-cart-checkout-order";
550
+
551
+ const params: CreateAccountCartAssociationData = {
552
+ path: {
553
+ cartID: "cartID",
554
+ },
555
+ body: {
556
+ data: {
557
+ type: "cart_item",
558
+ quantity: 1,
559
+ sku: "PRODUCT-SKU-001"
560
+ }
561
+ },
562
+ };
563
+
564
+ const result: CreateAccountCartAssociationResponse = await createAccountCartAssociation(params);
565
+ ```
566
+
567
+ ---
568
+
569
+ ### **`deleteCustomerCartAssociation`**
570
+
571
+ **Endpoint:** `DELETE /v2/carts/{cartID}/relationships/customers`
572
+
573
+ **Summary:** Delete Customer Cart Association
574
+
575
+ **Description:** You can delete an association between a customer and a cart.
576
+
577
+ **TypeScript Example:**
578
+
579
+ ```typescript
580
+ import { deleteCustomerCartAssociation, type DeleteCustomerCartAssociationData, type DeleteCustomerCartAssociationResponse } from "@epcc-sdk/sdks-cart-checkout-order";
581
+
582
+ const params: DeleteCustomerCartAssociationData = {
583
+ path: {
584
+ cartID: "cartID",
585
+ },
586
+ headers: {
587
+ "x-moltin-customer-token": "header-value", // OPTIONAL
588
+ },
589
+ };
590
+
591
+ const result: DeleteCustomerCartAssociationResponse = await deleteCustomerCartAssociation(params);
592
+ ```
593
+
594
+ ---
595
+
596
+ ### **`createCustomerCartAssociation`**
597
+
598
+ **Endpoint:** `POST /v2/carts/{cartID}/relationships/customers`
599
+
600
+ **Summary:** Create a Customer Cart Association
601
+
602
+ **Description:** POST operation
603
+
604
+ **TypeScript Example:**
605
+
606
+ ```typescript
607
+ import { createCustomerCartAssociation, type CreateCustomerCartAssociationData, type CreateCustomerCartAssociationResponse } from "@epcc-sdk/sdks-cart-checkout-order";
608
+
609
+ const params: CreateCustomerCartAssociationData = {
610
+ path: {
611
+ cartID: "cartID",
612
+ },
613
+ headers: {
614
+ "x-moltin-customer-token": "header-value", // OPTIONAL
615
+ },
616
+ body: {
617
+ data: {
618
+ type: "cart_item",
619
+ quantity: 1,
620
+ sku: "PRODUCT-SKU-001"
621
+ }
622
+ },
623
+ };
624
+
625
+ const result: CreateCustomerCartAssociationResponse = await createCustomerCartAssociation(params);
626
+ ```
627
+
628
+ ---
629
+
630
+ ### **`deleteAPromotionViaPromotionCode`**
631
+
632
+ **Endpoint:** `DELETE /v2/carts/{cartID}/discounts/{promoCode}`
633
+
634
+ **Summary:** Delete a Promotion via Promotion Code
635
+
636
+ **Description:** You can remove promotion code from a cart if it was applied manually. This endpoint does not work if the promotion is applied automatically.
637
+
638
+ **TypeScript Example:**
639
+
640
+ ```typescript
641
+ import { deleteAPromotionViaPromotionCode, type DeleteAPromotionViaPromotionCodeData, type DeleteAPromotionViaPromotionCodeResponse } from "@epcc-sdk/sdks-cart-checkout-order";
642
+
643
+ const params: DeleteAPromotionViaPromotionCodeData = {
644
+ path: {
645
+ cartID: "cartID",
646
+ promoCode: "promoCode",
647
+ },
648
+ };
649
+
650
+ const result: DeleteAPromotionViaPromotionCodeResponse = await deleteAPromotionViaPromotionCode(params);
651
+ ```
652
+
653
+ ---
654
+
655
+ ### **`addTaxItemToCart`**
656
+
657
+ **Endpoint:** `POST /v2/carts/{cartID}/items/{cartitemID}/taxes`
658
+
659
+ **Summary:** Add Tax Item to Cart
660
+
661
+ **Description:**
662
+ Use this endpoint to add a tax item to a cart.
663
+
664
+ :::note
665
+
666
+ There is a soft limit of 5 unique tax items per cart item at any one time.
667
+
668
+ :::
669
+
670
+
671
+ **TypeScript Example:**
672
+
673
+ ```typescript
674
+ import { addTaxItemToCart, type AddTaxItemToCartData, type AddTaxItemToCartResponse } from "@epcc-sdk/sdks-cart-checkout-order";
675
+
676
+ const params: AddTaxItemToCartData = {
677
+ path: {
678
+ cartID: "cartID",
679
+ cartitemID: "cartitemID",
680
+ },
681
+ body: {
682
+ data: {
683
+ type: "custom_discount",
684
+ name: "Discount Name",
685
+ amount: {
686
+ amount: 1000,
687
+ currency: "USD"
688
+ }
689
+ }
690
+ },
691
+ };
692
+
693
+ const result: AddTaxItemToCartResponse = await addTaxItemToCart(params);
694
+ ```
695
+
696
+ ---
697
+
698
+ ### **`bulkDeleteTaxItemsFromCart`**
699
+
700
+ **Endpoint:** `DELETE /v2/carts/{cartID}/taxes`
701
+
702
+ **Summary:** Bulk Delete Tax Items from Cart
703
+
704
+ **Description:** Use this endpoint to bulk delete tax items from cart.
705
+
706
+ **TypeScript Example:**
707
+
708
+ ```typescript
709
+ import { bulkDeleteTaxItemsFromCart, type BulkDeleteTaxItemsFromCartData, type BulkDeleteTaxItemsFromCartResponse } from "@epcc-sdk/sdks-cart-checkout-order";
710
+
711
+ const params: BulkDeleteTaxItemsFromCartData = {
712
+ path: {
713
+ cartID: "cartID",
714
+ },
715
+ };
716
+
717
+ const result: BulkDeleteTaxItemsFromCartResponse = await bulkDeleteTaxItemsFromCart(params);
718
+ ```
719
+
720
+ ---
721
+
722
+ ### **`bulkAddTaxItemsToCart`**
723
+
724
+ **Endpoint:** `POST /v2/carts/{cartID}/taxes`
725
+
726
+ **Summary:** Bulk Add Tax Items to Cart
727
+
728
+ **Description:** POST operation
729
+
730
+ **TypeScript Example:**
731
+
732
+ ```typescript
733
+ import { bulkAddTaxItemsToCart, type BulkAddTaxItemsToCartData, type BulkAddTaxItemsToCartResponse } from "@epcc-sdk/sdks-cart-checkout-order";
734
+
735
+ const params: BulkAddTaxItemsToCartData = {
736
+ path: {
737
+ cartID: "cartID",
738
+ },
739
+ body: {
740
+ data: [
741
+ {
742
+ type: "cart_item",
743
+ quantity: 2,
744
+ sku: "PRODUCT-SKU-001"
745
+ }
746
+ ]
747
+ },
748
+ };
749
+
750
+ const result: BulkAddTaxItemsToCartResponse = await bulkAddTaxItemsToCart(params);
751
+ ```
752
+
753
+ ---
754
+
755
+ ### **`deleteATaxItem`**
756
+
757
+ **Endpoint:** `DELETE /v2/carts/{cartID}/items/{cartitemID}/taxes/{taxitemID}`
758
+
759
+ **Summary:** Delete a Tax Item
760
+
761
+ **Description:** Use this endpoint to delete a tax item.
762
+
763
+ **TypeScript Example:**
764
+
765
+ ```typescript
766
+ import { deleteATaxItem, type DeleteATaxItemData, type DeleteATaxItemResponse } from "@epcc-sdk/sdks-cart-checkout-order";
767
+
768
+ const params: DeleteATaxItemData = {
769
+ path: {
770
+ cartID: "cartID",
771
+ cartitemID: "cartitemID",
772
+ taxitemID: "taxitemID",
773
+ },
774
+ };
775
+
776
+ const result: DeleteATaxItemResponse = await deleteATaxItem(params);
777
+ ```
778
+
779
+ ---
780
+
781
+ ### **`updateATaxItem`**
782
+
783
+ **Endpoint:** `PUT /v2/carts/{cartID}/items/{cartitemID}/taxes/{taxitemID}`
784
+
785
+ **Summary:** Update a Tax Item
786
+
787
+ **Description:** Use this endpoint to update a tax item. To change tax value from `rate` to `amount`, set `rate` to `null`, then set `amount` value and vice versa.
788
+
789
+ **TypeScript Example:**
790
+
791
+ ```typescript
792
+ import { updateATaxItem, type UpdateATaxItemData, type UpdateATaxItemResponse } from "@epcc-sdk/sdks-cart-checkout-order";
793
+
794
+ const params: UpdateATaxItemData = {
795
+ path: {
796
+ cartID: "cartID",
797
+ cartitemID: "cartitemID",
798
+ taxitemID: "taxitemID",
799
+ },
800
+ body: {
801
+ data: {
802
+ type: "resource",
803
+ attributes: {
804
+ name: "Resource Name",
805
+ description: "Resource Description"
806
+ }
807
+ }
808
+ },
809
+ };
810
+
811
+ const result: UpdateATaxItemResponse = await updateATaxItem(params);
812
+ ```
813
+
814
+ ---
815
+
816
+ ### **`bulkDeleteCustomDiscountsFromCart`**
817
+
818
+ **Endpoint:** `DELETE /v2/carts/{cartID}/custom-discounts`
819
+
820
+ **Summary:** Bulk Delete Custom Discounts From Cart
821
+
822
+ **Description:** Use this endpoint to bulk delete custom discounts from cart.
823
+
824
+ **TypeScript Example:**
825
+
826
+ ```typescript
827
+ import { bulkDeleteCustomDiscountsFromCart, type BulkDeleteCustomDiscountsFromCartData, type BulkDeleteCustomDiscountsFromCartResponse } from "@epcc-sdk/sdks-cart-checkout-order";
828
+
829
+ const params: BulkDeleteCustomDiscountsFromCartData = {
830
+ path: {
831
+ cartID: "cartID",
832
+ },
833
+ };
834
+
835
+ const result: BulkDeleteCustomDiscountsFromCartResponse = await bulkDeleteCustomDiscountsFromCart(params);
836
+ ```
837
+
838
+ ---
839
+
840
+ ### **`bulkAddCustomDiscountsToCart`**
841
+
842
+ **Endpoint:** `POST /v2/carts/{cartID}/custom-discounts`
843
+
844
+ **Summary:** Bulk Add Custom Discounts to Cart
845
+
846
+ **Description:** POST operation
847
+
848
+ **TypeScript Example:**
849
+
850
+ ```typescript
851
+ import { bulkAddCustomDiscountsToCart, type BulkAddCustomDiscountsToCartData, type BulkAddCustomDiscountsToCartResponse } from "@epcc-sdk/sdks-cart-checkout-order";
852
+
853
+ const params: BulkAddCustomDiscountsToCartData = {
854
+ path: {
855
+ cartID: "cartID",
856
+ },
857
+ body: {
858
+ data: [
859
+ {
860
+ type: "cart_item",
861
+ quantity: 2,
862
+ sku: "PRODUCT-SKU-001"
863
+ }
864
+ ]
865
+ },
866
+ };
867
+
868
+ const result: BulkAddCustomDiscountsToCartResponse = await bulkAddCustomDiscountsToCart(params);
869
+ ```
870
+
871
+ ---
872
+
873
+ ### **`deleteCustomDiscountFromCart`**
874
+
875
+ **Endpoint:** `DELETE /v2/carts/{cartID}/custom-discounts/{customdiscountID}`
876
+
877
+ **Summary:** Delete Custom Discount From Cart
878
+
879
+ **Description:** Use this endpoint to delete custom discount from cart.
880
+
881
+ **TypeScript Example:**
882
+
883
+ ```typescript
884
+ import { deleteCustomDiscountFromCart, type DeleteCustomDiscountFromCartData, type DeleteCustomDiscountFromCartResponse } from "@epcc-sdk/sdks-cart-checkout-order";
885
+
886
+ const params: DeleteCustomDiscountFromCartData = {
887
+ path: {
888
+ cartID: "cartID",
889
+ customdiscountID: "customdiscountID",
890
+ },
891
+ };
892
+
893
+ const result: DeleteCustomDiscountFromCartResponse = await deleteCustomDiscountFromCart(params);
894
+ ```
895
+
896
+ ---
897
+
898
+ ### **`updateCustomDiscountForCart`**
899
+
900
+ **Endpoint:** `PUT /v2/carts/{cartID}/custom-discounts/{customdiscountID}`
901
+
902
+ **Summary:** Update Custom Discount For Cart
903
+
904
+ **Description:** Use this endpoint to update a custom discount in your cart.
905
+
906
+ **TypeScript Example:**
907
+
908
+ ```typescript
909
+ import { updateCustomDiscountForCart, type UpdateCustomDiscountForCartData, type UpdateCustomDiscountForCartResponse } from "@epcc-sdk/sdks-cart-checkout-order";
910
+
911
+ const params: UpdateCustomDiscountForCartData = {
912
+ path: {
913
+ cartID: "cartID",
914
+ customdiscountID: "customdiscountID",
915
+ },
916
+ body: {
917
+ data: {
918
+ type: "cart_item",
919
+ quantity: 1,
920
+ sku: "PRODUCT-SKU-001"
921
+ }
922
+ },
923
+ };
924
+
925
+ const result: UpdateCustomDiscountForCartResponse = await updateCustomDiscountForCart(params);
926
+ ```
927
+
928
+ ---
929
+
930
+ ### **`addCustomDiscountToCartItem`**
931
+
932
+ **Endpoint:** `POST /v2/carts/{cartID}/items/{cartitemID}/custom-discounts`
933
+
934
+ **Summary:** Add Custom Discount To Cart Item
935
+
936
+ **Description:** Use this endpoint to add a custom discount to cart item.
937
+
938
+ **TypeScript Example:**
939
+
940
+ ```typescript
941
+ import { addCustomDiscountToCartItem, type AddCustomDiscountToCartItemData, type AddCustomDiscountToCartItemResponse } from "@epcc-sdk/sdks-cart-checkout-order";
942
+
943
+ const params: AddCustomDiscountToCartItemData = {
944
+ path: {
945
+ cartID: "cartID",
946
+ cartitemID: "cartitemID",
947
+ },
948
+ body: {
949
+ data: {
950
+ type: "custom_discount",
951
+ name: "Discount Name",
952
+ amount: {
953
+ amount: 1000,
954
+ currency: "USD"
955
+ }
956
+ }
957
+ },
958
+ };
959
+
960
+ const result: AddCustomDiscountToCartItemResponse = await addCustomDiscountToCartItem(params);
961
+ ```
962
+
963
+ ---
964
+
965
+ ### **`deleteCustomDiscountFromCartItem`**
966
+
967
+ **Endpoint:** `DELETE /v2/carts/{cartID}/items/{cartitemID}/custom-discounts/{customdiscountID}`
968
+
969
+ **Summary:** Delete Custom Discount From Cart Item
970
+
971
+ **Description:** Use this endpoint to delete custom discount from cart item.
972
+
973
+ **TypeScript Example:**
974
+
975
+ ```typescript
976
+ import { deleteCustomDiscountFromCartItem, type DeleteCustomDiscountFromCartItemData, type DeleteCustomDiscountFromCartItemResponse } from "@epcc-sdk/sdks-cart-checkout-order";
977
+
978
+ const params: DeleteCustomDiscountFromCartItemData = {
979
+ path: {
980
+ cartID: "cartID",
981
+ cartitemID: "cartitemID",
982
+ customdiscountID: "customdiscountID",
983
+ },
984
+ };
985
+
986
+ const result: DeleteCustomDiscountFromCartItemResponse = await deleteCustomDiscountFromCartItem(params);
987
+ ```
988
+
989
+ ---
990
+
991
+ ### **`updateCustomDiscountForCartItem`**
992
+
993
+ **Endpoint:** `PUT /v2/carts/{cartID}/items/{cartitemID}/custom-discounts/{customdiscountID}`
994
+
995
+ **Summary:** Update Custom Discount For Cart Item
996
+
997
+ **Description:** Use this endpoint to update a custom discount in your cart item.
998
+
999
+ **TypeScript Example:**
1000
+
1001
+ ```typescript
1002
+ import { updateCustomDiscountForCartItem, type UpdateCustomDiscountForCartItemData, type UpdateCustomDiscountForCartItemResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1003
+
1004
+ const params: UpdateCustomDiscountForCartItemData = {
1005
+ path: {
1006
+ cartID: "cartID",
1007
+ cartitemID: "cartitemID",
1008
+ customdiscountID: "customdiscountID",
1009
+ },
1010
+ body: {
1011
+ data: {
1012
+ type: "cart_item",
1013
+ quantity: 1,
1014
+ sku: "PRODUCT-SKU-001"
1015
+ }
1016
+ },
1017
+ };
1018
+
1019
+ const result: UpdateCustomDiscountForCartItemResponse = await updateCustomDiscountForCartItem(params);
1020
+ ```
1021
+
1022
+ ---
1023
+
1024
+ ### **`getShippingGroups`**
1025
+
1026
+ **Endpoint:** `GET /v2/carts/{cartID}/shipping-groups`
1027
+
1028
+ **Summary:** Retrieve all shipping groups for a cart
1029
+
1030
+ **Description:** Retrieve all shipping groups for a cart
1031
+
1032
+ **TypeScript Example:**
1033
+
1034
+ ```typescript
1035
+ import { getShippingGroups, type GetShippingGroupsData, type GetShippingGroupsResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1036
+
1037
+ const params: GetShippingGroupsData = {
1038
+ path: {
1039
+ cartID: "cartID",
1040
+ },
1041
+ };
1042
+
1043
+ const result: GetShippingGroupsResponse = await getShippingGroups(params);
1044
+ ```
1045
+
1046
+ ---
1047
+
1048
+ ### **`createShippingGroup`**
1049
+
1050
+ **Endpoint:** `POST /v2/carts/{cartID}/shipping-groups`
1051
+
1052
+ **Summary:** Create a new shipping group for a cart
1053
+
1054
+ **Description:** Create a new shipping group for a cart
1055
+
1056
+ **TypeScript Example:**
1057
+
1058
+ ```typescript
1059
+ import { createShippingGroup, type CreateShippingGroupData, type CreateShippingGroupResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1060
+
1061
+ const params: CreateShippingGroupData = {
1062
+ path: {
1063
+ cartID: "cartID",
1064
+ },
1065
+ body: {
1066
+ data: {
1067
+ type: "resource",
1068
+ attributes: {
1069
+ name: "Resource Name",
1070
+ description: "Resource Description"
1071
+ }
1072
+ }
1073
+ },
1074
+ };
1075
+
1076
+ const result: CreateShippingGroupResponse = await createShippingGroup(params);
1077
+ ```
1078
+
1079
+ ---
1080
+
1081
+ ### **`deleteCartShippingGroup`**
1082
+
1083
+ **Endpoint:** `DELETE /v2/carts/{cartId}/shipping-groups/{shippingGroupId}`
1084
+
1085
+ **Summary:** Delete Cart Shipping Group
1086
+
1087
+ **Description:** DELETE operation
1088
+
1089
+ **TypeScript Example:**
1090
+
1091
+ ```typescript
1092
+ import { deleteCartShippingGroup, type DeleteCartShippingGroupData, type DeleteCartShippingGroupResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1093
+
1094
+ const params: DeleteCartShippingGroupData = {
1095
+ path: {
1096
+ cartId: "12345678-1234-5678-9012-123456789012",
1097
+ shippingGroupId: "12345678-1234-5678-9012-123456789012",
1098
+ },
1099
+ };
1100
+
1101
+ const result: DeleteCartShippingGroupResponse = await deleteCartShippingGroup(params);
1102
+ ```
1103
+
1104
+ ---
1105
+
1106
+ ### **`getShippingGroupById`**
1107
+
1108
+ **Endpoint:** `GET /v2/carts/{cartId}/shipping-groups/{shippingGroupId}`
1109
+
1110
+ **Summary:** Retrieve a specific shipping group for a cart
1111
+
1112
+ **Description:** Retrieve a specific shipping group for a cart
1113
+
1114
+ **TypeScript Example:**
1115
+
1116
+ ```typescript
1117
+ import { getShippingGroupById, type GetShippingGroupByIdData, type GetShippingGroupByIdResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1118
+
1119
+ const params: GetShippingGroupByIdData = {
1120
+ path: {
1121
+ cartId: "12345678-1234-5678-9012-123456789012",
1122
+ shippingGroupId: "12345678-1234-5678-9012-123456789012",
1123
+ },
1124
+ };
1125
+
1126
+ const result: GetShippingGroupByIdResponse = await getShippingGroupById(params);
1127
+ ```
1128
+
1129
+ ---
1130
+
1131
+ ### **`updateShippingGroup`**
1132
+
1133
+ **Endpoint:** `PUT /v2/carts/{cartId}/shipping-groups/{shippingGroupId}`
1134
+
1135
+ **Summary:** Update a shipping group for a cart
223
1136
 
224
- - **`getCartItems`** (`GET /v2/carts/{cartID}/items`)
1137
+ **Description:** Update a specific shipping group for a cart
225
1138
 
226
- - **`manageCarts`** (`POST /v2/carts/{cartID}/items`)
1139
+ **TypeScript Example:**
227
1140
 
228
- - **`bulkUpdateItemsInCart`** (`PUT /v2/carts/{cartID}/items`)
1141
+ ```typescript
1142
+ import { updateShippingGroup, type UpdateShippingGroupData, type UpdateShippingGroupResponse } from "@epcc-sdk/sdks-cart-checkout-order";
229
1143
 
230
- - **`deleteACartItem`** (`DELETE /v2/carts/{cartID}/items/{cartitemID}`)
1144
+ const params: UpdateShippingGroupData = {
1145
+ path: {
1146
+ cartId: "12345678-1234-5678-9012-123456789012",
1147
+ shippingGroupId: "12345678-1234-5678-9012-123456789012",
1148
+ },
1149
+ body: {
1150
+ data: {
1151
+ type: "resource",
1152
+ attributes: {
1153
+ name: "Resource Name",
1154
+ description: "Resource Description"
1155
+ }
1156
+ }
1157
+ },
1158
+ };
1159
+
1160
+ const result: UpdateShippingGroupResponse = await updateShippingGroup(params);
1161
+ ```
1162
+
1163
+ ---
1164
+
1165
+ ### **`createCartPaymentIntent`**
1166
+
1167
+ **Endpoint:** `POST /v2/carts/{cartID}/payments`
1168
+
1169
+ **Summary:** Create Stripe Payment Intent for a Cart
1170
+
1171
+ **Description:** POST operation
1172
+
1173
+ **TypeScript Example:**
1174
+
1175
+ ```typescript
1176
+ import { createCartPaymentIntent, type CreateCartPaymentIntentData, type CreateCartPaymentIntentResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1177
+
1178
+ const params: CreateCartPaymentIntentData = {
1179
+ path: {
1180
+ cartID: "cartID",
1181
+ },
1182
+ body: {
1183
+ data: {
1184
+ type: "cart_item",
1185
+ quantity: 1,
1186
+ sku: "PRODUCT-SKU-001"
1187
+ }
1188
+ },
1189
+ };
1190
+
1191
+ const result: CreateCartPaymentIntentResponse = await createCartPaymentIntent(params);
1192
+ ```
1193
+
1194
+ ---
1195
+
1196
+ ### **`updateCartPaymentIntent`**
1197
+
1198
+ **Endpoint:** `PUT /v2/carts/{cartID}/payments/{paymentIntentID}`
1199
+
1200
+ **Summary:** Update a Payment Intent on a Cart
1201
+
1202
+ **Description:** Updates the payment information for a specific payment intent on a cart.
1203
+
1204
+ **TypeScript Example:**
1205
+
1206
+ ```typescript
1207
+ import { updateCartPaymentIntent, type UpdateCartPaymentIntentData, type UpdateCartPaymentIntentResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1208
+
1209
+ const params: UpdateCartPaymentIntentData = {
1210
+ path: {
1211
+ cartID: "cartID",
1212
+ paymentIntentID: "paymentIntentID",
1213
+ },
1214
+ body: {
1215
+ data: {
1216
+ type: "cart_item",
1217
+ quantity: 1,
1218
+ sku: "PRODUCT-SKU-001"
1219
+ }
1220
+ },
1221
+ };
1222
+
1223
+ const result: UpdateCartPaymentIntentResponse = await updateCartPaymentIntent(params);
1224
+ ```
1225
+
1226
+ ---
1227
+
1228
+ ### **`checkoutApi`**
1229
+
1230
+ **Endpoint:** `POST /v2/carts/{cartID}/checkout`
1231
+
1232
+ **Summary:** Checkout API
1233
+
1234
+ **Description:** POST operation
1235
+
1236
+ **TypeScript Example:**
1237
+
1238
+ ```typescript
1239
+ import { checkoutApi, type CheckoutApiData, type CheckoutApiResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1240
+
1241
+ const params: CheckoutApiData = {
1242
+ path: {
1243
+ cartID: "cartID",
1244
+ },
1245
+ body: {
1246
+ data: {
1247
+ type: "resource"
1248
+ }
1249
+ },
1250
+ };
1251
+
1252
+ const result: CheckoutApiResponse = await checkoutApi(params);
1253
+ ```
1254
+
1255
+ ---
1256
+
1257
+ ### **`getCustomerOrders`**
1258
+
1259
+ **Endpoint:** `GET /v2/orders`
1260
+
1261
+ **Summary:** Get all Orders
1262
+
1263
+ **Description:** GET operation
1264
+
1265
+ **TypeScript Example:**
1266
+
1267
+ ```typescript
1268
+ import { getCustomerOrders, type GetCustomerOrdersData, type GetCustomerOrdersResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1269
+
1270
+ const params: GetCustomerOrdersData = {
1271
+ headers: {
1272
+ "x-moltin-customer-token": "header-value", // OPTIONAL
1273
+ },
1274
+ };
1275
+
1276
+ const result: GetCustomerOrdersResponse = await getCustomerOrders(params);
1277
+ ```
1278
+
1279
+ ---
1280
+
1281
+ ### **`getAnOrder`**
1282
+
1283
+ **Endpoint:** `GET /v2/orders/{orderID}`
1284
+
1285
+ **Summary:** Get an Order
1286
+
1287
+ **Description:** Use this endpoint to retrieve a specific order.
1288
+
1289
+ **TypeScript Example:**
1290
+
1291
+ ```typescript
1292
+ import { getAnOrder, type GetAnOrderData, type GetAnOrderResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1293
+
1294
+ const params: GetAnOrderData = {
1295
+ path: {
1296
+ orderID: "orderID",
1297
+ },
1298
+ };
1299
+
1300
+ const result: GetAnOrderResponse = await getAnOrder(params);
1301
+ ```
1302
+
1303
+ ---
1304
+
1305
+ ### **`updateAnOrder`**
1306
+
1307
+ **Endpoint:** `PUT /v2/orders/{orderID}`
1308
+
1309
+ **Summary:** Update an Order
1310
+
1311
+ **Description:** PUT operation
1312
+
1313
+ **TypeScript Example:**
1314
+
1315
+ ```typescript
1316
+ import { updateAnOrder, type UpdateAnOrderData, type UpdateAnOrderResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1317
+
1318
+ const params: UpdateAnOrderData = {
1319
+ path: {
1320
+ orderID: "orderID",
1321
+ },
1322
+ body: {
1323
+ data: {
1324
+ type: "resource",
1325
+ attributes: {
1326
+ name: "Resource Name",
1327
+ description: "Resource Description"
1328
+ }
1329
+ }
1330
+ },
1331
+ };
1332
+
1333
+ const result: UpdateAnOrderResponse = await updateAnOrder(params);
1334
+ ```
1335
+
1336
+ ---
1337
+
1338
+ ### **`getOrderItems`**
1339
+
1340
+ **Endpoint:** `GET /v2/orders/{orderID}/items`
1341
+
1342
+ **Summary:** Get Order Items
1343
+
1344
+ **Description:** Use this endpoint to retrieve order items.
1345
+
1346
+ **TypeScript Example:**
1347
+
1348
+ ```typescript
1349
+ import { getOrderItems, type GetOrderItemsData, type GetOrderItemsResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1350
+
1351
+ const params: GetOrderItemsData = {
1352
+ path: {
1353
+ orderID: "orderID",
1354
+ },
1355
+ };
1356
+
1357
+ const result: GetOrderItemsResponse = await getOrderItems(params);
1358
+ ```
1359
+
1360
+ ---
1361
+
1362
+ ### **`anonymizeOrders`**
1363
+
1364
+ **Endpoint:** `POST /v2/orders/anonymize`
1365
+
1366
+ **Summary:** Anonymize Orders
1367
+
1368
+ **Description:** POST operation
1369
+
1370
+ **TypeScript Example:**
1371
+
1372
+ ```typescript
1373
+ import { anonymizeOrders, type AnonymizeOrdersData, type AnonymizeOrdersResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1374
+
1375
+ const params: AnonymizeOrdersData = {
1376
+ body: {
1377
+ data: {
1378
+ type: "resource"
1379
+ }
1380
+ },
1381
+ };
1382
+
1383
+ const result: AnonymizeOrdersResponse = await anonymizeOrders(params);
1384
+ ```
1385
+
1386
+ ---
1387
+
1388
+ ### **`confirmOrder`**
1389
+
1390
+ **Endpoint:** `POST /v2/orders/{orderID}/confirm`
1391
+
1392
+ **Summary:** Confirm Order
1393
+
1394
+ **Description:** Use this endpoint to confirm an order. Confirming an order finalizes it and makes it ready for processing.
1395
+
1396
+
1397
+ **TypeScript Example:**
231
1398
 
232
- - **`updateACartItem`** (`PUT /v2/carts/{cartID}/items/{cartitemID}`)
1399
+ ```typescript
1400
+ import { confirmOrder, type ConfirmOrderData, type ConfirmOrderResponse } from "@epcc-sdk/sdks-cart-checkout-order";
233
1401
 
234
- - **`deleteAccountCartAssociation`** (`DELETE /v2/carts/{cartID}/relationships/accounts`)
1402
+ const params: ConfirmOrderData = {
1403
+ path: {
1404
+ orderID: "orderID",
1405
+ },
1406
+ body: {
1407
+ data: {
1408
+ type: "resource"
1409
+ }
1410
+ },
1411
+ };
1412
+
1413
+ const result: ConfirmOrderResponse = await confirmOrder(params);
1414
+ ```
1415
+
1416
+ ---
1417
+
1418
+ ### **`paymentSetup`**
1419
+
1420
+ **Endpoint:** `POST /v2/orders/{orderID}/payments`
1421
+
1422
+ **Summary:** Payments
1423
+
1424
+ **Description:** POST operation
1425
+
1426
+ **TypeScript Example:**
1427
+
1428
+ ```typescript
1429
+ import { paymentSetup, type PaymentSetupData, type PaymentSetupResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1430
+
1431
+ const params: PaymentSetupData = {
1432
+ path: {
1433
+ orderID: "orderID",
1434
+ },
1435
+ body: {
1436
+ data: {
1437
+ gateway: "stripe",
1438
+ method: "purchase"
1439
+ }
1440
+ },
1441
+ };
1442
+
1443
+ const result: PaymentSetupResponse = await paymentSetup(params);
1444
+ ```
1445
+
1446
+ ---
1447
+
1448
+ ### **`confirmPayment`**
1449
+
1450
+ **Endpoint:** `POST /v2/orders/{orderID}/transactions/{transactionID}/confirm`
1451
+
1452
+ **Summary:** Confirm Payment
1453
+
1454
+ **Description:** POST operation
1455
+
1456
+ **TypeScript Example:**
1457
+
1458
+ ```typescript
1459
+ import { confirmPayment, type ConfirmPaymentData, type ConfirmPaymentResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1460
+
1461
+ const params: ConfirmPaymentData = {
1462
+ path: {
1463
+ orderID: "orderID",
1464
+ transactionID: "transactionID",
1465
+ },
1466
+ body: {
1467
+ data: {
1468
+ gateway: "stripe",
1469
+ method: "purchase"
1470
+ }
1471
+ },
1472
+ };
1473
+
1474
+ const result: ConfirmPaymentResponse = await confirmPayment(params);
1475
+ ```
1476
+
1477
+ ---
1478
+
1479
+ ### **`captureATransaction`**
1480
+
1481
+ **Endpoint:** `POST /v2/orders/{orderID}/transactions/{transactionID}/capture`
1482
+
1483
+ **Summary:** Capture a Transaction
1484
+
1485
+ **Description:** POST operation
1486
+
1487
+ **TypeScript Example:**
1488
+
1489
+ ```typescript
1490
+ import { captureATransaction, type CaptureATransactionData, type CaptureATransactionResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1491
+
1492
+ const params: CaptureATransactionData = {
1493
+ path: {
1494
+ orderID: "orderID",
1495
+ transactionID: "transactionID",
1496
+ },
1497
+ body: {
1498
+ data: {
1499
+ type: "resource"
1500
+ }
1501
+ },
1502
+ };
1503
+
1504
+ const result: CaptureATransactionResponse = await captureATransaction(params);
1505
+ ```
1506
+
1507
+ ---
1508
+
1509
+ ### **`refundATransaction`**
1510
+
1511
+ **Endpoint:** `POST /v2/orders/{orderID}/transactions/{transactionID}/refund`
1512
+
1513
+ **Summary:** Refund a Transaction
1514
+
1515
+ **Description:** POST operation
1516
+
1517
+ **TypeScript Example:**
1518
+
1519
+ ```typescript
1520
+ import { refundATransaction, type RefundATransactionData, type RefundATransactionResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1521
+
1522
+ const params: RefundATransactionData = {
1523
+ path: {
1524
+ orderID: "orderID",
1525
+ transactionID: "transactionID",
1526
+ },
1527
+ body: {
1528
+ data: {
1529
+ type: "resource"
1530
+ }
1531
+ },
1532
+ };
235
1533
 
236
- - **`createAccountCartAssociation`** (`POST /v2/carts/{cartID}/relationships/accounts`)
1534
+ const result: RefundATransactionResponse = await refundATransaction(params);
1535
+ ```
1536
+
1537
+ ---
1538
+
1539
+ ### **`getOrderTransactions`**
1540
+
1541
+ **Endpoint:** `GET /v2/orders/{orderID}/transactions`
1542
+
1543
+ **Summary:** Get Order Transactions
1544
+
1545
+ **Description:** Get order transactions
1546
+
1547
+ **TypeScript Example:**
1548
+
1549
+ ```typescript
1550
+ import { getOrderTransactions, type GetOrderTransactionsData, type GetOrderTransactionsResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1551
+
1552
+ const params: GetOrderTransactionsData = {
1553
+ path: {
1554
+ orderID: "orderID",
1555
+ },
1556
+ };
1557
+
1558
+ const result: GetOrderTransactionsResponse = await getOrderTransactions(params);
1559
+ ```
1560
+
1561
+ ---
1562
+
1563
+ ### **`getATransaction`**
1564
+
1565
+ **Endpoint:** `GET /v2/orders/{orderID}/transactions/{transactionID}`
1566
+
1567
+ **Summary:** Get a Transaction
1568
+
1569
+ **Description:** Retrieves a transaction
1570
+
1571
+ **TypeScript Example:**
1572
+
1573
+ ```typescript
1574
+ import { getATransaction, type GetATransactionData, type GetATransactionResponse } from "@epcc-sdk/sdks-cart-checkout-order";
1575
+
1576
+ const params: GetATransactionData = {
1577
+ path: {
1578
+ orderID: "orderID",
1579
+ transactionID: "transactionID",
1580
+ },
1581
+ };
1582
+
1583
+ const result: GetATransactionResponse = await getATransaction(params);
1584
+ ```
1585
+
1586
+ ---
1587
+
1588
+ ### **`cancelATransaction`**
237
1589
 
238
- - **`deleteCustomerCartAssociation`** (`DELETE /v2/carts/{cartID}/relationships/customers`)
1590
+ **Endpoint:** `POST /v2/orders/{orderID}/transactions/{transactionID}/cancel`
239
1591
 
240
- - **`createCustomerCartAssociation`** (`POST /v2/carts/{cartID}/relationships/customers`)
1592
+ **Summary:** Cancel a Transaction
241
1593
 
242
- - **`deleteAPromotionViaPromotionCode`** (`DELETE /v2/carts/{cartID}/discounts/{promoCode}`)
1594
+ **Description:** POST operation
243
1595
 
244
- - **`addTaxItemToCart`** (`POST /v2/carts/{cartID}/items/{cartitemID}/taxes`)
1596
+ **TypeScript Example:**
245
1597
 
246
- - **`bulkDeleteTaxItemsFromCart`** (`DELETE /v2/carts/{cartID}/taxes`)
1598
+ ```typescript
1599
+ import { cancelATransaction, type CancelATransactionData, type CancelATransactionResponse } from "@epcc-sdk/sdks-cart-checkout-order";
247
1600
 
248
- - **`bulkAddTaxItemsToCart`** (`POST /v2/carts/{cartID}/taxes`)
1601
+ const params: CancelATransactionData = {
1602
+ path: {
1603
+ orderID: "orderID",
1604
+ transactionID: "transactionID",
1605
+ },
1606
+ body: {
1607
+ data: {
1608
+ type: "resource"
1609
+ }
1610
+ },
1611
+ };
1612
+
1613
+ const result: CancelATransactionResponse = await cancelATransaction(params);
1614
+ ```
1615
+
1616
+ ---
249
1617
 
250
- - **`deleteATaxItem`** (`DELETE /v2/carts/{cartID}/items/{cartitemID}/taxes/{taxitemID}`)
1618
+ ### **`getOrderShippingGroups`**
251
1619
 
252
- - **`updateATaxItem`** (`PUT /v2/carts/{cartID}/items/{cartitemID}/taxes/{taxitemID}`)
1620
+ **Endpoint:** `GET /v2/orders/{orderID}/shipping-groups`
253
1621
 
254
- - **`bulkDeleteCustomDiscountsFromCart`** (`DELETE /v2/carts/{cartID}/custom-discounts`)
1622
+ **Summary:** Retrieve all shipping groups for an order
255
1623
 
256
- - **`bulkAddCustomDiscountsToCart`** (`POST /v2/carts/{cartID}/custom-discounts`)
1624
+ **Description:** Retrieve all shipping groups for an order
257
1625
 
258
- - **`deleteCustomDiscountFromCart`** (`DELETE /v2/carts/{cartID}/custom-discounts/{customdiscountID}`)
1626
+ **TypeScript Example:**
259
1627
 
260
- - **`updateCustomDiscountForCart`** (`PUT /v2/carts/{cartID}/custom-discounts/{customdiscountID}`)
1628
+ ```typescript
1629
+ import { getOrderShippingGroups, type GetOrderShippingGroupsData, type GetOrderShippingGroupsResponse } from "@epcc-sdk/sdks-cart-checkout-order";
261
1630
 
262
- - **`addCustomDiscountToCartItem`** (`POST /v2/carts/{cartID}/items/{cartitemID}/custom-discounts`)
1631
+ const params: GetOrderShippingGroupsData = {
1632
+ path: {
1633
+ orderID: "orderID",
1634
+ },
1635
+ };
1636
+
1637
+ const result: GetOrderShippingGroupsResponse = await getOrderShippingGroups(params);
1638
+ ```
1639
+
1640
+ ---
263
1641
 
264
- - **`deleteCustomDiscountFromCartItem`** (`DELETE /v2/carts/{cartID}/items/{cartitemID}/custom-discounts/{customdiscountID}`)
1642
+ ### **`createOrderShippingGroup`**
265
1643
 
266
- - **`updateCustomDiscountForCartItem`** (`PUT /v2/carts/{cartID}/items/{cartitemID}/custom-discounts/{customdiscountID}`)
1644
+ **Endpoint:** `POST /v2/orders/{orderID}/shipping-groups`
267
1645
 
268
- - **`getShippingGroups`** (`GET /v2/carts/{cartID}/shipping-groups`)
1646
+ **Summary:** Create a shipping group for an order
269
1647
 
270
- - **`createShippingGroup`** (`POST /v2/carts/{cartID}/shipping-groups`)
1648
+ **Description:** Create a new shipping group for an order
271
1649
 
272
- - **`deleteCartShippingGroup`** (`DELETE /v2/carts/{cartId}/shipping-groups/{shippingGroupId}`)
1650
+ **TypeScript Example:**
273
1651
 
274
- - **`getShippingGroupById`** (`GET /v2/carts/{cartId}/shipping-groups/{shippingGroupId}`)
1652
+ ```typescript
1653
+ import { createOrderShippingGroup, type CreateOrderShippingGroupData, type CreateOrderShippingGroupResponse } from "@epcc-sdk/sdks-cart-checkout-order";
275
1654
 
276
- - **`updateShippingGroup`** (`PUT /v2/carts/{cartId}/shipping-groups/{shippingGroupId}`)
1655
+ const params: CreateOrderShippingGroupData = {
1656
+ path: {
1657
+ orderID: "orderID",
1658
+ },
1659
+ body: {
1660
+ data: {
1661
+ type: "resource",
1662
+ attributes: {
1663
+ name: "Resource Name",
1664
+ description: "Resource Description"
1665
+ }
1666
+ }
1667
+ },
1668
+ };
277
1669
 
278
- - **`createCartPaymentIntent`** (`POST /v2/carts/{cartID}/payments`)
1670
+ const result: CreateOrderShippingGroupResponse = await createOrderShippingGroup(params);
1671
+ ```
279
1672
 
280
- - **`updateCartPaymentIntent`** (`PUT /v2/carts/{cartID}/payments/{paymentIntentID}`)
1673
+ ---
281
1674
 
282
- - **`checkoutApi`** (`POST /v2/carts/{cartID}/checkout`)
1675
+ ### **`getShippingGroupsById`**
283
1676
 
284
- - **`getCustomerOrders`** (`GET /v2/orders`)
1677
+ **Endpoint:** `GET /v2/orders/{orderID}/shipping-groups/{shippingGroupID}`
285
1678
 
286
- - **`getAnOrder`** (`GET /v2/orders/{orderID}`)
1679
+ **Summary:** Retrieve a specific shipping group for an order
287
1680
 
288
- - **`updateAnOrder`** (`PUT /v2/orders/{orderID}`)
1681
+ **Description:** Retrieve a specific shipping group for an order
289
1682
 
290
- - **`getOrderItems`** (`GET /v2/orders/{orderID}/items`)
1683
+ **TypeScript Example:**
291
1684
 
292
- - **`anonymizeOrders`** (`POST /v2/orders/anonymize`)
1685
+ ```typescript
1686
+ import { getShippingGroupsById, type GetShippingGroupsByIdData, type GetShippingGroupsByIdResponse } from "@epcc-sdk/sdks-cart-checkout-order";
293
1687
 
294
- - **`confirmOrder`** (`POST /v2/orders/{orderID}/confirm`)
1688
+ const params: GetShippingGroupsByIdData = {
1689
+ path: {
1690
+ orderID: "orderID",
1691
+ shippingGroupID: "shippingGroupID",
1692
+ },
1693
+ };
295
1694
 
296
- - **`paymentSetup`** (`POST /v2/orders/{orderID}/payments`)
1695
+ const result: GetShippingGroupsByIdResponse = await getShippingGroupsById(params);
1696
+ ```
297
1697
 
298
- - **`confirmPayment`** (`POST /v2/orders/{orderID}/transactions/{transactionID}/confirm`)
1698
+ ---
299
1699
 
300
- - **`captureATransaction`** (`POST /v2/orders/{orderID}/transactions/{transactionID}/capture`)
1700
+ ### **`putShippingGroupById`**
301
1701
 
302
- - **`refundATransaction`** (`POST /v2/orders/{orderID}/transactions/{transactionID}/refund`)
1702
+ **Endpoint:** `PUT /v2/orders/{orderID}/shipping-groups/{shippingGroupID}`
303
1703
 
304
- - **`getOrderTransactions`** (`GET /v2/orders/{orderID}/transactions`)
1704
+ **Summary:** Update a shipping group for an order
305
1705
 
306
- - **`getATransaction`** (`GET /v2/orders/{orderID}/transactions/{transactionID}`)
1706
+ **Description:** Update a shipping group for an order
307
1707
 
308
- - **`cancelATransaction`** (`POST /v2/orders/{orderID}/transactions/{transactionID}/cancel`)
1708
+ **TypeScript Example:**
309
1709
 
310
- - **`getOrderShippingGroups`** (`GET /v2/orders/{orderID}/shipping-groups`)
1710
+ ```typescript
1711
+ import { putShippingGroupById, type PutShippingGroupByIdData, type PutShippingGroupByIdResponse } from "@epcc-sdk/sdks-cart-checkout-order";
311
1712
 
312
- - **`createOrderShippingGroup`** (`POST /v2/orders/{orderID}/shipping-groups`)
1713
+ const params: PutShippingGroupByIdData = {
1714
+ path: {
1715
+ orderID: "orderID",
1716
+ shippingGroupID: "shippingGroupID",
1717
+ },
1718
+ body: {
1719
+ data: {
1720
+ type: "resource"
1721
+ }
1722
+ },
1723
+ };
313
1724
 
314
- - **`getShippingGroupsById`** (`GET /v2/orders/{orderID}/shipping-groups/{shippingGroupID}`)
1725
+ const result: PutShippingGroupByIdResponse = await putShippingGroupById(params);
1726
+ ```
315
1727
 
316
- - **`putShippingGroupById`** (`PUT /v2/orders/{orderID}/shipping-groups/{shippingGroupID}`)
1728
+ ---
317
1729
 
318
1730
 
319
1731