@epilot/pricing-client 0.2.0 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.ts CHANGED
@@ -1 +1,2 @@
1
- export declare const getClient: () => import("openapi-client-axios").OpenAPIClient<import("./openapi").OperationMethods, import("./openapi").PathsDictionary>;
1
+ import { Client } from './openapi';
2
+ export declare const getClient: () => Client;
package/dist/client.js CHANGED
@@ -7,7 +7,10 @@ exports.getClient = void 0;
7
7
  var openapi_client_axios_1 = __importDefault(require("openapi-client-axios"));
8
8
  var definition_1 = __importDefault(require("./definition"));
9
9
  var getClient = function () {
10
- var api = new openapi_client_axios_1.default({ definition: definition_1.default, quick: true });
10
+ var api = new openapi_client_axios_1.default({
11
+ definition: definition_1.default,
12
+ quick: true,
13
+ });
11
14
  return api.initSync();
12
15
  };
13
16
  exports.getClient = getClient;
@@ -1 +1 @@
1
- !function(e,t){for(var a in t)e[a]=t[a];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,a){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=i(a(279));t.default=n.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Pricing API","description":"This API hub sets the foundations for the following Pricing APIs:\\n\\n- Order API, provides a way to manage orders, keep track of inventory, with individual adjustments, tax calculation, and shipping, apply discounts, store tracking information, and handle returns. The responsibilities of this API contemplate the following set of features:\\n - Create or update a new Order from a Shopping Cart\\n - Marking a Shopping Cart as complete once the Order is set as open (immutable/closed for modification)\\n - Pricing features such as automatic calculation of totals and price breakdowns for taxes\\n\\n- Shopping Cart API, used to interact with a cart during a customer\'s checkout session, and it\'s responsible for providing the following set of features:\\n - A unified data model to model a Shopping Cart\\n - Cart abandonment recovery\\n - Pricing features such as automatic calculation of totals and price breakdowns for taxes\\n - Product and pricing data validation\\n - Checkout a cart into an order, invoice, or quote\\n","contact":{"name":"Maintainers Channel","url":"https://epilot.slack.com/archives/C020B4URQNS"},"version":"1.0.0"},"externalDocs":{"description":"Read the full RFC here","url":"https://e-pilot.atlassian.net/wiki/spaces/~880810188/pages/5459705918/Shopping+Cart+Orders+API"},"tags":[{"name":"Public","description":"Customer-facing Endpoints (requiring a X-Ivy-Org-ID identification)"},{"name":"Cart","description":"The shopping cart & checkout management operations"},{"name":"Order","description":"Order management operations"},{"name":"Pricing","description":"Pricing utility operations"}],"security":[{"EpilotAuth":[]},{"AsOrganization":[]}],"paths":{"/v1/public/cart":{"put":{"description":"Creates a new cart or updates an existing one.","operationId":"upsertCart","summary":"upsertCart","security":[],"tags":["Cart","Public"],"parameters":[{"in":"header","name":"X-Ivy-Org-ID","description":"The target Organization Id represented by the caller","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"},"examples":{"Cart with Line Items":{"$ref":"#/components/examples/cartCreationPayload"}}}}},"responses":{"200":{"description":"The updated Cart.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"},"examples":{"Cart with Totals and Tax Breakdown":{"$ref":"#/components/examples/cart"}}}}},"201":{"description":"The new Cart.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"},"examples":{"Cart with Totals and Tax Breakdown":{"$ref":"#/components/examples/cart"}}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"Modifying a cart marked as complete":{"value":{"message":"The cart is marked as complete and can no longer be modified."}},"Modifying a cart with an invalid price":{"value":{"message":"The cart update failed due to an invalid price provided."}},"Modifying a cart with an invalid product":{"value":{"message":"The cart update failed due to an invalid provided provided."}}}}}}}}},"/v1/public/cart:checkout":{"post":{"description":"Checkouts a cart and executes the specified checkout `mode` process. \\n\\nA Checkout implicitly finalizes the provided cart (if not transient from a fast-checkout) and behaves in one of the following modes:\\n- `create_order` (**default**): the payment happens at a later date or managed by 3rd-party CRM (SAP)\\n- `create_invoice`: the payment happens on the online checkout (paypal, stripe, adyen)\\n- `create_quote`: the checkout represents a price quote request\\n\\nFast checkout is also supported, by passing the Cart contents directly.\\nWhen a fast checkout is performed the cart is considered transient and there is no cart persistance.\\n\\nIf the checkout `mode` is omitted, the `mode` will default to `create_order`.\\n","operationId":"checkoutCart","summary":"checkoutCart","security":[],"tags":["Cart","Public"],"parameters":[{"in":"header","name":"X-Ivy-Org-ID","description":"The target Organization Id represented by the caller","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"cart":{"oneOf":[{"description":"the cart id","type":"string"},{"$ref":"#/components/schemas/Cart"}]},"mode":{"$ref":"#/components/schemas/CheckoutMode"}}}]},"examples":{"Checkout with a CartID":{"value":{"mode":"create_order","cart":"pZ324jnndf"}},"Fast Checkout with a transient Cart":{"value":{"mode":"create_order","cart":{"customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"line_items":[{"quantity":1,"product":"b7185fb7-b10f-4875-bda7-288631446555","price":"df240bab-9f71-4a9a-a9e1-59f18827dbf9"},{"quantity":1,"product":"zzzzzz-b10f-4875-bda7-288631446555","price":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9"}]}}}}}}},"responses":{"200":{"description":"The checkout result","content":{"application/json":{"schema":{"type":"object","description":"The checkout result","properties":{"order":{"$ref":"#/components/schemas/Order"}}},"examples":{"Checkout with created order":{"value":{"order":{"_id":"d1ZoC1FwZ6","type":"open","order_number":"20201023-1234ndf","_org_id":123,"customer":"fe2ce36e-7577-4dff-b33e-1c7da6f91c89","customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"billing_first_name":"john","billing_last_name":"doe","billing_company_name":"i me and myself","billing_vat":234823948,"billing_email":"johndoe@nowhere.com","billing_phone":1234234545,"billing_address":"wallstreet, 1","billing_contact":"villy or zilly","line_items":[{"id":"mSjGCTfn8w","metadata":[{"cart_id":"p0ZoB1FwH6"}],"description":"Wallbox Premium - Premium Price","currency":"EUR","amount_subtotal":50000,"amount_total":61500,"quantity":1,"product":{"_id":"b7185fb7-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":11500,"rate":"MwSt. 23%"}]},{"id":"mZkGCTfn6p","metadata":[{"cart_id":"p0ZoB1FwH6"}],"description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","amount_subtotal":50000,"amount_total":53500,"quantity":1,"product":{"_id":"zzzzzz-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":3500,"rate":"MwSt. 7%"}]}],"amount_subtotal":100000,"amount_total":115000,"total_details":{"amount_shipping":10000,"amount_tax":15000,"breakdown":[{"amount":11500,"rate":"MwSt. 23%"},{"amount":3500,"rate":"MwSt. 7%"}]},"_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z"}}}}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cart/{cart-id}":{"get":{"description":"Retrieves a cart by id.","operationId":"getCart","summary":"getCart","tags":["Cart"],"parameters":[{"in":"path","name":"cart-id","schema":{"type":"string"},"description":"The id of the cart to be fetched","required":true}],"responses":{"200":{"description":"The customer\'s cart.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"},"examples":{"Cart with Totals and Tax Breakdown":{"$ref":"#/components/examples/cart"}}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Cart not found"}}},"delete":{"description":"Deletes the Cart specified and returns its content.","operationId":"deleteCart","summary":"deleteCart","tags":["Cart"],"parameters":[{"in":"path","name":"cart-id","schema":{"type":"string"},"description":"The id of the cart to be deleted","required":true}],"responses":{"200":{"description":"The customer\'s cart.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"},"examples":{"Content of the deleted Cart":{"$ref":"#/components/examples/cart"}}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/order":{"put":{"description":"Creates a new order or updates an existing one. During the creation of an order, an unique customer-readable `order_number` will be generated.\\nThe `order_number` can be used to universally identify an order within epilot platform.\\n\\nThe upsert operation is idempotent, meaning that multiple calls will have effect just once. Calling the upsert multiple times will not duplicate the items on an order.\\n\\nWhen the the `cart_id` payload field is specified, the cart items are appended to the existing order items, or replaced in-place if they belong to the same `cart_id`.\\n\\nOn multiple updates with the same `cart_id` the line items linked with that `cart_id` (`order.line_items[]?.metadata.cart_id`) are removed and re-added.\\n","operationId":"upsertOrder","summary":"upsertOrder","tags":["Order"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"examples":{"Sample order creation":{"$ref":"#/components/examples/orderCreationPayload"}}}}},"responses":{"200":{"description":"The updated Order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"examples":{"Order with Totals and Tax Breakdown":{"$ref":"#/components/examples/order"}}}}},"201":{"description":"The new Order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"examples":{"Order with Totals and Tax Breakdown":{"$ref":"#/components/examples/order"}}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/public/pricing:calculate":{"post":{"description":"Calculates the pricing amounts for a set of price items, including aggregated totals such as subtotal, total and aggregates per tax rate.\\n","operationId":"calculatePricing","summary":"calculatePricing","tags":["Pricing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/PriceItems"}]}},"examples":{"Price items sample":{"$ref":"#/components/examples/priceItemsPayload"}}}}},"responses":{"200":{"description":"The","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceItemsCalculateResult"},"examples":{"Pricing Items Calculation example":{"$ref":"#/components/examples/priceItemsResult"}}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Epilot Bearer Token"},"AsOrganization":{"type":"apiKey","in":"header","name":"x-ivy-org-id","description":"Set organization id when using internal auth"},"AsUser":{"type":"apiKey","in":"header","name":"x-ivy-user-id","description":"Set user id when using internal auth"}},"schemas":{"Error":{"required":["message"],"properties":{"message":{"type":"string","description":"Error message"}}},"MetaData":{"description":"A set of key-value pairs.","type":"array","items":{"oneOf":[{"type":"object","description":"Key value pair entry","properties":{"key":{"type":"string","description":"Item key"},"value":{"type":"string","description":"Item value"}}}]}},"CheckoutMode":{"type":"string","description":"The checkout mode for the cart checkout.","enum":["create_order","create_invoice","create_quote"]},"Cart":{"description":"Supports shopping for products and services until ready for checkout.","properties":{"id":{"type":"string","description":"The cart identifier"},"org_id":{"type":"string","description":"The user\'s Organization Id the cart belongs to","readOnly":true},"status":{"enum":["open","complete","expired"],"type":"string","readOnly":true,"description":"The status of the Cart:\\n- open - the cart checkout is still in progress. Payment processing has not started\\n- complete - the cart checkout is complete. Payment processing may still be in progress\\n- expired - the cart checkout has expired. No further processing will occur\\n"},"customer":{"readOnly":true,"type":"string","description":"ID of an existing Customer, if one exists. Or the customer data object."},"customer_email":{"type":"string","description":"A valid email identifying the customer."},"metadata":{"$ref":"#/components/schemas/MetaData"},"line_items":{"$ref":"#/components/schemas/PriceItems"},"amount_subtotal":{"readOnly":true,"type":"integer","description":"Total of all items before (discounts or) taxes are applied."},"amount_total":{"readOnly":true,"type":"integer","description":"Total of all items after (discounts and) taxes are applied."},"total_details":{"$ref":"#/components/schemas/TotalDetails"},"created_at":{"readOnly":true,"type":"string","format":"date-time"},"updated_at":{"readOnly":true,"type":"string","format":"date-time"}}},"Order":{"type":"object","description":"The order entity","properties":{"order_number":{"type":"string","description":"The Order Id Number for the customer"},"cart_id":{"type":"string","description":"The Cart Id that originated or is associated with the order"},"customer_email":{"type":"string","description":"A valid email identifying the customer. \\nWhen the `customer` field is filled with an ID, this field is populated/overwritten with that customer\'s email.\\n"},"customer":{"readOnly":true,"type":"string","description":"ID of an existing Customer, if one exists. Or the customer data object."},"type":{"type":"string","enum":["Draft","Open","Paid","Shipped","Delivered","Complete"],"description":"The order status"},"billing_first_name":{"type":"string"},"billing_last_name":{"type":"string"},"billing_company_name":{"type":"string"},"billing_vat":{"type":"string"},"billing_email":{"type":"string"},"billing_phone":{"type":"string"},"billing_address":{"type":"string"},"billing_contact":{"type":"string"},"metadata":{"$ref":"#/components/schemas/MetaData"},"line_items":{"$ref":"#/components/schemas/PriceItems"},"amount_subtotal":{"readOnly":true,"type":"integer","description":"Total of all items before (discounts or) taxes are applied."},"amount_total":{"readOnly":true,"type":"integer","description":"Total of all items after (discounts and) taxes are applied."},"total_details":{"$ref":"#/components/schemas/TotalDetails"},"_org_id":{"type":"string","description":"Organization Id the order belongs to"},"_id":{"type":"string","readOnly":true},"_created_at":{"type":"string","readOnly":true},"_updated_at":{"type":"string","readOnly":true}}},"PriceItems":{"description":"Tracks a set of product prices, quantities, (discounts) and taxes.","type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/PriceItem"}]}},"PriceItem":{"description":"Represents a price item","type":"object","properties":{"id":{"type":"string","description":"price item id","readOnly":true},"metadata":{"$ref":"#/components/schemas/MetaData"},"amount_subtotal":{"type":"integer","description":"Total before any (discounts or) taxes are applied.","readOnly":true},"amount_total":{"type":"integer","description":"Total after (discounts and) taxes.","readOnly":true},"currency":{"type":"string","description":"Three-letter ISO currency code, in lowercase. \\nDefaults to the customer currency when the customer or customer_email field is provided, or to EUR as a fallback.\\n"},"description":{"type":"string","description":"An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name."},"quantity":{"type":"integer","description":"The quantity of products being purchased."},"product":{"oneOf":[{"type":"string","description":"The id of the product."},{"$ref":"#/components/schemas/Product"}]},"price":{"oneOf":[{"type":"string","description":"The id of the price."},{"$ref":"#/components/schemas/Price"}]},"taxes":{"type":"array","description":"The taxes applied to the price item.","readOnly":true,"items":{"oneOf":[{"$ref":"#/components/schemas/TaxAmount"}]}}}},"TaxAmount":{"type":"object","description":"A tax amount associated with a specific tax rate.","readOnly":true,"properties":{"amount":{"type":"integer","description":"The tax amount."},"rate":{"type":"string","description":"The tax rate applied."}}},"TotalDetails":{"type":"object","description":"The total details with tax (and discount) aggregated totals.","readOnly":true,"properties":{"amount_shipping":{"type":"integer","description":"This is the sum of all the price item shipping amounts."},"amount_tax":{"type":"integer","description":"This is the sum of all the price item tax amounts."},"breakdown":{"type":"object","description":"Breakdown of individual tax (and discount) amounts that add up to the totals.","properties":{"taxes":{"type":"array","description":"The aggregated price items tax amount per rate.","items":{"oneOf":[{"$ref":"#/components/schemas/TaxAmount"}]}}}}}},"PriceItemsCalculateResult":{"type":"object","description":"The result from the calculation of a set of price items.","properties":{"items":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/PriceItems"}]}},"amount_subtotal":{"type":"integer","description":"Total of all items before (discounts or) taxes are applied."},"amount_total":{"type":"integer","description":"Total of all items after (discounts and) taxes are applied."},"total_details":{"$ref":"#/components/schemas/TotalDetails"}}},"Product":{"type":"object","description":"The product configuration","readOnly":true,"properties":{"code":{"type":"string"},"type":{"type":"string","enum":["Product","Service"]},"categories":{"type":"array","items":{"type":"string"}},"name":{"type":"string"},"feature":{"type":"array","items":{"type":"object","properties":{"_tags":{"type":"array","items":{"type":"string"}},"feature":{"type":"string"}}}},"active":{"type":"boolean"},"_id":{"type":"string"},"_files":{"$ref":"#/components/schemas/FileField"},"_images":{"$ref":"#/components/schemas/FileField"},"_created_at":{"type":"string"},"_updated_at":{"type":"string"},"_title":{"type":"string"},"_tags":{"type":"array","items":{"type":"string"}}},"example":{"$ref":"#/components/examples/product"}},"Price":{"type":"object","description":"The price configuration","readOnly":true,"properties":{"active":{"type":"boolean"},"billing_scheme":{"type":"string","enum":["Per Unit"]},"description":{"type":"string"},"sales_tax":{"type":"string","enum":["Nontaxable","Reduced (7%)","Standard (19%)"]},"tax_behavior":{"type":"string","enum":["Inclusive (Price amount includes Tax)","Exclusive (Price amount excludes Tax)"]},"tiers_mode":{"type":"string","enum":["Standard"]},"type":{"type":"string","enum":["One Time","Recurring"]},"unit_amount":{"type":"string"},"_created_at":{"type":"string"},"_id":{"type":"string"},"_title":{"type":"string"},"_updated_at":{"type":"string"}},"example":{"$ref":"#/components/examples/price"}},"FileField":{"description":"The file field","properties":{"type":{"type":"string","enum":["file","image"]},"attachments":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string"},"mime":{"type":"string"},"name":{"type":"string"},"size":{"type":"number"},"image_url":{"type":"string"},"download_url":{"type":"string"}}}]}}},"example":{"$ref":"#/components/examples/price"}}},"examples":{"cart":{"description":"Example of a Shopping Cart","value":{"id":"p0ZoB1FwH6","status":"open","org_id":123,"customer":"fe2ce36e-7577-4dff-b33e-1c7da6f91c89","customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"line_items":[{"id":"mSjGCTfn8w","description":"Wallbox Premium - Premium Price","currency":"EUR","amount_subtotal":50000,"amount_total":61500,"quantity":1,"product":{"_id":"b7185fb7-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":11500,"rate":"MwSt. 23%"}]},{"id":"mZkGCTfn6p","description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","amount_subtotal":50000,"amount_total":53500,"quantity":1,"product":{"_id":"zzzzzz-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":3500,"rate":"MwSt. 7%"}]}],"amount_subtotal":100000,"amount_total":115000,"total_details":{"amount_shipping":10000,"amount_tax":15000,"breakdown":[{"amount":11500,"rate":"MwSt. 23%"},{"amount":3500,"rate":"MwSt. 7%"}]},"created_at":"2021-11-10T18:02:58.318Z","updated_at":"2021-11-10T18:02:58.318Z"}},"cartComplete":{"description":"Example of a Shopping Cart marked as complete","value":{"id":"p0ZoB1FwH6","status":"complete","org_id":123,"customer":"fe2ce36e-7577-4dff-b33e-1c7da6f91c89","customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"line_items":[{"id":"mSjGCTfn8w","description":"Wallbox Premium - Premium Price","currency":"EUR","amount_subtotal":50000,"amount_total":61500,"quantity":1,"product":{"_id":"b7185fb7-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":11500,"rate":"MwSt. 23%"}]},{"id":"mZkGCTfn6p","description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","amount_subtotal":50000,"amount_total":53500,"quantity":1,"product":{"_id":"zzzzzz-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":3500,"rate":"MwSt. 7%"}]}],"amount_subtotal":100000,"amount_total":115000,"total_details":{"amount_shipping":10000,"amount_tax":15000,"breakdown":[{"amount":11500,"rate":"MwSt. 23%"},{"amount":3500,"rate":"MwSt. 7%"}]},"created_at":"2021-11-10T18:02:58.318Z","updated_at":"2021-11-10T18:02:58.318Z"}},"cartCreationPayload":{"description":"Example of a Cart creation payload","value":{"customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"line_items":[{"quantity":1,"product":"b7185fb7-b10f-4875-bda7-288631446555","price":"df240bab-9f71-4a9a-a9e1-59f18827dbf9"},{"quantity":1,"product":"zzzzzz-b10f-4875-bda7-288631446555","price":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9"}]}},"orderCreationPayload":{"description":"Example of an Order creation payload","value":{"order_number":"a34234jd","customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"billing_first_name":"john","billing_last_name":"doe","billing_company_name":"i me and myself","billing_vat":234823948,"billing_email":"johndoe@nowhere.com","billing_phone":1234234545,"billing_address":"wallstreet, 1","billing_contact":"villy or zilly","line_items":[{"quantity":1,"product":"b7185fb7-b10f-4875-bda7-288631446555","price":"df240bab-9f71-4a9a-a9e1-59f18827dbf9"},{"quantity":1,"product":"zzzzzz-b10f-4875-bda7-288631446555","price":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9"}]}},"order":{"description":"Example of an Order","value":{"_id":"d1ZoC1FwZ6","type":"open","cart_id":"p0ZoB1FwH6","order_number":"20201021-234324","_org_id":123,"customer":"fe2ce36e-7577-4dff-b33e-1c7da6f91c89","customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"billing_first_name":"john","billing_last_name":"doe","billing_company_name":"i me and myself","billing_vat":234823948,"billing_email":"johndoe@nowhere.com","billing_phone":1234234545,"billing_address":"wallstreet, 1","billing_contact":"villy or zilly","line_items":[{"id":"mSjGCTfn8w","metadata":[{"cart_id":"p0ZoB1FwH6"}],"description":"Wallbox Premium - Premium Price","currency":"EUR","amount_subtotal":50000,"amount_total":61500,"quantity":1,"product":{"_id":"b7185fb7-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":11500,"rate":"MwSt. 23%"}]},{"id":"mZkGCTfn6p","metadata":[{"cart_id":"p0ZoB1FwH6"}],"description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","amount_subtotal":50000,"amount_total":53500,"quantity":1,"product":{"_id":"zzzzzz-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":3500,"rate":"MwSt. 7%"}]}],"amount_subtotal":100000,"amount_total":115000,"total_details":{"amount_shipping":10000,"amount_tax":15000,"breakdown":[{"amount":11500,"rate":"MwSt. 23%"},{"amount":3500,"rate":"MwSt. 7%"}]},"_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z"}},"priceItemsPayload":{"description":"A price items payload example","value":[{"id":"mSjGCTfn8w","cart_id":"p0ZoB1FwH6","description":"Wallbox Premium - Premium Price","currency":"EUR","amount_subtotal":50000,"amount_total":61500,"quantity":1,"product":{"_id":"b7185fb7-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":11500,"rate":"MwSt. 23%"}]},{"id":"mZkGCTfn6p","cart_id":"p0ZoB1FwH6","description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","amount_subtotal":50000,"amount_total":53500,"quantity":1,"product":{"_id":"zzzzzz-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":3500,"rate":"MwSt. 7%"}]}]},"priceItemsResult":{"description":"A price items calculation result example","value":{"amount_subtotal":100000,"amount_total":115000,"total_details":{"amount_shipping":10000,"amount_tax":15000,"breakdown":[{"amount":11500,"rate":"MwSt. 23%"},{"amount":3500,"rate":"MwSt. 7%"}]},"items":[{"id":"mSjGCTfn8w","cart_id":"p0ZoB1FwH6","description":"Wallbox Premium - Premium Price","currency":"EUR","amount_subtotal":50000,"amount_total":61500,"quantity":1,"product":{"_id":"b7185fb7-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":11500,"rate":"MwSt. 23%"}]},{"id":"mZkGCTfn6p","cart_id":"p0ZoB1FwH6","description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","amount_subtotal":50000,"amount_total":53500,"quantity":1,"product":{"_id":"zzzzzz-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":3500,"rate":"MwSt. 7%"}]}]}},"product":{"description":"A product example","value":{"name":"Alfen Eve Single S-line Wallbox","code":"904460583","categories":["House Connection"],"type":"Product","active":true,"_id":"b7185fb7-b10f-4875-bda7-288631446555","_created_at":"2021-11-10T18:01:39.681Z","_updated_at":"2021-11-11T10:40:23.430Z","_title":"Alfen Eve Single S-line Wallbox","_tags":["product review demo"],"feature":[{"_tags":[],"feature":"Bis zu 11 kW Ladeleistung (5x schneller laden)"},{"_tags":[],"feature":"Konfigurierbare Ladeleistung"},{"_tags":[],"feature":"Zugangskontrolle über RFID-Karten"}],"_images":{"type":"image","attachments":[{"key":"files/ckvtu0lq5000108me1pdc7y4k/original","mime":"image/jpeg","name":"juice-charger-me_closeup_bottom.jpeg","size":38210,"image_url":"https://avkhavsdjq.cloudimg.io/v7/e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu0lq5000108me1pdc7y4k/original?w=100","download_url":"https://e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu0lq5000108me1pdc7y4k/original","alt_text":""},{"key":"files/ckvtu06ny000008me01xl79ot/original","mime":"image/jpeg","name":"eve-single-s-line-socket-front-_1__web_1.jpeg","size":11587,"image_url":"https://avkhavsdjq.cloudimg.io/v7/e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu06ny000008me01xl79ot/original?w=100","download_url":"https://e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu06ny000008me01xl79ot/original","alt_text":""}]},"_files":{"type":"file","attachments":[{"key":"files/ckvutl6wp00000al5cx8063nz/original","mime":"application/pdf","name":"Wallbox_Pulsar-Plus_technisches-Datenblatt.pdf","size":171501,"image_url":"https://avkhavsdjq.cloudimg.io/v7/e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvutl6wp00000al5cx8063nz/original?w=100","download_url":"https://e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvutl6wp00000al5cx8063nz/original","alt_text":""}]}}},"price":{"description":"A price example","value":{"unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_schema":"price","_id":"8ca293d6-89f5-4b20-98f5-fa68341ef611","_org":"739224","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"}},"fileField":{"description":"A File Field example","value":{"type":"image","attachments":[{"key":"files/ckvtu0lq5000108me1pdc7y4k/original","mime":"image/jpeg","name":"juice-charger-me_closeup_bottom.jpeg","size":38210,"image_url":"https://avkhavsdjq.cloudimg.io/v7/e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu0lq5000108me1pdc7y4k/original?w=100","download_url":"https://e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu0lq5000108me1pdc7y4k/original","alt_text":""},{"key":"files/ckvtu06ny000008me01xl79ot/original","mime":"image/jpeg","name":"eve-single-s-line-socket-front-_1__web_1.jpeg","size":11587,"image_url":"https://avkhavsdjq.cloudimg.io/v7/e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu06ny000008me01xl79ot/original?w=100","download_url":"https://e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu06ny000008me01xl79ot/original","alt_text":""}]}}}}}')}},t={};return function a(i){if(t[i])return t[i].exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,a),n.exports}(914)})());
1
+ !function(e,t){for(var a in t)e[a]=t[a];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,a){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var n=i(a(279));t.default=n.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Pricing API","description":"This API hub sets the foundations for the following Pricing APIs:\\n\\n- Order API, provides a way to manage orders, keep track of inventory, with individual adjustments, tax calculation, and shipping, apply discounts, store tracking information, and handle returns. The responsibilities of this API contemplate the following set of features:\\n - Create or update a new Order from a Shopping Cart\\n - Marking a Shopping Cart as complete once the Order is set as open (immutable/closed for modification)\\n - Pricing features such as automatic calculation of totals and price breakdowns for taxes\\n\\n- Shopping Cart API, used to interact with a cart during a customer\'s checkout session, and it\'s responsible for providing the following set of features:\\n - A unified data model to model a Shopping Cart\\n - Cart abandonment recovery\\n - Pricing features such as automatic calculation of totals and price breakdowns for taxes\\n - Product and pricing data validation\\n - Checkout a cart into an order, invoice, or quote\\n","contact":{"name":"Maintainers Channel","url":"https://epilot.slack.com/archives/C020B4URQNS"},"version":"1.0.0"},"externalDocs":{"description":"Read the full RFC here","url":"https://e-pilot.atlassian.net/wiki/spaces/~880810188/pages/5459705918/Shopping+Cart+Orders+API"},"tags":[{"name":"Public","description":"Customer-facing Endpoints (requiring a X-Ivy-Org-ID identification)"},{"name":"Cart","description":"The shopping cart & checkout management operations"},{"name":"Order","description":"Order management operations"},{"name":"Pricing","description":"Pricing utility operations"}],"security":[{"EpilotAuth":[]},{"AsOrganization":[]}],"paths":{"/v1/public/cart":{"put":{"description":"Creates a new cart or updates an existing one.","operationId":"$upsertCart","summary":"upsertCart","security":[],"tags":["Cart","Public"],"parameters":[{"in":"header","name":"X-Ivy-Org-ID","description":"The target Organization Id represented by the caller","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartPayload"},"examples":{"Cart with Line Items":{"$ref":"#/components/examples/cartCreationPayload"}}}}},"responses":{"200":{"description":"The updated Cart.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"},"examples":{"Cart with Totals and Tax Breakdown":{"$ref":"#/components/examples/cart"}}}}},"201":{"description":"The new Cart.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"},"examples":{"Cart with Totals and Tax Breakdown":{"$ref":"#/components/examples/cart"}}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"Modifying a cart marked as complete":{"value":{"message":"The cart is marked as complete and can no longer be modified."}},"Modifying a cart with an invalid price":{"value":{"message":"The cart update failed due to an invalid price provided."}},"Modifying a cart with an invalid product":{"value":{"message":"The cart update failed due to an invalid provided provided."}}}}}}}}},"/v1/public/cart:checkout":{"post":{"description":"Checkouts a cart and executes the specified checkout `mode` process. \\n\\nA Checkout implicitly finalizes the provided cart (if not transient from a fast-checkout) and behaves in one of the following modes:\\n- `create_order` (**default**): the payment happens at a later date or managed by 3rd-party CRM (SAP)\\n- `create_invoice`: the payment happens on the online checkout (paypal, stripe, adyen)\\n- `create_quote`: the checkout represents a price quote request\\n\\nFast checkout is also supported, by passing the Cart contents directly.\\nWhen a fast checkout is performed the cart is considered transient and there is no cart persistance.\\n\\nIf the checkout `mode` is omitted, the `mode` will default to `create_order`.\\n","operationId":"$checkoutCart","summary":"checkoutCart","security":[],"tags":["Cart","Public"],"parameters":[{"in":"header","name":"X-Ivy-Org-ID","description":"The target Organization Id represented by the caller","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutCart"},"examples":{"Checkout with a CartID":{"value":{"mode":"create_order","cart":"pZ324jnndf"}},"Fast Checkout with a transient Cart":{"value":{"mode":"create_order","cart":{"customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"line_items":[{"quantity":1,"product":"b7185fb7-b10f-4875-bda7-288631446555","price":"df240bab-9f71-4a9a-a9e1-59f18827dbf9"},{"quantity":1,"product":"zzzzzz-b10f-4875-bda7-288631446555","price":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9"}]}}}}}}},"responses":{"200":{"description":"The checkout result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutCartResult"},"examples":{"Checkout with created order":{"value":{"order":{"_id":"d1ZoC1FwZ6","type":"open","order_number":"20201023-1234ndf","_org_id":123,"customer":"fe2ce36e-7577-4dff-b33e-1c7da6f91c89","customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"billing_first_name":"john","billing_last_name":"doe","billing_company_name":"i me and myself","billing_vat":234823948,"billing_email":"johndoe@nowhere.com","billing_phone":1234234545,"billing_address":"wallstreet, 1","billing_contact":"villy or zilly","line_items":[{"id":"mSjGCTfn8w","metadata":[{"cart_id":"p0ZoB1FwH6"}],"description":"Wallbox Premium - Premium Price","currency":"EUR","amount_subtotal":50000,"amount_total":61500,"quantity":1,"product":{"_id":"b7185fb7-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":11500,"rate":"MwSt. 23%"}]},{"id":"mZkGCTfn6p","metadata":[{"cart_id":"p0ZoB1FwH6"}],"description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","amount_subtotal":50000,"amount_total":53500,"quantity":1,"product":{"_id":"zzzzzz-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":3500,"rate":"MwSt. 7%"}]}],"amount_subtotal":100000,"amount_total":115000,"total_details":{"amount_shipping":10000,"amount_tax":15000,"breakdown":[{"amount":11500,"rate":"MwSt. 23%"},{"amount":3500,"rate":"MwSt. 7%"}]},"_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z"}}}}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cart/{cart-id}":{"get":{"description":"Retrieves a cart by id.","operationId":"$getCart","summary":"getCart","tags":["Cart"],"parameters":[{"in":"path","name":"cart-id","schema":{"type":"string"},"description":"The id of the cart to be fetched","required":true}],"responses":{"200":{"description":"The customer\'s cart.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"},"examples":{"Cart with Totals and Tax Breakdown":{"$ref":"#/components/examples/cart"}}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Cart not found"}}},"delete":{"description":"Deletes the Cart specified and returns its content.","operationId":"$deleteCart","summary":"deleteCart","tags":["Cart"],"parameters":[{"in":"path","name":"cart-id","schema":{"type":"string"},"description":"The id of the cart to be deleted","required":true}],"responses":{"200":{"description":"The customer\'s cart.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cart"},"examples":{"Content of the deleted Cart":{"$ref":"#/components/examples/cart"}}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/order":{"put":{"description":"Creates a new order or updates an existing one. During the creation of an order, an unique customer-readable `order_number` will be generated.\\nThe `order_number` can be used to universally identify an order within epilot platform.\\n\\nThe upsert operation is idempotent, meaning that multiple calls will have effect just once. Calling the upsert multiple times will not duplicate the items on an order.\\n\\nWhen the the `cart_id` payload field is specified, the cart items are appended to the existing order items, or replaced in-place if they belong to the same `cart_id`.\\n\\nOn multiple updates with the same `cart_id` the line items linked with that `cart_id` (`order.line_items[]?.metadata.cart_id`) are removed and re-added.\\n","operationId":"$upsertOrder","summary":"upsertOrder","tags":["Order"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"examples":{"Sample order creation":{"$ref":"#/components/examples/orderCreationPayload"}}}}},"responses":{"200":{"description":"The updated Order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"examples":{"Order with Totals and Tax Breakdown":{"$ref":"#/components/examples/order"}}}}},"201":{"description":"The new Order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"examples":{"Order with Totals and Tax Breakdown":{"$ref":"#/components/examples/order"}}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/public/pricing:calculate":{"post":{"description":"Calculates the pricing amounts for a set of price items, including aggregated totals such as subtotal, total and aggregates per tax rate.\\n","operationId":"$calculatePricing","summary":"calculatePricing","tags":["Pricing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/PriceItems"}]}},"examples":{"Price items sample":{"$ref":"#/components/examples/priceItemsPayload"}}}}},"responses":{"200":{"description":"The","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingDetails"},"examples":{"Pricing Items Calculation example":{"$ref":"#/components/examples/priceItemsResult"}}}}},"400":{"description":"Invalid payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Epilot Bearer Token"},"AsOrganization":{"type":"apiKey","in":"header","name":"x-ivy-org-id","description":"Set organization id when using internal auth"},"AsUser":{"type":"apiKey","in":"header","name":"x-ivy-user-id","description":"Set user id when using internal auth"}},"schemas":{"Error":{"required":["message"],"properties":{"message":{"type":"string","description":"Error message"}}},"MetaData":{"description":"A set of key-value pairs.","type":"array","items":{"oneOf":[{"type":"object","description":"Key value pair entry","properties":{"key":{"type":"string","description":"Item key"},"value":{"type":"string","description":"Item value"}}}]}},"CheckoutCart":{"type":"object","description":"The cart checkout request payload","properties":{"cart":{"anyOf":[{"description":"the cart id","type":"string"},{"$ref":"#/components/schemas/CartPayload"}]},"mode":{"$ref":"#/components/schemas/CheckoutMode"}}},"CheckoutCartResult":{"type":"object","description":"The cart checkout result","properties":{"order":{"$ref":"#/components/schemas/Order"}}},"CheckoutMode":{"type":"string","description":"The checkout mode for the cart checkout.","enum":["create_order","create_invoice","create_quote"]},"CartPayload":{"description":"A valid cart payload from a client.","properties":{"customer_email":{"type":"string","description":"A valid email identifying the customer."},"metadata":{"$ref":"#/components/schemas/MetaData"},"line_items":{"$ref":"#/components/schemas/PriceItemsPayload"}}},"Cart":{"description":"Supports shopping for products and services until ready for checkout.","properties":{"id":{"type":"string","description":"The cart identifier"},"org_id":{"type":"string","description":"The user\'s Organization Id the cart belongs to","readOnly":true},"status":{"enum":["open","complete","expired"],"type":"string","readOnly":true,"description":"The status of the Cart:\\n- open - the cart checkout is still in progress. Payment processing has not started\\n- complete - the cart checkout is complete. Payment processing may still be in progress\\n- expired - the cart checkout has expired. No further processing will occur\\n"},"customer":{"readOnly":true,"type":"string","description":"ID of an existing Customer, if one exists. Or the customer data object."},"customer_email":{"type":"string","description":"A valid email identifying the customer."},"metadata":{"$ref":"#/components/schemas/MetaData"},"line_items":{"$ref":"#/components/schemas/PriceItems"},"amount_subtotal":{"readOnly":true,"type":"integer","description":"Total of all items before (discounts or) taxes are applied."},"amount_total":{"readOnly":true,"type":"integer","description":"Total of all items after (discounts and) taxes are applied."},"total_details":{"$ref":"#/components/schemas/TotalDetails"},"created_at":{"readOnly":true,"type":"string","format":"date-time"},"updated_at":{"readOnly":true,"type":"string","format":"date-time"}}},"Order":{"type":"object","description":"The order entity","properties":{"order_number":{"type":"string","description":"The Order Id Number for the customer"},"cart_id":{"type":"string","description":"The Cart Id that originated or is associated with the order"},"customer_email":{"type":"string","description":"A valid email identifying the customer. \\nWhen the `customer` field is filled with an ID, this field is populated/overwritten with that customer\'s email.\\n"},"customer":{"readOnly":true,"type":"string","description":"ID of an existing Customer, if one exists. Or the customer data object."},"type":{"type":"string","enum":["Draft","Open","Paid","Shipped","Delivered","Complete"],"description":"The order status"},"billing_first_name":{"type":"string"},"billing_last_name":{"type":"string"},"billing_company_name":{"type":"string"},"billing_vat":{"type":"string"},"billing_email":{"type":"string"},"billing_phone":{"type":"string"},"billing_address":{"type":"string"},"billing_contact":{"type":"string"},"metadata":{"$ref":"#/components/schemas/MetaData"},"line_items":{"$ref":"#/components/schemas/PriceItems"},"amount_subtotal":{"readOnly":true,"type":"integer","description":"Total of all items before (discounts or) taxes are applied."},"amount_total":{"readOnly":true,"type":"integer","description":"Total of all items after (discounts and) taxes are applied."},"total_details":{"$ref":"#/components/schemas/TotalDetails"},"_org_id":{"type":"string","description":"Organization Id the order belongs to"},"_id":{"type":"string","readOnly":true},"_created_at":{"type":"string","readOnly":true},"_updated_at":{"type":"string","readOnly":true}}},"PriceItemsPayload":{"description":"A valid set of product prices, quantities, (discounts) and taxes from a client.","type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/PriceItemPayload"}]}},"PriceItems":{"description":"Tracks a set of product prices, quantities, (discounts) and taxes.","type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/PriceItem"}]}},"PriceItemPayload":{"description":"Represents a valid price item from a client.","type":"object","properties":{"metadata":{"$ref":"#/components/schemas/MetaData"},"currency":{"type":"string","description":"Three-letter ISO currency code, in lowercase. \\nDefaults to the customer currency when the customer or customer_email field is provided, or to EUR as a fallback.\\n"},"quantity":{"type":"integer","description":"The quantity of products being purchased."},"product":{"type":"string","description":"The id of the product."},"price":{"type":"string","description":"The id of the price."},"taxes":{"type":"array","description":"The taxes applied to the price item.","readOnly":true,"items":{"oneOf":[{"$ref":"#/components/schemas/TaxAmountPayload"}]}}}},"PriceItem":{"description":"Represents a price item","type":"object","properties":{"id":{"type":"string","description":"price item id","readOnly":true},"metadata":{"$ref":"#/components/schemas/MetaData"},"amount_subtotal":{"type":"integer","description":"Total before any (discounts or) taxes are applied.","readOnly":true},"amount_total":{"type":"integer","description":"Total after (discounts and) taxes.","readOnly":true},"currency":{"type":"string","description":"Three-letter ISO currency code, in lowercase. \\nDefaults to the customer currency when the customer or customer_email field is provided, or to EUR as a fallback.\\n"},"description":{"type":"string","description":"An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name."},"quantity":{"type":"integer","description":"The quantity of products being purchased."},"product":{"oneOf":[{"type":"string","description":"The id of the product."},{"$ref":"#/components/schemas/Product"}]},"price":{"oneOf":[{"type":"string","description":"The id of the price."},{"$ref":"#/components/schemas/Price"}]},"taxes":{"type":"array","description":"The taxes applied to the price item.","readOnly":true,"items":{"oneOf":[{"$ref":"#/components/schemas/TaxAmount"}]}}}},"TaxAmountPayload":{"type":"object","description":"A valid tax rate from a client.","properties":{"rate":{"type":"string","description":"The tax rate applied."}}},"TaxAmount":{"type":"object","description":"A tax amount associated with a specific tax rate.","readOnly":true,"properties":{"amount":{"type":"integer","description":"The tax amount."},"rate":{"type":"string","description":"The tax rate applied."}}},"TotalDetails":{"type":"object","description":"The total details with tax (and discount) aggregated totals.","readOnly":true,"properties":{"amount_shipping":{"type":"integer","description":"This is the sum of all the price item shipping amounts."},"amount_tax":{"type":"integer","description":"This is the sum of all the price item tax amounts."},"breakdown":{"type":"object","description":"Breakdown of individual tax (and discount) amounts that add up to the totals.","properties":{"taxes":{"type":"array","description":"The aggregated price items tax amount per rate.","items":{"oneOf":[{"$ref":"#/components/schemas/TaxAmount"}]}}}}}},"PricingDetails":{"type":"object","description":"The result from the calculation of a set of price items.","properties":{"items":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/PriceItem"}]}},"amount_subtotal":{"type":"integer","description":"Total of all items before (discounts or) taxes are applied."},"amount_total":{"type":"integer","description":"Total of all items after (discounts and) taxes are applied."},"total_details":{"$ref":"#/components/schemas/TotalDetails"}}},"Product":{"type":"object","description":"The product configuration","readOnly":true,"properties":{"code":{"type":"string"},"type":{"type":"string","enum":["Product","Service"]},"categories":{"type":"array","items":{"type":"string"}},"name":{"type":"string"},"feature":{"type":"array","items":{"type":"object","properties":{"_tags":{"type":"array","items":{"type":"string"}},"feature":{"type":"string"}}}},"active":{"type":"boolean"},"_id":{"type":"string"},"_files":{"$ref":"#/components/schemas/FileField"},"_images":{"$ref":"#/components/schemas/FileField"},"_created_at":{"type":"string"},"_updated_at":{"type":"string"},"_title":{"type":"string"},"_tags":{"type":"array","items":{"type":"string"}}},"example":{"$ref":"#/components/examples/product"}},"Price":{"type":"object","description":"The price configuration","readOnly":true,"properties":{"active":{"type":"boolean"},"billing_scheme":{"type":"string","enum":["Per Unit"]},"description":{"type":"string"},"sales_tax":{"type":"string","enum":["Nontaxable","Reduced (7%)","Standard (19%)"]},"tax_behavior":{"type":"string","enum":["Inclusive (Price amount includes Tax)","Exclusive (Price amount excludes Tax)"]},"tiers_mode":{"type":"string","enum":["Standard"]},"type":{"type":"string","enum":["One Time","Recurring"]},"billing_period":{"type":"string","enum":["Weekly","Monthly","Every Quarter","Every 6 months","Yearly"]},"unit_amount":{"type":"string"},"billing_duration_amount":{"type":"number"},"billing_duration_unit":{"type":"string","enum":["Weeks","Months","Years"]},"notice_time_amount":{"type":"number"},"notice_time_unit":{"type":"string","enum":["Weeks","Months","Years"]},"termination_time_amount":{"type":"number"},"termination_time_unit":{"type":"string","enum":["Weeks","Months","Years"]},"renewal_duration_amount":{"type":"number"},"renewal_duration_unit":{"type":"string","enum":["Weeks","Months","Years"]},"_created_at":{"type":"string"},"_id":{"type":"string"},"_title":{"type":"string"},"_updated_at":{"type":"string"}},"example":{"$ref":"#/components/examples/price"}},"FileField":{"description":"The file field","properties":{"type":{"type":"string","enum":["file","image"]},"attachments":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string"},"mime":{"type":"string"},"name":{"type":"string"},"size":{"type":"number"},"image_url":{"type":"string"},"download_url":{"type":"string"}}}]}}},"example":{"$ref":"#/components/examples/price"}}},"examples":{"cart":{"description":"Example of a Shopping Cart","value":{"id":"p0ZoB1FwH6","status":"open","org_id":123,"customer":"fe2ce36e-7577-4dff-b33e-1c7da6f91c89","customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"line_items":[{"id":"mSjGCTfn8w","description":"Wallbox Premium - Premium Price","currency":"EUR","amount_subtotal":50000,"amount_total":61500,"quantity":1,"product":{"_id":"b7185fb7-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":11500,"rate":"MwSt. 23%"}]},{"id":"mZkGCTfn6p","description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","amount_subtotal":50000,"amount_total":53500,"quantity":1,"product":{"_id":"zzzzzz-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":3500,"rate":"MwSt. 7%"}]}],"amount_subtotal":100000,"amount_total":115000,"total_details":{"amount_shipping":10000,"amount_tax":15000,"breakdown":[{"amount":11500,"rate":"MwSt. 23%"},{"amount":3500,"rate":"MwSt. 7%"}]},"created_at":"2021-11-10T18:02:58.318Z","updated_at":"2021-11-10T18:02:58.318Z"}},"cartComplete":{"description":"Example of a Shopping Cart marked as complete","value":{"id":"p0ZoB1FwH6","status":"complete","org_id":123,"customer":"fe2ce36e-7577-4dff-b33e-1c7da6f91c89","customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"line_items":[{"id":"mSjGCTfn8w","description":"Wallbox Premium - Premium Price","currency":"EUR","amount_subtotal":50000,"amount_total":61500,"quantity":1,"product":{"_id":"b7185fb7-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":11500,"rate":"MwSt. 23%"}]},{"id":"mZkGCTfn6p","description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","amount_subtotal":50000,"amount_total":53500,"quantity":1,"product":{"_id":"zzzzzz-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":3500,"rate":"MwSt. 7%"}]}],"amount_subtotal":100000,"amount_total":115000,"total_details":{"amount_shipping":10000,"amount_tax":15000,"breakdown":[{"amount":11500,"rate":"MwSt. 23%"},{"amount":3500,"rate":"MwSt. 7%"}]},"created_at":"2021-11-10T18:02:58.318Z","updated_at":"2021-11-10T18:02:58.318Z"}},"cartCreationPayload":{"description":"Example of a Cart creation payload","value":{"customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"line_items":[{"quantity":1,"product":"b7185fb7-b10f-4875-bda7-288631446555","price":"df240bab-9f71-4a9a-a9e1-59f18827dbf9"},{"quantity":1,"product":"zzzzzz-b10f-4875-bda7-288631446555","price":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9"}]}},"orderCreationPayload":{"description":"Example of an Order creation payload","value":{"order_number":"a34234jd","customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"billing_first_name":"john","billing_last_name":"doe","billing_company_name":"i me and myself","billing_vat":234823948,"billing_email":"johndoe@nowhere.com","billing_phone":1234234545,"billing_address":"wallstreet, 1","billing_contact":"villy or zilly","line_items":[{"quantity":1,"product":"b7185fb7-b10f-4875-bda7-288631446555","price":"df240bab-9f71-4a9a-a9e1-59f18827dbf9"},{"quantity":1,"product":"zzzzzz-b10f-4875-bda7-288631446555","price":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9"}]}},"order":{"description":"Example of an Order","value":{"_id":"d1ZoC1FwZ6","type":"open","cart_id":"p0ZoB1FwH6","order_number":"20201021-234324","_org_id":123,"customer":"fe2ce36e-7577-4dff-b33e-1c7da6f91c89","customer_email":"johndoe@epilot.cloud","metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"billing_first_name":"john","billing_last_name":"doe","billing_company_name":"i me and myself","billing_vat":234823948,"billing_email":"johndoe@nowhere.com","billing_phone":1234234545,"billing_address":"wallstreet, 1","billing_contact":"villy or zilly","line_items":[{"id":"mSjGCTfn8w","metadata":[{"cart_id":"p0ZoB1FwH6"}],"description":"Wallbox Premium - Premium Price","currency":"EUR","amount_subtotal":50000,"amount_total":61500,"quantity":1,"product":{"_id":"b7185fb7-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":11500,"rate":"MwSt. 23%"}]},{"id":"mZkGCTfn6p","metadata":[{"cart_id":"p0ZoB1FwH6"}],"description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","amount_subtotal":50000,"amount_total":53500,"quantity":1,"product":{"_id":"zzzzzz-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":3500,"rate":"MwSt. 7%"}]}],"amount_subtotal":100000,"amount_total":115000,"total_details":{"amount_shipping":10000,"amount_tax":15000,"breakdown":[{"amount":11500,"rate":"MwSt. 23%"},{"amount":3500,"rate":"MwSt. 7%"}]},"_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z"}},"priceItemsPayload":{"description":"A price items payload example","value":[{"id":"mSjGCTfn8w","cart_id":"p0ZoB1FwH6","description":"Wallbox Premium - Premium Price","currency":"EUR","amount_subtotal":50000,"amount_total":61500,"quantity":1,"product":{"_id":"b7185fb7-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":11500,"rate":"MwSt. 23%"}]},{"id":"mZkGCTfn6p","cart_id":"p0ZoB1FwH6","description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","amount_subtotal":50000,"amount_total":53500,"quantity":1,"product":{"_id":"zzzzzz-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":3500,"rate":"MwSt. 7%"}]}]},"priceItemsResult":{"description":"A price items calculation result example","value":{"amount_subtotal":100000,"amount_total":115000,"total_details":{"amount_shipping":10000,"amount_tax":15000,"breakdown":[{"amount":11500,"rate":"MwSt. 23%"},{"amount":3500,"rate":"MwSt. 7%"}]},"items":[{"id":"mSjGCTfn8w","cart_id":"p0ZoB1FwH6","description":"Wallbox Premium - Premium Price","currency":"EUR","amount_subtotal":50000,"amount_total":61500,"quantity":1,"product":{"_id":"b7185fb7-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":11500,"rate":"MwSt. 23%"}]},{"id":"mZkGCTfn6p","cart_id":"p0ZoB1FwH6","description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","amount_subtotal":50000,"amount_total":53500,"quantity":1,"product":{"_id":"zzzzzz-b10f-4875-bda7-288631446555","name":"Alfen Eve Single S-line Wallbox","code":904460583,"categories":["House Connection"]},"price":{"_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"},"taxes":[{"amount":3500,"rate":"MwSt. 7%"}]}]}},"product":{"description":"A product example","value":{"name":"Alfen Eve Single S-line Wallbox","code":"904460583","categories":["House Connection"],"type":"Product","active":true,"_id":"b7185fb7-b10f-4875-bda7-288631446555","_created_at":"2021-11-10T18:01:39.681Z","_updated_at":"2021-11-11T10:40:23.430Z","_title":"Alfen Eve Single S-line Wallbox","_tags":["product review demo"],"feature":[{"_tags":[],"feature":"Bis zu 11 kW Ladeleistung (5x schneller laden)"},{"_tags":[],"feature":"Konfigurierbare Ladeleistung"},{"_tags":[],"feature":"Zugangskontrolle über RFID-Karten"}],"_images":{"type":"image","attachments":[{"key":"files/ckvtu0lq5000108me1pdc7y4k/original","mime":"image/jpeg","name":"juice-charger-me_closeup_bottom.jpeg","size":38210,"image_url":"https://avkhavsdjq.cloudimg.io/v7/e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu0lq5000108me1pdc7y4k/original?w=100","download_url":"https://e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu0lq5000108me1pdc7y4k/original","alt_text":""},{"key":"files/ckvtu06ny000008me01xl79ot/original","mime":"image/jpeg","name":"eve-single-s-line-socket-front-_1__web_1.jpeg","size":11587,"image_url":"https://avkhavsdjq.cloudimg.io/v7/e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu06ny000008me01xl79ot/original?w=100","download_url":"https://e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu06ny000008me01xl79ot/original","alt_text":""}]},"_files":{"type":"file","attachments":[{"key":"files/ckvutl6wp00000al5cx8063nz/original","mime":"application/pdf","name":"Wallbox_Pulsar-Plus_technisches-Datenblatt.pdf","size":171501,"image_url":"https://avkhavsdjq.cloudimg.io/v7/e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvutl6wp00000al5cx8063nz/original?w=100","download_url":"https://e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvutl6wp00000al5cx8063nz/original","alt_text":""}]}}},"price":{"description":"A price example","value":{"unit_amount":"€ 789","type":"One Time","active":true,"sales_tax":"Standard (19%)","tax_behavior":"Inclusive (Price amount includes Tax)","description":"Winter Sale","billing_scheme":"Per Unit","tiers_mode":"Standard","_schema":"price","_id":"8ca293d6-89f5-4b20-98f5-fa68341ef611","_org":"739224","_created_at":"2021-11-10T18:02:58.318Z","_updated_at":"2021-11-10T18:02:58.318Z","_title":"Winter Sale"}},"fileField":{"description":"A File Field example","value":{"type":"image","attachments":[{"key":"files/ckvtu0lq5000108me1pdc7y4k/original","mime":"image/jpeg","name":"juice-charger-me_closeup_bottom.jpeg","size":38210,"image_url":"https://avkhavsdjq.cloudimg.io/v7/e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu0lq5000108me1pdc7y4k/original?w=100","download_url":"https://e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu0lq5000108me1pdc7y4k/original","alt_text":""},{"key":"files/ckvtu06ny000008me01xl79ot/original","mime":"image/jpeg","name":"eve-single-s-line-socket-front-_1__web_1.jpeg","size":11587,"image_url":"https://avkhavsdjq.cloudimg.io/v7/e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu06ny000008me01xl79ot/original?w=100","download_url":"https://e-mage-sam-bucket-dev.s3.eu-central-1.amazonaws.com/files/ckvtu06ny000008me01xl79ot/original","alt_text":""}]}}}}}')}},t={};return function a(i){if(t[i])return t[i].exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,a),n.exports}(914)})());
package/dist/openapi.d.ts CHANGED
@@ -51,6 +51,30 @@ declare namespace Components {
51
51
  readonly created_at?: string; // date-time
52
52
  readonly updated_at?: string; // date-time
53
53
  }
