@epcc-sdk/sdks-cart-checkout-order 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2426 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var mcp_gen_exports = {};
30
+ __export(mcp_gen_exports, {
31
+ addCustomDiscountToCartItemTool: () => addCustomDiscountToCartItemTool,
32
+ addTaxItemToCartItemComponentTool: () => addTaxItemToCartItemComponentTool,
33
+ addTaxItemToCartTool: () => addTaxItemToCartTool,
34
+ anonymizeOrdersTool: () => anonymizeOrdersTool,
35
+ bulkAddCustomDiscountsToCartTool: () => bulkAddCustomDiscountsToCartTool,
36
+ bulkAddTaxItemsToCartTool: () => bulkAddTaxItemsToCartTool,
37
+ bulkDeleteCustomDiscountsFromCartTool: () => bulkDeleteCustomDiscountsFromCartTool,
38
+ bulkDeleteTaxItemsFromCartTool: () => bulkDeleteTaxItemsFromCartTool,
39
+ bulkUpdateItemsInCartTool: () => bulkUpdateItemsInCartTool,
40
+ cancelATransactionTool: () => cancelATransactionTool,
41
+ captureATransactionTool: () => captureATransactionTool,
42
+ checkoutApiTool: () => checkoutApiTool,
43
+ confirmOrderTool: () => confirmOrderTool,
44
+ confirmPaymentTool: () => confirmPaymentTool,
45
+ createACartTool: () => createACartTool,
46
+ createAccountCartAssociationTool: () => createAccountCartAssociationTool,
47
+ createCartPaymentIntentTool: () => createCartPaymentIntentTool,
48
+ createCustomerCartAssociationTool: () => createCustomerCartAssociationTool,
49
+ createOrderShippingGroupTool: () => createOrderShippingGroupTool,
50
+ createShippingGroupTool: () => createShippingGroupTool,
51
+ deleteACartItemTool: () => deleteACartItemTool,
52
+ deleteACartTool: () => deleteACartTool,
53
+ deleteAPromotionViaPromotionCodeTool: () => deleteAPromotionViaPromotionCodeTool,
54
+ deleteATaxItemTool: () => deleteATaxItemTool,
55
+ deleteAccountCartAssociationTool: () => deleteAccountCartAssociationTool,
56
+ deleteAllCartItemsTool: () => deleteAllCartItemsTool,
57
+ deleteCartShippingGroupTool: () => deleteCartShippingGroupTool,
58
+ deleteCustomDiscountFromCartItemTool: () => deleteCustomDiscountFromCartItemTool,
59
+ deleteCustomDiscountFromCartTool: () => deleteCustomDiscountFromCartTool,
60
+ deleteCustomerCartAssociationTool: () => deleteCustomerCartAssociationTool,
61
+ deleteTaxItemFromCartItemComponentTool: () => deleteTaxItemFromCartItemComponentTool,
62
+ getACartTool: () => getACartTool,
63
+ getATransactionTool: () => getATransactionTool,
64
+ getAnOrderTool: () => getAnOrderTool,
65
+ getCartItemsTool: () => getCartItemsTool,
66
+ getCartsTool: () => getCartsTool,
67
+ getCustomerOrdersTool: () => getCustomerOrdersTool,
68
+ getOrderItemsTool: () => getOrderItemsTool,
69
+ getOrderShippingGroupsTool: () => getOrderShippingGroupsTool,
70
+ getOrderTransactionsTool: () => getOrderTransactionsTool,
71
+ getShippingGroupByIdTool: () => getShippingGroupByIdTool,
72
+ getShippingGroupsByIdTool: () => getShippingGroupsByIdTool,
73
+ getShippingGroupsTool: () => getShippingGroupsTool,
74
+ getV2SettingsCartStoreIdTool: () => getV2SettingsCartStoreIdTool,
75
+ getV2SettingsCartTool: () => getV2SettingsCartTool,
76
+ manageCartsTool: () => manageCartsTool,
77
+ paymentSetupTool: () => paymentSetupTool,
78
+ putShippingGroupByIdTool: () => putShippingGroupByIdTool,
79
+ putV2SettingsCartStoreIdTool: () => putV2SettingsCartStoreIdTool,
80
+ putV2SettingsCartTool: () => putV2SettingsCartTool,
81
+ refundATransactionTool: () => refundATransactionTool,
82
+ tools: () => tools,
83
+ updateACartItemTool: () => updateACartItemTool,
84
+ updateACartTool: () => updateACartTool,
85
+ updateATaxItemTool: () => updateATaxItemTool,
86
+ updateAnOrderTool: () => updateAnOrderTool,
87
+ updateCartPaymentIntentTool: () => updateCartPaymentIntentTool,
88
+ updateCustomDiscountForCartItemTool: () => updateCustomDiscountForCartItemTool,
89
+ updateCustomDiscountForCartTool: () => updateCustomDiscountForCartTool,
90
+ updateShippingGroupTool: () => updateShippingGroupTool,
91
+ updateTaxItemFromCartItemComponentTool: () => updateTaxItemFromCartItemComponentTool
92
+ });
93
+ module.exports = __toCommonJS(mcp_gen_exports);
94
+ var z = __toESM(require("zod"), 1);
95
+ var import_mcp_support = require('./mcp-support.gen.cjs');
96
+ var import_sdk = require('./sdk.gen.cjs');
97
+ var import_zod = require('./zod.gen.cjs');
98
+ const getCartsInput = z.object({
99
+ query: import_zod.zGetCartsQuery.strict().optional(),
100
+ headers: import_zod.zGetCartsHeaders.strict().optional()
101
+ }).strict();
102
+ const getCartsTool = (options) => {
103
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
104
+ (0, import_sdk.getCarts)({
105
+ ...args,
106
+ client: options?.client,
107
+ signal: extra.signal,
108
+ throwOnError: false
109
+ })
110
+ );
111
+ return {
112
+ name: "cart_checkout_order_get_carts",
113
+ config: {
114
+ title: "Get Carts",
115
+ description: "Retrieves a list of carts. The carts returned depend on the authentication method used:\n\n| Authentication Method | Header | Returns |\n| :--- | :--- | :--- |\n| **Customer Token** | `X-Moltin-Customer-Token` | Carts for the specified customer. See [Customer Tokens](/docs/customer-management/customer-management-api/customer-tokens). |\n| **Account Token** | `EP-Account-Management-Authentication-Token` | Carts for the specified account. See [Account Management Token](/docs/api/accounts/post-v-2-account-members-tokens). |\n| **Client Credentials** | `Authorization: Bearer <token>` | All carts or only registered carts, controlled by the `show_all_carts` setting. See [Cart Settings](/docs/api/carts/put-v-2-settings-cart). |\n\n**Client Credentials Behavior:**\n- When `show_all_carts` is `true`: Returns all carts in the store.\n- When `show_all_carts` is `false`: Returns only registered carts (associated with customers or accounts).\n\n**Sorting**\n\nCarts are sorted in descending order by `updated_date`. For more information, see [Pagination](/guides/Getting-Started/pagination).",
116
+ inputSchema: getCartsInput,
117
+ annotations: {
118
+ readOnlyHint: true,
119
+ destructiveHint: false,
120
+ idempotentHint: true,
121
+ openWorldHint: true
122
+ },
123
+ _meta: {
124
+ "com.elasticpath/operation": {
125
+ id: "cart_checkout_order.getCarts",
126
+ method: "GET",
127
+ path: "/v2/carts",
128
+ risk: "read"
129
+ }
130
+ }
131
+ },
132
+ handler
133
+ };
134
+ };
135
+ const createACartInput = z.object({
136
+ headers: import_zod.zCreateACartHeaders.strict().optional(),
137
+ body: (0, import_mcp_support.loose)(import_zod.zCreateACartBody).optional()
138
+ }).strict();
139
+ const createACartTool = (options) => {
140
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
141
+ (0, import_sdk.createACart)({
142
+ ...args,
143
+ client: options?.client,
144
+ signal: extra.signal,
145
+ throwOnError: false
146
+ })
147
+ );
148
+ return {
149
+ name: "cart_checkout_order_create_a_cart",
150
+ config: {
151
+ title: "Create a Cart",
152
+ description: 'Creates a cart. Call this endpoint each time a customer creates a cart.\n\nEach 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.\n\nAfter 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.\n\nYou can 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/carts/put-v-2-settings-cart).\n\nYou can also create a cart when inventory checks are not performed until checkout by setting the `inventory_settings.defer_inventory_check` field to `true`. Again the default is set from cart discount settings for the store. See [Update Cart Settings](/docs/api/carts/put-v-2-settings-cart).\n\n### Preview Cart\n\nYou 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.\n\n:::caution\n- Once the cart is in preview mode, you cannot revert it to a regular cart.\n- Carts with `snapshot_date` are same as preview carts.\n- You cannot checkout a cart that includes a `snapshot_date`.\n- To delete a promotion preview cart, use [Delete a cart](/docs/api/carts/delete-a-cart) endpoint.\n- The promotion preview cart has the same expiration time as a regular cart based on the store\'s [cart settings](/docs/api/carts/put-v-2-settings-cart).\n- Preview cart interactions skip inventory checks and events, allowing users to preview future carts without impacting related external systems.\n:::\n\n### Custom Attributes\nYou can create custom attributes for the cart object to include additional information, enabling promotions that target specific cart attributes.\nFor example:\n```\n"custom_attributes":{\n "membership": {\n "type": "string",\n "value": "VIP"\n }\n}\n```\nSee [adding cart custom attributes in promotions builder](/docs/commerce-manager/promotions-builder/creating-a-promotion-in-promotions-builder#adding-cart-custom-attributes)\n\nCart 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.\nCustom 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.\n\n### Contact Email\nYou 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.\nSee [Create Max Uses Per Shopper Promotion Codes](/docs/promotions-builder/promotions-builder-codes/create-max-use-limit-promotion-codes)\n\nFor example:\n```\n"contact": {\n "email": "tester@email.com"\n}\n```\n\nPlease 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.\n\n### Errors\n\n- `400 Bad Request` : This is returned when the submitted request does not adhere to the expected API contract for the endpoint.\n\n - 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.\n - 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`.',
153
+ inputSchema: createACartInput,
154
+ annotations: {
155
+ readOnlyHint: false,
156
+ destructiveHint: false,
157
+ idempotentHint: false,
158
+ openWorldHint: true
159
+ },
160
+ _meta: {
161
+ "com.elasticpath/operation": {
162
+ id: "cart_checkout_order.createACart",
163
+ method: "POST",
164
+ path: "/v2/carts",
165
+ risk: "create"
166
+ }
167
+ }
168
+ },
169
+ handler
170
+ };
171
+ };
172
+ const deleteACartInput = z.object({
173
+ path: import_zod.zDeleteACartPath.strict()
174
+ }).strict();
175
+ const deleteACartTool = (options) => {
176
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
177
+ (0, import_sdk.deleteACart)({
178
+ ...args,
179
+ client: options?.client,
180
+ signal: extra.signal,
181
+ throwOnError: false
182
+ })
183
+ );
184
+ return {
185
+ name: "cart_checkout_order_delete_a_cart",
186
+ config: {
187
+ title: "Delete a Cart",
188
+ description: "You can delete a cart, including the items, name, description, and remove all associations.\n\n### Errors\n\nThe 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.\n\n```json\nmessage: {\n errors: [\n {\n status: 400,\n title: 'Last cart',\n detail: 'This is the last cart associated with a customer and it cannot be deleted, try disassociating instead'\n }\n ]\n }\n````",
189
+ inputSchema: deleteACartInput,
190
+ annotations: {
191
+ readOnlyHint: false,
192
+ destructiveHint: true,
193
+ idempotentHint: true,
194
+ openWorldHint: true
195
+ },
196
+ _meta: {
197
+ "com.elasticpath/operation": {
198
+ id: "cart_checkout_order.deleteACart",
199
+ method: "DELETE",
200
+ path: "/v2/carts/{cartID}",
201
+ risk: "delete"
202
+ }
203
+ }
204
+ },
205
+ handler
206
+ };
207
+ };
208
+ const getACartInput = z.object({
209
+ path: import_zod.zGetACartPath.strict(),
210
+ query: import_zod.zGetACartQuery.strict().optional()
211
+ }).strict();
212
+ const getACartTool = (options) => {
213
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
214
+ (0, import_sdk.getACart)({
215
+ ...args,
216
+ client: options?.client,
217
+ signal: extra.signal,
218
+ throwOnError: false
219
+ })
220
+ );
221
+ return {
222
+ name: "cart_checkout_order_get_a_cart",
223
+ config: {
224
+ title: "Get a Cart",
225
+ description: "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.\n\nYou 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.\n\n:::note\n\n- 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.\n- Outside of the JS-SDK, we don't handle creating cart references. You need to create your own.\n\n:::\n\n:::caution\n\nAn 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).\n\n:::\n\n### Query parameters\n\n\n| Name | Required | Type | Description |\n|:----------|:---------|:---------|:-------------------------------------------|\n| `include` | Optional | `string` | Comma-delimited string of entities that can be included. The information included are `items`,`tax_items`, `custom_discounts`, or `promotions`. |",
226
+ inputSchema: getACartInput,
227
+ annotations: {
228
+ readOnlyHint: true,
229
+ destructiveHint: false,
230
+ idempotentHint: true,
231
+ openWorldHint: true
232
+ },
233
+ _meta: {
234
+ "com.elasticpath/operation": {
235
+ id: "cart_checkout_order.getACart",
236
+ method: "GET",
237
+ path: "/v2/carts/{cartID}",
238
+ risk: "read"
239
+ }
240
+ }
241
+ },
242
+ handler
243
+ };
244
+ };
245
+ const updateACartInput = z.object({
246
+ path: import_zod.zUpdateACartPath.strict(),
247
+ body: (0, import_mcp_support.loose)(import_zod.zUpdateACartBody).optional()
248
+ }).strict();
249
+ const updateACartTool = (options) => {
250
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
251
+ (0, import_sdk.updateACart)({
252
+ ...args,
253
+ client: options?.client,
254
+ signal: extra.signal,
255
+ throwOnError: false
256
+ })
257
+ );
258
+ return {
259
+ name: "cart_checkout_order_update_a_cart",
260
+ config: {
261
+ title: "Update a Cart",
262
+ description: "Updates cart properties for the specified cartID.\n\nYou can 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/carts/put-v-2-settings-cart).\n\nYou can also create a cart when inventory checks are not performed until checkout by setting the `inventory_settings.defer_inventory_check` field to `true`. Again the default is set from cart discount settings for the store. See [Update Cart Settings](/docs/api/carts/put-v-2-settings-cart).",
263
+ inputSchema: updateACartInput,
264
+ annotations: {
265
+ readOnlyHint: false,
266
+ destructiveHint: true,
267
+ idempotentHint: true,
268
+ openWorldHint: true
269
+ },
270
+ _meta: {
271
+ "com.elasticpath/operation": {
272
+ id: "cart_checkout_order.updateACart",
273
+ method: "PUT",
274
+ path: "/v2/carts/{cartID}",
275
+ risk: "update"
276
+ }
277
+ }
278
+ },
279
+ handler
280
+ };
281
+ };
282
+ const deleteAllCartItemsInput = z.object({
283
+ path: import_zod.zDeleteAllCartItemsPath.strict()
284
+ }).strict();
285
+ const deleteAllCartItemsTool = (options) => {
286
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
287
+ (0, import_sdk.deleteAllCartItems)({
288
+ ...args,
289
+ client: options?.client,
290
+ signal: extra.signal,
291
+ throwOnError: false
292
+ })
293
+ );
294
+ return {
295
+ name: "cart_checkout_order_delete_all_cart_items",
296
+ config: {
297
+ title: "Delete all Cart Items",
298
+ description: "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.",
299
+ inputSchema: deleteAllCartItemsInput,
300
+ annotations: {
301
+ readOnlyHint: false,
302
+ destructiveHint: true,
303
+ idempotentHint: true,
304
+ openWorldHint: true
305
+ },
306
+ _meta: {
307
+ "com.elasticpath/operation": {
308
+ id: "cart_checkout_order.deleteAllCartItems",
309
+ method: "DELETE",
310
+ path: "/v2/carts/{cartID}/items",
311
+ risk: "delete"
312
+ }
313
+ }
314
+ },
315
+ handler
316
+ };
317
+ };
318
+ const getCartItemsInput = z.object({
319
+ path: import_zod.zGetCartItemsPath.strict(),
320
+ query: import_zod.zGetCartItemsQuery.strict().optional()
321
+ }).strict();
322
+ const getCartItemsTool = (options) => {
323
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
324
+ (0, import_sdk.getCartItems)({
325
+ ...args,
326
+ client: options?.client,
327
+ signal: extra.signal,
328
+ throwOnError: false
329
+ })
330
+ );
331
+ return {
332
+ name: "cart_checkout_order_get_cart_items",
333
+ config: {
334
+ title: "Get Cart Items",
335
+ description: 'Use this endpoint to retrieve cart items. If the cart is associated with shipping groups, calling this endpoint displays the associated shipping group IDs.\n\nYou 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.\n\n```json\n"data": [\n{\n "id": "98de010d-dd10-4fa5-a070-0b9bcdc72974",\n "type": "cart_item",\n "product_id": "5a4662d2-9a2b-4f6e-a215-2970db914b0c",\n "name": "sku1",\n "description": "sku1",\n "sku": "sku1",\n "slug": "sku1",\n "image": {\n "mime_type": "",\n "file_name": "",\n "href": ""\n },\n "quantity": 1,\n "manage_stock": false,\n "unit_price": {\n "amount": 10000,\n "currency": "USD",\n "includes_tax": false\n },\n "value": {\n "amount": 10000,\n "currency": "USD",\n "includes_tax": false\n },\n "discounts": [\n {\n "amount": {\n "amount": -2000,\n "currency": "USD",\n "includes_tax": false\n },\n "code": "sale2024",\n "id": "e4d929d5-f471-4317-9a86-a84a6c572b44",\n "promotion_source": "rule-promotion",\n "is_cart_discount": true\n },\n {\n "amount": {\n "amount": -1000,\n "currency": "USD",\n "includes_tax": false\n },\n "code": "sale2024",\n "id": "de19a043-a6da-4bde-b896-d17e16b77e25",\n "promotion_source": "rule-promotion"\n },\n {\n "amount": {\n "amount": -1000,\n "currency": "USD",\n "includes_tax": false\n },\n "code": "sale2024",\n "id": "509295ee-2971-45b6-801e-95df09756989"\n },\n {\n "amount": {\n "amount": -1000,\n "currency": "USD",\n "includes_tax": false\n },\n "code": "sale2024",\n "id": "ca79e606-7ecd-41ac-9478-af4c8c28c546",\n "promotion_source": "rule-promotion",\n "is_cart_discount": true\n }\n ],\n "links": {\n "product": "https://useast.api.elasticpath.com/v2/products/5a4662d2-9a2b-4f6e-a215-2970db914b0c"\n },\n "meta": {\n "display_price": {\n "with_tax": {\n "unit": {\n "amount": 5000,\n "currency": "USD",\n "formatted": "$50.00"\n },\n "value": {\n "amount": 5000,\n "currency": "USD",\n "formatted": "$50.00"\n }\n },\n "without_tax": {\n "unit": {\n "amount": 5000,\n "currency": "USD",\n "formatted": "$50.00"\n },\n "value": {\n "amount": 5000,\n "currency": "USD",\n "formatted": "$50.00"\n }\n },\n "tax": {\n "unit": {\n "amount": 0,\n "currency": "USD",\n "formatted": "$0.00"\n },\n "value": {\n "amount": 0,\n "currency": "USD",\n "formatted": "$0.00"\n }\n },\n "discount": {\n "unit": {\n "amount": -5000,\n "currency": "USD",\n "formatted": "-$50.00"\n },\n "value": {\n "amount": -5000,\n "currency": "USD",\n "formatted": "-$50.00"\n }\n },\n "without_discount": {\n "unit": {\n "amount": 10000,\n "currency": "USD",\n "formatted": "$100.00"\n },\n "value": {\n "amount": 10000,\n "currency": "USD",\n "formatted": "$100.00"\n }\n },\n "discounts": {\n "sale2024": {\n "amount": -5000,\n "currency": "USD",\n "formatted": "-$50.00",\n "constituents": {\n "509295ee-2971-45b6-801e-95df09756989": {\n "amount": -1000,\n "currency": "USD",\n "formatted": "-$10.00"\n },\n "ca79e606-7ecd-41ac-9478-af4c8c28c546": {\n "amount": -1000,\n "currency": "USD",\n "formatted": "-$10.00"\n },\n "de19a043-a6da-4bde-b896-d17e16b77e25": {\n "amount": -1000,\n "currency": "USD",\n "formatted": "-$10.00"\n },\n "e4d929d5-f471-4317-9a86-a84a6c572b44": {\n "amount": -2000,\n "currency": "USD",\n "formatted": "-$20.00"\n }\n }\n }\n }\n },\n "timestamps": {\n "created_at": "2024-05-24T18:00:58Z",\n "updated_at": "2024-05-24T18:00:58Z"\n }\n },\n "catalog_id": "09b9359f-897f-407f-89a2-702e167fe781",\n "catalog_source": "pim"\n}\n```',
336
+ inputSchema: getCartItemsInput,
337
+ annotations: {
338
+ readOnlyHint: true,
339
+ destructiveHint: false,
340
+ idempotentHint: true,
341
+ openWorldHint: true
342
+ },
343
+ _meta: {
344
+ "com.elasticpath/operation": {
345
+ id: "cart_checkout_order.getCartItems",
346
+ method: "GET",
347
+ path: "/v2/carts/{cartID}/items",
348
+ risk: "read"
349
+ }
350
+ }
351
+ },
352
+ handler
353
+ };
354
+ };
355
+ const manageCartsInput = z.object({
356
+ path: import_zod.zManageCartsPath.strict(),
357
+ body: (0, import_mcp_support.loose)(import_zod.zManageCartsBody).optional()
358
+ }).strict();
359
+ const manageCartsTool = (options) => {
360
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
361
+ (0, import_sdk.manageCarts)({
362
+ ...args,
363
+ client: options?.client,
364
+ signal: extra.signal,
365
+ throwOnError: false
366
+ })
367
+ );
368
+ return {
369
+ name: "cart_checkout_order_manage_carts",
370
+ config: {
371
+ title: "Add Items to Cart",
372
+ description: '### Add Product to Cart\n\nAdding 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.\n\n#### Dynamic Bundles\n\nA 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).\n\nYour dynamic bundles are displayed in your published catalogs.\n\n1. Use the configure a shopper endpoint to allow shoppers to make their selections from a bundle.\n2. In the response of the configure a shopper, the `bundle_configuration` object contains the bundle selections a shopper has made.\n3. In the add a product to cart request, use the `bundle_configuration` object to add the customers selections to a cart.\n\n```json\n "bundle_configuration": {\n "selected_options": {\n "games": {\n "d7b79eb8-19d8-45ea-86ed-2324a604dd9c": 1\n },\n "toys": {\n "0192ccdd-6d33-4898-87d7-c4d87f2bf8ea": 1,\n "1aea6f97-f0d9-452c-b3c1-7fb5629ead82": 1\n }\n }\n}\n```\n\nWhen a cart is checked out, the options a shopper selected are added to the order. See [order items](/docs/api/carts/get-order-items).\n\n#### Personalized Products\n\nYou 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.\n\nFirst, 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.\n\nFor example, you may sell T-shirts that can have personalized text on the front and back of the shirt.\n\n```json\n {\n "data": {\n "type": "product",\n "attributes": {\n "custom_inputs": {\n "front": {\n "name": "T-Shirt Front",\n "validation_rules": [\n {\n "type": "string",\n "options": {\n "max_length": 50\n }\n }\n ],\n "required": false\n },\n "back": {\n "name": "T-Shirt Back",\n "validation_rules": [\n {\n "type": "string",\n "options": {\n "max_length": 50\n }\n }\n ],\n "required": false\n }\n }\n }\n }\n}\n```\n\nIf the same product has different `custom_inputs` attributes, then these are added as separate items in a cart.\n\nThe `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.\n\n#### Limitations on Usage of `custom_inputs` with Specific Promotion Types\n\nWhen you add products to a cart with `custom_inputs`, there are certain limitations on usage of the `custom_inputs` with the following promotion types:\n\n - For [Free Gift Promotions](/docs/api/promotions/create-a-promotion), you can add `custom_inputs` to gift items.\n - 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`.\n - 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.\n\n#### Stock locations\n\nWhen 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.\n\nEach 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.\n\n:::note\n\n- Any requests to add a product to cart returns the collection of cart items.\n- [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.\n- The cart currency is set when the first item is added to the cart.\n- 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.\n- A cart can contain a maximum of 100 unique items. Items include products, custom items, tax items, and promotions.\n- 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.\n\n:::\n\n### Including Resources\n\nWhen 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.\n\nWhen a bundle with selected component products is added to a cart, the cart displays both the bundle pricing and component product IDs.\n\nThe 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.\n\n| Parameter | Required | Description |\n|:------------------------|:-------------|:-------------------|\n| `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. |\n| `main_image` | Optional | The main images associated with a product. |\n| `files` | Optional | Any files associated with a product. |\n\n```json\n"bundle_configuration": {\n "selected_options": {\n "mixed-shirts": {\n "16a6cc14-6ebb-4156-9973-e6a0f92f5731": 3,\n "55037cc5-f382-4039-95c6-1e04ac0351d3": 2,\n "standard-shirts"\n "70f1c9d2-c580-4839-bd6c-a0a9b91d5159": 5\n }\n },\n "component_products": [\n {\n "id": "16a6cc14-6ebb-4156-9973-e6a0f92f5731",\n "type": "product",\n "attributes": {\n "name": "Red T-shirt",\n "description": "Standard red t-shirt.",\n "slug": "red-t-shirt-slug",\n "sku": "red-t-shirt-sku",\n "status": "live",\n "commodity_type": "physical"\n },\n "meta": {\n "display_price": {\n "without_tax": {\n "amount": 500,\n "currency": "USD",\n "formatted": "$5.00"\n }\n }\n }\n },\n {\n "id": "55037cc5-f382-4039-95c6-1e04ac0351d3",\n "type": "product",\n "attributes": {\n "name": "Blue T-shirt",\n "description": "Standard blue t-shirt.",\n "slug": "blue-t-shirt-slug",\n "sku": "blue-t-shirt-sku",\n "status": "live",\n "commodity_type": "physical"\n },\n "meta": {\n "display_price": {\n "without_tax": {\n "amount": 500,\n "currency": "USD",\n "formatted": "$5.00"\n }\n }\n }\n },\n {\n "id": "70f1c9d2-c580-4839-bd6c-a0a9b91d5159",\n "type": "product",\n "attributes": {\n "name": "White T-shirt",\n "description": "Standard white t-shirt.",\n "slug": "white-t-shirt-slug",\n "sku": "white-t-shirt-sku",\n "status": "live",\n "commodity_type": "physical"\n },\n "meta": {\n "display_price": {\n "without_tax": {\n "amount": 500,\n "currency": "USD",\n "formatted": "$5.00"\n }\n }\n }\n }\n ]\n}\n```\n\nSee [Including Resources](https://elasticpath.dev/guides/Getting-Started/includes).\n\n### Add Subscription to Cart\n\nTo add a subscription to your cart, you need to provide the ID of the subscription offering, and the ID of the pricing option and plan within that offering that you want to subscribe to.\n\n```json\n {\n {\n "data": {\n "id": "5b9be99f-1c94-4ddd-9718-81adab0cc3e0",\n "type": "subscription_item",\n "quantity": 1,\n "subscription_configuration": {\n "plan": "dfa31307-748c-4369-8571-709f924a0807",\n "pricing_option": "40010dde-2f38-489b-8b3f-14a13cbfb431"\n }\n }\n }\n```\n\nThe 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.\n\n### Add Custom Item to Cart\n\nYou can add a custom item to the cart when you don\'t manage things like shipping, taxes and inventory in Commerce.\n\nFor [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.\n\n:::note\n\n- 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.\n\n:::\n\n### Add Promotion to Cart\n\nYou 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.\n\n 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).\n\nTo remove promotion from the cart via the promotion code, see [Delete Promotion Code from Cart](/docs/api/carts/delete-a-promotion-via-promotion-code).\n\n### Re-order\n\nFrom 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).\n\n:::note\n - Any requests to add an item to cart return a collection of [cart items](/docs/api/carts/cart-items).\n - A cart can contain a maximum of 100 unique items. Items include products, custom items, and promotions.\n - 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.\n - Custom items do not exist in catalogs, and therefore cannot be reordered.\n:::\n\n### Merging Carts\n\nA 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`.\n\nIf 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.\n\n:::note\n\nWhen 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.\n\n:::\n\n### Best Practices\n\nWe 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.\n\nFor example, if a cart consists of the following items:\n\n- `product-1` with quantity 1 and sku code as `sku-1`\n- `product-2` with quantity 1 and sku code as `sku-1`\n- `product-3` with quantity 1 and sku code as `sku-2`.\n\nThe 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:\n\n```json\n{\n "data": [\n {\n "id": "c58760f4-8889-4719-b34d-be1f1d11ae59",\n "type": "custom_item",\n "name": "product-1",\n "description": "My first custom item!",\n "sku": "sku-1",\n "slug": "",\n "image": {\n "mime_type": "",\n "file_name": "",\n "href": ""\n },\n "quantity": 2,\n "manage_stock": false,\n "unit_price": {\n "amount": 20000,\n "currency": "USD",\n "includes_tax": true\n },\n "value": {\n "amount": 40000,\n "currency": "USD",\n "includes_tax": true\n },\n "links": {},\n "meta": {\n "display_price": {\n "with_tax": {\n "unit": {\n "amount": 20000,\n "currency": "USD",\n "formatted": "$200.00"\n },\n "value": {\n "amount": 40000,\n "currency": "USD",\n "formatted": "$400.00"\n }\n },\n "without_tax": {\n "unit": {\n "amount": 20000,\n "currency": "USD",\n "formatted": "$200.00"\n },\n "value": {\n "amount": 40000,\n "currency": "USD",\n "formatted": "$400.00"\n }\n },\n "tax": {\n "unit": {\n "amount": 0,\n "currency": "USD",\n "formatted": "$0.00"\n },\n "value": {\n "amount": 0,\n "currency": "USD",\n "formatted": "$0.00"\n }\n },\n "discount": {\n "unit": {\n "amount": 0,\n "currency": "USD",\n "formatted": "$0.00"\n },\n "value": {\n "amount": 0,\n "currency": "USD",\n "formatted": "$0.00"\n }\n },\n "without_discount": {\n "unit": {\n "amount": 20000,\n "currency": "USD",\n "formatted": "$200.00"\n },\n "value": {\n "amount": 40000,\n "currency": "USD",\n "formatted": "$400.00"\n }\n }\n },\n "timestamps": {\n "created_at": "2023-05-02T16:28:11Z",\n "updated_at": "2023-05-02T16:28:18Z"\n }\n }\n ]\n ```',
373
+ inputSchema: manageCartsInput,
374
+ annotations: {
375
+ readOnlyHint: false,
376
+ destructiveHint: false,
377
+ idempotentHint: false,
378
+ openWorldHint: true
379
+ },
380
+ _meta: {
381
+ "com.elasticpath/operation": {
382
+ id: "cart_checkout_order.manageCarts",
383
+ method: "POST",
384
+ path: "/v2/carts/{cartID}/items",
385
+ risk: "create"
386
+ }
387
+ }
388
+ },
389
+ handler
390
+ };
391
+ };
392
+ const bulkUpdateItemsInCartInput = z.object({
393
+ path: import_zod.zBulkUpdateItemsInCartPath.strict(),
394
+ body: (0, import_mcp_support.loose)(import_zod.zBulkUpdateItemsInCartBody).optional()
395
+ }).strict();
396
+ const bulkUpdateItemsInCartTool = (options) => {
397
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
398
+ (0, import_sdk.bulkUpdateItemsInCart)({
399
+ ...args,
400
+ client: options?.client,
401
+ signal: extra.signal,
402
+ throwOnError: false
403
+ })
404
+ );
405
+ return {
406
+ name: "cart_checkout_order_bulk_update_items_in_cart",
407
+ config: {
408
+ title: "Bulk Update Items in Cart",
409
+ description: "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.\n\nWhen 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.",
410
+ inputSchema: bulkUpdateItemsInCartInput,
411
+ annotations: {
412
+ readOnlyHint: false,
413
+ destructiveHint: true,
414
+ idempotentHint: true,
415
+ openWorldHint: true
416
+ },
417
+ _meta: {
418
+ "com.elasticpath/operation": {
419
+ id: "cart_checkout_order.bulkUpdateItemsInCart",
420
+ method: "PUT",
421
+ path: "/v2/carts/{cartID}/items",
422
+ risk: "update"
423
+ }
424
+ }
425
+ },
426
+ handler
427
+ };
428
+ };
429
+ const deleteACartItemInput = z.object({
430
+ path: import_zod.zDeleteACartItemPath.strict()
431
+ }).strict();
432
+ const deleteACartItemTool = (options) => {
433
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
434
+ (0, import_sdk.deleteACartItem)({
435
+ ...args,
436
+ client: options?.client,
437
+ signal: extra.signal,
438
+ throwOnError: false
439
+ })
440
+ );
441
+ return {
442
+ name: "cart_checkout_order_delete_a_cart_item",
443
+ config: {
444
+ title: "Delete a Cart Item",
445
+ description: "Use this endpoint to delete a cart item.",
446
+ inputSchema: deleteACartItemInput,
447
+ annotations: {
448
+ readOnlyHint: false,
449
+ destructiveHint: true,
450
+ idempotentHint: true,
451
+ openWorldHint: true
452
+ },
453
+ _meta: {
454
+ "com.elasticpath/operation": {
455
+ id: "cart_checkout_order.deleteACartItem",
456
+ method: "DELETE",
457
+ path: "/v2/carts/{cartID}/items/{cartitemID}",
458
+ risk: "delete"
459
+ }
460
+ }
461
+ },
462
+ handler
463
+ };
464
+ };
465
+ const updateACartItemInput = z.object({
466
+ path: import_zod.zUpdateACartItemPath.strict(),
467
+ body: (0, import_mcp_support.loose)(import_zod.zUpdateACartItemBody).optional()
468
+ }).strict();
469
+ const updateACartItemTool = (options) => {
470
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
471
+ (0, import_sdk.updateACartItem)({
472
+ ...args,
473
+ client: options?.client,
474
+ signal: extra.signal,
475
+ throwOnError: false
476
+ })
477
+ );
478
+ return {
479
+ name: "cart_checkout_order_update_a_cart_item",
480
+ config: {
481
+ title: "Update a Cart Item",
482
+ description: "You can easily update a cart item. A successful update returns the cart items.",
483
+ inputSchema: updateACartItemInput,
484
+ annotations: {
485
+ readOnlyHint: false,
486
+ destructiveHint: true,
487
+ idempotentHint: true,
488
+ openWorldHint: true
489
+ },
490
+ _meta: {
491
+ "com.elasticpath/operation": {
492
+ id: "cart_checkout_order.updateACartItem",
493
+ method: "PUT",
494
+ path: "/v2/carts/{cartID}/items/{cartitemID}",
495
+ risk: "update"
496
+ }
497
+ }
498
+ },
499
+ handler
500
+ };
501
+ };
502
+ const deleteAccountCartAssociationInput = z.object({
503
+ path: import_zod.zDeleteAccountCartAssociationPath.strict(),
504
+ headers: import_zod.zDeleteAccountCartAssociationHeaders.strict().optional(),
505
+ body: (0, import_mcp_support.loose)(import_zod.zDeleteAccountCartAssociationBody).optional()
506
+ }).strict();
507
+ const deleteAccountCartAssociationTool = (options) => {
508
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
509
+ (0, import_sdk.deleteAccountCartAssociation)({
510
+ ...args,
511
+ client: options?.client,
512
+ signal: extra.signal,
513
+ throwOnError: false
514
+ })
515
+ );
516
+ return {
517
+ name: "cart_checkout_order_delete_account_cart_association",
518
+ config: {
519
+ title: "Delete Account Cart Association",
520
+ description: "You can delete an association between an account and a cart.",
521
+ inputSchema: deleteAccountCartAssociationInput,
522
+ annotations: {
523
+ readOnlyHint: false,
524
+ destructiveHint: true,
525
+ idempotentHint: true,
526
+ openWorldHint: true
527
+ },
528
+ _meta: {
529
+ "com.elasticpath/operation": {
530
+ id: "cart_checkout_order.deleteAccountCartAssociation",
531
+ method: "DELETE",
532
+ path: "/v2/carts/{cartID}/relationships/accounts",
533
+ risk: "delete"
534
+ }
535
+ }
536
+ },
537
+ handler
538
+ };
539
+ };
540
+ const createAccountCartAssociationInput = z.object({
541
+ path: import_zod.zCreateAccountCartAssociationPath.strict(),
542
+ headers: import_zod.zCreateAccountCartAssociationHeaders.strict().optional(),
543
+ body: (0, import_mcp_support.loose)(import_zod.zCreateAccountCartAssociationBody).optional()
544
+ }).strict();
545
+ const createAccountCartAssociationTool = (options) => {
546
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
547
+ (0, import_sdk.createAccountCartAssociation)({
548
+ ...args,
549
+ client: options?.client,
550
+ signal: extra.signal,
551
+ throwOnError: false
552
+ })
553
+ );
554
+ return {
555
+ name: "cart_checkout_order_create_account_cart_association",
556
+ config: {
557
+ title: "Create an Account Cart Association",
558
+ description: "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.",
559
+ inputSchema: createAccountCartAssociationInput,
560
+ annotations: {
561
+ readOnlyHint: false,
562
+ destructiveHint: false,
563
+ idempotentHint: false,
564
+ openWorldHint: true
565
+ },
566
+ _meta: {
567
+ "com.elasticpath/operation": {
568
+ id: "cart_checkout_order.createAccountCartAssociation",
569
+ method: "POST",
570
+ path: "/v2/carts/{cartID}/relationships/accounts",
571
+ risk: "create"
572
+ }
573
+ }
574
+ },
575
+ handler
576
+ };
577
+ };
578
+ const deleteCustomerCartAssociationInput = z.object({
579
+ path: import_zod.zDeleteCustomerCartAssociationPath.strict(),
580
+ headers: import_zod.zDeleteCustomerCartAssociationHeaders.strict().optional(),
581
+ body: (0, import_mcp_support.loose)(import_zod.zDeleteCustomerCartAssociationBody).optional()
582
+ }).strict();
583
+ const deleteCustomerCartAssociationTool = (options) => {
584
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
585
+ (0, import_sdk.deleteCustomerCartAssociation)({
586
+ ...args,
587
+ client: options?.client,
588
+ signal: extra.signal,
589
+ throwOnError: false
590
+ })
591
+ );
592
+ return {
593
+ name: "cart_checkout_order_delete_customer_cart_association",
594
+ config: {
595
+ title: "Delete Customer Cart Association",
596
+ description: "You can delete an association between a customer and a cart.",
597
+ inputSchema: deleteCustomerCartAssociationInput,
598
+ annotations: {
599
+ readOnlyHint: false,
600
+ destructiveHint: true,
601
+ idempotentHint: true,
602
+ openWorldHint: true
603
+ },
604
+ _meta: {
605
+ "com.elasticpath/operation": {
606
+ id: "cart_checkout_order.deleteCustomerCartAssociation",
607
+ method: "DELETE",
608
+ path: "/v2/carts/{cartID}/relationships/customers",
609
+ risk: "delete"
610
+ }
611
+ }
612
+ },
613
+ handler
614
+ };
615
+ };
616
+ const createCustomerCartAssociationInput = z.object({
617
+ path: import_zod.zCreateCustomerCartAssociationPath.strict(),
618
+ headers: import_zod.zCreateCustomerCartAssociationHeaders.strict().optional(),
619
+ body: (0, import_mcp_support.loose)(import_zod.zCreateCustomerCartAssociationBody).optional()
620
+ }).strict();
621
+ const createCustomerCartAssociationTool = (options) => {
622
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
623
+ (0, import_sdk.createCustomerCartAssociation)({
624
+ ...args,
625
+ client: options?.client,
626
+ signal: extra.signal,
627
+ throwOnError: false
628
+ })
629
+ );
630
+ return {
631
+ name: "cart_checkout_order_create_customer_cart_association",
632
+ config: {
633
+ title: "Create a Customer Cart Association",
634
+ description: "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.",
635
+ inputSchema: createCustomerCartAssociationInput,
636
+ annotations: {
637
+ readOnlyHint: false,
638
+ destructiveHint: false,
639
+ idempotentHint: false,
640
+ openWorldHint: true
641
+ },
642
+ _meta: {
643
+ "com.elasticpath/operation": {
644
+ id: "cart_checkout_order.createCustomerCartAssociation",
645
+ method: "POST",
646
+ path: "/v2/carts/{cartID}/relationships/customers",
647
+ risk: "create"
648
+ }
649
+ }
650
+ },
651
+ handler
652
+ };
653
+ };
654
+ const deleteAPromotionViaPromotionCodeInput = z.object({
655
+ path: import_zod.zDeleteAPromotionViaPromotionCodePath.strict()
656
+ }).strict();
657
+ const deleteAPromotionViaPromotionCodeTool = (options) => {
658
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
659
+ (0, import_sdk.deleteAPromotionViaPromotionCode)({
660
+ ...args,
661
+ client: options?.client,
662
+ signal: extra.signal,
663
+ throwOnError: false
664
+ })
665
+ );
666
+ return {
667
+ name: "cart_checkout_order_delete_a_promotion_via_promotion_code",
668
+ config: {
669
+ title: "Delete a Promotion via Promotion Code",
670
+ description: "You can remove promotion code from a cart if it was applied manually. This endpoint does not work if the promotion is applied automatically.",
671
+ inputSchema: deleteAPromotionViaPromotionCodeInput,
672
+ annotations: {
673
+ readOnlyHint: false,
674
+ destructiveHint: true,
675
+ idempotentHint: true,
676
+ openWorldHint: true
677
+ },
678
+ _meta: {
679
+ "com.elasticpath/operation": {
680
+ id: "cart_checkout_order.deleteAPromotionViaPromotionCode",
681
+ method: "DELETE",
682
+ path: "/v2/carts/{cartID}/discounts/{promoCode}",
683
+ risk: "delete"
684
+ }
685
+ }
686
+ },
687
+ handler
688
+ };
689
+ };
690
+ const addTaxItemToCartInput = z.object({
691
+ path: import_zod.zAddTaxItemToCartPath.strict(),
692
+ body: (0, import_mcp_support.loose)(import_zod.zAddTaxItemToCartBody)
693
+ }).strict();
694
+ const addTaxItemToCartTool = (options) => {
695
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
696
+ (0, import_sdk.addTaxItemToCart)({
697
+ ...args,
698
+ client: options?.client,
699
+ signal: extra.signal,
700
+ throwOnError: false
701
+ })
702
+ );
703
+ return {
704
+ name: "cart_checkout_order_add_tax_item_to_cart",
705
+ config: {
706
+ title: "Add Tax Item to Cart",
707
+ description: "Use this endpoint to add a tax item to a cart.\n\n:::note\n\nThere is a soft limit of 5 unique tax items per cart item at any one time.\n\n:::",
708
+ inputSchema: addTaxItemToCartInput,
709
+ annotations: {
710
+ readOnlyHint: false,
711
+ destructiveHint: false,
712
+ idempotentHint: false,
713
+ openWorldHint: true
714
+ },
715
+ _meta: {
716
+ "com.elasticpath/operation": {
717
+ id: "cart_checkout_order.addTaxItemToCart",
718
+ method: "POST",
719
+ path: "/v2/carts/{cartID}/items/{cartitemID}/taxes",
720
+ risk: "create"
721
+ }
722
+ }
723
+ },
724
+ handler
725
+ };
726
+ };
727
+ const addTaxItemToCartItemComponentInput = z.object({
728
+ path: import_zod.zAddTaxItemToCartItemComponentPath.strict(),
729
+ body: (0, import_mcp_support.loose)(import_zod.zAddTaxItemToCartItemComponentBody)
730
+ }).strict();
731
+ const addTaxItemToCartItemComponentTool = (options) => {
732
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
733
+ (0, import_sdk.addTaxItemToCartItemComponent)({
734
+ ...args,
735
+ client: options?.client,
736
+ signal: extra.signal,
737
+ throwOnError: false
738
+ })
739
+ );
740
+ return {
741
+ name: "cart_checkout_order_add_tax_item_to_cart_item_component",
742
+ config: {
743
+ title: "Add Tax Item to Bundle Component",
744
+ description: "Use this endpoint to add a tax item to a specific bundle component (component product) within a cart item.\n\n:::note\n\nThere is a soft limit of 5 unique tax items per component product at any one time.\n\n:::",
745
+ inputSchema: addTaxItemToCartItemComponentInput,
746
+ annotations: {
747
+ readOnlyHint: false,
748
+ destructiveHint: false,
749
+ idempotentHint: false,
750
+ openWorldHint: true
751
+ },
752
+ _meta: {
753
+ "com.elasticpath/operation": {
754
+ id: "cart_checkout_order.addTaxItemToCartItemComponent",
755
+ method: "POST",
756
+ path: "/v2/carts/{cartID}/items/{cartitemID}/components/{productID}/taxes",
757
+ risk: "create"
758
+ }
759
+ }
760
+ },
761
+ handler
762
+ };
763
+ };
764
+ const deleteTaxItemFromCartItemComponentInput = z.object({
765
+ path: import_zod.zDeleteTaxItemFromCartItemComponentPath.strict()
766
+ }).strict();
767
+ const deleteTaxItemFromCartItemComponentTool = (options) => {
768
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
769
+ (0, import_sdk.deleteTaxItemFromCartItemComponent)({
770
+ ...args,
771
+ client: options?.client,
772
+ signal: extra.signal,
773
+ throwOnError: false
774
+ })
775
+ );
776
+ return {
777
+ name: "cart_checkout_order_delete_tax_item_from_cart_item_component",
778
+ config: {
779
+ title: "Delete Tax Item from Bundle Component",
780
+ description: "Use this endpoint to delete a tax item from a specific bundle component (component product) within a cart item.",
781
+ inputSchema: deleteTaxItemFromCartItemComponentInput,
782
+ annotations: {
783
+ readOnlyHint: false,
784
+ destructiveHint: true,
785
+ idempotentHint: true,
786
+ openWorldHint: true
787
+ },
788
+ _meta: {
789
+ "com.elasticpath/operation": {
790
+ id: "cart_checkout_order.deleteTaxItemFromCartItemComponent",
791
+ method: "DELETE",
792
+ path: "/v2/carts/{cartID}/items/{cartitemID}/components/{productID}/taxes/{taxitemID}",
793
+ risk: "delete"
794
+ }
795
+ }
796
+ },
797
+ handler
798
+ };
799
+ };
800
+ const updateTaxItemFromCartItemComponentInput = z.object({
801
+ path: import_zod.zUpdateTaxItemFromCartItemComponentPath.strict(),
802
+ body: (0, import_mcp_support.loose)(import_zod.zUpdateTaxItemFromCartItemComponentBody).optional()
803
+ }).strict();
804
+ const updateTaxItemFromCartItemComponentTool = (options) => {
805
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
806
+ (0, import_sdk.updateTaxItemFromCartItemComponent)({
807
+ ...args,
808
+ client: options?.client,
809
+ signal: extra.signal,
810
+ throwOnError: false
811
+ })
812
+ );
813
+ return {
814
+ name: "cart_checkout_order_update_tax_item_from_cart_item_component",
815
+ config: {
816
+ title: "Update Tax Item on Bundle Component",
817
+ description: "Use this endpoint to update a tax item on a specific bundle component (component product) within a cart item. To change tax value from `rate` to `amount`, set `rate` to `null`, then set `amount` value and vice versa.",
818
+ inputSchema: updateTaxItemFromCartItemComponentInput,
819
+ annotations: {
820
+ readOnlyHint: false,
821
+ destructiveHint: true,
822
+ idempotentHint: true,
823
+ openWorldHint: true
824
+ },
825
+ _meta: {
826
+ "com.elasticpath/operation": {
827
+ id: "cart_checkout_order.updateTaxItemFromCartItemComponent",
828
+ method: "PUT",
829
+ path: "/v2/carts/{cartID}/items/{cartitemID}/components/{productID}/taxes/{taxitemID}",
830
+ risk: "update"
831
+ }
832
+ }
833
+ },
834
+ handler
835
+ };
836
+ };
837
+ const bulkDeleteTaxItemsFromCartInput = z.object({
838
+ path: import_zod.zBulkDeleteTaxItemsFromCartPath.strict()
839
+ }).strict();
840
+ const bulkDeleteTaxItemsFromCartTool = (options) => {
841
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
842
+ (0, import_sdk.bulkDeleteTaxItemsFromCart)({
843
+ ...args,
844
+ client: options?.client,
845
+ signal: extra.signal,
846
+ throwOnError: false
847
+ })
848
+ );
849
+ return {
850
+ name: "cart_checkout_order_bulk_delete_tax_items_from_cart",
851
+ config: {
852
+ title: "Bulk Delete Tax Items from Cart",
853
+ description: 'Use this endpoint to bulk delete all tax items from all cart items and bundle component products in the cart.\n\n:::warning\n\nThis operation will remove ALL tax items from:\n- All cart items in the cart\n- All bundle component products within bundle cart items\n\n:::\n\n### Behavior\n\n- Removes all tax items from every cart item\n- Removes all tax items from every component product in bundle cart items\n- If no tax items exist anywhere in the cart, returns a 404 error\n\n### Errors\n\n`404 Not Found`\n\nIf no tax items exist in the cart (on cart items or component products):\n\n```json\n{\n "status": 404,\n "title": "Resource Not Found",\n "detail": "No tax items exist in the cart"\n}\n```',
854
+ inputSchema: bulkDeleteTaxItemsFromCartInput,
855
+ annotations: {
856
+ readOnlyHint: false,
857
+ destructiveHint: true,
858
+ idempotentHint: true,
859
+ openWorldHint: true
860
+ },
861
+ _meta: {
862
+ "com.elasticpath/operation": {
863
+ id: "cart_checkout_order.bulkDeleteTaxItemsFromCart",
864
+ method: "DELETE",
865
+ path: "/v2/carts/{cartID}/taxes",
866
+ risk: "delete"
867
+ }
868
+ }
869
+ },
870
+ handler
871
+ };
872
+ };
873
+ const bulkAddTaxItemsToCartInput = z.object({
874
+ path: import_zod.zBulkAddTaxItemsToCartPath.strict(),
875
+ body: (0, import_mcp_support.loose)(import_zod.zBulkAddTaxItemsToCartBody).optional()
876
+ }).strict();
877
+ const bulkAddTaxItemsToCartTool = (options) => {
878
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
879
+ (0, import_sdk.bulkAddTaxItemsToCart)({
880
+ ...args,
881
+ client: options?.client,
882
+ signal: extra.signal,
883
+ throwOnError: false
884
+ })
885
+ );
886
+ return {
887
+ name: "cart_checkout_order_bulk_add_tax_items_to_cart",
888
+ config: {
889
+ title: "Bulk Add Tax Items to Cart",
890
+ description: 'Use this endpoint to bulk add tax items to cart items and bundle component products.\n\n:::note\n\nA cart item can only have a maximum of five tax items.\nA bundle component product can only have a maximum of five tax items.\n\n:::\n\n### Bundle Component Taxes\n\nTo add tax items to bundle component products, include a `meta` object with `component_product_id` in each tax item:\n\n```json\n{\n "data": [\n {\n "type": "tax_item",\n "code": "GST",\n "name": "Goods and Services Tax",\n "rate": 0.1,\n "meta": {\n "component_product_id": "12345678-1234-5678-9012-123456789012"\n },\n "relationships": {\n "item": {\n "data": {\n "type": "cart_item",\n "id": "cart-item-id"\n }\n }\n }\n }\n ]\n}\n```\n\n### Errors\n\n\n`422 Unprocessable Entity`\n\n\nIn this example, when `options.add_all_or_nothing` is set to `true` and if\none of cart items is not found or has reached its maximum tax item limit,\nthe following error response is returned:\n\n\n```json\n\n{\n "status": 422,\n "title": "Add all or nothing.",\n "detail": "Add all or nothing set to (true). Could not bulk add tax items to cart."\n }\n\n```\n\n\nIn this example, if you add more than five tax items to the same cart item,\nthe following error response is returned:\n\n\n```json\n\n{\n "status": 422,\n "title": "Tax item not added to cart item.",\n "detail": "Cannot exceed tax item limit of (5) on cart item.",\n "meta": {\n "id": "f88e6370-cb35-40b2-a998-c759f31dec0a"\n }\n }\n```\n\n\n`404`\n\n\nIn this example, if there is a mismatch between `cart_item`/`custom_item`\nand the `relationships.item.data.type` specified in the bulk add tax item,\nthe following error response is returned:\n\n\n```json\n\n{\n "data": [],\n "errors": [\n {\n "status": 404,\n "title": "Tax item not added to cart item.",\n "detail": "Mismatch between bulk tax item type(cart_item) and cart item type(custom_item).",\n "meta": {\n "id": "56aab5d1-1dd4-45ed-88ed-4d0cc396b62d"\n }\n },\n {\n "status": 404,\n "title": "Tax item not added to cart item.",\n "detail": "Mismatch between bulk tax item type(cart_item) and cart item type(custom_item).",\n "meta": {\n "id": "56aab5d1-1dd4-45ed-88ed-4d0cc396b62d"\n }\n }\n ]\n}\n\n```',
891
+ inputSchema: bulkAddTaxItemsToCartInput,
892
+ annotations: {
893
+ readOnlyHint: false,
894
+ destructiveHint: false,
895
+ idempotentHint: false,
896
+ openWorldHint: true
897
+ },
898
+ _meta: {
899
+ "com.elasticpath/operation": {
900
+ id: "cart_checkout_order.bulkAddTaxItemsToCart",
901
+ method: "POST",
902
+ path: "/v2/carts/{cartID}/taxes",
903
+ risk: "create"
904
+ }
905
+ }
906
+ },
907
+ handler
908
+ };
909
+ };
910
+ const deleteATaxItemInput = z.object({
911
+ path: import_zod.zDeleteATaxItemPath.strict()
912
+ }).strict();
913
+ const deleteATaxItemTool = (options) => {
914
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
915
+ (0, import_sdk.deleteATaxItem)({
916
+ ...args,
917
+ client: options?.client,
918
+ signal: extra.signal,
919
+ throwOnError: false
920
+ })
921
+ );
922
+ return {
923
+ name: "cart_checkout_order_delete_a_tax_item",
924
+ config: {
925
+ title: "Delete a Tax Item",
926
+ description: "Use this endpoint to delete a tax item.",
927
+ inputSchema: deleteATaxItemInput,
928
+ annotations: {
929
+ readOnlyHint: false,
930
+ destructiveHint: true,
931
+ idempotentHint: true,
932
+ openWorldHint: true
933
+ },
934
+ _meta: {
935
+ "com.elasticpath/operation": {
936
+ id: "cart_checkout_order.deleteATaxItem",
937
+ method: "DELETE",
938
+ path: "/v2/carts/{cartID}/items/{cartitemID}/taxes/{taxitemID}",
939
+ risk: "delete"
940
+ }
941
+ }
942
+ },
943
+ handler
944
+ };
945
+ };
946
+ const updateATaxItemInput = z.object({
947
+ path: import_zod.zUpdateATaxItemPath.strict(),
948
+ body: (0, import_mcp_support.loose)(import_zod.zUpdateATaxItemBody).optional()
949
+ }).strict();
950
+ const updateATaxItemTool = (options) => {
951
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
952
+ (0, import_sdk.updateATaxItem)({
953
+ ...args,
954
+ client: options?.client,
955
+ signal: extra.signal,
956
+ throwOnError: false
957
+ })
958
+ );
959
+ return {
960
+ name: "cart_checkout_order_update_a_tax_item",
961
+ config: {
962
+ title: "Update a Tax Item",
963
+ description: "Use this endpoint to update a tax item. To change tax value from `rate` to `amount`, set `rate` to `null`, then set `amount` value and vice versa.",
964
+ inputSchema: updateATaxItemInput,
965
+ annotations: {
966
+ readOnlyHint: false,
967
+ destructiveHint: true,
968
+ idempotentHint: true,
969
+ openWorldHint: true
970
+ },
971
+ _meta: {
972
+ "com.elasticpath/operation": {
973
+ id: "cart_checkout_order.updateATaxItem",
974
+ method: "PUT",
975
+ path: "/v2/carts/{cartID}/items/{cartitemID}/taxes/{taxitemID}",
976
+ risk: "update"
977
+ }
978
+ }
979
+ },
980
+ handler
981
+ };
982
+ };
983
+ const bulkDeleteCustomDiscountsFromCartInput = z.object({
984
+ path: import_zod.zBulkDeleteCustomDiscountsFromCartPath.strict()
985
+ }).strict();
986
+ const bulkDeleteCustomDiscountsFromCartTool = (options) => {
987
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
988
+ (0, import_sdk.bulkDeleteCustomDiscountsFromCart)({
989
+ ...args,
990
+ client: options?.client,
991
+ signal: extra.signal,
992
+ throwOnError: false
993
+ })
994
+ );
995
+ return {
996
+ name: "cart_checkout_order_bulk_delete_custom_discounts_from_cart",
997
+ config: {
998
+ title: "Bulk Delete Custom Discounts From Cart",
999
+ description: "Use this endpoint to bulk delete custom discounts from cart.",
1000
+ inputSchema: bulkDeleteCustomDiscountsFromCartInput,
1001
+ annotations: {
1002
+ readOnlyHint: false,
1003
+ destructiveHint: true,
1004
+ idempotentHint: true,
1005
+ openWorldHint: true
1006
+ },
1007
+ _meta: {
1008
+ "com.elasticpath/operation": {
1009
+ id: "cart_checkout_order.bulkDeleteCustomDiscountsFromCart",
1010
+ method: "DELETE",
1011
+ path: "/v2/carts/{cartID}/custom-discounts",
1012
+ risk: "delete"
1013
+ }
1014
+ }
1015
+ },
1016
+ handler
1017
+ };
1018
+ };
1019
+ const bulkAddCustomDiscountsToCartInput = z.object({
1020
+ path: import_zod.zBulkAddCustomDiscountsToCartPath.strict(),
1021
+ body: (0, import_mcp_support.loose)(import_zod.zBulkAddCustomDiscountsToCartBody).optional()
1022
+ }).strict();
1023
+ const bulkAddCustomDiscountsToCartTool = (options) => {
1024
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1025
+ (0, import_sdk.bulkAddCustomDiscountsToCart)({
1026
+ ...args,
1027
+ client: options?.client,
1028
+ signal: extra.signal,
1029
+ throwOnError: false
1030
+ })
1031
+ );
1032
+ return {
1033
+ name: "cart_checkout_order_bulk_add_custom_discounts_to_cart",
1034
+ config: {
1035
+ title: "Bulk Add Custom Discounts to Cart",
1036
+ description: "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.\n\nTo increase the custom discount value, contact [Elastic Path Support team](https://support.elasticpath.com/hc/en-us).\n\nCustom discounts cannot be combined with Elastic Path promotions. If the cart already contains Elastic Path promotions, remove them before adding custom discounts.",
1037
+ inputSchema: bulkAddCustomDiscountsToCartInput,
1038
+ annotations: {
1039
+ readOnlyHint: false,
1040
+ destructiveHint: false,
1041
+ idempotentHint: false,
1042
+ openWorldHint: true
1043
+ },
1044
+ _meta: {
1045
+ "com.elasticpath/operation": {
1046
+ id: "cart_checkout_order.bulkAddCustomDiscountsToCart",
1047
+ method: "POST",
1048
+ path: "/v2/carts/{cartID}/custom-discounts",
1049
+ risk: "create"
1050
+ }
1051
+ }
1052
+ },
1053
+ handler
1054
+ };
1055
+ };
1056
+ const deleteCustomDiscountFromCartInput = z.object({
1057
+ path: import_zod.zDeleteCustomDiscountFromCartPath.strict()
1058
+ }).strict();
1059
+ const deleteCustomDiscountFromCartTool = (options) => {
1060
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1061
+ (0, import_sdk.deleteCustomDiscountFromCart)({
1062
+ ...args,
1063
+ client: options?.client,
1064
+ signal: extra.signal,
1065
+ throwOnError: false
1066
+ })
1067
+ );
1068
+ return {
1069
+ name: "cart_checkout_order_delete_custom_discount_from_cart",
1070
+ config: {
1071
+ title: "Delete Custom Discount From Cart",
1072
+ description: "Use this endpoint to delete custom discount from cart.",
1073
+ inputSchema: deleteCustomDiscountFromCartInput,
1074
+ annotations: {
1075
+ readOnlyHint: false,
1076
+ destructiveHint: true,
1077
+ idempotentHint: true,
1078
+ openWorldHint: true
1079
+ },
1080
+ _meta: {
1081
+ "com.elasticpath/operation": {
1082
+ id: "cart_checkout_order.deleteCustomDiscountFromCart",
1083
+ method: "DELETE",
1084
+ path: "/v2/carts/{cartID}/custom-discounts/{customdiscountID}",
1085
+ risk: "delete"
1086
+ }
1087
+ }
1088
+ },
1089
+ handler
1090
+ };
1091
+ };
1092
+ const updateCustomDiscountForCartInput = z.object({
1093
+ path: import_zod.zUpdateCustomDiscountForCartPath.strict(),
1094
+ body: (0, import_mcp_support.loose)(import_zod.zUpdateCustomDiscountForCartBody).optional()
1095
+ }).strict();
1096
+ const updateCustomDiscountForCartTool = (options) => {
1097
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1098
+ (0, import_sdk.updateCustomDiscountForCart)({
1099
+ ...args,
1100
+ client: options?.client,
1101
+ signal: extra.signal,
1102
+ throwOnError: false
1103
+ })
1104
+ );
1105
+ return {
1106
+ name: "cart_checkout_order_update_custom_discount_for_cart",
1107
+ config: {
1108
+ title: "Update Custom Discount For Cart",
1109
+ description: "Use this endpoint to update a custom discount in your cart.",
1110
+ inputSchema: updateCustomDiscountForCartInput,
1111
+ annotations: {
1112
+ readOnlyHint: false,
1113
+ destructiveHint: true,
1114
+ idempotentHint: true,
1115
+ openWorldHint: true
1116
+ },
1117
+ _meta: {
1118
+ "com.elasticpath/operation": {
1119
+ id: "cart_checkout_order.updateCustomDiscountForCart",
1120
+ method: "PUT",
1121
+ path: "/v2/carts/{cartID}/custom-discounts/{customdiscountID}",
1122
+ risk: "update"
1123
+ }
1124
+ }
1125
+ },
1126
+ handler
1127
+ };
1128
+ };
1129
+ const addCustomDiscountToCartItemInput = z.object({
1130
+ path: import_zod.zAddCustomDiscountToCartItemPath.strict(),
1131
+ body: (0, import_mcp_support.loose)(import_zod.zAddCustomDiscountToCartItemBody).optional()
1132
+ }).strict();
1133
+ const addCustomDiscountToCartItemTool = (options) => {
1134
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1135
+ (0, import_sdk.addCustomDiscountToCartItem)({
1136
+ ...args,
1137
+ client: options?.client,
1138
+ signal: extra.signal,
1139
+ throwOnError: false
1140
+ })
1141
+ );
1142
+ return {
1143
+ name: "cart_checkout_order_add_custom_discount_to_cart_item",
1144
+ config: {
1145
+ title: "Add Custom Discount To Cart Item",
1146
+ description: "Use this endpoint to add a custom discount to cart item. Custom discounts cannot be combined with Elastic Path promotions. If the cart already contains Elastic Path promotions, remove them before adding custom discounts.",
1147
+ inputSchema: addCustomDiscountToCartItemInput,
1148
+ annotations: {
1149
+ readOnlyHint: false,
1150
+ destructiveHint: false,
1151
+ idempotentHint: false,
1152
+ openWorldHint: true
1153
+ },
1154
+ _meta: {
1155
+ "com.elasticpath/operation": {
1156
+ id: "cart_checkout_order.addCustomDiscountToCartItem",
1157
+ method: "POST",
1158
+ path: "/v2/carts/{cartID}/items/{cartitemID}/custom-discounts",
1159
+ risk: "create"
1160
+ }
1161
+ }
1162
+ },
1163
+ handler
1164
+ };
1165
+ };
1166
+ const deleteCustomDiscountFromCartItemInput = z.object({
1167
+ path: import_zod.zDeleteCustomDiscountFromCartItemPath.strict()
1168
+ }).strict();
1169
+ const deleteCustomDiscountFromCartItemTool = (options) => {
1170
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1171
+ (0, import_sdk.deleteCustomDiscountFromCartItem)({
1172
+ ...args,
1173
+ client: options?.client,
1174
+ signal: extra.signal,
1175
+ throwOnError: false
1176
+ })
1177
+ );
1178
+ return {
1179
+ name: "cart_checkout_order_delete_custom_discount_from_cart_item",
1180
+ config: {
1181
+ title: "Delete Custom Discount From Cart Item",
1182
+ description: "Use this endpoint to delete custom discount from cart item.",
1183
+ inputSchema: deleteCustomDiscountFromCartItemInput,
1184
+ annotations: {
1185
+ readOnlyHint: false,
1186
+ destructiveHint: true,
1187
+ idempotentHint: true,
1188
+ openWorldHint: true
1189
+ },
1190
+ _meta: {
1191
+ "com.elasticpath/operation": {
1192
+ id: "cart_checkout_order.deleteCustomDiscountFromCartItem",
1193
+ method: "DELETE",
1194
+ path: "/v2/carts/{cartID}/items/{cartitemID}/custom-discounts/{customdiscountID}",
1195
+ risk: "delete"
1196
+ }
1197
+ }
1198
+ },
1199
+ handler
1200
+ };
1201
+ };
1202
+ const updateCustomDiscountForCartItemInput = z.object({
1203
+ path: import_zod.zUpdateCustomDiscountForCartItemPath.strict(),
1204
+ body: (0, import_mcp_support.loose)(import_zod.zUpdateCustomDiscountForCartItemBody).optional()
1205
+ }).strict();
1206
+ const updateCustomDiscountForCartItemTool = (options) => {
1207
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1208
+ (0, import_sdk.updateCustomDiscountForCartItem)({
1209
+ ...args,
1210
+ client: options?.client,
1211
+ signal: extra.signal,
1212
+ throwOnError: false
1213
+ })
1214
+ );
1215
+ return {
1216
+ name: "cart_checkout_order_update_custom_discount_for_cart_item",
1217
+ config: {
1218
+ title: "Update Custom Discount For Cart Item",
1219
+ description: "Use this endpoint to update a custom discount in your cart item.",
1220
+ inputSchema: updateCustomDiscountForCartItemInput,
1221
+ annotations: {
1222
+ readOnlyHint: false,
1223
+ destructiveHint: true,
1224
+ idempotentHint: true,
1225
+ openWorldHint: true
1226
+ },
1227
+ _meta: {
1228
+ "com.elasticpath/operation": {
1229
+ id: "cart_checkout_order.updateCustomDiscountForCartItem",
1230
+ method: "PUT",
1231
+ path: "/v2/carts/{cartID}/items/{cartitemID}/custom-discounts/{customdiscountID}",
1232
+ risk: "update"
1233
+ }
1234
+ }
1235
+ },
1236
+ handler
1237
+ };
1238
+ };
1239
+ const getShippingGroupsInput = z.object({
1240
+ path: import_zod.zGetShippingGroupsPath.strict()
1241
+ }).strict();
1242
+ const getShippingGroupsTool = (options) => {
1243
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1244
+ (0, import_sdk.getShippingGroups)({
1245
+ ...args,
1246
+ client: options?.client,
1247
+ signal: extra.signal,
1248
+ throwOnError: false
1249
+ })
1250
+ );
1251
+ return {
1252
+ name: "cart_checkout_order_get_shipping_groups",
1253
+ config: {
1254
+ title: "Retrieve all shipping groups for a cart",
1255
+ description: "Retrieve all shipping groups for a cart",
1256
+ inputSchema: getShippingGroupsInput,
1257
+ annotations: {
1258
+ readOnlyHint: true,
1259
+ destructiveHint: false,
1260
+ idempotentHint: true,
1261
+ openWorldHint: true
1262
+ },
1263
+ _meta: {
1264
+ "com.elasticpath/operation": {
1265
+ id: "cart_checkout_order.getShippingGroups",
1266
+ method: "GET",
1267
+ path: "/v2/carts/{cartID}/shipping-groups",
1268
+ risk: "read"
1269
+ }
1270
+ }
1271
+ },
1272
+ handler
1273
+ };
1274
+ };
1275
+ const createShippingGroupInput = z.object({
1276
+ path: import_zod.zCreateShippingGroupPath.strict(),
1277
+ body: (0, import_mcp_support.loose)(import_zod.zCreateShippingGroupBody)
1278
+ }).strict();
1279
+ const createShippingGroupTool = (options) => {
1280
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1281
+ (0, import_sdk.createShippingGroup)({
1282
+ ...args,
1283
+ client: options?.client,
1284
+ signal: extra.signal,
1285
+ throwOnError: false
1286
+ })
1287
+ );
1288
+ return {
1289
+ name: "cart_checkout_order_create_shipping_group",
1290
+ config: {
1291
+ title: "Create a new shipping group for a cart",
1292
+ description: "Create a new shipping group for a cart",
1293
+ inputSchema: createShippingGroupInput,
1294
+ annotations: {
1295
+ readOnlyHint: false,
1296
+ destructiveHint: false,
1297
+ idempotentHint: false,
1298
+ openWorldHint: true
1299
+ },
1300
+ _meta: {
1301
+ "com.elasticpath/operation": {
1302
+ id: "cart_checkout_order.createShippingGroup",
1303
+ method: "POST",
1304
+ path: "/v2/carts/{cartID}/shipping-groups",
1305
+ risk: "create"
1306
+ }
1307
+ }
1308
+ },
1309
+ handler
1310
+ };
1311
+ };
1312
+ const deleteCartShippingGroupInput = z.object({
1313
+ path: import_zod.zDeleteCartShippingGroupPath.strict()
1314
+ }).strict();
1315
+ const deleteCartShippingGroupTool = (options) => {
1316
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1317
+ (0, import_sdk.deleteCartShippingGroup)({
1318
+ ...args,
1319
+ client: options?.client,
1320
+ signal: extra.signal,
1321
+ throwOnError: false
1322
+ })
1323
+ );
1324
+ return {
1325
+ name: "cart_checkout_order_delete_cart_shipping_group",
1326
+ config: {
1327
+ title: "Delete Cart Shipping Group",
1328
+ description: "Deletes a shipping group from a cart. You cannot delete a shipping group that is attached to cart items.\nYou must first remove the shipping group from all cart items before deleting the shipping group.",
1329
+ inputSchema: deleteCartShippingGroupInput,
1330
+ annotations: {
1331
+ readOnlyHint: false,
1332
+ destructiveHint: true,
1333
+ idempotentHint: true,
1334
+ openWorldHint: true
1335
+ },
1336
+ _meta: {
1337
+ "com.elasticpath/operation": {
1338
+ id: "cart_checkout_order.deleteCartShippingGroup",
1339
+ method: "DELETE",
1340
+ path: "/v2/carts/{cartId}/shipping-groups/{shippingGroupId}",
1341
+ risk: "delete"
1342
+ }
1343
+ }
1344
+ },
1345
+ handler
1346
+ };
1347
+ };
1348
+ const getShippingGroupByIdInput = z.object({
1349
+ path: import_zod.zGetShippingGroupByIdPath.strict()
1350
+ }).strict();
1351
+ const getShippingGroupByIdTool = (options) => {
1352
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1353
+ (0, import_sdk.getShippingGroupById)({
1354
+ ...args,
1355
+ client: options?.client,
1356
+ signal: extra.signal,
1357
+ throwOnError: false
1358
+ })
1359
+ );
1360
+ return {
1361
+ name: "cart_checkout_order_get_shipping_group_by_id",
1362
+ config: {
1363
+ title: "Retrieve a specific shipping group for a cart",
1364
+ description: "Retrieve a specific shipping group for a cart",
1365
+ inputSchema: getShippingGroupByIdInput,
1366
+ annotations: {
1367
+ readOnlyHint: true,
1368
+ destructiveHint: false,
1369
+ idempotentHint: true,
1370
+ openWorldHint: true
1371
+ },
1372
+ _meta: {
1373
+ "com.elasticpath/operation": {
1374
+ id: "cart_checkout_order.getShippingGroupById",
1375
+ method: "GET",
1376
+ path: "/v2/carts/{cartId}/shipping-groups/{shippingGroupId}",
1377
+ risk: "read"
1378
+ }
1379
+ }
1380
+ },
1381
+ handler
1382
+ };
1383
+ };
1384
+ const updateShippingGroupInput = z.object({
1385
+ path: import_zod.zUpdateShippingGroupPath.strict(),
1386
+ body: (0, import_mcp_support.loose)(import_zod.zUpdateShippingGroupBody)
1387
+ }).strict();
1388
+ const updateShippingGroupTool = (options) => {
1389
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1390
+ (0, import_sdk.updateShippingGroup)({
1391
+ ...args,
1392
+ client: options?.client,
1393
+ signal: extra.signal,
1394
+ throwOnError: false
1395
+ })
1396
+ );
1397
+ return {
1398
+ name: "cart_checkout_order_update_shipping_group",
1399
+ config: {
1400
+ title: "Update a shipping group for a cart",
1401
+ description: "Update a specific shipping group for a cart",
1402
+ inputSchema: updateShippingGroupInput,
1403
+ annotations: {
1404
+ readOnlyHint: false,
1405
+ destructiveHint: true,
1406
+ idempotentHint: true,
1407
+ openWorldHint: true
1408
+ },
1409
+ _meta: {
1410
+ "com.elasticpath/operation": {
1411
+ id: "cart_checkout_order.updateShippingGroup",
1412
+ method: "PUT",
1413
+ path: "/v2/carts/{cartId}/shipping-groups/{shippingGroupId}",
1414
+ risk: "update"
1415
+ }
1416
+ }
1417
+ },
1418
+ handler
1419
+ };
1420
+ };
1421
+ const createCartPaymentIntentInput = z.object({
1422
+ path: import_zod.zCreateCartPaymentIntentPath.strict(),
1423
+ body: (0, import_mcp_support.loose)(import_zod.zCreateCartPaymentIntentBody).optional()
1424
+ }).strict();
1425
+ const createCartPaymentIntentTool = (options) => {
1426
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1427
+ (0, import_sdk.createCartPaymentIntent)({
1428
+ ...args,
1429
+ client: options?.client,
1430
+ signal: extra.signal,
1431
+ throwOnError: false
1432
+ })
1433
+ );
1434
+ return {
1435
+ name: "cart_checkout_order_create_cart_payment_intent",
1436
+ config: {
1437
+ title: "Create Stripe Payment Intent for a Cart",
1438
+ description: "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.\n\n:::note\n\n- 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.\n- 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).\n\n:::\n\nThe following steps outline the workflow associated with the Payment Intent:\n\n1. [Add items to cart](/docs/api/carts/manage-carts#add-custom-item-to-cart).\n1. [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.\n1. [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.\n1. [Checkout the cart](/docs/api/carts/checkout). An unpaid order is created, and the Payment Intent ID is linked to the order.\n1. [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.\n\n### Best Practices\n\nWe recommend you follow these practices to maintain consistency and accuracy when using Cart Payment Intent.\n\n- 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.\n- 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.\n- 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.",
1439
+ inputSchema: createCartPaymentIntentInput,
1440
+ annotations: {
1441
+ readOnlyHint: false,
1442
+ destructiveHint: false,
1443
+ idempotentHint: false,
1444
+ openWorldHint: true
1445
+ },
1446
+ _meta: {
1447
+ "com.elasticpath/operation": {
1448
+ id: "cart_checkout_order.createCartPaymentIntent",
1449
+ method: "POST",
1450
+ path: "/v2/carts/{cartID}/payments",
1451
+ risk: "create"
1452
+ }
1453
+ }
1454
+ },
1455
+ handler
1456
+ };
1457
+ };
1458
+ const updateCartPaymentIntentInput = z.object({
1459
+ path: import_zod.zUpdateCartPaymentIntentPath.strict(),
1460
+ body: (0, import_mcp_support.loose)(import_zod.zUpdateCartPaymentIntentBody)
1461
+ }).strict();
1462
+ const updateCartPaymentIntentTool = (options) => {
1463
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1464
+ (0, import_sdk.updateCartPaymentIntent)({
1465
+ ...args,
1466
+ client: options?.client,
1467
+ signal: extra.signal,
1468
+ throwOnError: false
1469
+ })
1470
+ );
1471
+ return {
1472
+ name: "cart_checkout_order_update_cart_payment_intent",
1473
+ config: {
1474
+ title: "Update a Payment Intent on a Cart",
1475
+ description: "Updates the payment information for a specific payment intent on a cart.",
1476
+ inputSchema: updateCartPaymentIntentInput,
1477
+ annotations: {
1478
+ readOnlyHint: false,
1479
+ destructiveHint: true,
1480
+ idempotentHint: true,
1481
+ openWorldHint: true
1482
+ },
1483
+ _meta: {
1484
+ "com.elasticpath/operation": {
1485
+ id: "cart_checkout_order.updateCartPaymentIntent",
1486
+ method: "PUT",
1487
+ path: "/v2/carts/{cartID}/payments/{paymentIntentID}",
1488
+ risk: "update"
1489
+ }
1490
+ }
1491
+ },
1492
+ handler
1493
+ };
1494
+ };
1495
+ const checkoutApiInput = z.object({
1496
+ path: import_zod.zCheckoutApiPath.strict(),
1497
+ headers: import_zod.zCheckoutApiHeaders.strict().optional(),
1498
+ body: (0, import_mcp_support.loose)(import_zod.zCheckoutApiBody).optional()
1499
+ }).strict();
1500
+ const checkoutApiTool = (options) => {
1501
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1502
+ (0, import_sdk.checkoutApi)({
1503
+ ...args,
1504
+ client: options?.client,
1505
+ signal: extra.signal,
1506
+ throwOnError: false
1507
+ })
1508
+ );
1509
+ return {
1510
+ name: "cart_checkout_order_checkout_api",
1511
+ config: {
1512
+ title: "Checkout API",
1513
+ description: '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.\n\nA cart can be checked out with a customer ID, customer object, or with an account by authenticating with the `Client Credentials Token`.\n\nAfter 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.\n\nYou can checkout using one of the following methods:\n- **Customer ID**: You can checkout a cart with an existing customer ID.\n- **Guest Checkout** (Checkout with Customer Object): You can checkout a cart with an associated customer name and email.\n- **Checkout with Account**: The shopper authenticates with the `Client Credentials` Token.\n- **Checkout with Account Management Authentication Token**: The shopper authenticates with the `Implicit Token` and the `EP-Account-Management-Authentication-Token`.\n\n:::note\n\n- The cart currency is set when the first item is added to the cart.\n- 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.\n- 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.\n\n:::\n\n:::caution\n\n- By default, carts are automatically deleted 7 days after the last update. You can change this setting by [updating cart settings](/docs/api/carts/put-v-2-settings-cart).\n- 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.\n\n:::\n\n 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.\n\n### Next Steps\n\nAfter 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).\n\n### Errors\n\nThe following error response is returned during checkout when an eligible item is added to the cart, and the free gift is out of stock.\n\n```json\n{\n "errors": [\n {\n "status": 400,\n "title": "Insufficient stock",\n "detail": "There is not enough stock to add gift2 to your cart",\n "meta": {\n "id": "f2b68648-9621-45a3-aed6-1b526b0f5beb",\n "sku": "gift2"\n }\n }\n ]\n}\n```',
1514
+ inputSchema: checkoutApiInput,
1515
+ annotations: {
1516
+ readOnlyHint: false,
1517
+ destructiveHint: false,
1518
+ idempotentHint: false,
1519
+ openWorldHint: true
1520
+ },
1521
+ _meta: {
1522
+ "com.elasticpath/operation": {
1523
+ id: "cart_checkout_order.checkoutApi",
1524
+ method: "POST",
1525
+ path: "/v2/carts/{cartID}/checkout",
1526
+ risk: "create"
1527
+ }
1528
+ }
1529
+ },
1530
+ handler
1531
+ };
1532
+ };
1533
+ const getCustomerOrdersInput = z.object({
1534
+ query: import_zod.zGetCustomerOrdersQuery.strict().optional(),
1535
+ headers: import_zod.zGetCustomerOrdersHeaders.strict().optional()
1536
+ }).strict();
1537
+ const getCustomerOrdersTool = (options) => {
1538
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1539
+ (0, import_sdk.getCustomerOrders)({
1540
+ ...args,
1541
+ client: options?.client,
1542
+ signal: extra.signal,
1543
+ throwOnError: false
1544
+ })
1545
+ );
1546
+ return {
1547
+ name: "cart_checkout_order_get_customer_orders",
1548
+ config: {
1549
+ title: "Get all Orders",
1550
+ description: "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.\n\n:::note\n\n- 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).\n- 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).\n- You can use pagination with this resource. For more information, see [pagination](/guides/Getting-Started/pagination).\n\n:::\n\n### Filtering\n\nThe following operators and attributes are available for filtering orders.\n\n| Attribute | Type | Operator | Example |\n| :--- | :--- | :--- | :--- |\n| `status` | `string` | `eq` | `eq(status,complete)` |\n| `payment` | `string` | `eq` | `eq(payment,paid)` |\n| `shipping` | `string` | `eq` | `eq(shipping,unfulfilled)` |\n| `name` (`customer.name`) | `string` | `eq` / `like` | `like(name,Brad*)` |\n| `email` (`customer.email`) | `string` | `eq` / `like` | `like(email,*@elasticpath.com)` |\n| `customer_id` | `string` | `eq` / `like` | `eq(customer_id, e5a0d684-a4af-4919-a348-f66b0b4955e0)` |\n| `account_id` | `string` | `eq` / `like` | `eq(account_id,3d7200c9-a9bc-4085-9822-63e80fd94a09)` |\n| `account_member_id` | `string` | `eq` / `like` | `eq(account_member_id,2a8a3a92-2ccd-4b2b-a7af-52d3896eaecb)` |\n| `contact.name` | `string` | `eq` / `like` | `eq(name,John Doe)` |\n| `contact.email` | `string` | `eq` / `like` | `eq(email,John Doe)` |\n| `shipping_postcode` | `string` | `eq` / `like` | `like(shipping_postcode,117*)` |\n| `billing_postcode` | `string` | `eq` / `like` | `like(billing_postcode,117*)` |\n| `with_tax` | `integer` | `gt`/`ge`/`lt`/`le` | `ge(with_tax,10000)` |\n| `without_tax` | `integer` | `gt`/`ge`/`lt`/`le` | `ge(without_tax,10000)` |\n| `currency` | `string` | `eq` | `eq(currency,USD)` |\n| `product_id` | `string` | `eq` | `eq(product_id,6837058c-ae42-46db-b3c6-7f01e0c34b40)` |\n| `product_sku` | `string` | `eq` | `eq(product_sku,deck-shoe-001)` |\n| `created_at` | `date` | `eq` / `gt` / `ge`/ `le` / `lt` | `gt(created_at,YYYY-MM-DD)` |\n| `updated_at` | `date` | `eq` / `gt` / `ge`/ `le`/ `lt` | `lt(updated_at,YYYY-MM-DD)` |\n| `external_ref` | `string` | `eq` / `like` | `like(external_ref, 16be*)` |\n| `order_number` | `string` | `eq` / `like` | `like(order_number, 123*)` |\n### Includes\nYou can include related resources with the order response by using the `include` query parameter.\n| Name | Optional | Type | Description |\n|:-----|:---------|:-----|:------------|\n| `include` | Optional | `string` | Comma-delimited string of entities that can be included. The information included are `items`, `tax_items`, `custom_discounts`, or `promotions`. |",
1551
+ inputSchema: getCustomerOrdersInput,
1552
+ annotations: {
1553
+ readOnlyHint: true,
1554
+ destructiveHint: false,
1555
+ idempotentHint: true,
1556
+ openWorldHint: true
1557
+ },
1558
+ _meta: {
1559
+ "com.elasticpath/operation": {
1560
+ id: "cart_checkout_order.getCustomerOrders",
1561
+ method: "GET",
1562
+ path: "/v2/orders",
1563
+ risk: "read"
1564
+ }
1565
+ }
1566
+ },
1567
+ handler
1568
+ };
1569
+ };
1570
+ const getAnOrderInput = z.object({
1571
+ path: import_zod.zGetAnOrderPath.strict(),
1572
+ query: import_zod.zGetAnOrderQuery.strict().optional()
1573
+ }).strict();
1574
+ const getAnOrderTool = (options) => {
1575
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1576
+ (0, import_sdk.getAnOrder)({
1577
+ ...args,
1578
+ client: options?.client,
1579
+ signal: extra.signal,
1580
+ throwOnError: false
1581
+ })
1582
+ );
1583
+ return {
1584
+ name: "cart_checkout_order_get_an_order",
1585
+ config: {
1586
+ title: "Get an Order",
1587
+ description: "Use this endpoint to retrieve a specific order.\n\n### Includes\n\nYou can include related resources with the order response by using the `include` query parameter.\n\n| Name | Required | Type | Description |\n|:----------|:---------|:---------|:------------|\n| `include` | Optional | `string` | Comma-delimited string of entities that can be included. The included options are `items`, `tax_items`, `custom_discounts`, or `promotions`. |",
1588
+ inputSchema: getAnOrderInput,
1589
+ annotations: {
1590
+ readOnlyHint: true,
1591
+ destructiveHint: false,
1592
+ idempotentHint: true,
1593
+ openWorldHint: true
1594
+ },
1595
+ _meta: {
1596
+ "com.elasticpath/operation": {
1597
+ id: "cart_checkout_order.getAnOrder",
1598
+ method: "GET",
1599
+ path: "/v2/orders/{orderID}",
1600
+ risk: "read"
1601
+ }
1602
+ }
1603
+ },
1604
+ handler
1605
+ };
1606
+ };
1607
+ const updateAnOrderInput = z.object({
1608
+ path: import_zod.zUpdateAnOrderPath.strict(),
1609
+ body: (0, import_mcp_support.loose)(import_zod.zUpdateAnOrderBody).optional()
1610
+ }).strict();
1611
+ const updateAnOrderTool = (options) => {
1612
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1613
+ (0, import_sdk.updateAnOrder)({
1614
+ ...args,
1615
+ client: options?.client,
1616
+ signal: extra.signal,
1617
+ throwOnError: false
1618
+ })
1619
+ );
1620
+ return {
1621
+ name: "cart_checkout_order_update_an_order",
1622
+ config: {
1623
+ title: "Update an Order",
1624
+ description: "You can only update custom data, `shipping`, `shipping_address`, and status of orders. All other settings in the order object are immutable.\n\n This endpoint allows you to:\n\n- **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.\n- **Cancel an order**: You can cancel an order only if it has not been fulfilled.\n- **Fulfill an order**: You can fulfill a paid order only.\n\n:::caution\n\nYou 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.\n\n:::\n\n:::note\n\n- This request is only accessible to client credentials token users with Seller Admin role.\n- Non client credentials token users cannot access this endpoint. See [Permissions](/docs/authentication/tokens/permissions).\n- The `order_number` will appear as the invoice number in Authorize.net transactions.\n\n:::",
1625
+ inputSchema: updateAnOrderInput,
1626
+ annotations: {
1627
+ readOnlyHint: false,
1628
+ destructiveHint: true,
1629
+ idempotentHint: true,
1630
+ openWorldHint: true
1631
+ },
1632
+ _meta: {
1633
+ "com.elasticpath/operation": {
1634
+ id: "cart_checkout_order.updateAnOrder",
1635
+ method: "PUT",
1636
+ path: "/v2/orders/{orderID}",
1637
+ risk: "update"
1638
+ }
1639
+ }
1640
+ },
1641
+ handler
1642
+ };
1643
+ };
1644
+ const getOrderItemsInput = z.object({
1645
+ path: import_zod.zGetOrderItemsPath.strict(),
1646
+ query: import_zod.zGetOrderItemsQuery.strict().optional()
1647
+ }).strict();
1648
+ const getOrderItemsTool = (options) => {
1649
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1650
+ (0, import_sdk.getOrderItems)({
1651
+ ...args,
1652
+ client: options?.client,
1653
+ signal: extra.signal,
1654
+ throwOnError: false
1655
+ })
1656
+ );
1657
+ return {
1658
+ name: "cart_checkout_order_get_order_items",
1659
+ config: {
1660
+ title: "Get Order Items",
1661
+ description: "Use this endpoint to retrieve order items.\n\n### Includes\n\nYou can include related resources with the order items response by using the `include` query parameter.\n\n| Name | Required | Type | Description |\n|:----------|:---------|:---------|:------------|\n| `include` | Optional | `string` | Comma-delimited string of entities that can be included. The included options are `tax_items`, `custom_discounts`, or `promotions`. |",
1662
+ inputSchema: getOrderItemsInput,
1663
+ annotations: {
1664
+ readOnlyHint: true,
1665
+ destructiveHint: false,
1666
+ idempotentHint: true,
1667
+ openWorldHint: true
1668
+ },
1669
+ _meta: {
1670
+ "com.elasticpath/operation": {
1671
+ id: "cart_checkout_order.getOrderItems",
1672
+ method: "GET",
1673
+ path: "/v2/orders/{orderID}/items",
1674
+ risk: "read"
1675
+ }
1676
+ }
1677
+ },
1678
+ handler
1679
+ };
1680
+ };
1681
+ const anonymizeOrdersInput = z.object({
1682
+ body: (0, import_mcp_support.loose)(import_zod.zAnonymizeOrdersBody).optional()
1683
+ }).strict();
1684
+ const anonymizeOrdersTool = (options) => {
1685
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1686
+ (0, import_sdk.anonymizeOrders)({
1687
+ ...args,
1688
+ client: options?.client,
1689
+ signal: extra.signal,
1690
+ throwOnError: false
1691
+ })
1692
+ );
1693
+ return {
1694
+ name: "cart_checkout_order_anonymize_orders",
1695
+ config: {
1696
+ title: "Anonymize Orders",
1697
+ description: "You can anonymize an order when it is fulfilled, canceled, or fully refunded.\n\nWhen anonymization is successful, Personal Identifiable Information such as customer details, `shipping_address`, and `billing_address` are replaced with *.",
1698
+ inputSchema: anonymizeOrdersInput,
1699
+ annotations: {
1700
+ readOnlyHint: false,
1701
+ destructiveHint: true,
1702
+ idempotentHint: false,
1703
+ openWorldHint: true
1704
+ },
1705
+ _meta: {
1706
+ "com.elasticpath/operation": {
1707
+ id: "cart_checkout_order.anonymizeOrders",
1708
+ method: "POST",
1709
+ path: "/v2/orders/anonymize",
1710
+ risk: "update"
1711
+ }
1712
+ }
1713
+ },
1714
+ handler
1715
+ };
1716
+ };
1717
+ const confirmOrderInput = z.object({
1718
+ path: import_zod.zConfirmOrderPath.strict()
1719
+ }).strict();
1720
+ const confirmOrderTool = (options) => {
1721
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1722
+ (0, import_sdk.confirmOrder)({
1723
+ ...args,
1724
+ client: options?.client,
1725
+ signal: extra.signal,
1726
+ throwOnError: false
1727
+ })
1728
+ );
1729
+ return {
1730
+ name: "cart_checkout_order_confirm_order",
1731
+ config: {
1732
+ title: "Confirm Order",
1733
+ description: "Use this endpoint to confirm an order. Confirming an order finalizes it and makes it ready for processing.",
1734
+ inputSchema: confirmOrderInput,
1735
+ annotations: {
1736
+ readOnlyHint: false,
1737
+ destructiveHint: false,
1738
+ idempotentHint: false,
1739
+ openWorldHint: true
1740
+ },
1741
+ _meta: {
1742
+ "com.elasticpath/operation": {
1743
+ id: "cart_checkout_order.confirmOrder",
1744
+ method: "POST",
1745
+ path: "/v2/orders/{orderID}/confirm",
1746
+ risk: "create"
1747
+ }
1748
+ }
1749
+ },
1750
+ handler
1751
+ };
1752
+ };
1753
+ const paymentSetupInput = z.object({
1754
+ path: import_zod.zPaymentSetupPath.strict(),
1755
+ body: (0, import_mcp_support.loose)(import_zod.zPaymentSetupBody).optional()
1756
+ }).strict();
1757
+ const paymentSetupTool = (options) => {
1758
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1759
+ (0, import_sdk.paymentSetup)({
1760
+ ...args,
1761
+ client: options?.client,
1762
+ signal: extra.signal,
1763
+ throwOnError: false
1764
+ })
1765
+ );
1766
+ return {
1767
+ name: "cart_checkout_order_payment_setup",
1768
+ config: {
1769
+ title: "Payments",
1770
+ description: "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 [Payments](/docs/api/carts/payments).\n\nThe following types of payment methods are available depending on the payment gateway:\n\n- `purchase`: This is the simplest method. The gateway attempts to charge the customer immediately.\n- `authorize`: This method authorizes a payment so that funds can be captured later, for example, when an item is dispatched or restocked.\n- `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.\n- `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.\n\n:::note\n\nSplit payments can be performed using any methods for any gateway.\n\n- 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`\n- 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`.\n- A `purchase_setup` method allows verification of payment details for partial payments without transferring funds until the customer confirms the full order.\n- 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.\nUntil 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).\n\n:::",
1771
+ inputSchema: paymentSetupInput,
1772
+ annotations: {
1773
+ readOnlyHint: false,
1774
+ destructiveHint: false,
1775
+ idempotentHint: false,
1776
+ openWorldHint: true
1777
+ },
1778
+ _meta: {
1779
+ "com.elasticpath/operation": {
1780
+ id: "cart_checkout_order.paymentSetup",
1781
+ method: "POST",
1782
+ path: "/v2/orders/{orderID}/payments",
1783
+ risk: "create"
1784
+ }
1785
+ }
1786
+ },
1787
+ handler
1788
+ };
1789
+ };
1790
+ const confirmPaymentInput = z.object({
1791
+ path: import_zod.zConfirmPaymentPath.strict(),
1792
+ body: (0, import_mcp_support.loose)(import_zod.zConfirmPaymentBody).optional()
1793
+ }).strict();
1794
+ const confirmPaymentTool = (options) => {
1795
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1796
+ (0, import_sdk.confirmPayment)({
1797
+ ...args,
1798
+ client: options?.client,
1799
+ signal: extra.signal,
1800
+ throwOnError: false
1801
+ })
1802
+ );
1803
+ return {
1804
+ name: "cart_checkout_order_confirm_payment",
1805
+ config: {
1806
+ title: "Confirm Payment",
1807
+ description: "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.\n\n### Handling 3D Secure Validations for Stripe Payments\n\nFor 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.",
1808
+ inputSchema: confirmPaymentInput,
1809
+ annotations: {
1810
+ readOnlyHint: false,
1811
+ destructiveHint: false,
1812
+ idempotentHint: false,
1813
+ openWorldHint: true
1814
+ },
1815
+ _meta: {
1816
+ "com.elasticpath/operation": {
1817
+ id: "cart_checkout_order.confirmPayment",
1818
+ method: "POST",
1819
+ path: "/v2/orders/{orderID}/transactions/{transactionID}/confirm",
1820
+ risk: "create"
1821
+ }
1822
+ }
1823
+ },
1824
+ handler
1825
+ };
1826
+ };
1827
+ const captureATransactionInput = z.object({
1828
+ path: import_zod.zCaptureATransactionPath.strict(),
1829
+ body: (0, import_mcp_support.loose)(import_zod.zCaptureATransactionBody).optional()
1830
+ }).strict();
1831
+ const captureATransactionTool = (options) => {
1832
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1833
+ (0, import_sdk.captureATransaction)({
1834
+ ...args,
1835
+ client: options?.client,
1836
+ signal: extra.signal,
1837
+ throwOnError: false
1838
+ })
1839
+ );
1840
+ return {
1841
+ name: "cart_checkout_order_capture_a_transaction",
1842
+ config: {
1843
+ title: "Capture a Transaction",
1844
+ description: "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.",
1845
+ inputSchema: captureATransactionInput,
1846
+ annotations: {
1847
+ readOnlyHint: false,
1848
+ destructiveHint: false,
1849
+ idempotentHint: false,
1850
+ openWorldHint: true
1851
+ },
1852
+ _meta: {
1853
+ "com.elasticpath/operation": {
1854
+ id: "cart_checkout_order.captureATransaction",
1855
+ method: "POST",
1856
+ path: "/v2/orders/{orderID}/transactions/{transactionID}/capture",
1857
+ risk: "create"
1858
+ }
1859
+ }
1860
+ },
1861
+ handler
1862
+ };
1863
+ };
1864
+ const refundATransactionInput = z.object({
1865
+ path: import_zod.zRefundATransactionPath.strict(),
1866
+ body: (0, import_mcp_support.loose)(import_zod.zRefundATransactionBody).optional()
1867
+ }).strict();
1868
+ const refundATransactionTool = (options) => {
1869
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1870
+ (0, import_sdk.refundATransaction)({
1871
+ ...args,
1872
+ client: options?.client,
1873
+ signal: extra.signal,
1874
+ throwOnError: false
1875
+ })
1876
+ );
1877
+ return {
1878
+ name: "cart_checkout_order_refund_a_transaction",
1879
+ config: {
1880
+ title: "Refund a Transaction",
1881
+ description: "There are two ways to refund; through your payment gateway and mark it refunded in Commerce Manager, or directly through Commerce Manager or API.\n\n* 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.\n* 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.\n\n:::caution\n\nIf you use manual gateway for partial or full refund, you need to handle the actual refund on your side with your payment provider.\n\n:::",
1882
+ inputSchema: refundATransactionInput,
1883
+ annotations: {
1884
+ readOnlyHint: false,
1885
+ destructiveHint: false,
1886
+ idempotentHint: false,
1887
+ openWorldHint: true
1888
+ },
1889
+ _meta: {
1890
+ "com.elasticpath/operation": {
1891
+ id: "cart_checkout_order.refundATransaction",
1892
+ method: "POST",
1893
+ path: "/v2/orders/{orderID}/transactions/{transactionID}/refund",
1894
+ risk: "create"
1895
+ }
1896
+ }
1897
+ },
1898
+ handler
1899
+ };
1900
+ };
1901
+ const getOrderTransactionsInput = z.object({
1902
+ path: import_zod.zGetOrderTransactionsPath.strict()
1903
+ }).strict();
1904
+ const getOrderTransactionsTool = (options) => {
1905
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1906
+ (0, import_sdk.getOrderTransactions)({
1907
+ ...args,
1908
+ client: options?.client,
1909
+ signal: extra.signal,
1910
+ throwOnError: false
1911
+ })
1912
+ );
1913
+ return {
1914
+ name: "cart_checkout_order_get_order_transactions",
1915
+ config: {
1916
+ title: "Get Order Transactions",
1917
+ description: "Get order transactions",
1918
+ inputSchema: getOrderTransactionsInput,
1919
+ annotations: {
1920
+ readOnlyHint: true,
1921
+ destructiveHint: false,
1922
+ idempotentHint: true,
1923
+ openWorldHint: true
1924
+ },
1925
+ _meta: {
1926
+ "com.elasticpath/operation": {
1927
+ id: "cart_checkout_order.getOrderTransactions",
1928
+ method: "GET",
1929
+ path: "/v2/orders/{orderID}/transactions",
1930
+ risk: "read"
1931
+ }
1932
+ }
1933
+ },
1934
+ handler
1935
+ };
1936
+ };
1937
+ const getATransactionInput = z.object({
1938
+ path: import_zod.zGetATransactionPath.strict()
1939
+ }).strict();
1940
+ const getATransactionTool = (options) => {
1941
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1942
+ (0, import_sdk.getATransaction)({
1943
+ ...args,
1944
+ client: options?.client,
1945
+ signal: extra.signal,
1946
+ throwOnError: false
1947
+ })
1948
+ );
1949
+ return {
1950
+ name: "cart_checkout_order_get_a_transaction",
1951
+ config: {
1952
+ title: "Get a Transaction",
1953
+ description: "Retrieves a transaction",
1954
+ inputSchema: getATransactionInput,
1955
+ annotations: {
1956
+ readOnlyHint: true,
1957
+ destructiveHint: false,
1958
+ idempotentHint: true,
1959
+ openWorldHint: true
1960
+ },
1961
+ _meta: {
1962
+ "com.elasticpath/operation": {
1963
+ id: "cart_checkout_order.getATransaction",
1964
+ method: "GET",
1965
+ path: "/v2/orders/{orderID}/transactions/{transactionID}",
1966
+ risk: "read"
1967
+ }
1968
+ }
1969
+ },
1970
+ handler
1971
+ };
1972
+ };
1973
+ const cancelATransactionInput = z.object({
1974
+ path: import_zod.zCancelATransactionPath.strict(),
1975
+ body: (0, import_mcp_support.loose)(import_zod.zCancelATransactionBody).optional()
1976
+ }).strict();
1977
+ const cancelATransactionTool = (options) => {
1978
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
1979
+ (0, import_sdk.cancelATransaction)({
1980
+ ...args,
1981
+ client: options?.client,
1982
+ signal: extra.signal,
1983
+ throwOnError: false
1984
+ })
1985
+ );
1986
+ return {
1987
+ name: "cart_checkout_order_cancel_a_transaction",
1988
+ config: {
1989
+ title: "Cancel a Transaction",
1990
+ description: "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.\n\n:::caution\n\nThis endpoint works only for Stripe and PayPal and does not work for manual gateway.\n\n:::",
1991
+ inputSchema: cancelATransactionInput,
1992
+ annotations: {
1993
+ readOnlyHint: false,
1994
+ destructiveHint: false,
1995
+ idempotentHint: false,
1996
+ openWorldHint: true
1997
+ },
1998
+ _meta: {
1999
+ "com.elasticpath/operation": {
2000
+ id: "cart_checkout_order.cancelATransaction",
2001
+ method: "POST",
2002
+ path: "/v2/orders/{orderID}/transactions/{transactionID}/cancel",
2003
+ risk: "create"
2004
+ }
2005
+ }
2006
+ },
2007
+ handler
2008
+ };
2009
+ };
2010
+ const getOrderShippingGroupsInput = z.object({
2011
+ path: import_zod.zGetOrderShippingGroupsPath.strict()
2012
+ }).strict();
2013
+ const getOrderShippingGroupsTool = (options) => {
2014
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
2015
+ (0, import_sdk.getOrderShippingGroups)({
2016
+ ...args,
2017
+ client: options?.client,
2018
+ signal: extra.signal,
2019
+ throwOnError: false
2020
+ })
2021
+ );
2022
+ return {
2023
+ name: "cart_checkout_order_get_order_shipping_groups",
2024
+ config: {
2025
+ title: "Retrieve all shipping groups for an order",
2026
+ description: "Retrieve all shipping groups for an order",
2027
+ inputSchema: getOrderShippingGroupsInput,
2028
+ annotations: {
2029
+ readOnlyHint: true,
2030
+ destructiveHint: false,
2031
+ idempotentHint: true,
2032
+ openWorldHint: true
2033
+ },
2034
+ _meta: {
2035
+ "com.elasticpath/operation": {
2036
+ id: "cart_checkout_order.getOrderShippingGroups",
2037
+ method: "GET",
2038
+ path: "/v2/orders/{orderID}/shipping-groups",
2039
+ risk: "read"
2040
+ }
2041
+ }
2042
+ },
2043
+ handler
2044
+ };
2045
+ };
2046
+ const createOrderShippingGroupInput = z.object({
2047
+ path: import_zod.zCreateOrderShippingGroupPath.strict(),
2048
+ body: (0, import_mcp_support.loose)(import_zod.zCreateOrderShippingGroupBody).optional()
2049
+ }).strict();
2050
+ const createOrderShippingGroupTool = (options) => {
2051
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
2052
+ (0, import_sdk.createOrderShippingGroup)({
2053
+ ...args,
2054
+ client: options?.client,
2055
+ signal: extra.signal,
2056
+ throwOnError: false
2057
+ })
2058
+ );
2059
+ return {
2060
+ name: "cart_checkout_order_create_order_shipping_group",
2061
+ config: {
2062
+ title: "Create a shipping group for an order",
2063
+ description: "Create a new shipping group for an order",
2064
+ inputSchema: createOrderShippingGroupInput,
2065
+ annotations: {
2066
+ readOnlyHint: false,
2067
+ destructiveHint: false,
2068
+ idempotentHint: false,
2069
+ openWorldHint: true
2070
+ },
2071
+ _meta: {
2072
+ "com.elasticpath/operation": {
2073
+ id: "cart_checkout_order.createOrderShippingGroup",
2074
+ method: "POST",
2075
+ path: "/v2/orders/{orderID}/shipping-groups",
2076
+ risk: "create"
2077
+ }
2078
+ }
2079
+ },
2080
+ handler
2081
+ };
2082
+ };
2083
+ const getShippingGroupsByIdInput = z.object({
2084
+ path: import_zod.zGetShippingGroupsByIdPath.strict(),
2085
+ query: import_zod.zGetShippingGroupsByIdQuery.strict().optional()
2086
+ }).strict();
2087
+ const getShippingGroupsByIdTool = (options) => {
2088
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
2089
+ (0, import_sdk.getShippingGroupsById)({
2090
+ ...args,
2091
+ client: options?.client,
2092
+ signal: extra.signal,
2093
+ throwOnError: false
2094
+ })
2095
+ );
2096
+ return {
2097
+ name: "cart_checkout_order_get_shipping_groups_by_id",
2098
+ config: {
2099
+ title: "Retrieve a specific shipping group for an order",
2100
+ description: "Retrieve a specific shipping group for an order",
2101
+ inputSchema: getShippingGroupsByIdInput,
2102
+ annotations: {
2103
+ readOnlyHint: true,
2104
+ destructiveHint: false,
2105
+ idempotentHint: true,
2106
+ openWorldHint: true
2107
+ },
2108
+ _meta: {
2109
+ "com.elasticpath/operation": {
2110
+ id: "cart_checkout_order.getShippingGroupsById",
2111
+ method: "GET",
2112
+ path: "/v2/orders/{orderID}/shipping-groups/{shippingGroupID}",
2113
+ risk: "read"
2114
+ }
2115
+ }
2116
+ },
2117
+ handler
2118
+ };
2119
+ };
2120
+ const putShippingGroupByIdInput = z.object({
2121
+ path: import_zod.zPutShippingGroupByIdPath.strict(),
2122
+ body: (0, import_mcp_support.loose)(import_zod.zPutShippingGroupByIdBody)
2123
+ }).strict();
2124
+ const putShippingGroupByIdTool = (options) => {
2125
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
2126
+ (0, import_sdk.putShippingGroupById)({
2127
+ ...args,
2128
+ client: options?.client,
2129
+ signal: extra.signal,
2130
+ throwOnError: false
2131
+ })
2132
+ );
2133
+ return {
2134
+ name: "cart_checkout_order_put_shipping_group_by_id",
2135
+ config: {
2136
+ title: "Update a shipping group for an order",
2137
+ description: "Update a shipping group for an order",
2138
+ inputSchema: putShippingGroupByIdInput,
2139
+ annotations: {
2140
+ readOnlyHint: false,
2141
+ destructiveHint: true,
2142
+ idempotentHint: true,
2143
+ openWorldHint: true
2144
+ },
2145
+ _meta: {
2146
+ "com.elasticpath/operation": {
2147
+ id: "cart_checkout_order.putShippingGroupById",
2148
+ method: "PUT",
2149
+ path: "/v2/orders/{orderID}/shipping-groups/{shippingGroupID}",
2150
+ risk: "update"
2151
+ }
2152
+ }
2153
+ },
2154
+ handler
2155
+ };
2156
+ };
2157
+ const getV2SettingsCartInput = z.object({}).strict();
2158
+ const getV2SettingsCartTool = (options) => {
2159
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
2160
+ (0, import_sdk.getV2SettingsCart)({
2161
+ ...args,
2162
+ client: options?.client,
2163
+ signal: extra.signal,
2164
+ throwOnError: false
2165
+ })
2166
+ );
2167
+ return {
2168
+ name: "cart_checkout_order_get_v2_settings_cart",
2169
+ config: {
2170
+ title: "Get Cart Settings",
2171
+ description: "Retrieves cart settings.",
2172
+ inputSchema: getV2SettingsCartInput,
2173
+ annotations: {
2174
+ readOnlyHint: true,
2175
+ destructiveHint: false,
2176
+ idempotentHint: true,
2177
+ openWorldHint: true
2178
+ },
2179
+ _meta: {
2180
+ "com.elasticpath/operation": {
2181
+ id: "cart_checkout_order.getV2SettingsCart",
2182
+ method: "GET",
2183
+ path: "/v2/settings/cart",
2184
+ risk: "read"
2185
+ }
2186
+ }
2187
+ },
2188
+ handler
2189
+ };
2190
+ };
2191
+ const putV2SettingsCartInput = z.object({
2192
+ body: (0, import_mcp_support.loose)(import_zod.zPutV2SettingsCartBody).optional()
2193
+ }).strict();
2194
+ const putV2SettingsCartTool = (options) => {
2195
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
2196
+ (0, import_sdk.putV2SettingsCart)({
2197
+ ...args,
2198
+ client: options?.client,
2199
+ signal: extra.signal,
2200
+ throwOnError: false
2201
+ })
2202
+ );
2203
+ return {
2204
+ name: "cart_checkout_order_put_v2_settings_cart",
2205
+ config: {
2206
+ title: "Update Cart Settings",
2207
+ description: "You can modify the cart expiry settings to set it to any number of days up to 365. Any existing carts default to the expiry of 7 days. To update cart settings in Commerce Manager, see [Updating Cart setting](/docs/commerce-manager/settings/general-settings#updating-cart-settings).\n\nWith update cart settings endpoint, you can:\n\n- Enable or disable custom discounts by setting the `custom_discounts_enabled` field to `true`. This allows you to activate your custom discounts from external services. By default, this setting is determined by the cart settings configured for the store.\n- Enable or disable the use of rule promotions within the cart. You can apply this setting either at the store level using the update cart setting endpoint or individually to a specific cart using the [update a cart](/docs/api/carts/update-a-cart) endpoint.\n- Enable or disable deferred inventory checks by setting `defer_inventory_check` to `true`. When set, stock levels are not verified for products in a cart until checkout.\n- Control whether admins can see all carts or only shopper-associated carts by setting `show_all_carts` to `true` or `false`.\n- Enable or disable location-based item separation by setting `separate_items_by_location` to `true`. When enabled, cart items with the same SKU but different locations are kept as separate line items instead of being merged.\n\n:::note\n\nCustom discounts and rule promotions can both be enabled for a store at the same time, for example, while transitioning from one promotion system to the other. However, an individual cart can only contain one type of discount at a time. A cart that contains custom discounts rejects Elastic Path promotions, and a cart that contains Elastic Path promotions rejects custom discounts, until the existing discounts are removed.\n\n:::",
2208
+ inputSchema: putV2SettingsCartInput,
2209
+ annotations: {
2210
+ readOnlyHint: false,
2211
+ destructiveHint: true,
2212
+ idempotentHint: true,
2213
+ openWorldHint: true
2214
+ },
2215
+ _meta: {
2216
+ "com.elasticpath/operation": {
2217
+ id: "cart_checkout_order.putV2SettingsCart",
2218
+ method: "PUT",
2219
+ path: "/v2/settings/cart",
2220
+ risk: "update"
2221
+ }
2222
+ }
2223
+ },
2224
+ handler
2225
+ };
2226
+ };
2227
+ const getV2SettingsCartStoreIdInput = z.object({
2228
+ path: import_zod.zGetV2SettingsCartStoreIdPath.strict()
2229
+ }).strict();
2230
+ const getV2SettingsCartStoreIdTool = (options) => {
2231
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
2232
+ (0, import_sdk.getV2SettingsCartStoreId)({
2233
+ ...args,
2234
+ client: options?.client,
2235
+ signal: extra.signal,
2236
+ throwOnError: false
2237
+ })
2238
+ );
2239
+ return {
2240
+ name: "cart_checkout_order_get_v2_settings_cart_store_id",
2241
+ config: {
2242
+ title: "Get Cart Settings by Store ID",
2243
+ description: "Retrieves cart settings for the specified store.",
2244
+ inputSchema: getV2SettingsCartStoreIdInput,
2245
+ annotations: {
2246
+ readOnlyHint: true,
2247
+ destructiveHint: false,
2248
+ idempotentHint: true,
2249
+ openWorldHint: true
2250
+ },
2251
+ _meta: {
2252
+ "com.elasticpath/operation": {
2253
+ id: "cart_checkout_order.getV2SettingsCartStoreId",
2254
+ method: "GET",
2255
+ path: "/v2/settings/cart/{storeID}",
2256
+ risk: "read"
2257
+ }
2258
+ }
2259
+ },
2260
+ handler
2261
+ };
2262
+ };
2263
+ const putV2SettingsCartStoreIdInput = z.object({
2264
+ path: import_zod.zPutV2SettingsCartStoreIdPath.strict(),
2265
+ body: (0, import_mcp_support.loose)(import_zod.zPutV2SettingsCartStoreIdBody).optional()
2266
+ }).strict();
2267
+ const putV2SettingsCartStoreIdTool = (options) => {
2268
+ const handler = (args, extra) => (0, import_mcp_support.toToolResult)(
2269
+ (0, import_sdk.putV2SettingsCartStoreId)({
2270
+ ...args,
2271
+ client: options?.client,
2272
+ signal: extra.signal,
2273
+ throwOnError: false
2274
+ })
2275
+ );
2276
+ return {
2277
+ name: "cart_checkout_order_put_v2_settings_cart_store_id",
2278
+ config: {
2279
+ title: "Update Cart Settings by Store ID",
2280
+ description: "You can modify the cart expiry settings to set it to any number of days up to 365. Any existing carts default to the expiry of 7 days. To update cart settings in Commerce Manager, see [Updating Cart setting](/docs/commerce-manager/settings/general-settings#updating-cart-settings).\n\nWith update cart settings endpoint, you can:\n\n- Enable or disable custom discounts by setting the `custom_discounts_enabled` field to `true`. This allows you to activate your custom discounts from external services. By default, this setting is determined by the cart settings configured for the store.\n- Enable or disable the use of rule promotions within the cart. You can apply this setting either at the store level using the update cart setting endpoint or individually to a specific cart using the [update a cart](/docs/api/carts/update-a-cart) endpoint.\n- Enable or disable deferred inventory checks by setting `defer_inventory_check` to `true`. When set, stock levels are not verified for products in a cart until checkout.\n- Control whether admins can see all carts or only shopper-associated carts by setting `show_all_carts` to `true` or `false`.\n- Enable or disable location-based item separation by setting `separate_items_by_location` to `true`. When enabled, cart items with the same SKU but different locations are kept as separate line items instead of being merged.\n\n:::note\n\nCustom discounts and rule promotions can both be enabled for a store at the same time, for example, while transitioning from one promotion system to the other. However, an individual cart can only contain one type of discount at a time. A cart that contains custom discounts rejects Elastic Path promotions, and a cart that contains Elastic Path promotions rejects custom discounts, until the existing discounts are removed.\n\n:::",
2281
+ inputSchema: putV2SettingsCartStoreIdInput,
2282
+ annotations: {
2283
+ readOnlyHint: false,
2284
+ destructiveHint: true,
2285
+ idempotentHint: true,
2286
+ openWorldHint: true
2287
+ },
2288
+ _meta: {
2289
+ "com.elasticpath/operation": {
2290
+ id: "cart_checkout_order.putV2SettingsCartStoreId",
2291
+ method: "PUT",
2292
+ path: "/v2/settings/cart/{storeID}",
2293
+ risk: "update"
2294
+ }
2295
+ }
2296
+ },
2297
+ handler
2298
+ };
2299
+ };
2300
+ const tools = (options) => [
2301
+ getCartsTool(options),
2302
+ createACartTool(options),
2303
+ deleteACartTool(options),
2304
+ getACartTool(options),
2305
+ updateACartTool(options),
2306
+ deleteAllCartItemsTool(options),
2307
+ getCartItemsTool(options),
2308
+ manageCartsTool(options),
2309
+ bulkUpdateItemsInCartTool(options),
2310
+ deleteACartItemTool(options),
2311
+ updateACartItemTool(options),
2312
+ deleteAccountCartAssociationTool(options),
2313
+ createAccountCartAssociationTool(options),
2314
+ deleteCustomerCartAssociationTool(options),
2315
+ createCustomerCartAssociationTool(options),
2316
+ deleteAPromotionViaPromotionCodeTool(options),
2317
+ addTaxItemToCartTool(options),
2318
+ addTaxItemToCartItemComponentTool(options),
2319
+ deleteTaxItemFromCartItemComponentTool(options),
2320
+ updateTaxItemFromCartItemComponentTool(options),
2321
+ bulkDeleteTaxItemsFromCartTool(options),
2322
+ bulkAddTaxItemsToCartTool(options),
2323
+ deleteATaxItemTool(options),
2324
+ updateATaxItemTool(options),
2325
+ bulkDeleteCustomDiscountsFromCartTool(options),
2326
+ bulkAddCustomDiscountsToCartTool(options),
2327
+ deleteCustomDiscountFromCartTool(options),
2328
+ updateCustomDiscountForCartTool(options),
2329
+ addCustomDiscountToCartItemTool(options),
2330
+ deleteCustomDiscountFromCartItemTool(options),
2331
+ updateCustomDiscountForCartItemTool(options),
2332
+ getShippingGroupsTool(options),
2333
+ createShippingGroupTool(options),
2334
+ deleteCartShippingGroupTool(options),
2335
+ getShippingGroupByIdTool(options),
2336
+ updateShippingGroupTool(options),
2337
+ createCartPaymentIntentTool(options),
2338
+ updateCartPaymentIntentTool(options),
2339
+ checkoutApiTool(options),
2340
+ getCustomerOrdersTool(options),
2341
+ getAnOrderTool(options),
2342
+ updateAnOrderTool(options),
2343
+ getOrderItemsTool(options),
2344
+ anonymizeOrdersTool(options),
2345
+ confirmOrderTool(options),
2346
+ paymentSetupTool(options),
2347
+ confirmPaymentTool(options),
2348
+ captureATransactionTool(options),
2349
+ refundATransactionTool(options),
2350
+ getOrderTransactionsTool(options),
2351
+ getATransactionTool(options),
2352
+ cancelATransactionTool(options),
2353
+ getOrderShippingGroupsTool(options),
2354
+ createOrderShippingGroupTool(options),
2355
+ getShippingGroupsByIdTool(options),
2356
+ putShippingGroupByIdTool(options),
2357
+ getV2SettingsCartTool(options),
2358
+ putV2SettingsCartTool(options),
2359
+ getV2SettingsCartStoreIdTool(options),
2360
+ putV2SettingsCartStoreIdTool(options)
2361
+ ];
2362
+ // Annotate the CommonJS export names for ESM import in node:
2363
+ 0 && (module.exports = {
2364
+ addCustomDiscountToCartItemTool,
2365
+ addTaxItemToCartItemComponentTool,
2366
+ addTaxItemToCartTool,
2367
+ anonymizeOrdersTool,
2368
+ bulkAddCustomDiscountsToCartTool,
2369
+ bulkAddTaxItemsToCartTool,
2370
+ bulkDeleteCustomDiscountsFromCartTool,
2371
+ bulkDeleteTaxItemsFromCartTool,
2372
+ bulkUpdateItemsInCartTool,
2373
+ cancelATransactionTool,
2374
+ captureATransactionTool,
2375
+ checkoutApiTool,
2376
+ confirmOrderTool,
2377
+ confirmPaymentTool,
2378
+ createACartTool,
2379
+ createAccountCartAssociationTool,
2380
+ createCartPaymentIntentTool,
2381
+ createCustomerCartAssociationTool,
2382
+ createOrderShippingGroupTool,
2383
+ createShippingGroupTool,
2384
+ deleteACartItemTool,
2385
+ deleteACartTool,
2386
+ deleteAPromotionViaPromotionCodeTool,
2387
+ deleteATaxItemTool,
2388
+ deleteAccountCartAssociationTool,
2389
+ deleteAllCartItemsTool,
2390
+ deleteCartShippingGroupTool,
2391
+ deleteCustomDiscountFromCartItemTool,
2392
+ deleteCustomDiscountFromCartTool,
2393
+ deleteCustomerCartAssociationTool,
2394
+ deleteTaxItemFromCartItemComponentTool,
2395
+ getACartTool,
2396
+ getATransactionTool,
2397
+ getAnOrderTool,
2398
+ getCartItemsTool,
2399
+ getCartsTool,
2400
+ getCustomerOrdersTool,
2401
+ getOrderItemsTool,
2402
+ getOrderShippingGroupsTool,
2403
+ getOrderTransactionsTool,
2404
+ getShippingGroupByIdTool,
2405
+ getShippingGroupsByIdTool,
2406
+ getShippingGroupsTool,
2407
+ getV2SettingsCartStoreIdTool,
2408
+ getV2SettingsCartTool,
2409
+ manageCartsTool,
2410
+ paymentSetupTool,
2411
+ putShippingGroupByIdTool,
2412
+ putV2SettingsCartStoreIdTool,
2413
+ putV2SettingsCartTool,
2414
+ refundATransactionTool,
2415
+ tools,
2416
+ updateACartItemTool,
2417
+ updateACartTool,
2418
+ updateATaxItemTool,
2419
+ updateAnOrderTool,
2420
+ updateCartPaymentIntentTool,
2421
+ updateCustomDiscountForCartItemTool,
2422
+ updateCustomDiscountForCartTool,
2423
+ updateShippingGroupTool,
2424
+ updateTaxItemFromCartItemComponentTool
2425
+ });
2426
+ //# sourceMappingURL=mcp.gen.cjs.map