@epcc-sdk/sdks-shopper 0.0.2 → 0.0.4
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/dist/client/@tanstack/react-query.gen.d.ts +288 -20
- package/dist/client/@tanstack/react-query.gen.js +168 -16
- package/dist/client/sdk.gen.d.ts +277 -22
- package/dist/client/sdk.gen.js +312 -19
- package/dist/client/transformers.gen.d.ts +5 -1
- package/dist/client/transformers.gen.js +55 -0
- package/dist/client/types.gen.d.ts +2128 -95
- package/package.json +3 -3
package/dist/client/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Options } from "@hey-api/client-fetch";
|
|
2
|
-
import type { GetByContextReleaseData, GetByContextAllHierarchiesData, GetByContextHierarchyData, GetByContextHierarchyNodesData, GetByContextHierarchyChildNodesData, GetByContextAllNodesData, GetByContextNodeData, GetByContextChildNodesData, GetByContextAllProductsData, GetByContextProductData, GetByContextComponentProductIdsData, GetByContextChildProductsData, GetByContextProductsForHierarchyData, GetByContextProductsForNodeData, ConfigureByContextProductData, GetCatalogsData, CreateCatalogData, DeleteCatalogByIdData, GetCatalogByIdData, UpdateCatalogData, DeleteReleasesData, GetReleasesData, PublishReleaseData, DeleteReleaseByIdData, GetReleaseByIdData, GetRulesData, CreateRuleData, DeleteRuleByIdData, GetRuleByIdData, UpdateRuleData, GetAllHierarchiesData, GetHierarchyData, GetHierarchyNodesData, GetHierarchyChildNodesData, GetAllNodesData, GetNodeData, GetChildNodesData, GetAllProductsData, GetProductData, GetComponentProductIdsData, GetChildProductsData, GetProductsForHierarchyData, GetProductsForNodeData, GetCartsData, CreateACartData, DeleteACartData, GetCartData, UpdateACartData, DeleteAllCartItemsData, GetCartItemsData, ManageCartsData, BulkUpdateItemsInCartData, DeleteACartItemData, UpdateACartItemData, DeleteAccountCartAssociationData, CreateAccountCartAssociationData, CreateAccountCartAssociationResponse, DeleteCustomerCartAssociationData, CreateCustomerCartAssociationData, DeleteAPromotionViaPromotionCodeData, AddTaxItemToCartData, BulkDeleteTaxItemsFromCartData, BulkAddTaxItemsToCartData, DeleteATaxItemData, UpdateATaxItemData, BulkDeleteCustomDiscountsFromCartData, BulkAddCustomDiscountsToCartData, DeleteCustomDiscountFromCartData, UpdateCustomDiscountForCartData, AddCustomDiscountToCartItemData, DeleteCustomDiscountFromCartItemData, UpdateCustomDiscountForCartItemData, CreateCartPaymentIntentData, CheckoutApiData, GetCustomerOrdersData, GetAnOrderData, UpdateAnOrderData, GetOrderItemsData, AnonymizeOrdersData,
|
|
2
|
+
import type { GetByContextReleaseData, GetByContextAllHierarchiesData, GetByContextHierarchyData, GetByContextHierarchyNodesData, GetByContextHierarchyChildNodesData, GetByContextAllNodesData, GetByContextNodeData, GetByContextChildNodesData, GetByContextAllProductsData, GetByContextProductData, GetByContextComponentProductIdsData, GetByContextChildProductsData, GetByContextProductsForHierarchyData, GetByContextProductsForNodeData, ConfigureByContextProductData, GetCatalogsData, CreateCatalogData, DeleteCatalogByIdData, GetCatalogByIdData, UpdateCatalogData, DeleteReleasesData, GetReleasesData, PublishReleaseData, DeleteReleaseByIdData, GetReleaseByIdData, GetRulesData, CreateRuleData, DeleteRuleByIdData, GetRuleByIdData, UpdateRuleData, GetAllHierarchiesData, GetHierarchyData, GetHierarchyNodesData, GetHierarchyChildNodesData, GetAllNodesData, GetNodeData, GetChildNodesData, GetAllProductsData, GetProductData, GetComponentProductIdsData, GetChildProductsData, GetProductsForHierarchyData, GetProductsForNodeData, GetCartsData, CreateACartData, DeleteACartData, GetCartData, UpdateACartData, DeleteAllCartItemsData, GetCartItemsData, ManageCartsData, BulkUpdateItemsInCartData, DeleteACartItemData, UpdateACartItemData, DeleteAccountCartAssociationData, CreateAccountCartAssociationData, CreateAccountCartAssociationResponse, DeleteCustomerCartAssociationData, CreateCustomerCartAssociationData, DeleteAPromotionViaPromotionCodeData, AddTaxItemToCartData, BulkDeleteTaxItemsFromCartData, BulkAddTaxItemsToCartData, DeleteATaxItemData, UpdateATaxItemData, BulkDeleteCustomDiscountsFromCartData, BulkAddCustomDiscountsToCartData, DeleteCustomDiscountFromCartData, UpdateCustomDiscountForCartData, AddCustomDiscountToCartItemData, DeleteCustomDiscountFromCartItemData, UpdateCustomDiscountForCartItemData, CreateCartPaymentIntentData, CheckoutApiData, GetCustomerOrdersData, GetAnOrderData, UpdateAnOrderData, GetOrderItemsData, AnonymizeOrdersData, PaymentSetupData, ConfirmPaymentData, CaptureATransactionData, RefundATransactionData, GetOrderTransactionsData, GetATransactionData, CancelATransactionData, GetSubscriptionProductData, GetPlanData, ListOfferingsData, GetOfferingData, ListOfferingPlansData, ListOfferingFeaturesData, ListOfferingProductsData, GetFeatureData } from "./types.gen";
|
|
3
3
|
export declare const client: import("@hey-api/client-fetch").Client<Request, Response, unknown, import("@hey-api/client-fetch").RequestOptions<boolean, string>>;
|
|
4
4
|
/**
|
|
5
5
|
* Get the catalog release as shoppers
|
|
@@ -1058,6 +1058,35 @@ export declare const getCarts: <ThrowOnError extends boolean = false>(options?:
|
|
|
1058
1058
|
* - Preview cart interactions skip inventory checks and events, allowing users to preview future carts without impacting related external systems.
|
|
1059
1059
|
* :::
|
|
1060
1060
|
*
|
|
1061
|
+
* ### Custom Attributes
|
|
1062
|
+
* You can create custom attributes for the cart object to include additional information, enabling promotions that target specific cart attributes.
|
|
1063
|
+
* For example:
|
|
1064
|
+
* ```
|
|
1065
|
+
* "custom_attributes":{
|
|
1066
|
+
* "membership": {
|
|
1067
|
+
* "type": "string",
|
|
1068
|
+
* "value": "VIP"
|
|
1069
|
+
* }
|
|
1070
|
+
* }
|
|
1071
|
+
* ```
|
|
1072
|
+
* See [adding cart custom attributes in promotions builder](/docs/commerce-manager/promotions-builder/creating-a-promotion-in-promotions-builder#adding-cart-custom-attributes)
|
|
1073
|
+
*
|
|
1074
|
+
* Cart custom attributes remain with the corresponding cart for the extent of its lifecycle. These custom attributes carry over to the resulting order objects on checkout and those on carts are deleted with their carts upon cart deletions.
|
|
1075
|
+
* Custom attributes can be updated or removed using a PUT request. To delete specific custom attributes, simply exclude the unwanted attribute objects from the PUT request body.
|
|
1076
|
+
*
|
|
1077
|
+
* ### Contact Email
|
|
1078
|
+
* You can attach an email to carts via the `contact.email` field. These values help identify guest shopper carts and, in the case of promotions with maximum usage settings for guest and registered shopper, track per-shopper promotion usages.
|
|
1079
|
+
* See [Create Max Uses Per Shopper Promotion Codes](/docs/promotions-builder/promotions-builder-codes/create-max-use-limit-promotion-codes)
|
|
1080
|
+
*
|
|
1081
|
+
* For example:
|
|
1082
|
+
* ```
|
|
1083
|
+
* "contact": {
|
|
1084
|
+
* "email": "tester@email.com"
|
|
1085
|
+
* }
|
|
1086
|
+
* ```
|
|
1087
|
+
*
|
|
1088
|
+
* Please note, this value is not supported for registered shopper carts (that is, carts with accounts or customers associated), as these carts already have email values associated via the shopper details. Accordingly, requests to add contact email information to registered shopper carts (and vice versa) result in error messages.
|
|
1089
|
+
*
|
|
1061
1090
|
* ### Errors
|
|
1062
1091
|
*
|
|
1063
1092
|
* - `400 Bad Request` : This is returned when the submitted request does not adhere to the expected API contract for the endpoint.
|
|
@@ -1100,7 +1129,7 @@ export declare const deleteACart: <ThrowOnError extends boolean = false>(options
|
|
|
1100
1129
|
* :::note
|
|
1101
1130
|
*
|
|
1102
1131
|
* - The default cart name is Cart. However, you can update the cart name as required. Ensure that the string length of the name is greater than or equal to one. Follow the safe character guidelines for name and description naming. For more information about cart ID naming requirements, see the [Safe Characters](/guides/Getting-Started/safe-characters) section.
|
|
1103
|
-
* - Outside of the JS-SDK, we don
|
|
1132
|
+
* - Outside of the JS-SDK, we don't handle creating cart references. You need to create your own.
|
|
1104
1133
|
*
|
|
1105
1134
|
* :::
|
|
1106
1135
|
*
|
|
@@ -1322,7 +1351,7 @@ export declare const deleteAllCartItems: <ThrowOnError extends boolean = false>(
|
|
|
1322
1351
|
*/
|
|
1323
1352
|
export declare const getCartItems: <ThrowOnError extends boolean = false>(options: Options<GetCartItemsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").CartsResponse, import("./types.gen").ResponseError, ThrowOnError>;
|
|
1324
1353
|
/**
|
|
1325
|
-
*
|
|
1354
|
+
* Add Items to Cart
|
|
1326
1355
|
*
|
|
1327
1356
|
* ### Add Product to Cart
|
|
1328
1357
|
*
|
|
@@ -1410,10 +1439,16 @@ export declare const getCartItems: <ThrowOnError extends boolean = false>(option
|
|
|
1410
1439
|
* - For [Fixed Bundle Discount Promotions](/docs/api/promotions/create-a-promotion), the promotion applies as long as the cart contains the bundle SKUs even when there are different `custom_inputs`.
|
|
1411
1440
|
* - For [X for Y Discount Promotion and X for amount discount promotion](/docs/api/promotions/create-a-promotion), the promotion applies when there are two SKUs with the same `custom_inputs`. The promotion does not apply when there are different `custom_inputs` and the SKUs are in different line items.
|
|
1412
1441
|
*
|
|
1442
|
+
* #### Stock locations
|
|
1443
|
+
*
|
|
1444
|
+
* When adding to a cart it is possible to specify which [stock location](/docs/api/pxm/inventory_mli/inventories-introduction?#multi-location-inventories) should be used for tracking inventory for that product by specifying its slug in `location`. This might represent the warehouse a product is shipped from or the store holding the stock in a Buy Online Pick Up In Store scenario.
|
|
1445
|
+
*
|
|
1446
|
+
* Each line item is restricted to a single stock location. If the same product is added with a different location then the most recently-specified location will be used for the total quantity of that line item.
|
|
1447
|
+
*
|
|
1413
1448
|
* :::note
|
|
1414
1449
|
*
|
|
1415
1450
|
* - Any requests to add a product to cart returns the collection of cart items.
|
|
1416
|
-
* - [Tax items](/docs/api/carts/tax-items) may optionally be added with the product. Only administrators with [
|
|
1451
|
+
* - [Tax items](/docs/api/carts/tax-items) may optionally be added with the product. Only administrators with [client_credentials access tokens](/docs/api/authentication/create-an-access-token) are able to do this. If included, they replace any existing taxes on the product.
|
|
1417
1452
|
* - The cart currency is set when the first item is added to the cart.
|
|
1418
1453
|
* - The product being added to the cart requires a price in the same currency as the other items in the cart. The API returns a 400 error if a price is not defined in the correct currency.
|
|
1419
1454
|
* - A cart can contain a maximum of 100 unique items. Items include products, custom items, tax items, and promotions.
|
|
@@ -1421,15 +1456,129 @@ export declare const getCartItems: <ThrowOnError extends boolean = false>(option
|
|
|
1421
1456
|
*
|
|
1422
1457
|
* :::
|
|
1423
1458
|
*
|
|
1459
|
+
* ### Including Resources
|
|
1460
|
+
*
|
|
1461
|
+
* When you make an `Add Product to Cart` request to the catalog-view service, you can obtain details of the component products. If you include the optional parameter `include=component_products` in the request, the response will include details for each component product.
|
|
1462
|
+
*
|
|
1463
|
+
* When a bundle with selected component products is added to a cart, the cart displays both the bundle pricing and component product IDs.
|
|
1464
|
+
*
|
|
1465
|
+
* The response example is returned with a new field called `component_products` under `bundle_configuration`, which is a list of component products that the user has selected for dynamic bundles.
|
|
1466
|
+
*
|
|
1467
|
+
* | Parameter | Required | Description |
|
|
1468
|
+
* |:------------------------|:-------------|:-------------------|
|
|
1469
|
+
* | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. |
|
|
1470
|
+
* | `main_image` | Optional | The main images associated with a product. |
|
|
1471
|
+
* | `files` | Optional | Any files associated with a product. |
|
|
1472
|
+
*
|
|
1473
|
+
* ```json
|
|
1474
|
+
* "bundle_configuration": {
|
|
1475
|
+
* "selected_options": {
|
|
1476
|
+
* "mixed-shirts": {
|
|
1477
|
+
* "16a6cc14-6ebb-4156-9973-e6a0f92f5731": 3,
|
|
1478
|
+
* "55037cc5-f382-4039-95c6-1e04ac0351d3": 2,
|
|
1479
|
+
* "standard-shirts"
|
|
1480
|
+
* "70f1c9d2-c580-4839-bd6c-a0a9b91d5159": 5
|
|
1481
|
+
* }
|
|
1482
|
+
* },
|
|
1483
|
+
* "component_products": [
|
|
1484
|
+
* {
|
|
1485
|
+
* "id": "16a6cc14-6ebb-4156-9973-e6a0f92f5731",
|
|
1486
|
+
* "type": "product",
|
|
1487
|
+
* "attributes": {
|
|
1488
|
+
* "name": "Red T-shirt",
|
|
1489
|
+
* "description": "Standard red t-shirt.",
|
|
1490
|
+
* "slug": "red-t-shirt-slug",
|
|
1491
|
+
* "sku": "red-t-shirt-sku",
|
|
1492
|
+
* "status": "live",
|
|
1493
|
+
* "commodity_type": "physical"
|
|
1494
|
+
* },
|
|
1495
|
+
* "meta": {
|
|
1496
|
+
* "display_price": {
|
|
1497
|
+
* "without_tax": {
|
|
1498
|
+
* "amount": 500,
|
|
1499
|
+
* "currency": "USD",
|
|
1500
|
+
* "formatted": "$5.00"
|
|
1501
|
+
* }
|
|
1502
|
+
* }
|
|
1503
|
+
* }
|
|
1504
|
+
* },
|
|
1505
|
+
* {
|
|
1506
|
+
* "id": "55037cc5-f382-4039-95c6-1e04ac0351d3",
|
|
1507
|
+
* "type": "product",
|
|
1508
|
+
* "attributes": {
|
|
1509
|
+
* "name": "Blue T-shirt",
|
|
1510
|
+
* "description": "Standard blue t-shirt.",
|
|
1511
|
+
* "slug": "blue-t-shirt-slug",
|
|
1512
|
+
* "sku": "blue-t-shirt-sku",
|
|
1513
|
+
* "status": "live",
|
|
1514
|
+
* "commodity_type": "physical"
|
|
1515
|
+
* },
|
|
1516
|
+
* "meta": {
|
|
1517
|
+
* "display_price": {
|
|
1518
|
+
* "without_tax": {
|
|
1519
|
+
* "amount": 500,
|
|
1520
|
+
* "currency": "USD",
|
|
1521
|
+
* "formatted": "$5.00"
|
|
1522
|
+
* }
|
|
1523
|
+
* }
|
|
1524
|
+
* }
|
|
1525
|
+
* },
|
|
1526
|
+
* {
|
|
1527
|
+
* "id": "70f1c9d2-c580-4839-bd6c-a0a9b91d5159",
|
|
1528
|
+
* "type": "product",
|
|
1529
|
+
* "attributes": {
|
|
1530
|
+
* "name": "White T-shirt",
|
|
1531
|
+
* "description": "Standard white t-shirt.",
|
|
1532
|
+
* "slug": "white-t-shirt-slug",
|
|
1533
|
+
* "sku": "white-t-shirt-sku",
|
|
1534
|
+
* "status": "live",
|
|
1535
|
+
* "commodity_type": "physical"
|
|
1536
|
+
* },
|
|
1537
|
+
* "meta": {
|
|
1538
|
+
* "display_price": {
|
|
1539
|
+
* "without_tax": {
|
|
1540
|
+
* "amount": 500,
|
|
1541
|
+
* "currency": "USD",
|
|
1542
|
+
* "formatted": "$5.00"
|
|
1543
|
+
* }
|
|
1544
|
+
* }
|
|
1545
|
+
* }
|
|
1546
|
+
* }
|
|
1547
|
+
* ]
|
|
1548
|
+
* }
|
|
1549
|
+
* ```
|
|
1550
|
+
*
|
|
1551
|
+
* See [Including Resources](https://elasticpath.dev/guides/Getting-Started/includes).
|
|
1552
|
+
*
|
|
1553
|
+
* ### Add Subscription to Cart
|
|
1554
|
+
*
|
|
1555
|
+
* To add a subscription to your cart, you need to provide the ID of the subscription offering and the ID of the plan within that offering that you want to subscribe to.
|
|
1556
|
+
*
|
|
1557
|
+
* ```json
|
|
1558
|
+
* {
|
|
1559
|
+
* {
|
|
1560
|
+
* "data": {
|
|
1561
|
+
* "id": "5b9be99f-1c94-4ddd-9718-81adab0cc3e0",
|
|
1562
|
+
* "type": "subscription_item",
|
|
1563
|
+
* "quantity": 1,
|
|
1564
|
+
* "subscription_configuration": {
|
|
1565
|
+
* "plan": "40010dde-2f38-489b-8b3f-14a13cbfb431"
|
|
1566
|
+
* }
|
|
1567
|
+
* }
|
|
1568
|
+
* }
|
|
1569
|
+
* ```
|
|
1570
|
+
*
|
|
1571
|
+
* The price of the subscription item in the cart reflects the cost of the subscription's initial billing period. Once the cart has been checked out and the order paid for, the subscription will be automatically created in the subscriptions service.
|
|
1572
|
+
*
|
|
1424
1573
|
* ### Add Custom Item to Cart
|
|
1425
1574
|
*
|
|
1426
1575
|
* You can add a custom item to the cart when you don't manage things like shipping, taxes and inventory in Commerce.
|
|
1427
1576
|
*
|
|
1428
|
-
* For [Shipping Groups](/docs/ship-groups/shipping-groups), once you have created a [cart shipping group](/docs/ship-groups/shipping-groups/shipping-groups-api/create-cart-shipping-group), you need to link it to the cart items. This is important, because it is necessary to associate items with shipping groups in order to include shipping groups in the corresponding cart, order, and totals.
|
|
1577
|
+
* For [Shipping Groups](/docs/ship-groups/shipping-groups/index), once you have created a [cart shipping group](/docs/ship-groups/shipping-groups/shipping-groups-api/create-cart-shipping-group), you need to link it to the cart items. This is important, because it is necessary to associate items with shipping groups in order to include shipping groups in the corresponding cart, order, and totals.
|
|
1429
1578
|
*
|
|
1430
1579
|
* :::note
|
|
1431
1580
|
*
|
|
1432
|
-
* - Custom Cart Items are available
|
|
1581
|
+
* - Custom Cart Items are available when using [implicit access tokens](/docs/api/authentication/create-an-access-token). Ensure that you always check each order has the correct details for each item, most importantly, price.
|
|
1433
1582
|
*
|
|
1434
1583
|
* :::
|
|
1435
1584
|
*
|
|
@@ -1652,7 +1801,7 @@ export declare const bulkDeleteTaxItemsFromCart: <ThrowOnError extends boolean =
|
|
|
1652
1801
|
*
|
|
1653
1802
|
* `422 Unprocessable Entity`
|
|
1654
1803
|
*
|
|
1655
|
-
* In this example, when `options.add_all_or_nothing` is set to `true` and if one of cart items is not found or
|
|
1804
|
+
* In this example, when `options.add_all_or_nothing` is set to `true` and if one of cart items is not found or has reached its maximum tax item limit, the following error response is returned:
|
|
1656
1805
|
*
|
|
1657
1806
|
* ```json
|
|
1658
1807
|
* {
|
|
@@ -1712,7 +1861,7 @@ export declare const bulkAddTaxItemsToCart: <ThrowOnError extends boolean = fals
|
|
|
1712
1861
|
*/
|
|
1713
1862
|
export declare const deleteATaxItem: <ThrowOnError extends boolean = false>(options: Options<DeleteATaxItemData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<void, import("./types.gen").ResponseError, ThrowOnError>;
|
|
1714
1863
|
/**
|
|
1715
|
-
* Update a
|
|
1864
|
+
* Update a Tax Item
|
|
1716
1865
|
* Use this endpoint to update a tax item.
|
|
1717
1866
|
*/
|
|
1718
1867
|
export declare const updateATaxItem: <ThrowOnError extends boolean = false>(options: Options<UpdateATaxItemData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
|
|
@@ -1747,7 +1896,9 @@ export declare const updateCustomDiscountForCart: <ThrowOnError extends boolean
|
|
|
1747
1896
|
* Add Custom Discount To Cart Item
|
|
1748
1897
|
* Use this endpoint to add a custom discount to cart item.
|
|
1749
1898
|
*/
|
|
1750
|
-
export declare const addCustomDiscountToCartItem: <ThrowOnError extends boolean = false>(options: Options<AddCustomDiscountToCartItemData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<
|
|
1899
|
+
export declare const addCustomDiscountToCartItem: <ThrowOnError extends boolean = false>(options: Options<AddCustomDiscountToCartItemData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
|
|
1900
|
+
data?: import("./types.gen").CartsCustomDiscountsResponse;
|
|
1901
|
+
}, import("./types.gen").ResponseError, ThrowOnError>;
|
|
1751
1902
|
/**
|
|
1752
1903
|
* Delete Custom Discount From Cart Item
|
|
1753
1904
|
* Use this endpoint to delete custom discount from cart item.
|
|
@@ -1757,7 +1908,9 @@ export declare const deleteCustomDiscountFromCartItem: <ThrowOnError extends boo
|
|
|
1757
1908
|
* Update Custom Discount For Cart Item
|
|
1758
1909
|
* Use this endpoint to update a custom discount in your cart item.
|
|
1759
1910
|
*/
|
|
1760
|
-
export declare const updateCustomDiscountForCartItem: <ThrowOnError extends boolean = false>(options: Options<UpdateCustomDiscountForCartItemData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<
|
|
1911
|
+
export declare const updateCustomDiscountForCartItem: <ThrowOnError extends boolean = false>(options: Options<UpdateCustomDiscountForCartItemData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
|
|
1912
|
+
data?: import("./types.gen").CartsCustomDiscountsResponse;
|
|
1913
|
+
}, import("./types.gen").ResponseError, ThrowOnError>;
|
|
1761
1914
|
/**
|
|
1762
1915
|
* Create Stripe Payment Intent for a Cart
|
|
1763
1916
|
* The Cart Payment Intent feature enables the creation of a Stripe Payment Intent specifically tied to a shopping cart and its subsequent order. This allows Payment Intent users to track payment details from the cart stage and seamlessly maintain consistency in payment information throughout the order stage. Using these features, you can create Payment Intents for their carts, update Payment Intents with final cart details, and synchronize Payment Intents from Stripe to Commerce.
|
|
@@ -1796,10 +1949,10 @@ export declare const createCartPaymentIntent: <ThrowOnError extends boolean = fa
|
|
|
1796
1949
|
* After a successful checkout, a response that contains the order is returned. If the cart is linked to a shipping group, the shipping group is also associated with the order after checkout.
|
|
1797
1950
|
*
|
|
1798
1951
|
* You can checkout using one of the following methods:
|
|
1799
|
-
* - Customer ID
|
|
1800
|
-
* - Guest Checkout (Checkout with Customer Object)
|
|
1801
|
-
* - Checkout with Account
|
|
1802
|
-
* - Checkout with Account Management Authentication Token
|
|
1952
|
+
* - **Customer ID**: You can checkout a cart with an existing customer ID.
|
|
1953
|
+
* - **Guest Checkout** (Checkout with Customer Object): You can checkout a cart with an associated customer name and email.
|
|
1954
|
+
* - **Checkout with Account**: The shopper authenticates with the `Client Credentials` Token.
|
|
1955
|
+
* - **Checkout with Account Management Authentication Token**: The shopper authenticates with the `Implicit Token` and the `EP-Account-Management-Authentication-Token`.
|
|
1803
1956
|
*
|
|
1804
1957
|
* :::note
|
|
1805
1958
|
*
|
|
@@ -1816,6 +1969,8 @@ export declare const createCartPaymentIntent: <ThrowOnError extends boolean = fa
|
|
|
1816
1969
|
*
|
|
1817
1970
|
* :::
|
|
1818
1971
|
*
|
|
1972
|
+
* You can pass `order_number` and `external_ref` in the checkout endpoint or when [updating an order](/docs/api/carts/update-an-order). The `order_number` is an optional, user-managed field that is used as an alternative to `order_id`. When processing transactions through Authorize.net, the `order_number` is sent instead of the `order_id`, and it will appear in the invoice number section. If no `order_number` is provided, the `order_id` is sent to Authorize.net on payment by default. There are no duplication restrictions on the `order_number` value.
|
|
1973
|
+
*
|
|
1819
1974
|
* ### Next Steps
|
|
1820
1975
|
*
|
|
1821
1976
|
* After a cart has been converted to an Order using either of the previous methods, you most likely want to capture payment for order. See [Paying for an Order](/docs/api/carts/payments).
|
|
@@ -1845,7 +2000,7 @@ export declare const checkoutApi: <ThrowOnError extends boolean = false>(options
|
|
|
1845
2000
|
data?: import("./types.gen").OrderResponse;
|
|
1846
2001
|
}, import("./types.gen").ResponseError, ThrowOnError>;
|
|
1847
2002
|
/**
|
|
1848
|
-
* Get
|
|
2003
|
+
* Get all Orders
|
|
1849
2004
|
* This endpoint returns all orders with custom flow fields. The pagination offset is set to fetch a maximum of 10,000 orders. If the store has 10,000 orders and you fetch the orders without using filters, an error is returned. Use a filter to view orders when the order is beyond the 10,000 mark.
|
|
1850
2005
|
*
|
|
1851
2006
|
* :::note
|
|
@@ -1882,6 +2037,7 @@ export declare const checkoutApi: <ThrowOnError extends boolean = false>(options
|
|
|
1882
2037
|
* | `created_at` | `date` | `eq` / `gt` / `ge`/ `le` / `lt` | `gt(created_at,YYYY-MM-DD)` |
|
|
1883
2038
|
* | `updated_at` | `date` | `eq` / `gt` / `ge`/ `le`/ `lt` | `lt(updated_at,YYYY-MM-DD)` |
|
|
1884
2039
|
* | `external_ref` | `string` | `eq` / `like` | `like(external_ref, 16be*)` |
|
|
2040
|
+
* | `order_number` | `string` | `eq` / `like` | `like(order_number, 123*)` |
|
|
1885
2041
|
*
|
|
1886
2042
|
*/
|
|
1887
2043
|
export declare const getCustomerOrders: <ThrowOnError extends boolean = false>(options?: Options<GetCustomerOrdersData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
|
|
@@ -1898,7 +2054,13 @@ export declare const getAnOrder: <ThrowOnError extends boolean = false>(options:
|
|
|
1898
2054
|
}, import("./types.gen").ResponseError, ThrowOnError>;
|
|
1899
2055
|
/**
|
|
1900
2056
|
* Update an Order
|
|
1901
|
-
* You can only update custom data, `shipping`, `shipping_address`, and status
|
|
2057
|
+
* You can only update custom data, `shipping`, `shipping_address`, and status of orders. All other settings in the order object are immutable.
|
|
2058
|
+
*
|
|
2059
|
+
* This endpoint allows you to:
|
|
2060
|
+
*
|
|
2061
|
+
* - **Update an order number and external reference**: You can update an existing order that does not have an `order_number` and `external_ref`, modify the `order_number` and `external_ref` values, or remove them by passing an empty value in the `order_number` and `external_ref` fields.
|
|
2062
|
+
* - **Cancel an order**: You can cancel an order only if it has not been fulfilled.
|
|
2063
|
+
* - **Fulfill an order**: You can fulfill a paid order only.
|
|
1902
2064
|
*
|
|
1903
2065
|
* :::caution
|
|
1904
2066
|
*
|
|
@@ -1910,6 +2072,7 @@ export declare const getAnOrder: <ThrowOnError extends boolean = false>(options:
|
|
|
1910
2072
|
*
|
|
1911
2073
|
* - This request is only accessible to client credentials token users with Seller Admin role.
|
|
1912
2074
|
* - Non client credentials token users cannot access this endpoint. See [Permissions](/docs/authentication/Tokens/permissions).
|
|
2075
|
+
* - The `order_number` will appear as the invoice number in Authorize.net transactions.
|
|
1913
2076
|
*
|
|
1914
2077
|
* :::
|
|
1915
2078
|
*
|
|
@@ -1935,17 +2098,42 @@ export declare const anonymizeOrders: <ThrowOnError extends boolean = false>(opt
|
|
|
1935
2098
|
data?: import("./types.gen").OrderResponse;
|
|
1936
2099
|
}, import("./types.gen").ResponseError, ThrowOnError>;
|
|
1937
2100
|
/**
|
|
1938
|
-
*
|
|
1939
|
-
*
|
|
2101
|
+
* Payment Setup
|
|
2102
|
+
* Depending on the payment gateway, you may have access to different transaction types such as capturing funds immediately or authorizing them for later. For more information, see [Transactions](/docs/api/carts/transactions).
|
|
2103
|
+
*
|
|
2104
|
+
* The following types of payment methods are available depending on the payment gateway:
|
|
2105
|
+
*
|
|
2106
|
+
* - `purchase`: This is the simplest method. The gateway attempts to charge the customer immediately.
|
|
2107
|
+
* - `authorize`: This method authorizes a payment so that funds can be captured later, for example, when an item is dispatched or restocked.
|
|
2108
|
+
* - `purchase_setup`: This method prepares the system for a purchase by verifying payment details without actually charging the customer. For example, a customer adds items to their cart and proceeds to checkout. Before finalizing the purchase, the system runs `purchase_setup` to confirm all payment details, but no funds are transferred until the customer confirms the order.
|
|
2109
|
+
* - `authorize_setup`: This method prepares the system for an authorization-only transaction. This process holds the necessary funds but does not transfer them, ensuring that the customer has sufficient balance for the transaction. It sets up the conditions for a future capture of the authorized funds. For example, a customer places a pre-order for a product that will ship in two weeks. The merchant uses `authorize_setup` to prepare for the payment authorization. This holds the customer's funds to ensure they can cover the purchase but waits to capture the payment until the product ships. This ensures that payment is secured but not collected prematurely.
|
|
2110
|
+
*
|
|
2111
|
+
* :::note
|
|
2112
|
+
*
|
|
2113
|
+
* Split payments can be performed using any methods for any gateway.
|
|
2114
|
+
*
|
|
2115
|
+
* - You can partially pay funds using `purchase` method. The gateway attempts to charge the customer immediately, and the payment status for an order will show `partially_paid`
|
|
2116
|
+
* - You can partially pay for an order using `authorize` method where the order will be marked as `partially_authorized`. The transaction must be completed for the order status to be `partially_authorized`.
|
|
2117
|
+
* - A `purchase_setup` method allows verification of payment details for partial payments without transferring funds until the customer confirms the full order.
|
|
2118
|
+
* - An `authorize_setup` method can be used to hold a partial amount of the total funds, ensuring the customer has enough balance for a future capture.
|
|
2119
|
+
* Until a payment is made neither `purchase_setup` nor `authorize_setup` affects the payment statuses, and the order remains unpaid. For more information about order and payment statuses for split payments, see [Split payments](/docs/api/payments/payment-gateways-introduction#split-payments).
|
|
2120
|
+
*
|
|
2121
|
+
* :::
|
|
2122
|
+
*
|
|
1940
2123
|
*/
|
|
1941
|
-
export declare const
|
|
2124
|
+
export declare const paymentSetup: <ThrowOnError extends boolean = false>(options: Options<PaymentSetupData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
|
|
1942
2125
|
data?: import("./types.gen").TransactionResponse;
|
|
1943
2126
|
}, import("./types.gen").ResponseError, ThrowOnError>;
|
|
1944
2127
|
/**
|
|
1945
|
-
* Confirm
|
|
1946
|
-
* Confirm
|
|
2128
|
+
* Confirm Payment
|
|
2129
|
+
* Confirm Payment serves as a mechanism to synchronize transaction information from the third-party payment provider back to our system. This ensures that Composable Commerce accurately reflects the values from the payment provider.
|
|
2130
|
+
*
|
|
2131
|
+
* ### Handling 3D Secure Validations for Stripe Payments
|
|
2132
|
+
*
|
|
2133
|
+
* For Stripe Payments requiring 3D Secure validation, the transaction response will include the `client_parameters` object, which provides credentials to support validation of these payment requests on the payment provider's side. We recommend using the Stripe's client libraries to manage these 3D Secure validations. Once the validation succeeds, proceed with a confirmation request to sync the validated transaction into Composable Commerce and continue with the payment process.
|
|
2134
|
+
*
|
|
1947
2135
|
*/
|
|
1948
|
-
export declare const
|
|
2136
|
+
export declare const confirmPayment: <ThrowOnError extends boolean = false>(options: Options<ConfirmPaymentData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
|
|
1949
2137
|
data?: import("./types.gen").TransactionResponse;
|
|
1950
2138
|
}, import("./types.gen").ResponseError, ThrowOnError>;
|
|
1951
2139
|
/**
|
|
@@ -2000,3 +2188,70 @@ export declare const getATransaction: <ThrowOnError extends boolean = false>(opt
|
|
|
2000
2188
|
export declare const cancelATransaction: <ThrowOnError extends boolean = false>(options: Options<CancelATransactionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
|
|
2001
2189
|
data?: import("./types.gen").TransactionResponse;
|
|
2002
2190
|
}, import("./types.gen").ResponseError, ThrowOnError>;
|
|
2191
|
+
/**
|
|
2192
|
+
* Get product
|
|
2193
|
+
*/
|
|
2194
|
+
export declare const getSubscriptionProduct: <ThrowOnError extends boolean = false>(options: Options<GetSubscriptionProductData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
|
|
2195
|
+
data?: import("./types.gen").Product2;
|
|
2196
|
+
}, import("./types.gen").ErrorResponse2, ThrowOnError>;
|
|
2197
|
+
/**
|
|
2198
|
+
* Get plan
|
|
2199
|
+
*/
|
|
2200
|
+
export declare const getPlan: <ThrowOnError extends boolean = false>(options: Options<GetPlanData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
|
|
2201
|
+
data?: import("./types.gen").Plan;
|
|
2202
|
+
}, import("./types.gen").ErrorResponse2, ThrowOnError>;
|
|
2203
|
+
/**
|
|
2204
|
+
* List offerings
|
|
2205
|
+
* Retrieves a list of all subscription offerings.
|
|
2206
|
+
*
|
|
2207
|
+
* ### Filtering
|
|
2208
|
+
*
|
|
2209
|
+
* This endpoint supports filtering. For the general syntax, see [**Filtering**](/guides/Getting-Started/filtering).
|
|
2210
|
+
*
|
|
2211
|
+
* The following attributes and operators are supported.
|
|
2212
|
+
*
|
|
2213
|
+
* | Operator | Attribute | Description |
|
|
2214
|
+
* | --- | --- | --- |
|
|
2215
|
+
* | `eq` | `external_ref`, `products.external_ref`, `proration_policy_id` | Equals. Checks if the values of two operands are equal. If they are, the condition is true. |
|
|
2216
|
+
* | `in` | `products.external_ref` | In. Checks if the values are included in the specified string. If they are, the condition is true. |
|
|
2217
|
+
*
|
|
2218
|
+
*/
|
|
2219
|
+
export declare const listOfferings: <ThrowOnError extends boolean = false>(options?: Options<ListOfferingsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
|
|
2220
|
+
data?: Array<import("./types.gen").Offering>;
|
|
2221
|
+
included?: import("./types.gen").OfferingIncludes;
|
|
2222
|
+
links?: import("./types.gen").Links2;
|
|
2223
|
+
}, import("./types.gen").ErrorResponse2, ThrowOnError>;
|
|
2224
|
+
/**
|
|
2225
|
+
* Get offering
|
|
2226
|
+
*/
|
|
2227
|
+
export declare const getOffering: <ThrowOnError extends boolean = false>(options: Options<GetOfferingData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
|
|
2228
|
+
data?: import("./types.gen").Offering;
|
|
2229
|
+
included?: import("./types.gen").OfferingIncludes;
|
|
2230
|
+
}, import("./types.gen").ErrorResponse2, ThrowOnError>;
|
|
2231
|
+
/**
|
|
2232
|
+
* List an offering's plans
|
|
2233
|
+
*/
|
|
2234
|
+
export declare const listOfferingPlans: <ThrowOnError extends boolean = false>(options: Options<ListOfferingPlansData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
|
|
2235
|
+
data?: Array<import("./types.gen").OfferingPlan>;
|
|
2236
|
+
links?: import("./types.gen").Links2;
|
|
2237
|
+
}, import("./types.gen").ErrorResponse2, ThrowOnError>;
|
|
2238
|
+
/**
|
|
2239
|
+
* List an offering's features
|
|
2240
|
+
*/
|
|
2241
|
+
export declare const listOfferingFeatures: <ThrowOnError extends boolean = false>(options: Options<ListOfferingFeaturesData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
|
|
2242
|
+
data?: Array<import("./types.gen").OfferingFeature>;
|
|
2243
|
+
links?: import("./types.gen").Links2;
|
|
2244
|
+
}, import("./types.gen").ErrorResponse2, ThrowOnError>;
|
|
2245
|
+
/**
|
|
2246
|
+
* List an offering's products
|
|
2247
|
+
*/
|
|
2248
|
+
export declare const listOfferingProducts: <ThrowOnError extends boolean = false>(options: Options<ListOfferingProductsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
|
|
2249
|
+
data?: Array<import("./types.gen").OfferingProduct>;
|
|
2250
|
+
links?: import("./types.gen").Links2;
|
|
2251
|
+
}, import("./types.gen").ErrorResponse2, ThrowOnError>;
|
|
2252
|
+
/**
|
|
2253
|
+
* Get feature
|
|
2254
|
+
*/
|
|
2255
|
+
export declare const getFeature: <ThrowOnError extends boolean = false>(options: Options<GetFeatureData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
|
|
2256
|
+
data?: import("./types.gen").Feature;
|
|
2257
|
+
}, import("./types.gen").ErrorResponse2, ThrowOnError>;
|