@epcc-sdk/sdks-cart-checkout-order 0.0.1

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.
@@ -0,0 +1,1175 @@
1
+ import { type Options } from "@hey-api/client-fetch";
2
+ import type { GetCartsData, CreateACartData, DeleteACartData, GetACartData, 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 } from "./types.gen";
3
+ export declare const client: import("@hey-api/client-fetch").Client<Request, Response, unknown, import("@hey-api/client-fetch").RequestOptions<boolean, string>>;
4
+ /**
5
+ * Get Shopper Carts
6
+ * You can retrieve the carts that are associated with an [account](/docs/api/carts/account-cart-associations) or a [customer](/docs/api/carts/customer-cart-associations).
7
+ *
8
+ * When a shopper retrieves their latest carts, the carts are sorted in descending order by the updated_date. For more information, see [Pagination](/guides/Getting-Started/pagination).
9
+ *
10
+ * :::note
11
+ *
12
+ * Requires an `implicit` token with only one of [Account Management Authentication Token](/docs/api/accounts/post-v-2-account-members-tokens) or [customer token](/docs/customer-management/customer-management-api/customer-tokens).
13
+ *
14
+ * :::
15
+ *
16
+ */
17
+ export declare const getCarts: <ThrowOnError extends boolean = false>(options?: Options<GetCartsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
18
+ data?: Array<import("./types.gen").CartResponse>;
19
+ links?: import("./types.gen").ResponsePageLinks;
20
+ meta?: import("./types.gen").ResponseMetaCarts;
21
+ }, import("./types.gen").ResponseError, ThrowOnError>;
22
+ /**
23
+ * Create a Cart
24
+ *
25
+ * Creates a cart. Call this endpoint each time a customer creates a cart.
26
+ *
27
+ * Each shopper can have multiple carts. Use the carts API to create a cart. The carts are distinct from one another. Shoppers can add different items to their carts. They can check out one of the carts without affecting the content or status of their other carts.
28
+ *
29
+ * After the shopper checks out the cart, the cart remains available to the shopper. The cart is persistent and stays with the shopper after it is used.
30
+ *
31
+ * You can also create a cart to specify custom discounts. You can enable custom discounts when the `discount_settings.custom_discounts_enabled` field is set to `true`. Default is set from cart discount settings for the store. See [Update Cart Settings](/docs/api/settings/put-v-2-settings-cart).
32
+ *
33
+ * ### Preview Cart
34
+ *
35
+ * You can set a future date for your shopping cart and view the promotions that will be available during that time period. This feature enables you to validate your promotion settings and observe how they will be applied in the cart.
36
+ *
37
+ * :::caution
38
+ * - Once the cart is in preview mode, you cannot revert it to a regular cart.
39
+ * - Carts with `snapshot_date` are same as preview carts.
40
+ * - You cannot checkout a cart that includes a `snapshot_date`.
41
+ * - To delete a promotion preview cart, use [Delete a cart](/docs/api/carts/delete-a-cart) endpoint.
42
+ * - The promotion preview cart has the same expiration time as a regular cart based on the store's [cart settings](/docs/api/settings/put-v-2-settings-cart).
43
+ * - Preview cart interactions skip inventory checks and events, allowing users to preview future carts without impacting related external systems.
44
+ * :::
45
+ *
46
+ * ### Custom Attributes
47
+ * You can create custom attributes for the cart object to include additional information, enabling promotions that target specific cart attributes.
48
+ * For example:
49
+ * ```
50
+ * "custom_attributes":{
51
+ * "membership": {
52
+ * "type": "string",
53
+ * "value": "VIP"
54
+ * }
55
+ * }
56
+ * ```
57
+ * See [adding cart custom attributes in promotions builder](/docs/commerce-manager/promotions-builder/creating-a-promotion-in-promotions-builder#adding-cart-custom-attributes)
58
+ *
59
+ * 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.
60
+ * 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.
61
+ *
62
+ * ### Contact Email
63
+ * 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.
64
+ * See [Create Max Uses Per Shopper Promotion Codes](/docs/promotions-builder/promotions-builder-codes/create-max-use-limit-promotion-codes)
65
+ *
66
+ * For example:
67
+ * ```
68
+ * "contact": {
69
+ * "email": "tester@email.com"
70
+ * }
71
+ * ```
72
+ *
73
+ * 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.
74
+ *
75
+ * ### Errors
76
+ *
77
+ * - `400 Bad Request` : This is returned when the submitted request does not adhere to the expected API contract for the endpoint.
78
+ *
79
+ * - For example, in the case of string fields, this error might indicate issues in the length or format of submitted strings. For more information about valid string fields, refer to Safe Characters section.
80
+ * - In the case of preview carts (those with `snapshot_date`), an error is returned for invalid actions, such as removing the preview date, setting a preview date in the past, or attempting to checkout a cart with a `snapshot_date`.
81
+ *
82
+ */
83
+ export declare const createACart: <ThrowOnError extends boolean = false>(options?: Options<CreateACartData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
84
+ data?: import("./types.gen").CartResponse;
85
+ }, import("./types.gen").ResponseError, ThrowOnError>;
86
+ /**
87
+ * Delete a Cart
88
+ * You can delete a cart, including the items, name, description, and remove all associations.
89
+ *
90
+ * ### Errors
91
+ *
92
+ * The following error message is received when you attempt to delete a cart that is associated with a customer. Before deletion, ensure that the cart is disassociated.
93
+ *
94
+ * ```json
95
+ * message: {
96
+ * errors: [
97
+ * {
98
+ * status: 400,
99
+ * title: 'Last cart',
100
+ * detail: 'This is the last cart associated with a customer and it cannot be deleted, try disassociating instead'
101
+ * }
102
+ * ]
103
+ * }
104
+ * ````
105
+ *
106
+ */
107
+ export declare const deleteACart: <ThrowOnError extends boolean = false>(options: Options<DeleteACartData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<void, import("./types.gen").ResponseError, ThrowOnError>;
108
+ /**
109
+ * Get a Cart
110
+ * Use this endpoint to retrieve a specific cart. If a cart ID does not exist, a new cart will be automatically created. If the cart is associated with shipping groups, calling this endpoint displays the associated shipping group IDs in the `relationships` section.
111
+ *
112
+ * You can easily get a new or existing cart by providing the unique cart reference in the request. If the cart is associated with shipping groups, calling this endpoint displays the associated shipping group IDs in the relationships section.
113
+ *
114
+ * :::note
115
+ *
116
+ * - 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.
117
+ * - Outside of the JS-SDK, we don't handle creating cart references. You need to create your own.
118
+ *
119
+ * :::
120
+ *
121
+ * :::caution
122
+ *
123
+ * An empty cart is returned for any carts that don’t currently exist. For more information about the cart items object, see [Get Cart Items](/docs/api/carts/get-cart-items).
124
+ *
125
+ * :::
126
+ *
127
+ * ### Query parameters
128
+ *
129
+ *
130
+ * | Name | Required | Type | Description |
131
+ * |:----------|:---------|:---------|:-------------------------------------------|
132
+ * | `include` | Optional | `string` | Comma-delimited string of entities that can be included. The information included are `items`,`tax_items`, `custom_discounts`, or `promotions`. |
133
+ *
134
+ */
135
+ export declare const getACart: <ThrowOnError extends boolean = false>(options: Options<GetACartData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
136
+ data?: import("./types.gen").CartResponse;
137
+ }, import("./types.gen").ResponseError, ThrowOnError>;
138
+ /**
139
+ * Update a Cart
140
+ * Updates cart properties for the specified cartID.
141
+ *
142
+ * You can also update a cart to specify custom discounts. You can enable custom discounts when the `discount_settings.custom_discounts_enabled` field is set to `true`. Default is set from cart discount settings for the store. See [Cart Settings](/docs/api/settings/put-v-2-settings-cart).
143
+ *
144
+ */
145
+ export declare const updateACart: <ThrowOnError extends boolean = false>(options: Options<UpdateACartData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
146
+ data?: import("./types.gen").CartResponse;
147
+ }, import("./types.gen").ResponseError, ThrowOnError>;
148
+ /**
149
+ * Delete all Cart Items
150
+ * A shopper can clean up their cart, deleting custom items, promotions, and so on, while the empty cart remains available. The cart id, name, description, and any account or customer associations persist. The shopper can continue to add items to the cart.
151
+ *
152
+ */
153
+ export declare const deleteAllCartItems: <ThrowOnError extends boolean = false>(options: Options<DeleteAllCartItemsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<void, import("./types.gen").ResponseError, ThrowOnError>;
154
+ /**
155
+ * Get Cart Items
156
+ *
157
+ * Use this endpoint to retrieve cart items. If the cart is associated with shipping groups, calling this endpoint displays the associated shipping group IDs.
158
+ *
159
+ * You can use this endpoint to retrieve the breakdown of cart items by promotion ID. For example, if you have Promotions Standard item discount with code *sale2024*, Rule Promotions item discount with code *sale2024*, and Rule Promotions cart discount with code *sale2024*, the `discounts.constituents` field in the response example will show the breakdown of the same promotion code used in both Promotions Standard and Rule Promotions.
160
+ *
161
+ * ```json
162
+ * "data": [
163
+ * {
164
+ * "id": "98de010d-dd10-4fa5-a070-0b9bcdc72974",
165
+ * "type": "cart_item",
166
+ * "product_id": "5a4662d2-9a2b-4f6e-a215-2970db914b0c",
167
+ * "name": "sku1",
168
+ * "description": "sku1",
169
+ * "sku": "sku1",
170
+ * "slug": "sku1",
171
+ * "image": {
172
+ * "mime_type": "",
173
+ * "file_name": "",
174
+ * "href": ""
175
+ * },
176
+ * "quantity": 1,
177
+ * "manage_stock": false,
178
+ * "unit_price": {
179
+ * "amount": 10000,
180
+ * "currency": "USD",
181
+ * "includes_tax": false
182
+ * },
183
+ * "value": {
184
+ * "amount": 10000,
185
+ * "currency": "USD",
186
+ * "includes_tax": false
187
+ * },
188
+ * "discounts": [
189
+ * {
190
+ * "amount": {
191
+ * "amount": -2000,
192
+ * "currency": "USD",
193
+ * "includes_tax": false
194
+ * },
195
+ * "code": "sale2024",
196
+ * "id": "e4d929d5-f471-4317-9a86-a84a6c572b44",
197
+ * "promotion_source": "rule-promotion",
198
+ * "is_cart_discount": true
199
+ * },
200
+ * {
201
+ * "amount": {
202
+ * "amount": -1000,
203
+ * "currency": "USD",
204
+ * "includes_tax": false
205
+ * },
206
+ * "code": "sale2024",
207
+ * "id": "de19a043-a6da-4bde-b896-d17e16b77e25",
208
+ * "promotion_source": "rule-promotion"
209
+ * },
210
+ * {
211
+ * "amount": {
212
+ * "amount": -1000,
213
+ * "currency": "USD",
214
+ * "includes_tax": false
215
+ * },
216
+ * "code": "sale2024",
217
+ * "id": "509295ee-2971-45b6-801e-95df09756989"
218
+ * },
219
+ * {
220
+ * "amount": {
221
+ * "amount": -1000,
222
+ * "currency": "USD",
223
+ * "includes_tax": false
224
+ * },
225
+ * "code": "sale2024",
226
+ * "id": "ca79e606-7ecd-41ac-9478-af4c8c28c546",
227
+ * "promotion_source": "rule-promotion",
228
+ * "is_cart_discount": true
229
+ * }
230
+ * ],
231
+ * "links": {
232
+ * "product": "https://useast.api.elasticpath.com/v2/products/5a4662d2-9a2b-4f6e-a215-2970db914b0c"
233
+ * },
234
+ * "meta": {
235
+ * "display_price": {
236
+ * "with_tax": {
237
+ * "unit": {
238
+ * "amount": 5000,
239
+ * "currency": "USD",
240
+ * "formatted": "$50.00"
241
+ * },
242
+ * "value": {
243
+ * "amount": 5000,
244
+ * "currency": "USD",
245
+ * "formatted": "$50.00"
246
+ * }
247
+ * },
248
+ * "without_tax": {
249
+ * "unit": {
250
+ * "amount": 5000,
251
+ * "currency": "USD",
252
+ * "formatted": "$50.00"
253
+ * },
254
+ * "value": {
255
+ * "amount": 5000,
256
+ * "currency": "USD",
257
+ * "formatted": "$50.00"
258
+ * }
259
+ * },
260
+ * "tax": {
261
+ * "unit": {
262
+ * "amount": 0,
263
+ * "currency": "USD",
264
+ * "formatted": "$0.00"
265
+ * },
266
+ * "value": {
267
+ * "amount": 0,
268
+ * "currency": "USD",
269
+ * "formatted": "$0.00"
270
+ * }
271
+ * },
272
+ * "discount": {
273
+ * "unit": {
274
+ * "amount": -5000,
275
+ * "currency": "USD",
276
+ * "formatted": "-$50.00"
277
+ * },
278
+ * "value": {
279
+ * "amount": -5000,
280
+ * "currency": "USD",
281
+ * "formatted": "-$50.00"
282
+ * }
283
+ * },
284
+ * "without_discount": {
285
+ * "unit": {
286
+ * "amount": 10000,
287
+ * "currency": "USD",
288
+ * "formatted": "$100.00"
289
+ * },
290
+ * "value": {
291
+ * "amount": 10000,
292
+ * "currency": "USD",
293
+ * "formatted": "$100.00"
294
+ * }
295
+ * },
296
+ * "discounts": {
297
+ * "sale2024": {
298
+ * "amount": -5000,
299
+ * "currency": "USD",
300
+ * "formatted": "-$50.00",
301
+ * "constituents": {
302
+ * "509295ee-2971-45b6-801e-95df09756989": {
303
+ * "amount": -1000,
304
+ * "currency": "USD",
305
+ * "formatted": "-$10.00"
306
+ * },
307
+ * "ca79e606-7ecd-41ac-9478-af4c8c28c546": {
308
+ * "amount": -1000,
309
+ * "currency": "USD",
310
+ * "formatted": "-$10.00"
311
+ * },
312
+ * "de19a043-a6da-4bde-b896-d17e16b77e25": {
313
+ * "amount": -1000,
314
+ * "currency": "USD",
315
+ * "formatted": "-$10.00"
316
+ * },
317
+ * "e4d929d5-f471-4317-9a86-a84a6c572b44": {
318
+ * "amount": -2000,
319
+ * "currency": "USD",
320
+ * "formatted": "-$20.00"
321
+ * }
322
+ * }
323
+ * }
324
+ * }
325
+ * },
326
+ * "timestamps": {
327
+ * "created_at": "2024-05-24T18:00:58Z",
328
+ * "updated_at": "2024-05-24T18:00:58Z"
329
+ * }
330
+ * },
331
+ * "catalog_id": "09b9359f-897f-407f-89a2-702e167fe781",
332
+ * "catalog_source": "pim"
333
+ * }
334
+ * ```
335
+ *
336
+ */
337
+ 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>;
338
+ /**
339
+ * Add Items to Cart
340
+ *
341
+ * ### Add Product to Cart
342
+ *
343
+ * Adding a Product to Cart is the most common Cart action. If you want to add any custom products or promotions, you need to do that as a separate action.
344
+ *
345
+ * #### Dynamic Bundles
346
+ *
347
+ * A bundle is a purchasable product that is composed of a combination of two or more products that you want to sell together. You can create multiple components within a bundle. Each component can have one or more options. Each option is a product and a quantity. You can configure minimum and/or maximum values for the number of product options in a component that your shoppers can select. For example, you can enable a shopper to select 1 or more product options from a list of 10. These are called [dynamic bundles](/docs/api/pxm/products/products#dynamic-bundles).
348
+ *
349
+ * Your dynamic bundles are displayed in your published catalogs.
350
+ *
351
+ * 1. Use the configure a shopper endpoint to allow shoppers to make their selections from a bundle.
352
+ * 2. In the response of the configure a shopper, the `bundle_configuration` object contains the bundle selections a shopper has made.
353
+ * 3. In the add a product to cart request, use the `bundle_configuration` object to add the customers selections to a cart.
354
+ *
355
+ * ```json
356
+ * "bundle_configuration": {
357
+ * "selected_options": {
358
+ * "games": {
359
+ * "d7b79eb8-19d8-45ea-86ed-2324a604dd9c": 1
360
+ * },
361
+ * "toys": {
362
+ * "0192ccdd-6d33-4898-87d7-c4d87f2bf8ea": 1,
363
+ * "1aea6f97-f0d9-452c-b3c1-7fb5629ead82": 1
364
+ * }
365
+ * }
366
+ * }
367
+ * ```
368
+ *
369
+ * When a cart is checked out, the options a shopper selected are added to the order. See [order items](/docs/api/carts/get-order-items).
370
+ *
371
+ * #### Personalized Products
372
+ *
373
+ * You can allow shoppers to personalize their goods by adding custom text inputs to products directly. This feature is particularly useful for customizable items, such as personalized T-shirts or greeting cards. You can use this functionality by leveraging the `custom_inputs` attribute, and defining the details and validation rules for the custom text.
374
+ *
375
+ * First, you must configure a `custom_inputs` attribute when creating a new product or updating an existing product. Once you have defined your custom inputs on a product, you must configure the custom inputs in your orders.
376
+ *
377
+ * For example, you may sell T-shirts that can have personalized text on the front and back of the shirt.
378
+ *
379
+ * ```json
380
+ * {
381
+ * "data": {
382
+ * "type": "product",
383
+ * "attributes": {
384
+ * "custom_inputs": {
385
+ * "front": {
386
+ * "name": "T-Shirt Front",
387
+ * "validation_rules": [
388
+ * {
389
+ * "type": "string",
390
+ * "options": {
391
+ * "max_length": 50
392
+ * }
393
+ * }
394
+ * ],
395
+ * "required": false
396
+ * },
397
+ * "back": {
398
+ * "name": "T-Shirt Back",
399
+ * "validation_rules": [
400
+ * {
401
+ * "type": "string",
402
+ * "options": {
403
+ * "max_length": 50
404
+ * }
405
+ * }
406
+ * ],
407
+ * "required": false
408
+ * }
409
+ * }
410
+ * }
411
+ * }
412
+ * }
413
+ * ```
414
+ *
415
+ * If the same product has different `custom_inputs` attributes, then these are added as separate items in a cart.
416
+ *
417
+ * The `custom_inputs` attribute is stored in the cart item and the text for `custom_input` must not exceed 255 characters in length. When a cart is checked out, the `custom_inputs` attribute becomes part of the order.
418
+ *
419
+ * #### Limitations on Usage of `custom_inputs` with Specific Promotion Types
420
+ *
421
+ * When you add products to a cart with `custom_inputs`, there are certain limitations on usage of the `custom_inputs` with the following promotion types:
422
+ *
423
+ * - For [Free Gift Promotions](/docs/api/promotions/create-a-promotion), you can add `custom_inputs` to gift items.
424
+ * - 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`.
425
+ * - 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.
426
+ *
427
+ * #### Stock locations
428
+ *
429
+ * 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.
430
+ *
431
+ * 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.
432
+ *
433
+ * :::note
434
+ *
435
+ * - Any requests to add a product to cart returns the collection of cart items.
436
+ * - [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.
437
+ * - The cart currency is set when the first item is added to the cart.
438
+ * - 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.
439
+ * - A cart can contain a maximum of 100 unique items. Items include products, custom items, tax items, and promotions.
440
+ * - There are a number of actions that happen to your inventory when checking out and paying for an order. For more information, see the [Inventory](/docs/api/pxm/inventory/inventories-introduction) documentation.
441
+ *
442
+ * :::
443
+ *
444
+ * ### Including Resources
445
+ *
446
+ * 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.
447
+ *
448
+ * When a bundle with selected component products is added to a cart, the cart displays both the bundle pricing and component product IDs.
449
+ *
450
+ * 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.
451
+ *
452
+ * | Parameter | Required | Description |
453
+ * |:------------------------|:-------------|:-------------------|
454
+ * | `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. |
455
+ * | `main_image` | Optional | The main images associated with a product. |
456
+ * | `files` | Optional | Any files associated with a product. |
457
+ *
458
+ * ```json
459
+ * "bundle_configuration": {
460
+ * "selected_options": {
461
+ * "mixed-shirts": {
462
+ * "16a6cc14-6ebb-4156-9973-e6a0f92f5731": 3,
463
+ * "55037cc5-f382-4039-95c6-1e04ac0351d3": 2,
464
+ * "standard-shirts"
465
+ * "70f1c9d2-c580-4839-bd6c-a0a9b91d5159": 5
466
+ * }
467
+ * },
468
+ * "component_products": [
469
+ * {
470
+ * "id": "16a6cc14-6ebb-4156-9973-e6a0f92f5731",
471
+ * "type": "product",
472
+ * "attributes": {
473
+ * "name": "Red T-shirt",
474
+ * "description": "Standard red t-shirt.",
475
+ * "slug": "red-t-shirt-slug",
476
+ * "sku": "red-t-shirt-sku",
477
+ * "status": "live",
478
+ * "commodity_type": "physical"
479
+ * },
480
+ * "meta": {
481
+ * "display_price": {
482
+ * "without_tax": {
483
+ * "amount": 500,
484
+ * "currency": "USD",
485
+ * "formatted": "$5.00"
486
+ * }
487
+ * }
488
+ * }
489
+ * },
490
+ * {
491
+ * "id": "55037cc5-f382-4039-95c6-1e04ac0351d3",
492
+ * "type": "product",
493
+ * "attributes": {
494
+ * "name": "Blue T-shirt",
495
+ * "description": "Standard blue t-shirt.",
496
+ * "slug": "blue-t-shirt-slug",
497
+ * "sku": "blue-t-shirt-sku",
498
+ * "status": "live",
499
+ * "commodity_type": "physical"
500
+ * },
501
+ * "meta": {
502
+ * "display_price": {
503
+ * "without_tax": {
504
+ * "amount": 500,
505
+ * "currency": "USD",
506
+ * "formatted": "$5.00"
507
+ * }
508
+ * }
509
+ * }
510
+ * },
511
+ * {
512
+ * "id": "70f1c9d2-c580-4839-bd6c-a0a9b91d5159",
513
+ * "type": "product",
514
+ * "attributes": {
515
+ * "name": "White T-shirt",
516
+ * "description": "Standard white t-shirt.",
517
+ * "slug": "white-t-shirt-slug",
518
+ * "sku": "white-t-shirt-sku",
519
+ * "status": "live",
520
+ * "commodity_type": "physical"
521
+ * },
522
+ * "meta": {
523
+ * "display_price": {
524
+ * "without_tax": {
525
+ * "amount": 500,
526
+ * "currency": "USD",
527
+ * "formatted": "$5.00"
528
+ * }
529
+ * }
530
+ * }
531
+ * }
532
+ * ]
533
+ * }
534
+ * ```
535
+ *
536
+ * See [Including Resources](https://elasticpath.dev/guides/Getting-Started/includes).
537
+ *
538
+ * ### Add Subscription to Cart
539
+ *
540
+ * 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.
541
+ *
542
+ * ```json
543
+ * {
544
+ * {
545
+ * "data": {
546
+ * "id": "5b9be99f-1c94-4ddd-9718-81adab0cc3e0",
547
+ * "type": "subscription_item",
548
+ * "quantity": 1,
549
+ * "subscription_configuration": {
550
+ * "plan": "40010dde-2f38-489b-8b3f-14a13cbfb431"
551
+ * }
552
+ * }
553
+ * }
554
+ * ```
555
+ *
556
+ * 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.
557
+ *
558
+ * ### Add Custom Item to Cart
559
+ *
560
+ * You can add a custom item to the cart when you don't manage things like shipping, taxes and inventory in Commerce.
561
+ *
562
+ * 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.
563
+ *
564
+ * :::note
565
+ *
566
+ * - 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.
567
+ *
568
+ * :::
569
+ *
570
+ * ### Add Promotion to Cart
571
+ *
572
+ * You can use the Promotions API to apply discounts to your cart as a special cart item type. Any requests to add a product to cart will return a collection of cart items.
573
+ *
574
+ * There are certain limitations on usage of the `custom_inputs` attribute with some promotion types. See [Limitations on Usage of `custom_inputs` with Specific Promotion Types](/docs/api/carts/manage-carts#limitations-on-usage-of-custom_inputs-with-specific-promotion-types).
575
+ *
576
+ * To remove promotion from the cart via the promotion code, see [Delete Promotion Code from Cart](/docs/api/carts/delete-a-promotion-via-promotion-code).
577
+ *
578
+ * ### Re-order
579
+ *
580
+ * From a shopper’s order history, they can add the items from a previous order into their carts. Shoppers can add items regardless of past order status, such as incomplete or not paid. For more information, see [Orders](/docs/api/carts/orders).
581
+ *
582
+ * :::note
583
+ * - Any requests to add an item to cart return a collection of [cart items](/docs/api/carts/cart-items).
584
+ * - A cart can contain a maximum of 100 unique items. Items include products, custom items, and promotions.
585
+ * - When a shopper creates a cart and re-orders items from an order with properties such as custom attributes, custom discounts, and payment intent ID, these properties will remain unchanged in the original cart.
586
+ * - Custom items do not exist in catalogs, and therefore cannot be reordered.
587
+ * :::
588
+ *
589
+ * ### Merging Carts
590
+ *
591
+ * A shopper can have multiple carts, and the system may automatically merge items from an anonymous cart into the shopper's registered cart when they sign in. For example, if a shopper has an existing cart with items `A`, `B` and `C`, and later adds items `D` and `E` while not signed in, the system can merge these carts when the shopper signs in. After the carts merge, the cart contains items `A`, `B`, `C`, `D` and `E`.
592
+ *
593
+ * If any items are duplicated from the anonymous cart to the registered cart, their quantities are incremented accordingly. For example, if a shopper's existing cart with items `A`, `B` and `C`, and they later add two more `A` items and one `B` item while not signed in, the system will merge the carts when the shopper signs in. The existing cart will now contain three `A` items, two `B` items, and one `C` item.
594
+ *
595
+ * :::note
596
+ *
597
+ * When the system merges items from one cart into another cart, properties such as custom attributes, custom discounts, and payment intent ID will remain unchanged in the original cart.
598
+ *
599
+ * :::
600
+ *
601
+ * ### Best Practices
602
+ *
603
+ * We recommend to include a unique `sku` code within the request body while adding custom items to carts. If the same `sku` is used for multiple products, they are merged into a single line item.
604
+ *
605
+ * For example, if a cart consists of the following items:
606
+ *
607
+ * - `product-1` with quantity 1 and sku code as `sku-1`
608
+ * - `product-2` with quantity 1 and sku code as `sku-1`
609
+ * - `product-3` with quantity 1 and sku code as `sku-2`.
610
+ *
611
+ * The following response is returned where it combines all products with the same sku codes into a single line item, while products with a unique sku codes are represented as separate items:
612
+ *
613
+ * ```json
614
+ * {
615
+ * "data": [
616
+ * {
617
+ * "id": "c58760f4-8889-4719-b34d-be1f1d11ae59",
618
+ * "type": "custom_item",
619
+ * "name": "product-1",
620
+ * "description": "My first custom item!",
621
+ * "sku": "sku-1",
622
+ * "slug": "",
623
+ * "image": {
624
+ * "mime_type": "",
625
+ * "file_name": "",
626
+ * "href": ""
627
+ * },
628
+ * "quantity": 2,
629
+ * "manage_stock": false,
630
+ * "unit_price": {
631
+ * "amount": 20000,
632
+ * "currency": "USD",
633
+ * "includes_tax": true
634
+ * },
635
+ * "value": {
636
+ * "amount": 40000,
637
+ * "currency": "USD",
638
+ * "includes_tax": true
639
+ * },
640
+ * "links": {},
641
+ * "meta": {
642
+ * "display_price": {
643
+ * "with_tax": {
644
+ * "unit": {
645
+ * "amount": 20000,
646
+ * "currency": "USD",
647
+ * "formatted": "$200.00"
648
+ * },
649
+ * "value": {
650
+ * "amount": 40000,
651
+ * "currency": "USD",
652
+ * "formatted": "$400.00"
653
+ * }
654
+ * },
655
+ * "without_tax": {
656
+ * "unit": {
657
+ * "amount": 20000,
658
+ * "currency": "USD",
659
+ * "formatted": "$200.00"
660
+ * },
661
+ * "value": {
662
+ * "amount": 40000,
663
+ * "currency": "USD",
664
+ * "formatted": "$400.00"
665
+ * }
666
+ * },
667
+ * "tax": {
668
+ * "unit": {
669
+ * "amount": 0,
670
+ * "currency": "USD",
671
+ * "formatted": "$0.00"
672
+ * },
673
+ * "value": {
674
+ * "amount": 0,
675
+ * "currency": "USD",
676
+ * "formatted": "$0.00"
677
+ * }
678
+ * },
679
+ * "discount": {
680
+ * "unit": {
681
+ * "amount": 0,
682
+ * "currency": "USD",
683
+ * "formatted": "$0.00"
684
+ * },
685
+ * "value": {
686
+ * "amount": 0,
687
+ * "currency": "USD",
688
+ * "formatted": "$0.00"
689
+ * }
690
+ * },
691
+ * "without_discount": {
692
+ * "unit": {
693
+ * "amount": 20000,
694
+ * "currency": "USD",
695
+ * "formatted": "$200.00"
696
+ * },
697
+ * "value": {
698
+ * "amount": 40000,
699
+ * "currency": "USD",
700
+ * "formatted": "$400.00"
701
+ * }
702
+ * }
703
+ * },
704
+ * "timestamps": {
705
+ * "created_at": "2023-05-02T16:28:11Z",
706
+ * "updated_at": "2023-05-02T16:28:18Z"
707
+ * }
708
+ * }
709
+ * }
710
+ * ```
711
+ *
712
+ */
713
+ export declare const manageCarts: <ThrowOnError extends boolean = false>(options: Options<ManageCartsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").CartsResponse, import("./types.gen").ResponseError, ThrowOnError>;
714
+ /**
715
+ * Bulk Update Items in Cart
716
+ * The bulk update feature allows shoppers to update an array of items to their cart in one action, rather than updating each item one at a time. Shoppers can update quantity and shipping group details in bulk requests. This minimizes the time for shoppers while updating items to their cart. Shoppers can even update multiple items with the same or different shipping groups to their cart.
717
+ *
718
+ * When you update multiple items that qualify for free gifts in the cart, the corresponding free gifts for all eligible products are also automatically updated in the cart.
719
+ *
720
+ */
721
+ export declare const bulkUpdateItemsInCart: <ThrowOnError extends boolean = false>(options: Options<BulkUpdateItemsInCartData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, import("./types.gen").ResponseError, ThrowOnError>;
722
+ /**
723
+ * Delete a Cart Item
724
+ * Use this endpoint to delete a cart item.
725
+ */
726
+ export declare const deleteACartItem: <ThrowOnError extends boolean = false>(options: Options<DeleteACartItemData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<void, import("./types.gen").ResponseError, ThrowOnError>;
727
+ /**
728
+ * Update a Cart Item
729
+ * You can easily update a cart item. A successful update returns the cart items.
730
+ */
731
+ export declare const updateACartItem: <ThrowOnError extends boolean = false>(options: Options<UpdateACartItemData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").CartsResponse, import("./types.gen").ResponseError, ThrowOnError>;
732
+ /**
733
+ * Delete Account Cart Association
734
+ * You can delete an association between an account and a cart.
735
+ */
736
+ export declare const deleteAccountCartAssociation: <ThrowOnError extends boolean = false>(options: Options<DeleteAccountCartAssociationData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<void, import("./types.gen").ResponseError, ThrowOnError>;
737
+ /**
738
+ * Create an Account Cart Association
739
+ * You can create associations between an account and one or more carts. After cart associations exist for an account, the account can access those carts across any device.
740
+ */
741
+ export declare const createAccountCartAssociation: <ThrowOnError extends boolean = false>(options: Options<CreateAccountCartAssociationData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<CreateAccountCartAssociationResponse, import("./types.gen").ResponseError, ThrowOnError>;
742
+ /**
743
+ * Delete Customer Cart Association
744
+ * You can delete an association between a customer and a cart.
745
+ */
746
+ export declare const deleteCustomerCartAssociation: <ThrowOnError extends boolean = false>(options: Options<DeleteCustomerCartAssociationData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<void, import("./types.gen").ResponseError, ThrowOnError>;
747
+ /**
748
+ * Create a Customer Cart Association
749
+ * You can create associations between a customer and one or more carts. After cart associations exist for a customer, the customer can access those carts across any device.
750
+ */
751
+ export declare const createCustomerCartAssociation: <ThrowOnError extends boolean = false>(options: Options<CreateCustomerCartAssociationData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").CartsRelationshipsCustomersData, import("./types.gen").ResponseError, ThrowOnError>;
752
+ /**
753
+ * Delete a Promotion via Promotion Code
754
+ * You can remove promotion code from a cart if it was applied manually. This endpoint does not work if the promotion is applied automatically.
755
+ */
756
+ export declare const deleteAPromotionViaPromotionCode: <ThrowOnError extends boolean = false>(options: Options<DeleteAPromotionViaPromotionCodeData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<void, import("./types.gen").ResponseError, ThrowOnError>;
757
+ /**
758
+ * Add Tax Item to Cart
759
+ *
760
+ * Use this endpoint to add a tax item to a cart.
761
+ *
762
+ * :::note
763
+ *
764
+ * There is a soft limit of 5 unique tax items per cart item at any one time.
765
+ *
766
+ * :::
767
+ *
768
+ */
769
+ export declare const addTaxItemToCart: <ThrowOnError extends boolean = false>(options: Options<AddTaxItemToCartData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
770
+ data?: import("./types.gen").CartsItemsTaxesObject;
771
+ }, import("./types.gen").ResponseError, ThrowOnError>;
772
+ /**
773
+ * Bulk Delete Tax Items from Cart
774
+ * Use this endpoint to bulk delete tax items from cart.
775
+ */
776
+ export declare const bulkDeleteTaxItemsFromCart: <ThrowOnError extends boolean = false>(options: Options<BulkDeleteTaxItemsFromCartData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<void, import("./types.gen").ResponseError, ThrowOnError>;
777
+ /**
778
+ * Bulk Add Tax Items to Cart
779
+ * :::note
780
+ *
781
+ * A cart item can only have a maximum of five tax items.
782
+ *
783
+ * :::
784
+ *
785
+ * ### Errors
786
+ *
787
+ * `422 Unprocessable Entity`
788
+ *
789
+ * 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:
790
+ *
791
+ * ```json
792
+ * {
793
+ * "status": 422,
794
+ * "title": "Add all or nothing.",
795
+ * "detail": "Add all or nothing set to (true). Could not bulk add tax items to cart."
796
+ * }
797
+ *
798
+ * ```
799
+ *
800
+ * In this example, if you add more than five tax items to the same cart item, the following error response is returned:
801
+ *
802
+ * ```json
803
+ * {
804
+ * "status": 422,
805
+ * "title": "Tax item not added to cart item.",
806
+ * "detail": "Cannot exceed tax item limit of (5) on cart item.",
807
+ * "meta": {
808
+ * "id": "f88e6370-cb35-40b2-a998-c759f31dec0a"
809
+ * }
810
+ * }
811
+ * ```
812
+ *
813
+ * `404`
814
+ *
815
+ * In this example, if there is a mismatch between `cart_item`/`custom_item` and the `relationships.item.data.type` specified in the bulk add tax item, the following error response is returned:
816
+ *
817
+ * ```json
818
+ * {
819
+ * "data": [],
820
+ * "errors": [
821
+ * {
822
+ * "status": 404,
823
+ * "title": "Tax item not added to cart item.",
824
+ * "detail": "Mismatch between bulk tax item type(cart_item) and cart item type(custom_item).",
825
+ * "meta": {
826
+ * "id": "56aab5d1-1dd4-45ed-88ed-4d0cc396b62d"
827
+ * }
828
+ * },
829
+ * {
830
+ * "status": 404,
831
+ * "title": "Tax item not added to cart item.",
832
+ * "detail": "Mismatch between bulk tax item type(cart_item) and cart item type(custom_item).",
833
+ * "meta": {
834
+ * "id": "56aab5d1-1dd4-45ed-88ed-4d0cc396b62d"
835
+ * }
836
+ * }
837
+ * ]
838
+ * }
839
+ * ```
840
+ *
841
+ */
842
+ export declare const bulkAddTaxItemsToCart: <ThrowOnError extends boolean = false>(options: Options<BulkAddTaxItemsToCartData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").CartsBulkTaxes, import("./types.gen").ResponseError, ThrowOnError>;
843
+ /**
844
+ * Delete a Tax Item
845
+ * Use this endpoint to delete a tax item.
846
+ */
847
+ export declare const deleteATaxItem: <ThrowOnError extends boolean = false>(options: Options<DeleteATaxItemData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<void, import("./types.gen").ResponseError, ThrowOnError>;
848
+ /**
849
+ * Update a Tax Item
850
+ * Use this endpoint to update a tax item.
851
+ */
852
+ export declare const updateATaxItem: <ThrowOnError extends boolean = false>(options: Options<UpdateATaxItemData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
853
+ data?: import("./types.gen").CartsItemsTaxesObject;
854
+ }, import("./types.gen").ResponseError, ThrowOnError>;
855
+ /**
856
+ * Bulk Delete Custom Discounts From Cart
857
+ * Use this endpoint to bulk delete custom discounts from cart.
858
+ */
859
+ export declare const bulkDeleteCustomDiscountsFromCart: <ThrowOnError extends boolean = false>(options: Options<BulkDeleteCustomDiscountsFromCartData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<void, import("./types.gen").ResponseError, ThrowOnError>;
860
+ /**
861
+ * Bulk Add Custom Discounts to Cart
862
+ * The default value for custom discounts on both the cart and cart items is set to 5 if this parameter is not configured in the store. To verify the custom discount limit value, call [Get all settings](/docs/api/settings/get-v-2-settings) endpoint.
863
+ *
864
+ * To increase the custom discount value, contact [Elastic Path Support team](https://support.elasticpath.com/hc/en-us).
865
+ *
866
+ */
867
+ export declare const bulkAddCustomDiscountsToCart: <ThrowOnError extends boolean = false>(options: Options<BulkAddCustomDiscountsToCartData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").CartsBulkCustomDiscountsResponse, import("./types.gen").ResponseError, ThrowOnError>;
868
+ /**
869
+ * Delete Custom Discount From Cart
870
+ * Use this endpoint to delete custom discount from cart.
871
+ */
872
+ export declare const deleteCustomDiscountFromCart: <ThrowOnError extends boolean = false>(options: Options<DeleteCustomDiscountFromCartData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<void, import("./types.gen").ResponseError, ThrowOnError>;
873
+ /**
874
+ * Update Custom Discount For Cart
875
+ * Use this endpoint to update a custom discount in your cart.
876
+ */
877
+ export declare const updateCustomDiscountForCart: <ThrowOnError extends boolean = false>(options: Options<UpdateCustomDiscountForCartData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
878
+ data?: import("./types.gen").CartsCustomDiscountsResponse;
879
+ }, import("./types.gen").ResponseError, ThrowOnError>;
880
+ /**
881
+ * Add Custom Discount To Cart Item
882
+ * Use this endpoint to add a custom discount to cart item.
883
+ */
884
+ export declare const addCustomDiscountToCartItem: <ThrowOnError extends boolean = false>(options: Options<AddCustomDiscountToCartItemData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
885
+ data?: import("./types.gen").CartsCustomDiscountsResponse;
886
+ }, import("./types.gen").ResponseError, ThrowOnError>;
887
+ /**
888
+ * Delete Custom Discount From Cart Item
889
+ * Use this endpoint to delete custom discount from cart item.
890
+ */
891
+ export declare const deleteCustomDiscountFromCartItem: <ThrowOnError extends boolean = false>(options: Options<DeleteCustomDiscountFromCartItemData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<void, import("./types.gen").ResponseError, ThrowOnError>;
892
+ /**
893
+ * Update Custom Discount For Cart Item
894
+ * Use this endpoint to update a custom discount in your cart item.
895
+ */
896
+ export declare const updateCustomDiscountForCartItem: <ThrowOnError extends boolean = false>(options: Options<UpdateCustomDiscountForCartItemData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
897
+ data?: import("./types.gen").CartsCustomDiscountsResponse;
898
+ }, import("./types.gen").ResponseError, ThrowOnError>;
899
+ /**
900
+ * Create Stripe Payment Intent for a Cart
901
+ * 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.
902
+ *
903
+ * :::note
904
+ *
905
+ * - Typically, in Commerce, inventory is allocated at the time of payment initiation after an order is created. However, in the case of Cart Payment Intent, information about the payment is received only upon synchronizing the order from Stripe to Commerce. This may happen after the payment is completed. Therefore, there might be a delay between the payment made and allocation, increasing the chance of paying for items that are not in stock.
906
+ * - There are certain fields you can choose to set up when [creating a payment intent](https://stripe.com/docs/api/payment_intents/create). However, if you decide to update a payment intent, the available options may not be the same as those allowed while creating a payment intent. See [updating a payment intent](https://stripe.com/docs/api/payment_intents/update).
907
+ *
908
+ * :::
909
+ *
910
+ * The following steps outline the workflow associated with the Payment Intent:
911
+ *
912
+ * 1. [Add items to cart](/docs/api/carts/manage-carts#add-custom-item-to-cart).
913
+ * 1. [Create a Payment Intent for the cart](/docs/api/carts/create-cart-payment-intent). The Payment Intent is created in Stripe, reflecting the cart and transaction details, including currency, amounts, payment type, and any optional Stripe details. The Payment Intent ID is generated and linked to the cart.
914
+ * 1. [Update a Payment Intent](/docs/carts-orders/update-cart-payment-intent). This step is optional but becomes necessary when there are changes in the cart details at the time of payment. It ensures the Payment Intent accurately reflects the current cart details when processing the payments on the front end.
915
+ * 1. [Checkout the cart](/docs/api/carts/checkout). An unpaid order is created, and the Payment Intent ID is linked to the order.
916
+ * 1. [Confirm the order](/docs/carts-orders/confirm-an-order). This is important because after checkout, it is essential to confirm the Payment Intent and synchronize it with Commerce. This results in a corresponding transaction and change in order statuses in Commerce. Additionally, the Payment Intent ID is removed from the order once it is linked via the transaction.
917
+ *
918
+ * ### Best Practices
919
+ *
920
+ * We recommend you follow these practices to maintain consistency and accuracy when using Cart Payment Intent.
921
+ *
922
+ * - After checkout, we recommend clearing the shopping cart. You can achieve this using a [Delete a cart](/docs/api/carts/delete-a-cart) endpoint or [Update a cart](/docs/api/carts/update-a-cart) to remove the Payment Intent ID. This helps to avoid potential issues where subsequent checkouts for the same cart might unintentionally use the previous Stripe Payment Intent ID.
923
+ * - If it is not reasonable to clear the cart immediately after checkout due to several subsequent, duplicate checkouts to the same cart, ensure that you only synchronize the Payment Intent when finalizing the order. Each order confirmation is unaware of the others, and syncing Payment Intent IDs for each confirmation can lead to duplicate transactions in Commerce. In other words, if you synchronize Payment Intents for earlier versions of a repeated checkout, you'll end up with multiple orders from the same cart, each having transactions linked to the same Payment Intent.
924
+ * - To pay the entire amount at once, use the [Update Cart Payment Intent](/docs/carts-orders/update-cart-payment-intent) endpoint to update the Stripe Payment Intent with the final cart details when preparing to take the payment. Doing so, ensures that the Payment Intent accurately reflects the current cart details when processing payments on the front end. We do not recommend calling the [Update Cart Payment Intent](/docs/carts-orders/update-cart-payment-intent) for each individual change in the cart, as this can lead to more requests and may slow down the front-end performance.
925
+ *
926
+ */
927
+ export declare const createCartPaymentIntent: <ThrowOnError extends boolean = false>(options: Options<CreateCartPaymentIntentData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").CartResponse, import("./types.gen").ResponseError, ThrowOnError>;
928
+ /**
929
+ * Checkout API
930
+ * When a Cart is ready for checkout, you can convert the cart to an order. The cart remains and can be modified and checked out again if required.
931
+ *
932
+ * A cart can be checked out with a customer ID, customer object, or with an account by authenticating with the `Client Credentials Token`.
933
+ *
934
+ * 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.
935
+ *
936
+ * You can checkout using one of the following methods:
937
+ * - **Customer ID**: You can checkout a cart with an existing customer ID.
938
+ * - **Guest Checkout** (Checkout with Customer Object): You can checkout a cart with an associated customer name and email.
939
+ * - **Checkout with Account**: The shopper authenticates with the `Client Credentials` Token.
940
+ * - **Checkout with Account Management Authentication Token**: The shopper authenticates with the `Implicit Token` and the `EP-Account-Management-Authentication-Token`.
941
+ *
942
+ * :::note
943
+ *
944
+ * - The cart currency is set when the first item is added to the cart.
945
+ * - 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.
946
+ * - To ensure that a free gift is automatically applied to an order, set the promotion to automatic. The checkout process will not be successful if free gift items are out of stock. See [Errors](#errors) section.
947
+ *
948
+ * :::
949
+ *
950
+ * :::caution
951
+ *
952
+ * - By default, carts are automatically deleted 7 days after the last update. You can change this setting by [updating cart settings](/docs/api/settings/put-v-2-settings-cart).
953
+ * - Your inventory is modified during checkout and payment of an order. For more information about the changes in the inventory, see the [Inventory](/docs/api/pxm/inventory/inventories-introduction) section.
954
+ *
955
+ * :::
956
+ *
957
+ * 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.
958
+ *
959
+ * ### Next Steps
960
+ *
961
+ * 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).
962
+ *
963
+ * ### Errors
964
+ *
965
+ * The following error response is returned during checkout when an eligible item is added to the cart, and the free gift is out of stock.
966
+ *
967
+ * ```json
968
+ * {
969
+ * "errors": [
970
+ * {
971
+ * "status": 400,
972
+ * "title": "Insufficient stock",
973
+ * "detail": "There is not enough stock to add gift2 to your cart",
974
+ * "meta": {
975
+ * "id": "f2b68648-9621-45a3-aed6-1b526b0f5beb",
976
+ * "sku": "gift2"
977
+ * }
978
+ * }
979
+ * ]
980
+ * }
981
+ * ```
982
+ *
983
+ */
984
+ export declare const checkoutApi: <ThrowOnError extends boolean = false>(options: Options<CheckoutApiData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
985
+ data?: import("./types.gen").OrderResponse;
986
+ }, import("./types.gen").ResponseError, ThrowOnError>;
987
+ /**
988
+ * Get all Orders
989
+ * 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.
990
+ *
991
+ * :::note
992
+ *
993
+ * - Pass the `X-Moltin-Customer-Token` header to limit orders to a specific customer. See [Customer Tokens](/docs/customer-management/customer-management-api/customer-tokens).
994
+ * - Pass the `EP-Account-Management-Authentication-Token` header to limit orders to a specific account. See [Account Management Token](/docs/api/accounts/post-v-2-account-members-tokens).
995
+ * - You can use pagination with this resource. For more information, see [pagination](/guides/Getting-Started/pagination).
996
+ *
997
+ * :::
998
+ *
999
+ * ### Filtering
1000
+ *
1001
+ * The following operators and attributes are available for filtering orders.
1002
+ *
1003
+ * | Attribute | Type | Operator | Example |
1004
+ * | :--- | :--- | :--- | :--- |
1005
+ * | `status` | `string` | `eq` | `eq(status,complete)` |
1006
+ * | `payment` | `string` | `eq` | `eq(payment,paid)` |
1007
+ * | `shipping` | `string` | `eq` | `eq(shipping,unfulfilled)` |
1008
+ * | `name` (`customer.name`) | `string` | `eq` / `like` | `like(name,Brad*)` |
1009
+ * | `email` (`customer.email`) | `string` | `eq` / `like` | `like(email,*@elasticpath.com)` |
1010
+ * | `customer_id` | `string` | `eq` / `like` | `eq(customer_id, e5a0d684-a4af-4919-a348-f66b0b4955e0)` |
1011
+ * | `account_id` | `string` | `eq` / `like` | `eq(account_id,3d7200c9-a9bc-4085-9822-63e80fd94a09)` |
1012
+ * | `account_member_id` | `string` | `eq` / `like` | `eq(account_member_id,2a8a3a92-2ccd-4b2b-a7af-52d3896eaecb)` |
1013
+ * | `contact.name` | `string` | `eq` / `like` | `eq(name,John Doe)` |
1014
+ * | `contact.email` | `string` | `eq` / `like` | `eq(email,John Doe)` |
1015
+ * | `shipping_postcode` | `string` | `eq` / `like` | `like(shipping_postcode,117*)` |
1016
+ * | `billing_postcode` | `string` | `eq` / `like` | `like(billing_postcode,117*)` |
1017
+ * | `with_tax` | `integer` | `gt`/`ge`/`lt`/`le` | `ge(with_tax,10000)` |
1018
+ * | `without_tax` | `integer` | `gt`/`ge`/`lt`/`le` | `ge(without_tax,10000)` |
1019
+ * | `currency` | `string` | `eq` | `eq(currency,USD)` |
1020
+ * | `product_id` | `string` | `eq` | `eq(product_id,6837058c-ae42-46db-b3c6-7f01e0c34b40)` |
1021
+ * | `product_sku` | `string` | `eq` | `eq(product_sku,deck-shoe-001)` |
1022
+ * | `created_at` | `date` | `eq` / `gt` / `ge`/ `le` / `lt` | `gt(created_at,YYYY-MM-DD)` |
1023
+ * | `updated_at` | `date` | `eq` / `gt` / `ge`/ `le`/ `lt` | `lt(updated_at,YYYY-MM-DD)` |
1024
+ * | `external_ref` | `string` | `eq` / `like` | `like(external_ref, 16be*)` |
1025
+ * | `order_number` | `string` | `eq` / `like` | `like(order_number, 123*)` |
1026
+ *
1027
+ */
1028
+ export declare const getCustomerOrders: <ThrowOnError extends boolean = false>(options?: Options<GetCustomerOrdersData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
1029
+ data?: Array<import("./types.gen").OrderResponse>;
1030
+ links?: import("./types.gen").ResponsePageLinks;
1031
+ meta?: import("./types.gen").ResponseMetaOrders;
1032
+ }, import("./types.gen").ResponseError, ThrowOnError>;
1033
+ /**
1034
+ * Get an Order
1035
+ * Use this endpoint to retrieve a specific order.
1036
+ */
1037
+ export declare const getAnOrder: <ThrowOnError extends boolean = false>(options: Options<GetAnOrderData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
1038
+ data?: import("./types.gen").OrderResponse;
1039
+ }, import("./types.gen").ResponseError, ThrowOnError>;
1040
+ /**
1041
+ * Update an Order
1042
+ * You can only update custom data, `shipping`, `shipping_address`, and status of orders. All other settings in the order object are immutable.
1043
+ *
1044
+ * This endpoint allows you to:
1045
+ *
1046
+ * - **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.
1047
+ * - **Cancel an order**: You can cancel an order only if it has not been fulfilled.
1048
+ * - **Fulfill an order**: You can fulfill a paid order only.
1049
+ *
1050
+ * :::caution
1051
+ *
1052
+ * You can update `shipping`, `shipping_address`, and status of an order only if the order is not fulfilled. You can use the refund API to refund an order only if the payment status is `paid`. Canceling an order does not automatically refund a payment. You must refund the orders manually.
1053
+ *
1054
+ * :::
1055
+ *
1056
+ * :::note
1057
+ *
1058
+ * - This request is only accessible to client credentials token users with Seller Admin role.
1059
+ * - Non client credentials token users cannot access this endpoint. See [Permissions](/docs/authentication/Tokens/permissions).
1060
+ * - The `order_number` will appear as the invoice number in Authorize.net transactions.
1061
+ *
1062
+ * :::
1063
+ *
1064
+ */
1065
+ export declare const updateAnOrder: <ThrowOnError extends boolean = false>(options: Options<UpdateAnOrderData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
1066
+ data?: import("./types.gen").OrderResponse;
1067
+ }, import("./types.gen").ResponseError, ThrowOnError>;
1068
+ /**
1069
+ * Get Order Items
1070
+ * Use this endpoint to retrieve order items.
1071
+ */
1072
+ export declare const getOrderItems: <ThrowOnError extends boolean = false>(options: Options<GetOrderItemsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
1073
+ data?: Array<import("./types.gen").OrderItemResponse>;
1074
+ }, import("./types.gen").ResponseError, ThrowOnError>;
1075
+ /**
1076
+ * Anonymize Orders
1077
+ * You can anonymize an order when it is fulfilled, canceled, or fully refunded.
1078
+ *
1079
+ * When anonymization is successful, Personal Identifiable Information such as customer details, `shipping_address`, and `billing_address` are replaced with *.
1080
+ *
1081
+ */
1082
+ export declare const anonymizeOrders: <ThrowOnError extends boolean = false>(options?: Options<AnonymizeOrdersData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
1083
+ data?: import("./types.gen").OrderResponse;
1084
+ }, import("./types.gen").ResponseError, ThrowOnError>;
1085
+ /**
1086
+ * Payment Setup
1087
+ * 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).
1088
+ *
1089
+ * The following types of payment methods are available depending on the payment gateway:
1090
+ *
1091
+ * - `purchase`: This is the simplest method. The gateway attempts to charge the customer immediately.
1092
+ * - `authorize`: This method authorizes a payment so that funds can be captured later, for example, when an item is dispatched or restocked.
1093
+ * - `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.
1094
+ * - `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.
1095
+ *
1096
+ * :::note
1097
+ *
1098
+ * Split payments can be performed using any methods for any gateway.
1099
+ *
1100
+ * - 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`
1101
+ * - 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`.
1102
+ * - A `purchase_setup` method allows verification of payment details for partial payments without transferring funds until the customer confirms the full order.
1103
+ * - 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.
1104
+ * 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).
1105
+ *
1106
+ * :::
1107
+ *
1108
+ */
1109
+ export declare const paymentSetup: <ThrowOnError extends boolean = false>(options: Options<PaymentSetupData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
1110
+ data?: import("./types.gen").TransactionResponse;
1111
+ }, import("./types.gen").ResponseError, ThrowOnError>;
1112
+ /**
1113
+ * Confirm Payment
1114
+ * 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.
1115
+ *
1116
+ * ### Handling 3D Secure Validations for Stripe Payments
1117
+ *
1118
+ * 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.
1119
+ *
1120
+ */
1121
+ export declare const confirmPayment: <ThrowOnError extends boolean = false>(options: Options<ConfirmPaymentData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
1122
+ data?: import("./types.gen").TransactionResponse;
1123
+ }, import("./types.gen").ResponseError, ThrowOnError>;
1124
+ /**
1125
+ * Capture a Transaction
1126
+ * Use this endpoint to capture a previously authorized payment. In this step, you can also pass in a custom reference, such as the payment reference from your chosen gateway.
1127
+ */
1128
+ export declare const captureATransaction: <ThrowOnError extends boolean = false>(options: Options<CaptureATransactionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
1129
+ data?: import("./types.gen").TransactionResponse;
1130
+ }, import("./types.gen").ResponseError, ThrowOnError>;
1131
+ /**
1132
+ * Refund a Transaction
1133
+ * There are two ways to refund; through your payment gateway and mark it refunded in Commerce Manager, or directly through Commerce Manager or API.
1134
+ *
1135
+ * * Mark as Refunded: You can manually mark a transaction as refunded. Before you can mark the order as refunded, you need to handle the actual refund on your side with your payment provider. Mark as Refunded is a full refund made to the transaction.
1136
+ * * Refund through Composable Commerce: You can process a full or partial refund to a supported payment provider directly from Commerce Manager or API by providing the refund amount. When you start the refund process, the request is directly sent to the payment gateway.
1137
+ *
1138
+ * :::caution
1139
+ *
1140
+ * If you use manual gateway for partial or full refund, you need to handle the actual refund on your side with your payment provider.
1141
+ *
1142
+ * :::
1143
+ *
1144
+ */
1145
+ export declare const refundATransaction: <ThrowOnError extends boolean = false>(options: Options<RefundATransactionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
1146
+ data?: import("./types.gen").TransactionResponse;
1147
+ }, import("./types.gen").ResponseError, ThrowOnError>;
1148
+ /**
1149
+ * Get Order Transactions
1150
+ * Get order transactions
1151
+ */
1152
+ export declare const getOrderTransactions: <ThrowOnError extends boolean = false>(options: Options<GetOrderTransactionsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
1153
+ data?: Array<import("./types.gen").TransactionResponse>;
1154
+ }, import("./types.gen").ResponseError, ThrowOnError>;
1155
+ /**
1156
+ * Get a Transaction
1157
+ * Retrieves a transaction
1158
+ */
1159
+ export declare const getATransaction: <ThrowOnError extends boolean = false>(options: Options<GetATransactionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
1160
+ data?: import("./types.gen").TransactionResponse;
1161
+ }, import("./types.gen").ResponseError, ThrowOnError>;
1162
+ /**
1163
+ * Cancel a Transaction
1164
+ * Use this endpoint to cancel or void a pending or authorized transaction. The transaction can be canceled or voided when it is in `pending` and `completed` statuses.
1165
+ *
1166
+ * :::caution
1167
+ *
1168
+ * This endpoint works only for Stripe and PayPal and does not work for manual gateway.
1169
+ *
1170
+ * :::
1171
+ *
1172
+ */
1173
+ export declare const cancelATransaction: <ThrowOnError extends boolean = false>(options: Options<CancelATransactionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ResponseData & {
1174
+ data?: import("./types.gen").TransactionResponse;
1175
+ }, import("./types.gen").ResponseError, ThrowOnError>;