54
+ /**
55
+ * A valid cart payload from a client.
56
+ */
57
+ export interface CartPayload {
58
+ /**
59
+ * A valid email identifying the customer.
60
+ */
61
+ customer_email?: string;
62
+ metadata?: MetaData;
63
+ line_items?: PriceItemsPayload;
64
+ }
65
+ /**
66
+ * The cart checkout request payload
67
+ */
68
+ export interface CheckoutCart {
69
+ cart?: string | CartPayload;
70
+ mode?: CheckoutMode;
71
+ }
72
+ /**
73
+ * The cart checkout result
74
+ */
75
+ export interface CheckoutCartResult {
76
+ order?: Order;
77
+ }
54
78
  /**
55
79
  * The checkout mode for the cart checkout.
56
80
  */
@@ -160,7 +184,16 @@ declare namespace Components {
160
184
  tax_behavior?: "Inclusive (Price amount includes Tax)" | "Exclusive (Price amount excludes Tax)";
161
185
  tiers_mode?: "Standard";
162
186
  type?: "One Time" | "Recurring";
187
+ billing_period?: "Weekly" | "Monthly" | "Every Quarter" | "Every 6 months" | "Yearly";
163
188
  unit_amount?: string;
189
+ billing_duration_amount?: number;
190
+ billing_duration_unit?: "Weeks" | "Months" | "Years";
191
+ notice_time_amount?: number;
192
+ notice_time_unit?: "Weeks" | "Months" | "Years";
193
+ termination_time_amount?: number;
194
+ termination_time_unit?: "Weeks" | "Months" | "Years";
195
+ renewal_duration_amount?: number;
196
+ renewal_duration_unit?: "Weeks" | "Months" | "Years";
164
197
  _created_at?: string;
165
198
  _id?: string;
166
199
  _title?: string;
@@ -204,15 +237,47 @@ declare namespace Components {
204
237
  */
205
238
  readonly taxes?: (TaxAmount)[];
206
239
  }
240
+ /**
241
+ * Represents a valid price item from a client.
242
+ */
243
+ export interface PriceItemPayload {
244
+ metadata?: MetaData;
245
+ /**
246
+ * Three-letter ISO currency code, in lowercase.
247
+ * Defaults to the customer currency when the customer or customer_email field is provided, or to EUR as a fallback.
248
+ *
249
+ */
250
+ currency?: string;
251
+ /**
252
+ * The quantity of products being purchased.
253
+ */
254
+ quantity?: number;
255
+ /**
256
+ * The id of the product.
257
+ */
258
+ product?: string;
259
+ /**
260
+ * The id of the price.
261
+ */
262
+ price?: string;
263
+ /**
264
+ * The taxes applied to the price item.
265
+ */
266
+ readonly taxes?: (TaxAmountPayload)[];
267
+ }
207
268
  /**
208
269
  * Tracks a set of product prices, quantities, (discounts) and taxes.
209
270
  */
210
271
  export type PriceItems = (PriceItem)[];
272
+ /**
273
+ * A valid set of product prices, quantities, (discounts) and taxes from a client.
274
+ */
275
+ export type PriceItemsPayload = (PriceItemPayload)[];
211
276
  /**
212
277
  * The result from the calculation of a set of price items.
213
278
  */
214
- export interface PriceItemsCalculateResult {
215
- items?: (PriceItems)[];
279
+ export interface PricingDetails {
280
+ items?: (PriceItem)[];
216
281
  /**
217
282
  * Total of all items before (discounts or) taxes are applied.
218
283
  */
@@ -261,6 +326,15 @@ declare namespace Components {
261
326
  */
262
327
  rate?: string;
263
328
  }
329
+ /**
330
+ * A valid tax rate from a client.
331
+ */
332
+ export interface TaxAmountPayload {
333
+ /**
334
+ * The tax rate applied.
335
+ */
336
+ rate?: string;
337
+ }
264
338
  /**
265
339
  * The total details with tax (and discount) aggregated totals.
266
340
  */
@@ -286,35 +360,27 @@ declare namespace Components {
286
360
  }
287
361
  }
288
362
  declare namespace Paths {
289
- namespace CalculatePricing {
363
+ namespace $CalculatePricing {
290
364
  export type RequestBody = (Components.Schemas.PriceItems)[];
291
365
  namespace Responses {
292
- export type $200 = Components.Schemas.PriceItemsCalculateResult;
366
+ export type $200 = Components.Schemas.PricingDetails;
293
367
  export type $400 = Components.Schemas.Error;
294
368
  }
295
369
  }
296
- namespace CheckoutCart {
370
+ namespace $CheckoutCart {
297
371
  export interface HeaderParameters {
298
372
  "X-Ivy-Org-ID": Parameters.XIvyOrgID;
299
373
  }
300
374
  namespace Parameters {
301
375
  export type XIvyOrgID = string;
302
376
  }
303
- export type RequestBody = {
304
- cart?: string | Components.Schemas.Cart;
305
- mode?: Components.Schemas.CheckoutMode;
306
- };
377
+ export type RequestBody = Components.Schemas.CheckoutCart;
307
378
  namespace Responses {
308
- /**
309
- * The checkout result
310
- */
311
- export interface $200 {
312
- order?: Components.Schemas.Order;
313
- }
379
+ export type $200 = Components.Schemas.CheckoutCartResult;
314
380
  export type $400 = Components.Schemas.Error;
315
381
  }
316
382
  }
317
- namespace DeleteCart {
383
+ namespace $DeleteCart {
318
384
  namespace Parameters {
319
385
  export type CartId = string;
320
386
  }
@@ -326,7 +392,7 @@ declare namespace Paths {
326
392
  export type $400 = Components.Schemas.Error;
327
393
  }
328
394
  }
329
- namespace GetCart {
395
+ namespace $GetCart {
330
396
  namespace Parameters {
331
397
  export type CartId = string;
332
398
  }
@@ -338,21 +404,21 @@ declare namespace Paths {
338
404
  export type $400 = Components.Schemas.Error;
339
405
  }
340
406
  }
341
- namespace UpsertCart {
407
+ namespace $UpsertCart {
342
408
  export interface HeaderParameters {
343
409
  "X-Ivy-Org-ID": Parameters.XIvyOrgID;
344
410
  }
345
411
  namespace Parameters {
346
412
  export type XIvyOrgID = string;
347
413
  }
348
- export type RequestBody = Components.Schemas.Cart;
414
+ export type RequestBody = Components.Schemas.CartPayload;
349
415
  namespace Responses {
350
416
  export type $200 = Components.Schemas.Cart;
351
417
  export type $201 = Components.Schemas.Cart;
352
418
  export type $400 = Components.Schemas.Error;
353
419
  }
354
420
  }
355
- namespace UpsertOrder {
421
+ namespace $UpsertOrder {
356
422
  export type RequestBody = Components.Schemas.Order;
357
423
  namespace Responses {
358
424
  export type $200 = Components.Schemas.Order;
@@ -364,17 +430,17 @@ declare namespace Paths {
364
430
 
365
431
  export interface OperationMethods {
366
432
  /**
367
- * upsertCart - upsertCart
433
+ * $upsertCart - upsertCart
368
434
  *
369
435
  * Creates a new cart or updates an existing one.
370
436
  */
371
- 'upsertCart'(
372
- parameters?: Parameters<Paths.UpsertCart.HeaderParameters> | null,
373
- data?: Paths.UpsertCart.RequestBody,
437
+ '$upsertCart'(
438
+ parameters?: Parameters<Paths.$UpsertCart.HeaderParameters> | null,
439
+ data?: Paths.$UpsertCart.RequestBody,
374
440
  config?: AxiosRequestConfig
375
- ): OperationResponse<Paths.UpsertCart.Responses.$200 | Paths.UpsertCart.Responses.$201 | Paths.UpsertCart.Responses.$400>
441
+ ): OperationResponse<Paths.$UpsertCart.Responses.$200 | Paths.$UpsertCart.Responses.$201 | Paths.$UpsertCart.Responses.$400>
376
442
  /**
377
- * checkoutCart - checkoutCart
443
+ * $checkoutCart - checkoutCart
378
444
  *
379
445
  * Checkouts a cart and executes the specified checkout `mode` process.
380
446
  *
@@ -389,33 +455,33 @@ export interface OperationMethods {
389
455
  * If the checkout `mode` is omitted, the `mode` will default to `create_order`.
390
456
  *
391
457
  */
392
- 'checkoutCart'(
393
- parameters?: Parameters<Paths.CheckoutCart.HeaderParameters> | null,
394
- data?: Paths.CheckoutCart.RequestBody,
458
+ '$checkoutCart'(
459
+ parameters?: Parameters<Paths.$CheckoutCart.HeaderParameters> | null,
460
+ data?: Paths.$CheckoutCart.RequestBody,
395
461
  config?: AxiosRequestConfig
396
- ): OperationResponse<Paths.CheckoutCart.Responses.$200 | Paths.CheckoutCart.Responses.$400>
462
+ ): OperationResponse<Paths.$CheckoutCart.Responses.$200 | Paths.$CheckoutCart.Responses.$400>
397
463
  /**
398
- * getCart - getCart
464
+ * $getCart - getCart
399
465
  *
400
466
  * Retrieves a cart by id.
401
467
  */
402
- 'getCart'(
403
- parameters?: Parameters<Paths.GetCart.PathParameters> | null,
468
+ '$getCart'(
469
+ parameters?: Parameters<Paths.$GetCart.PathParameters> | null,
404
470
  data?: any,
405
471
  config?: AxiosRequestConfig
406
- ): OperationResponse<Paths.GetCart.Responses.$200 | Paths.GetCart.Responses.$400>
472
+ ): OperationResponse<Paths.$GetCart.Responses.$200 | Paths.$GetCart.Responses.$400>
407
473
  /**
408
- * deleteCart - deleteCart
474
+ * $deleteCart - deleteCart
409
475
  *
410
476
  * Deletes the Cart specified and returns its content.
411
477
  */
412
- 'deleteCart'(
413
- parameters?: Parameters<Paths.DeleteCart.PathParameters> | null,
478
+ '$deleteCart'(
479
+ parameters?: Parameters<Paths.$DeleteCart.PathParameters> | null,
414
480
  data?: any,
415
481
  config?: AxiosRequestConfig
416
- ): OperationResponse<Paths.DeleteCart.Responses.$200 | Paths.DeleteCart.Responses.$400>
482
+ ): OperationResponse<Paths.$DeleteCart.Responses.$200 | Paths.$DeleteCart.Responses.$400>
417
483
  /**
418
- * upsertOrder - upsertOrder
484
+ * $upsertOrder - upsertOrder
419
485
  *
420
486
  * Creates a new order or updates an existing one. During the creation of an order, an unique customer-readable `order_number` will be generated.
421
487
  * The `order_number` can be used to universally identify an order within epilot platform.
@@ -427,40 +493,40 @@ export interface OperationMethods {
427
493
  * On multiple updates with the same `cart_id` the line items linked with that `cart_id` (`order.line_items[]?.metadata.cart_id`) are removed and re-added.
428
494
  *
429
495
  */
430
- 'upsertOrder'(
496
+ '$upsertOrder'(
431
497
  parameters?: Parameters<UnknownParamsObject> | null,
432
- data?: Paths.UpsertOrder.RequestBody,
498
+ data?: Paths.$UpsertOrder.RequestBody,
433
499
  config?: AxiosRequestConfig
434
- ): OperationResponse<Paths.UpsertOrder.Responses.$200 | Paths.UpsertOrder.Responses.$201 | Paths.UpsertOrder.Responses.$400>
500
+ ): OperationResponse<Paths.$UpsertOrder.Responses.$200 | Paths.$UpsertOrder.Responses.$201 | Paths.$UpsertOrder.Responses.$400>
435
501
  /**
436
- * calculatePricing - calculatePricing
502
+ * $calculatePricing - calculatePricing
437
503
  *
438
504
  * Calculates the pricing amounts for a set of price items, including aggregated totals such as subtotal, total and aggregates per tax rate.
439
505
  *
440
506
  */
441
- 'calculatePricing'(
507
+ '$calculatePricing'(
442
508
  parameters?: Parameters<UnknownParamsObject> | null,
443
- data?: Paths.CalculatePricing.RequestBody,
509
+ data?: Paths.$CalculatePricing.RequestBody,
444
510
  config?: AxiosRequestConfig
445
- ): OperationResponse<Paths.CalculatePricing.Responses.$200 | Paths.CalculatePricing.Responses.$400>
511
+ ): OperationResponse<Paths.$CalculatePricing.Responses.$200 | Paths.$CalculatePricing.Responses.$400>
446
512
  }
447
513
 
448
514
  export interface PathsDictionary {
449
515
  ['/v1/public/cart']: {
450
516
  /**
451
- * upsertCart - upsertCart
517
+ * $upsertCart - upsertCart
452
518
  *
453
519
  * Creates a new cart or updates an existing one.
454
520
  */
455
521
  'put'(
456
- parameters?: Parameters<Paths.UpsertCart.HeaderParameters> | null,
457
- data?: Paths.UpsertCart.RequestBody,
522
+ parameters?: Parameters<Paths.$UpsertCart.HeaderParameters> | null,
523
+ data?: Paths.$UpsertCart.RequestBody,
458
524
  config?: AxiosRequestConfig
459
- ): OperationResponse<Paths.UpsertCart.Responses.$200 | Paths.UpsertCart.Responses.$201 | Paths.UpsertCart.Responses.$400>
525
+ ): OperationResponse<Paths.$UpsertCart.Responses.$200 | Paths.$UpsertCart.Responses.$201 | Paths.$UpsertCart.Responses.$400>
460
526
  }
461
527
  ['/v1/public/cart:checkout']: {
462
528
  /**
463
- * checkoutCart - checkoutCart
529
+ * $checkoutCart - checkoutCart
464
530
  *
465
531
  * Checkouts a cart and executes the specified checkout `mode` process.
466
532
  *
@@ -476,36 +542,36 @@ export interface PathsDictionary {
476
542
  *
477
543
  */
478
544
  'post'(
479
- parameters?: Parameters<Paths.CheckoutCart.HeaderParameters> | null,
480
- data?: Paths.CheckoutCart.RequestBody,
545
+ parameters?: Parameters<Paths.$CheckoutCart.HeaderParameters> | null,
546
+ data?: Paths.$CheckoutCart.RequestBody,
481
547
  config?: AxiosRequestConfig
482
- ): OperationResponse<Paths.CheckoutCart.Responses.$200 | Paths.CheckoutCart.Responses.$400>
548
+ ): OperationResponse<Paths.$CheckoutCart.Responses.$200 | Paths.$CheckoutCart.Responses.$400>
483
549
  }
484
550
  ['/v1/cart/{cart-id}']: {
485
551
  /**
486
- * getCart - getCart
552
+ * $getCart - getCart
487
553
  *
488
554
  * Retrieves a cart by id.
489
555
  */
490
556
  'get'(
491
- parameters?: Parameters<Paths.GetCart.PathParameters> | null,
557
+ parameters?: Parameters<Paths.$GetCart.PathParameters> | null,
492
558
  data?: any,
493
559
  config?: AxiosRequestConfig
494
- ): OperationResponse<Paths.GetCart.Responses.$200 | Paths.GetCart.Responses.$400>
560
+ ): OperationResponse<Paths.$GetCart.Responses.$200 | Paths.$GetCart.Responses.$400>
495
561
  /**
496
- * deleteCart - deleteCart
562
+ * $deleteCart - deleteCart
497
563
  *
498
564
  * Deletes the Cart specified and returns its content.
499
565
  */
500
566
  'delete'(
501
- parameters?: Parameters<Paths.DeleteCart.PathParameters> | null,
567
+ parameters?: Parameters<Paths.$DeleteCart.PathParameters> | null,
502
568
  data?: any,
503
569
  config?: AxiosRequestConfig
504
- ): OperationResponse<Paths.DeleteCart.Responses.$200 | Paths.DeleteCart.Responses.$400>
570
+ ): OperationResponse<Paths.$DeleteCart.Responses.$200 | Paths.$DeleteCart.Responses.$400>
505
571
  }
506
572
  ['/v1/order']: {
507
573
  /**
508
- * upsertOrder - upsertOrder
574
+ * $upsertOrder - upsertOrder
509
575
  *
510
576
  * Creates a new order or updates an existing one. During the creation of an order, an unique customer-readable `order_number` will be generated.
511
577
  * The `order_number` can be used to universally identify an order within epilot platform.
@@ -519,22 +585,22 @@ export interface PathsDictionary {
519
585
  */
520
586
  'put'(
521
587
  parameters?: Parameters<UnknownParamsObject> | null,
522
- data?: Paths.UpsertOrder.RequestBody,
588
+ data?: Paths.$UpsertOrder.RequestBody,
523
589
  config?: AxiosRequestConfig
524
- ): OperationResponse<Paths.UpsertOrder.Responses.$200 | Paths.UpsertOrder.Responses.$201 | Paths.UpsertOrder.Responses.$400>
590
+ ): OperationResponse<Paths.$UpsertOrder.Responses.$200 | Paths.$UpsertOrder.Responses.$201 | Paths.$UpsertOrder.Responses.$400>
525
591
  }
526
592
  ['/v1/public/pricing:calculate']: {
527
593
  /**
528
- * calculatePricing - calculatePricing
594
+ * $calculatePricing - calculatePricing
529
595
  *
530
596
  * Calculates the pricing amounts for a set of price items, including aggregated totals such as subtotal, total and aggregates per tax rate.
531
597
  *
532
598
  */
533
599
  'post'(
534
600
  parameters?: Parameters<UnknownParamsObject> | null,
535
- data?: Paths.CalculatePricing.RequestBody,
601
+ data?: Paths.$CalculatePricing.RequestBody,
536
602
  config?: AxiosRequestConfig
537
- ): OperationResponse<Paths.CalculatePricing.Responses.$200 | Paths.CalculatePricing.Responses.$400>
603
+ ): OperationResponse<Paths.$CalculatePricing.Responses.$200 | Paths.$CalculatePricing.Responses.$400>
538
604
  }
539
605
  }
540
606
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/pricing-client",
3
- "version": "0.2.0",
3
+ "version": "0.2.3",
4
4
  "description": "Client for epilot Pricing APIs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/openapi.d.ts CHANGED
@@ -51,6 +51,30 @@ declare namespace Components {
51
51
  readonly created_at?: string; // date-time
52
52
  readonly updated_at?: string; // date-time
53
53
  }
54
+ /**
55
+ * A valid cart payload from a client.
56
+ */
57
+ export interface CartPayload {
58
+ /**
59
+ * A valid email identifying the customer.
60
+ */
61
+ customer_email?: string;
62
+ metadata?: MetaData;
63
+ line_items?: PriceItemsPayload;
64
+ }
65
+ /**
66
+ * The cart checkout request payload
67
+ */
68
+ export interface CheckoutCart {
69
+ cart?: string | CartPayload;
70
+ mode?: CheckoutMode;
71
+ }
72
+ /**
73
+ * The cart checkout result
74
+ */
75
+ export interface CheckoutCartResult {
76
+ order?: Order;
77
+ }
54
78
  /**
55
79
  * The checkout mode for the cart checkout.
56
80
  */
@@ -160,7 +184,16 @@ declare namespace Components {
160
184
  tax_behavior?: "Inclusive (Price amount includes Tax)" | "Exclusive (Price amount excludes Tax)";
161
185
  tiers_mode?: "Standard";
162
186
  type?: "One Time" | "Recurring";
187
+ billing_period?: "Weekly" | "Monthly" | "Every Quarter" | "Every 6 months" | "Yearly";
163
188
  unit_amount?: string;
189
+ billing_duration_amount?: number;
190
+ billing_duration_unit?: "Weeks" | "Months" | "Years";
191
+ notice_time_amount?: number;
192
+ notice_time_unit?: "Weeks" | "Months" | "Years";
193
+ termination_time_amount?: number;
194
+ termination_time_unit?: "Weeks" | "Months" | "Years";
195
+ renewal_duration_amount?: number;
196
+ renewal_duration_unit?: "Weeks" | "Months" | "Years";
164
197
  _created_at?: string;
165
198
  _id?: string;
166
199
  _title?: string;
@@ -204,15 +237,47 @@ declare namespace Components {
204
237
  */
205
238
  readonly taxes?: (TaxAmount)[];
206
239
  }
240
+ /**
241
+ * Represents a valid price item from a client.
242
+ */
243
+ export interface PriceItemPayload {
244
+ metadata?: MetaData;
245
+ /**
246
+ * Three-letter ISO currency code, in lowercase.
247
+ * Defaults to the customer currency when the customer or customer_email field is provided, or to EUR as a fallback.
248
+ *
249
+ */
250
+ currency?: string;
251
+ /**
252
+ * The quantity of products being purchased.
253
+ */
254
+ quantity?: number;
255
+ /**
256
+ * The id of the product.
257
+ */
258
+ product?: string;
259
+ /**
260
+ * The id of the price.
261
+ */
262
+ price?: string;
263
+ /**
264
+ * The taxes applied to the price item.
265
+ */
266
+ readonly taxes?: (TaxAmountPayload)[];
267
+ }
207
268
  /**
208
269
  * Tracks a set of product prices, quantities, (discounts) and taxes.
209
270
  */
210
271
  export type PriceItems = (PriceItem)[];
272
+ /**
273
+ * A valid set of product prices, quantities, (discounts) and taxes from a client.
274
+ */
275
+ export type PriceItemsPayload = (PriceItemPayload)[];
211
276
  /**
212
277
  * The result from the calculation of a set of price items.
213
278
  */
214
- export interface PriceItemsCalculateResult {
215
- items?: (PriceItems)[];
279
+ export interface PricingDetails {
280
+ items?: (PriceItem)[];
216
281
  /**
217
282
  * Total of all items before (discounts or) taxes are applied.
218
283
  */
@@ -261,6 +326,15 @@ declare namespace Components {
261
326
  */
262
327
  rate?: string;
263
328
  }
329
+ /**
330
+ * A valid tax rate from a client.
331
+ */
332
+ export interface TaxAmountPayload {
333
+ /**
334
+ * The tax rate applied.
335
+ */
336
+ rate?: string;
337
+ }
264
338
  /**
265
339
  * The total details with tax (and discount) aggregated totals.
266
340
  */
@@ -286,35 +360,27 @@ declare namespace Components {
286
360
  }
287
361
  }
288
362
  declare namespace Paths {
289
- namespace CalculatePricing {
363
+ namespace $CalculatePricing {
290
364
  export type RequestBody = (Components.Schemas.PriceItems)[];
291
365
  namespace Responses {
292
- export type $200 = Components.Schemas.PriceItemsCalculateResult;
366
+ export type $200 = Components.Schemas.PricingDetails;
293
367
  export type $400 = Components.Schemas.Error;
294
368
  }
295
369
  }
296
- namespace CheckoutCart {
370
+ namespace $CheckoutCart {
297
371
  export interface HeaderParameters {
298
372
  "X-Ivy-Org-ID": Parameters.XIvyOrgID;
299
373
  }
300
374
  namespace Parameters {
301
375
  export type XIvyOrgID = string;
302
376
  }
303
- export type RequestBody = {
304
- cart?: string | Components.Schemas.Cart;
305
- mode?: Components.Schemas.CheckoutMode;
306
- };
377
+ export type RequestBody = Components.Schemas.CheckoutCart;
307
378
  namespace Responses {
308
- /**
309
- * The checkout result
310
- */
311
- export interface $200 {
312
- order?: Components.Schemas.Order;
313
- }
379
+ export type $200 = Components.Schemas.CheckoutCartResult;
314
380
  export type $400 = Components.Schemas.Error;
315
381
  }
316
382
  }
317
- namespace DeleteCart {
383
+ namespace $DeleteCart {
318
384
  namespace Parameters {
319
385
  export type CartId = string;
320
386
  }
@@ -326,7 +392,7 @@ declare namespace Paths {
326
392
  export type $400 = Components.Schemas.Error;
327
393
  }
328
394
  }
329
- namespace GetCart {
395
+ namespace $GetCart {
330
396
  namespace Parameters {
331
397
  export type CartId = string;
332
398
  }
@@ -338,21 +404,21 @@ declare namespace Paths {
338
404
  export type $400 = Components.Schemas.Error;
339
405
  }
340
406
  }
341
- namespace UpsertCart {
407
+ namespace $UpsertCart {
342
408
  export interface HeaderParameters {
343
409
  "X-Ivy-Org-ID": Parameters.XIvyOrgID;
344
410
  }
345
411
  namespace Parameters {
346
412
  export type XIvyOrgID = string;
347
413
  }
348
- export type RequestBody = Components.Schemas.Cart;
414
+ export type RequestBody = Components.Schemas.CartPayload;
349
415
  namespace Responses {
350
416
  export type $200 = Components.Schemas.Cart;
351
417
  export type $201 = Components.Schemas.Cart;
352
418
  export type $400 = Components.Schemas.Error;
353
419
  }
354
420
  }
355
- namespace UpsertOrder {
421
+ namespace $UpsertOrder {
356
422
  export type RequestBody = Components.Schemas.Order;
357
423
  namespace Responses {
358
424
  export type $200 = Components.Schemas.Order;
@@ -364,17 +430,17 @@ declare namespace Paths {
364
430
 
365
431
  export interface OperationMethods {
366
432
  /**
367
- * upsertCart - upsertCart
433
+ * $upsertCart - upsertCart
368
434
  *
369
435
  * Creates a new cart or updates an existing one.
370
436
  */
371
- 'upsertCart'(
372
- parameters?: Parameters<Paths.UpsertCart.HeaderParameters> | null,
373
- data?: Paths.UpsertCart.RequestBody,
437
+ '$upsertCart'(
438
+ parameters?: Parameters<Paths.$UpsertCart.HeaderParameters> | null,
439
+ data?: Paths.$UpsertCart.RequestBody,
374
440
  config?: AxiosRequestConfig
375
- ): OperationResponse<Paths.UpsertCart.Responses.$200 | Paths.UpsertCart.Responses.$201 | Paths.UpsertCart.Responses.$400>
441
+ ): OperationResponse<Paths.$UpsertCart.Responses.$200 | Paths.$UpsertCart.Responses.$201 | Paths.$UpsertCart.Responses.$400>
376
442
  /**
377
- * checkoutCart - checkoutCart
443
+ * $checkoutCart - checkoutCart
378
444
  *
379
445
  * Checkouts a cart and executes the specified checkout `mode` process.
380
446
  *
@@ -389,33 +455,33 @@ export interface OperationMethods {
389
455
  * If the checkout `mode` is omitted, the `mode` will default to `create_order`.
390
456
  *
391
457
  */
392
- 'checkoutCart'(
393
- parameters?: Parameters<Paths.CheckoutCart.HeaderParameters> | null,
394
- data?: Paths.CheckoutCart.RequestBody,
458
+ '$checkoutCart'(
459
+ parameters?: Parameters<Paths.$CheckoutCart.HeaderParameters> | null,
460
+ data?: Paths.$CheckoutCart.RequestBody,
395
461
  config?: AxiosRequestConfig
396
- ): OperationResponse<Paths.CheckoutCart.Responses.$200 | Paths.CheckoutCart.Responses.$400>
462
+ ): OperationResponse<Paths.$CheckoutCart.Responses.$200 | Paths.$CheckoutCart.Responses.$400>
397
463
  /**
398
- * getCart - getCart
464
+ * $getCart - getCart
399
465
  *
400
466
  * Retrieves a cart by id.
401
467
  */
402
- 'getCart'(
403
- parameters?: Parameters<Paths.GetCart.PathParameters> | null,
468
+ '$getCart'(
469
+ parameters?: Parameters<Paths.$GetCart.PathParameters> | null,
404
470
  data?: any,
405
471
  config?: AxiosRequestConfig
406
- ): OperationResponse<Paths.GetCart.Responses.$200 | Paths.GetCart.Responses.$400>
472
+ ): OperationResponse<Paths.$GetCart.Responses.$200 | Paths.$GetCart.Responses.$400>
407
473
  /**
408
- * deleteCart - deleteCart
474
+ * $deleteCart - deleteCart
409
475
  *
410
476
  * Deletes the Cart specified and returns its content.
411
477
  */
412
- 'deleteCart'(
413
- parameters?: Parameters<Paths.DeleteCart.PathParameters> | null,
478
+ '$deleteCart'(
479
+ parameters?: Parameters<Paths.$DeleteCart.PathParameters> | null,
414
480
  data?: any,
415
481
  config?: AxiosRequestConfig
416
- ): OperationResponse<Paths.DeleteCart.Responses.$200 | Paths.DeleteCart.Responses.$400>
482
+ ): OperationResponse<Paths.$DeleteCart.Responses.$200 | Paths.$DeleteCart.Responses.$400>
417
483
  /**
418
- * upsertOrder - upsertOrder
484
+ * $upsertOrder - upsertOrder
419
485
  *
420
486
  * Creates a new order or updates an existing one. During the creation of an order, an unique customer-readable `order_number` will be generated.
421
487
  * The `order_number` can be used to universally identify an order within epilot platform.
@@ -427,40 +493,40 @@ export interface OperationMethods {
427
493
  * On multiple updates with the same `cart_id` the line items linked with that `cart_id` (`order.line_items[]?.metadata.cart_id`) are removed and re-added.
428
494
  *
429
495
  */
430
- 'upsertOrder'(
496
+ '$upsertOrder'(
431
497
  parameters?: Parameters<UnknownParamsObject> | null,
432
- data?: Paths.UpsertOrder.RequestBody,
498
+ data?: Paths.$UpsertOrder.RequestBody,
433
499
  config?: AxiosRequestConfig
434
- ): OperationResponse<Paths.UpsertOrder.Responses.$200 | Paths.UpsertOrder.Responses.$201 | Paths.UpsertOrder.Responses.$400>
500
+ ): OperationResponse<Paths.$UpsertOrder.Responses.$200 | Paths.$UpsertOrder.Responses.$201 | Paths.$UpsertOrder.Responses.$400>
435
501
  /**
436
- * calculatePricing - calculatePricing
502
+ * $calculatePricing - calculatePricing
437
503
  *
438
504
  * Calculates the pricing amounts for a set of price items, including aggregated totals such as subtotal, total and aggregates per tax rate.
439
505
  *
440
506
  */
441
- 'calculatePricing'(
507
+ '$calculatePricing'(
442
508
  parameters?: Parameters<UnknownParamsObject> | null,
443
- data?: Paths.CalculatePricing.RequestBody,
509
+ data?: Paths.$CalculatePricing.RequestBody,
444
510
  config?: AxiosRequestConfig
445
- ): OperationResponse<Paths.CalculatePricing.Responses.$200 | Paths.CalculatePricing.Responses.$400>
511
+ ): OperationResponse<Paths.$CalculatePricing.Responses.$200 | Paths.$CalculatePricing.Responses.$400>
446
512
  }
447
513
 
448
514
  export interface PathsDictionary {
449
515
  ['/v1/public/cart']: {
450
516
  /**
451
- * upsertCart - upsertCart
517
+ * $upsertCart - upsertCart
452
518
  *
453
519
  * Creates a new cart or updates an existing one.
454
520
  */
455
521
  'put'(
456
- parameters?: Parameters<Paths.UpsertCart.HeaderParameters> | null,
457
- data?: Paths.UpsertCart.RequestBody,
522
+ parameters?: Parameters<Paths.$UpsertCart.HeaderParameters> | null,
523
+ data?: Paths.$UpsertCart.RequestBody,
458
524
  config?: AxiosRequestConfig
459
- ): OperationResponse<Paths.UpsertCart.Responses.$200 | Paths.UpsertCart.Responses.$201 | Paths.UpsertCart.Responses.$400>
525
+ ): OperationResponse<Paths.$UpsertCart.Responses.$200 | Paths.$UpsertCart.Responses.$201 | Paths.$UpsertCart.Responses.$400>
460
526
  }
461
527
  ['/v1/public/cart:checkout']: {
462
528
  /**
463
- * checkoutCart - checkoutCart
529
+ * $checkoutCart - checkoutCart
464
530
  *
465
531
  * Checkouts a cart and executes the specified checkout `mode` process.
466
532
  *
@@ -476,36 +542,36 @@ export interface PathsDictionary {
476
542
  *
477
543
  */
478
544
  'post'(
479
- parameters?: Parameters<Paths.CheckoutCart.HeaderParameters> | null,
480
- data?: Paths.CheckoutCart.RequestBody,
545
+ parameters?: Parameters<Paths.$CheckoutCart.HeaderParameters> | null,
546
+ data?: Paths.$CheckoutCart.RequestBody,
481
547
  config?: AxiosRequestConfig
482
- ): OperationResponse<Paths.CheckoutCart.Responses.$200 | Paths.CheckoutCart.Responses.$400>
548
+ ): OperationResponse<Paths.$CheckoutCart.Responses.$200 | Paths.$CheckoutCart.Responses.$400>
483
549
  }
484
550
  ['/v1/cart/{cart-id}']: {
485
551
  /**
486
- * getCart - getCart
552
+ * $getCart - getCart
487
553
  *
488
554
  * Retrieves a cart by id.
489
555
  */
490
556
  'get'(
491
- parameters?: Parameters<Paths.GetCart.PathParameters> | null,
557
+ parameters?: Parameters<Paths.$GetCart.PathParameters> | null,
492
558
  data?: any,
493
559
  config?: AxiosRequestConfig
494
- ): OperationResponse<Paths.GetCart.Responses.$200 | Paths.GetCart.Responses.$400>
560
+ ): OperationResponse<Paths.$GetCart.Responses.$200 | Paths.$GetCart.Responses.$400>
495
561
  /**
496
- * deleteCart - deleteCart
562
+ * $deleteCart - deleteCart
497
563
  *
498
564
  * Deletes the Cart specified and returns its content.
499
565
  */
500
566
  'delete'(
501
- parameters?: Parameters<Paths.DeleteCart.PathParameters> | null,
567
+ parameters?: Parameters<Paths.$DeleteCart.PathParameters> | null,
502
568
  data?: any,
503
569
  config?: AxiosRequestConfig
504
- ): OperationResponse<Paths.DeleteCart.Responses.$200 | Paths.DeleteCart.Responses.$400>
570
+ ): OperationResponse<Paths.$DeleteCart.Responses.$200 | Paths.$DeleteCart.Responses.$400>
505
571
  }
506
572
  ['/v1/order']: {
507
573
  /**
508
- * upsertOrder - upsertOrder
574
+ * $upsertOrder - upsertOrder
509
575
  *
510
576
  * Creates a new order or updates an existing one. During the creation of an order, an unique customer-readable `order_number` will be generated.
511
577
  * The `order_number` can be used to universally identify an order within epilot platform.
@@ -519,22 +585,22 @@ export interface PathsDictionary {
519
585
  */
520
586
  'put'(
521
587
  parameters?: Parameters<UnknownParamsObject> | null,
522
- data?: Paths.UpsertOrder.RequestBody,
588
+ data?: Paths.$UpsertOrder.RequestBody,
523
589
  config?: AxiosRequestConfig
524
- ): OperationResponse<Paths.UpsertOrder.Responses.$200 | Paths.UpsertOrder.Responses.$201 | Paths.UpsertOrder.Responses.$400>
590
+ ): OperationResponse<Paths.$UpsertOrder.Responses.$200 | Paths.$UpsertOrder.Responses.$201 | Paths.$UpsertOrder.Responses.$400>
525
591
  }
526
592
  ['/v1/public/pricing:calculate']: {
527
593
  /**
528
- * calculatePricing - calculatePricing
594
+ * $calculatePricing - calculatePricing
529
595
  *
530
596
  * Calculates the pricing amounts for a set of price items, including aggregated totals such as subtotal, total and aggregates per tax rate.
531
597
  *
532
598
  */
533
599
  'post'(
534
600
  parameters?: Parameters<UnknownParamsObject> | null,
535
- data?: Paths.CalculatePricing.RequestBody,
601
+ data?: Paths.$CalculatePricing.RequestBody,
536
602
  config?: AxiosRequestConfig
537
- ): OperationResponse<Paths.CalculatePricing.Responses.$200 | Paths.CalculatePricing.Responses.$400>
603
+ ): OperationResponse<Paths.$CalculatePricing.Responses.$200 | Paths.$CalculatePricing.Responses.$400>
538
604
  }
539
605
  }
540
606