@epilot/pricing-client 0.2.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +2 -1
- package/dist/client.js +4 -1
- package/dist/definition.js +1 -1
- package/dist/openapi.d.ts +183 -117
- package/package.json +1 -1
- package/src/openapi.d.ts +183 -117
package/dist/client.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
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({
|
|
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;
|
package/dist/definition.js
CHANGED
|
@@ -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 r=i(a(279));t.default=r.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- 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\\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","contact":{"name":"Maintainers Channel","url":"https://epilot.slack.com/archives/C020B4URQNS"},"version":"1.0.0"},"externalDocs":{"description":"Read the full docs here","url":"https://e-pilot.atlassian.net/wiki/spaces/EO/pages/5459705918/Shopping+Cart+Orders+API"},"tags":[{"name":"Draft","description":"Operations not implement under the current release."},{"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"}],"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","Draft"],"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/CartDto"},"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":{"$ref":"#/components/examples/checkoutWithCartId"},"Fast Checkout with a transient Cart":{"$ref":"#/components/examples/checkoutWithTransientCart"}}}}},"responses":{"200":{"description":"The checkout result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutCartResult"},"examples":{"Checkout with created order":{"$ref":"#/components/examples/checkoutResult"}}}}},"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","Draft"],"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","Draft"],"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","Draft"],"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"}}}}}}}},"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"}}}]}},"CartDto":{"description":"A valid cart payload from a client.","properties":{"metadata":{"$ref":"#/components/schemas/MetaData"},"customer":{"$ref":"#/components/schemas/Customer"},"billing_address":{"$ref":"#/components/schemas/Address"},"delivery_address":{"$ref":"#/components/schemas/Address"},"line_items":{"$ref":"#/components/schemas/PriceItemsDto"}},"required":["line_items"]},"CheckoutCart":{"type":"object","description":"The cart checkout request payload","properties":{"cart":{"anyOf":[{"description":"the cart id","type":"string"},{"$ref":"#/components/schemas/CartDto"}]},"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"]},"PriceItemsDto":{"description":"A valid set of product prices, quantities, (discounts) and taxes from a client.","type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/PriceItemDto"}]}},"PriceItemDto":{"description":"Represents a valid price item from a client.","type":"object","properties":{"metadata":{"$ref":"#/components/schemas/MetaData"},"quantity":{"type":"integer","description":"The quantity of products being purchased."},"product_id":{"type":"string","description":"The id of the product."},"price_id":{"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/TaxAmountDto"}]}},"_price":{"$ref":"#/components/schemas/Price"}}},"TaxAmountDto":{"type":"object","description":"A valid tax rate from a client.","properties":{"rate":{"type":"string","description":"The tax rate applied."}}},"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":{"$ref":"#/components/schemas/Customer"},"billing_address":{"$ref":"#/components/schemas/Address"},"delivery_address":{"$ref":"#/components/schemas/Address"},"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"}}},"BillingEmail":{"type":"object","description":"An order billing email","properties":{"_tags":{"type":"array","items":{"type":"string"}},"billing_email":{"type":"string"}}},"BillingPhone":{"type":"object","description":"An order billing phone","properties":{"_tags":{"type":"array","items":{"type":"string"}},"billing_phone":{"type":"string"}}},"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"},"status":{"type":"string","enum":["Draft","Open","Paid","Shipped","Delivered","Complete"],"description":"The order status"},"metadata":{"$ref":"#/components/schemas/MetaData"},"billing_first_name":{"type":"string"},"billing_last_name":{"type":"string"},"billing_company_name":{"type":"string"},"billing_vat":{"type":"string"},"billing_email":{"type":"array","description":"A list of emails.","items":{"oneOf":[{"$ref":"#/components/schemas/BillingEmail"}]}},"billing_phone":{"type":"array","description":"A list of phone numbers.","items":{"oneOf":[{"$ref":"#/components/schemas/BillingPhone"}]}},"billing_address":{"$ref":"#/components/schemas/Address"},"delivery_address":{"$ref":"#/components/schemas/Address"},"contact":{"readOnly":true,"type":"string","description":"The id of an existing contact."},"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},"_tags":{"type":"array","items":{"type":"string"}}}},"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"},"unit_amount":{"type":"integer","description":"The unit amount value","readOnly":true},"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","readOnly":true,"description":"Three-letter ISO currency code, in lowercase. The currency is inferred from the price.\\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_id":{"type":"string","description":"The id of the product."},"price_id":{"type":"string","description":"The id of the price."},"_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"}]}}}}}},"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"}},"example":{"$ref":"#/components/examples/pricingDetails"}},"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":"number"},"unit_amount_decimal":{"type":"string"},"unit_amount_currency":{"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"}},"Address":{"type":"object","additionalProperties":true,"properties":{"street1":{"type":"string","description":"The first line of the address. Typically the street address or PO Box number."},"street2":{"type":"string","description":"The second line of the address. Typically the number of the apartment, suite, or unit."},"city":{"type":"string","description":"The name of the city, district, village, or town."},"country":{"type":"string","description":"The name of the country."},"country_code":{"type":"string","description":"The two-letter code for the country of the address."},"additional_info":{"type":"string","description":"An additional description for the address"}}},"PaymentMethod":{"type":"object","description":"A PaymentMethod represent your customer\'s payment instruments.\\n","properties":{"type":{"type":"string","description":"The type of the PaymentMethod."},"details":{"type":"object","description":"Contains relevant data associated with the payment method type.","additionalProperties":true}}},"Customer":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"company_name":{"type":"string"},"vat_id":{"type":"string"},"email":{"type":"string","description":"A valid email identifying the customer."},"phone":{"type":"string"}}}},"examples":{"checkoutWithCartId":{"value":{"mode":"create_order","cart":"pZ324jnndf"}},"checkoutWithTransientCart":{"value":{"mode":"create_order","cart":{"metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"customer":{"first_name":"john","last_name":"doe","company_name":"company limited","vat_id":"123892321","email":"johndoe@company.com","phone":"+44233242423"},"billing_address":{"street1":"wallstreet","street2":1,"city":"new york city","country":"united states","country_code":"US","additional_info":"headquarters office"},"delivery_address":{"street1":"berverly hills avenue","street2":"block 1","city":"berverly hills","country":"california","country_code":"CA","additional_info":"remote cowork place"},"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"}]}}},"checkoutResult":{"value":{"order":{"_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","unit_amount":78900,"amount_subtotal":50000,"amount_total":61500,"quantity":1,"product_id":"b7185fb7-b10f-4875-bda7-288631446555","price_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","taxes":[{"amount":11500,"rate":"MwSt. 23%"}],"_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"}},{"id":"mZkGCTfn6p","metadata":[{"cart_id":"p0ZoB1FwH6"}],"description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","unit_amount":78900,"amount_subtotal":50000,"amount_total":53500,"quantity":1,"product_id":"zzzzzz-b10f-4875-bda7-288631446555","price_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","taxes":[{"amount":3500,"rate":"MwSt. 7%"}],"_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"}}],"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"}}},"cart":{"description":"Example of a Shopping Cart","value":{"id":"p0ZoB1FwH6","status":"open","org_id":123,"customer":{"first_name":"john","last_name":"doe","company_name":"company limited","vat_id":"123892321","email":"johndoe@company.com","phone":"+44233242423"},"metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"billing_address":{"street1":"wallstreet","street2":"1","city":"new york city","country":"united states","country_code":"US","additional_info":"headquarters office"},"delivery_address":{"street1":"berverly hills avenue","street2":"block 1","city":"berverly hills","country":"california","country_code":"CA","additional_info":"remote cowork place"},"line_items":[{"id":"mSjGCTfn8w","description":"Wallbox Premium - Premium Price","currency":"EUR","amount_subtotal":50000,"amount_total":61500,"quantity":1,"unit_amount":78900,"product_id":"b7185fb7-b10f-4875-bda7-288631446555","price_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","taxes":[{"amount":11500,"rate":"MwSt. 23%"}],"_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"}},{"id":"mZkGCTfn6p","description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","amount_subtotal":50000,"amount_total":53500,"unit_amount":78900,"quantity":1,"product_id":"zzzzzz-b10f-4875-bda7-288631446555","price_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","taxes":[{"amount":3500,"rate":"MwSt. 7%"}],"_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"}}],"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":{"metadata":[{"key":"journey-id","value":"8d0a2235-97ce-42d0-88a3-e374634ca44e"}],"customer":{"first_name":"john","last_name":"doe","company_name":"company limited","vat_id":"123892321","email":"johndoe@company.com","phone":"+44233242423"},"billing_address":{"street1":"wallstreet","street2":"1","city":"new york city","country":"united states","country_code":"US","additional_info":"headquarters office"},"delivery_address":{"street1":"berverly hills avenue","street2":"block 1","city":"berverly hills","country":"california","country_code":"CA","additional_info":"remote cowork place"},"line_items":[{"quantity":1,"product_id":"b7185fb7-b10f-4875-bda7-288631446555","price_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9"},{"quantity":1,"product_id":"zzzzzz-b10f-4875-bda7-288631446555","price_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9"}]}},"orderCreationPayload":{"description":"Example of an Order creation payload","value":{"order_number":"a34234jd","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","line_items":[{"quantity":1,"product_id":"b7185fb7-b10f-4875-bda7-288631446555","price_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9"},{"quantity":1,"product_id":"zzzzzz-b10f-4875-bda7-288631446555","price_id":"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","unit_amount":78900,"amount_subtotal":50000,"amount_total":61500,"quantity":1,"product_id":"b7185fb7-b10f-4875-bda7-288631446555","price_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","taxes":[{"amount":11500,"rate":"MwSt. 23%"}],"_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"}},{"id":"mZkGCTfn6p","metadata":[{"cart_id":"p0ZoB1FwH6"}],"description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","unit_amount":78900,"amount_subtotal":50000,"amount_total":53500,"quantity":1,"product_id":"zzzzzz-b10f-4875-bda7-288631446555","price_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","taxes":[{"amount":3500,"rate":"MwSt. 7%"}],"_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"}}],"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"}},"price":{"description":"A price example","value":{"unit_amount":78943,"unit_amount_decimal":"789.43","unit_amount_currency":"EUR","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"}},"pricingDetails":{"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","description":"Wallbox Premium - Premium Price","currency":"EUR","unit_amount":78900,"amount_subtotal":50000,"amount_total":61500,"quantity":1,"product_id":"b7185fb7-b10f-4875-bda7-288631446555","price_id":"df240bab-9f71-4a9a-a9e1-59f18827dbf9","taxes":[{"amount":11500,"rate":"MwSt. 23%"}],"_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"}},{"id":"mZkGCTfn6p","description":"Wallbox Basic with Full Add-ons - Basic Price","currency":"EUR","unit_amount":78900,"amount_subtotal":50000,"amount_total":53500,"quantity":1,"product_id":"zzzzzz-b10f-4875-bda7-288631446555","price_id":"zzzzz-9f71-4a9a-a9e1-59f18827dbf9","taxes":[{"amount":3500,"rate":"MwSt. 7%"}],"_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"}}]}}}}}')}},t={};return function a(i){if(t[i])return t[i].exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,a),r.exports}(914)})());
|
package/dist/openapi.d.ts
CHANGED
|
@@ -9,6 +9,47 @@ import {
|
|
|
9
9
|
|
|
10
10
|
declare namespace Components {
|
|
11
11
|
namespace Schemas {
|
|
12
|
+
export interface Address {
|
|
13
|
+
[name: string]: any;
|
|
14
|
+
/**
|
|
15
|
+
* The first line of the address. Typically the street address or PO Box number.
|
|
16
|
+
*/
|
|
17
|
+
street1?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The second line of the address. Typically the number of the apartment, suite, or unit.
|
|
20
|
+
*/
|
|
21
|
+
street2?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The name of the city, district, village, or town.
|
|
24
|
+
*/
|
|
25
|
+
city?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The name of the country.
|
|
28
|
+
*/
|
|
29
|
+
country?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The two-letter code for the country of the address.
|
|
32
|
+
*/
|
|
33
|
+
country_code?: string;
|
|
34
|
+
/**
|
|
35
|
+
* An additional description for the address
|
|
36
|
+
*/
|
|
37
|
+
additional_info?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* An order billing email
|
|
41
|
+
*/
|
|
42
|
+
export interface BillingEmail {
|
|
43
|
+
_tags?: string[];
|
|
44
|
+
billing_email?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* An order billing phone
|
|
48
|
+
*/
|
|
49
|
+
export interface BillingPhone {
|
|
50
|
+
_tags?: string[];
|
|
51
|
+
billing_phone?: string;
|
|
52
|
+
}
|
|
12
53
|
/**
|
|
13
54
|
* Supports shopping for products and services until ready for checkout.
|
|
14
55
|
*/
|
|
@@ -29,14 +70,9 @@ declare namespace Components {
|
|
|
29
70
|
*
|
|
30
71
|
*/
|
|
31
72
|
readonly status?: "open" | "complete" | "expired";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
readonly customer?: string;
|
|
36
|
-
/**
|
|
37
|
-
* A valid email identifying the customer.
|
|
38
|
-
*/
|
|
39
|
-
customer_email?: string;
|
|
73
|
+
customer?: Customer;
|
|
74
|
+
billing_address?: Address;
|
|
75
|
+
delivery_address?: Address;
|
|
40
76
|
metadata?: MetaData;
|
|
41
77
|
line_items?: PriceItems;
|
|
42
78
|
/**
|
|
@@ -51,34 +87,50 @@ declare namespace Components {
|
|
|
51
87
|
readonly created_at?: string; // date-time
|
|
52
88
|
readonly updated_at?: string; // date-time
|
|
53
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* A valid cart payload from a client.
|
|
92
|
+
*/
|
|
93
|
+
export interface CartDto {
|
|
94
|
+
metadata?: MetaData;
|
|
95
|
+
customer?: Customer;
|
|
96
|
+
billing_address?: Address;
|
|
97
|
+
delivery_address?: Address;
|
|
98
|
+
line_items: PriceItemsDto;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The cart checkout request payload
|
|
102
|
+
*/
|
|
103
|
+
export interface CheckoutCart {
|
|
104
|
+
cart?: string | CartDto;
|
|
105
|
+
mode?: CheckoutMode;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The cart checkout result
|
|
109
|
+
*/
|
|
110
|
+
export interface CheckoutCartResult {
|
|
111
|
+
order?: Order;
|
|
112
|
+
}
|
|
54
113
|
/**
|
|
55
114
|
* The checkout mode for the cart checkout.
|
|
56
115
|
*/
|
|
57
116
|
export type CheckoutMode = "create_order" | "create_invoice" | "create_quote";
|
|
117
|
+
export interface Customer {
|
|
118
|
+
first_name?: string;
|
|
119
|
+
last_name?: string;
|
|
120
|
+
company_name?: string;
|
|
121
|
+
vat_id?: string;
|
|
122
|
+
/**
|
|
123
|
+
* A valid email identifying the customer.
|
|
124
|
+
*/
|
|
125
|
+
email?: string;
|
|
126
|
+
phone?: string;
|
|
127
|
+
}
|
|
58
128
|
export interface Error {
|
|
59
129
|
/**
|
|
60
130
|
* Error message
|
|
61
131
|
*/
|
|
62
132
|
message: string;
|
|
63
133
|
}
|
|
64
|
-
/**
|
|
65
|
-
* The file field
|
|
66
|
-
* example:
|
|
67
|
-
* {
|
|
68
|
-
* "$ref": "#/components/examples/price"
|
|
69
|
-
* }
|
|
70
|
-
*/
|
|
71
|
-
export interface FileField {
|
|
72
|
-
type?: "file" | "image";
|
|
73
|
-
attachments?: ({
|
|
74
|
-
key?: string;
|
|
75
|
-
mime?: string;
|
|
76
|
-
name?: string;
|
|
77
|
-
size?: number;
|
|
78
|
-
image_url?: string;
|
|
79
|
-
download_url?: string;
|
|
80
|
-
})[];
|
|
81
|
-
}
|
|
82
134
|
/**
|
|
83
135
|
* A set of key-value pairs.
|
|
84
136
|
*/
|
|
@@ -104,29 +156,29 @@ declare namespace Components {
|
|
|
104
156
|
* The Cart Id that originated or is associated with the order
|
|
105
157
|
*/
|
|
106
158
|
cart_id?: string;
|
|
107
|
-
/**
|
|
108
|
-
* A valid email identifying the customer.
|
|
109
|
-
* When the `customer` field is filled with an ID, this field is populated/overwritten with that customer's email.
|
|
110
|
-
*
|
|
111
|
-
*/
|
|
112
|
-
customer_email?: string;
|
|
113
|
-
/**
|
|
114
|
-
* ID of an existing Customer, if one exists. Or the customer data object.
|
|
115
|
-
*/
|
|
116
|
-
readonly customer?: string;
|
|
117
159
|
/**
|
|
118
160
|
* The order status
|
|
119
161
|
*/
|
|
120
|
-
|
|
162
|
+
status?: "Draft" | "Open" | "Paid" | "Shipped" | "Delivered" | "Complete";
|
|
163
|
+
metadata?: MetaData;
|
|
121
164
|
billing_first_name?: string;
|
|
122
165
|
billing_last_name?: string;
|
|
123
166
|
billing_company_name?: string;
|
|
124
167
|
billing_vat?: string;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
168
|
+
/**
|
|
169
|
+
* A list of emails.
|
|
170
|
+
*/
|
|
171
|
+
billing_email?: (BillingEmail)[];
|
|
172
|
+
/**
|
|
173
|
+
* A list of phone numbers.
|
|
174
|
+
*/
|
|
175
|
+
billing_phone?: (BillingPhone)[];
|
|
176
|
+
billing_address?: Address;
|
|
177
|
+
delivery_address?: Address;
|
|
178
|
+
/**
|
|
179
|
+
* The id of an existing contact.
|
|
180
|
+
*/
|
|
181
|
+
readonly contact?: string;
|
|
130
182
|
line_items?: PriceItems;
|
|
131
183
|
/**
|
|
132
184
|
* Total of all items before (discounts or) taxes are applied.
|
|
@@ -144,6 +196,23 @@ declare namespace Components {
|
|
|
144
196
|
readonly _id?: string;
|
|
145
197
|
readonly _created_at?: string;
|
|
146
198
|
readonly _updated_at?: string;
|
|
199
|
+
_tags?: string[];
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* A PaymentMethod represent your customer's payment instruments.
|
|
203
|
+
*
|
|
204
|
+
*/
|
|
205
|
+
export interface PaymentMethod {
|
|
206
|
+
/**
|
|
207
|
+
* The type of the PaymentMethod.
|
|
208
|
+
*/
|
|
209
|
+
type?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Contains relevant data associated with the payment method type.
|
|
212
|
+
*/
|
|
213
|
+
details?: {
|
|
214
|
+
[name: string]: any;
|
|
215
|
+
};
|
|
147
216
|
}
|
|
148
217
|
/**
|
|
149
218
|
* The price configuration
|
|
@@ -160,7 +229,18 @@ declare namespace Components {
|
|
|
160
229
|
tax_behavior?: "Inclusive (Price amount includes Tax)" | "Exclusive (Price amount excludes Tax)";
|
|
161
230
|
tiers_mode?: "Standard";
|
|
162
231
|
type?: "One Time" | "Recurring";
|
|
163
|
-
|
|
232
|
+
billing_period?: "Weekly" | "Monthly" | "Every Quarter" | "Every 6 months" | "Yearly";
|
|
233
|
+
unit_amount?: number;
|
|
234
|
+
unit_amount_decimal?: string;
|
|
235
|
+
unit_amount_currency?: string;
|
|
236
|
+
billing_duration_amount?: number;
|
|
237
|
+
billing_duration_unit?: "Weeks" | "Months" | "Years";
|
|
238
|
+
notice_time_amount?: number;
|
|
239
|
+
notice_time_unit?: "Weeks" | "Months" | "Years";
|
|
240
|
+
termination_time_amount?: number;
|
|
241
|
+
termination_time_unit?: "Weeks" | "Months" | "Years";
|
|
242
|
+
renewal_duration_amount?: number;
|
|
243
|
+
renewal_duration_unit?: "Weeks" | "Months" | "Years";
|
|
164
244
|
_created_at?: string;
|
|
165
245
|
_id?: string;
|
|
166
246
|
_title?: string;
|
|
@@ -175,6 +255,10 @@ declare namespace Components {
|
|
|
175
255
|
*/
|
|
176
256
|
readonly id?: string;
|
|
177
257
|
metadata?: MetaData;
|
|
258
|
+
/**
|
|
259
|
+
* The unit amount value
|
|
260
|
+
*/
|
|
261
|
+
readonly unit_amount?: number;
|
|
178
262
|
/**
|
|
179
263
|
* Total before any (discounts or) taxes are applied.
|
|
180
264
|
*/
|
|
@@ -184,11 +268,10 @@ declare namespace Components {
|
|
|
184
268
|
*/
|
|
185
269
|
readonly amount_total?: number;
|
|
186
270
|
/**
|
|
187
|
-
* Three-letter ISO currency code, in lowercase.
|
|
188
|
-
* Defaults to the customer currency when the customer or customer_email field is provided, or to EUR as a fallback.
|
|
271
|
+
* Three-letter ISO currency code, in lowercase. The currency is inferred from the price.
|
|
189
272
|
*
|
|
190
273
|
*/
|
|
191
|
-
currency?: string;
|
|
274
|
+
readonly currency?: string;
|
|
192
275
|
/**
|
|
193
276
|
* An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
|
|
194
277
|
*/
|
|
@@ -197,22 +280,60 @@ declare namespace Components {
|
|
|
197
280
|
* The quantity of products being purchased.
|
|
198
281
|
*/
|
|
199
282
|
quantity?: number;
|
|
200
|
-
|
|
201
|
-
|
|
283
|
+
/**
|
|
284
|
+
* The id of the product.
|
|
285
|
+
*/
|
|
286
|
+
product_id?: string;
|
|
287
|
+
/**
|
|
288
|
+
* The id of the price.
|
|
289
|
+
*/
|
|
290
|
+
price_id?: string;
|
|
291
|
+
_price?: Price;
|
|
202
292
|
/**
|
|
203
293
|
* The taxes applied to the price item.
|
|
204
294
|
*/
|
|
205
295
|
readonly taxes?: (TaxAmount)[];
|
|
206
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* Represents a valid price item from a client.
|
|
299
|
+
*/
|
|
300
|
+
export interface PriceItemDto {
|
|
301
|
+
metadata?: MetaData;
|
|
302
|
+
/**
|
|
303
|
+
* The quantity of products being purchased.
|
|
304
|
+
*/
|
|
305
|
+
quantity?: number;
|
|
306
|
+
/**
|
|
307
|
+
* The id of the product.
|
|
308
|
+
*/
|
|
309
|
+
product_id?: string;
|
|
310
|
+
/**
|
|
311
|
+
* The id of the price.
|
|
312
|
+
*/
|
|
313
|
+
price_id?: string;
|
|
314
|
+
/**
|
|
315
|
+
* The taxes applied to the price item.
|
|
316
|
+
*/
|
|
317
|
+
readonly taxes?: (TaxAmountDto)[];
|
|
318
|
+
_price?: Price;
|
|
319
|
+
}
|
|
207
320
|
/**
|
|
208
321
|
* Tracks a set of product prices, quantities, (discounts) and taxes.
|
|
209
322
|
*/
|
|
210
323
|
export type PriceItems = (PriceItem)[];
|
|
324
|
+
/**
|
|
325
|
+
* A valid set of product prices, quantities, (discounts) and taxes from a client.
|
|
326
|
+
*/
|
|
327
|
+
export type PriceItemsDto = (PriceItemDto)[];
|
|
211
328
|
/**
|
|
212
329
|
* The result from the calculation of a set of price items.
|
|
330
|
+
* example:
|
|
331
|
+
* {
|
|
332
|
+
* "$ref": "#/components/examples/pricingDetails"
|
|
333
|
+
* }
|
|
213
334
|
*/
|
|
214
|
-
export interface
|
|
215
|
-
items?: (
|
|
335
|
+
export interface PricingDetails {
|
|
336
|
+
items?: (PriceItem)[];
|
|
216
337
|
/**
|
|
217
338
|
* Total of all items before (discounts or) taxes are applied.
|
|
218
339
|
*/
|
|
@@ -223,31 +344,6 @@ declare namespace Components {
|
|
|
223
344
|
amount_total?: number;
|
|
224
345
|
total_details?: TotalDetails;
|
|
225
346
|
}
|
|
226
|
-
/**
|
|
227
|
-
* The product configuration
|
|
228
|
-
* example:
|
|
229
|
-
* {
|
|
230
|
-
* "$ref": "#/components/examples/product"
|
|
231
|
-
* }
|
|
232
|
-
*/
|
|
233
|
-
export interface Product {
|
|
234
|
-
code?: string;
|
|
235
|
-
type?: "Product" | "Service";
|
|
236
|
-
categories?: string[];
|
|
237
|
-
name?: string;
|
|
238
|
-
feature?: {
|
|
239
|
-
_tags?: string[];
|
|
240
|
-
feature?: string;
|
|
241
|
-
}[];
|
|
242
|
-
active?: boolean;
|
|
243
|
-
_id?: string;
|
|
244
|
-
_files?: FileField;
|
|
245
|
-
_images?: FileField;
|
|
246
|
-
_created_at?: string;
|
|
247
|
-
_updated_at?: string;
|
|
248
|
-
_title?: string;
|
|
249
|
-
_tags?: string[];
|
|
250
|
-
}
|
|
251
347
|
/**
|
|
252
348
|
* A tax amount associated with a specific tax rate.
|
|
253
349
|
*/
|
|
@@ -261,6 +357,15 @@ declare namespace Components {
|
|
|
261
357
|
*/
|
|
262
358
|
rate?: string;
|
|
263
359
|
}
|
|
360
|
+
/**
|
|
361
|
+
* A valid tax rate from a client.
|
|
362
|
+
*/
|
|
363
|
+
export interface TaxAmountDto {
|
|
364
|
+
/**
|
|
365
|
+
* The tax rate applied.
|
|
366
|
+
*/
|
|
367
|
+
rate?: string;
|
|
368
|
+
}
|
|
264
369
|
/**
|
|
265
370
|
* The total details with tax (and discount) aggregated totals.
|
|
266
371
|
*/
|
|
@@ -286,13 +391,6 @@ declare namespace Components {
|
|
|
286
391
|
}
|
|
287
392
|
}
|
|
288
393
|
declare namespace Paths {
|
|
289
|
-
namespace $CalculatePricing {
|
|
290
|
-
export type RequestBody = (Components.Schemas.PriceItems)[];
|
|
291
|
-
namespace Responses {
|
|
292
|
-
export type $200 = Components.Schemas.PriceItemsCalculateResult;
|
|
293
|
-
export type $400 = Components.Schemas.Error;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
394
|
namespace $CheckoutCart {
|
|
297
395
|
export interface HeaderParameters {
|
|
298
396
|
"X-Ivy-Org-ID": Parameters.XIvyOrgID;
|
|
@@ -300,17 +398,9 @@ declare namespace Paths {
|
|
|
300
398
|
namespace Parameters {
|
|
301
399
|
export type XIvyOrgID = string;
|
|
302
400
|
}
|
|
303
|
-
export type RequestBody =
|
|
304
|
-
cart?: string | Components.Schemas.Cart;
|
|
305
|
-
mode?: Components.Schemas.CheckoutMode;
|
|
306
|
-
};
|
|
401
|
+
export type RequestBody = Components.Schemas.CheckoutCart;
|
|
307
402
|
namespace Responses {
|
|
308
|
-
|
|
309
|
-
* The checkout result
|
|
310
|
-
*/
|
|
311
|
-
export interface $200 {
|
|
312
|
-
order?: Components.Schemas.Order;
|
|
313
|
-
}
|
|
403
|
+
export type $200 = Components.Schemas.CheckoutCartResult;
|
|
314
404
|
export type $400 = Components.Schemas.Error;
|
|
315
405
|
}
|
|
316
406
|
}
|
|
@@ -345,7 +435,7 @@ declare namespace Paths {
|
|
|
345
435
|
namespace Parameters {
|
|
346
436
|
export type XIvyOrgID = string;
|
|
347
437
|
}
|
|
348
|
-
export type RequestBody = Components.Schemas.
|
|
438
|
+
export type RequestBody = Components.Schemas.CartDto;
|
|
349
439
|
namespace Responses {
|
|
350
440
|
export type $200 = Components.Schemas.Cart;
|
|
351
441
|
export type $201 = Components.Schemas.Cart;
|
|
@@ -432,17 +522,6 @@ export interface OperationMethods {
|
|
|
432
522
|
data?: Paths.$UpsertOrder.RequestBody,
|
|
433
523
|
config?: AxiosRequestConfig
|
|
434
524
|
): OperationResponse<Paths.$UpsertOrder.Responses.$200 | Paths.$UpsertOrder.Responses.$201 | Paths.$UpsertOrder.Responses.$400>
|
|
435
|
-
/**
|
|
436
|
-
* $calculatePricing - calculatePricing
|
|
437
|
-
*
|
|
438
|
-
* Calculates the pricing amounts for a set of price items, including aggregated totals such as subtotal, total and aggregates per tax rate.
|
|
439
|
-
*
|
|
440
|
-
*/
|
|
441
|
-
'$calculatePricing'(
|
|
442
|
-
parameters?: Parameters<UnknownParamsObject> | null,
|
|
443
|
-
data?: Paths.$CalculatePricing.RequestBody,
|
|
444
|
-
config?: AxiosRequestConfig
|
|
445
|
-
): OperationResponse<Paths.$CalculatePricing.Responses.$200 | Paths.$CalculatePricing.Responses.$400>
|
|
446
525
|
}
|
|
447
526
|
|
|
448
527
|
export interface PathsDictionary {
|
|
@@ -523,19 +602,6 @@ export interface PathsDictionary {
|
|
|
523
602
|
config?: AxiosRequestConfig
|
|
524
603
|
): OperationResponse<Paths.$UpsertOrder.Responses.$200 | Paths.$UpsertOrder.Responses.$201 | Paths.$UpsertOrder.Responses.$400>
|
|
525
604
|
}
|
|
526
|
-
['/v1/public/pricing:calculate']: {
|
|
527
|
-
/**
|
|
528
|
-
* $calculatePricing - calculatePricing
|
|
529
|
-
*
|
|
530
|
-
* Calculates the pricing amounts for a set of price items, including aggregated totals such as subtotal, total and aggregates per tax rate.
|
|
531
|
-
*
|
|
532
|
-
*/
|
|
533
|
-
'post'(
|
|
534
|
-
parameters?: Parameters<UnknownParamsObject> | null,
|
|
535
|
-
data?: Paths.$CalculatePricing.RequestBody,
|
|
536
|
-
config?: AxiosRequestConfig
|
|
537
|
-
): OperationResponse<Paths.$CalculatePricing.Responses.$200 | Paths.$CalculatePricing.Responses.$400>
|
|
538
|
-
}
|
|
539
605
|
}
|
|
540
606
|
|
|
541
607
|
export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|
package/package.json
CHANGED
package/src/openapi.d.ts
CHANGED
|
@@ -9,6 +9,47 @@ import {
|
|
|
9
9
|
|
|
10
10
|
declare namespace Components {
|
|
11
11
|
namespace Schemas {
|
|
12
|
+
export interface Address {
|
|
13
|
+
[name: string]: any;
|
|
14
|
+
/**
|
|
15
|
+
* The first line of the address. Typically the street address or PO Box number.
|
|
16
|
+
*/
|
|
17
|
+
street1?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The second line of the address. Typically the number of the apartment, suite, or unit.
|
|
20
|
+
*/
|
|
21
|
+
street2?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The name of the city, district, village, or town.
|
|
24
|
+
*/
|
|
25
|
+
city?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The name of the country.
|
|
28
|
+
*/
|
|
29
|
+
country?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The two-letter code for the country of the address.
|
|
32
|
+
*/
|
|
33
|
+
country_code?: string;
|
|
34
|
+
/**
|
|
35
|
+
* An additional description for the address
|
|
36
|
+
*/
|
|
37
|
+
additional_info?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* An order billing email
|
|
41
|
+
*/
|
|
42
|
+
export interface BillingEmail {
|
|
43
|
+
_tags?: string[];
|
|
44
|
+
billing_email?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* An order billing phone
|
|
48
|
+
*/
|
|
49
|
+
export interface BillingPhone {
|
|
50
|
+
_tags?: string[];
|
|
51
|
+
billing_phone?: string;
|
|
52
|
+
}
|
|
12
53
|
/**
|
|
13
54
|
* Supports shopping for products and services until ready for checkout.
|
|
14
55
|
*/
|
|
@@ -29,14 +70,9 @@ declare namespace Components {
|
|
|
29
70
|
*
|
|
30
71
|
*/
|
|
31
72
|
readonly status?: "open" | "complete" | "expired";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
readonly customer?: string;
|
|
36
|
-
/**
|
|
37
|
-
* A valid email identifying the customer.
|
|
38
|
-
*/
|
|
39
|
-
customer_email?: string;
|
|
73
|
+
customer?: Customer;
|
|
74
|
+
billing_address?: Address;
|
|
75
|
+
delivery_address?: Address;
|
|
40
76
|
metadata?: MetaData;
|
|
41
77
|
line_items?: PriceItems;
|
|
42
78
|
/**
|
|
@@ -51,34 +87,50 @@ declare namespace Components {
|
|
|
51
87
|
readonly created_at?: string; // date-time
|
|
52
88
|
readonly updated_at?: string; // date-time
|
|
53
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* A valid cart payload from a client.
|
|
92
|
+
*/
|
|
93
|
+
export interface CartDto {
|
|
94
|
+
metadata?: MetaData;
|
|
95
|
+
customer?: Customer;
|
|
96
|
+
billing_address?: Address;
|
|
97
|
+
delivery_address?: Address;
|
|
98
|
+
line_items: PriceItemsDto;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The cart checkout request payload
|
|
102
|
+
*/
|
|
103
|
+
export interface CheckoutCart {
|
|
104
|
+
cart?: string | CartDto;
|
|
105
|
+
mode?: CheckoutMode;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The cart checkout result
|
|
109
|
+
*/
|
|
110
|
+
export interface CheckoutCartResult {
|
|
111
|
+
order?: Order;
|
|
112
|
+
}
|
|
54
113
|
/**
|
|
55
114
|
* The checkout mode for the cart checkout.
|
|
56
115
|
*/
|
|
57
116
|
export type CheckoutMode = "create_order" | "create_invoice" | "create_quote";
|
|
117
|
+
export interface Customer {
|
|
118
|
+
first_name?: string;
|
|
119
|
+
last_name?: string;
|
|
120
|
+
company_name?: string;
|
|
121
|
+
vat_id?: string;
|
|
122
|
+
/**
|
|
123
|
+
* A valid email identifying the customer.
|
|
124
|
+
*/
|
|
125
|
+
email?: string;
|
|
126
|
+
phone?: string;
|
|
127
|
+
}
|
|
58
128
|
export interface Error {
|
|
59
129
|
/**
|
|
60
130
|
* Error message
|
|
61
131
|
*/
|
|
62
132
|
message: string;
|
|
63
133
|
}
|
|
64
|
-
/**
|
|
65
|
-
* The file field
|
|
66
|
-
* example:
|
|
67
|
-
* {
|
|
68
|
-
* "$ref": "#/components/examples/price"
|
|
69
|
-
* }
|
|
70
|
-
*/
|
|
71
|
-
export interface FileField {
|
|
72
|
-
type?: "file" | "image";
|
|
73
|
-
attachments?: ({
|
|
74
|
-
key?: string;
|
|
75
|
-
mime?: string;
|
|
76
|
-
name?: string;
|
|
77
|
-
size?: number;
|
|
78
|
-
image_url?: string;
|
|
79
|
-
download_url?: string;
|
|
80
|
-
})[];
|
|
81
|
-
}
|
|
82
134
|
/**
|
|
83
135
|
* A set of key-value pairs.
|
|
84
136
|
*/
|
|
@@ -104,29 +156,29 @@ declare namespace Components {
|
|
|
104
156
|
* The Cart Id that originated or is associated with the order
|
|
105
157
|
*/
|
|
106
158
|
cart_id?: string;
|
|
107
|
-
/**
|
|
108
|
-
* A valid email identifying the customer.
|
|
109
|
-
* When the `customer` field is filled with an ID, this field is populated/overwritten with that customer's email.
|
|
110
|
-
*
|
|
111
|
-
*/
|
|
112
|
-
customer_email?: string;
|
|
113
|
-
/**
|
|
114
|
-
* ID of an existing Customer, if one exists. Or the customer data object.
|
|
115
|
-
*/
|
|
116
|
-
readonly customer?: string;
|
|
117
159
|
/**
|
|
118
160
|
* The order status
|
|
119
161
|
*/
|
|
120
|
-
|
|
162
|
+
status?: "Draft" | "Open" | "Paid" | "Shipped" | "Delivered" | "Complete";
|
|
163
|
+
metadata?: MetaData;
|
|
121
164
|
billing_first_name?: string;
|
|
122
165
|
billing_last_name?: string;
|
|
123
166
|
billing_company_name?: string;
|
|
124
167
|
billing_vat?: string;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
168
|
+
/**
|
|
169
|
+
* A list of emails.
|
|
170
|
+
*/
|
|
171
|
+
billing_email?: (BillingEmail)[];
|
|
172
|
+
/**
|
|
173
|
+
* A list of phone numbers.
|
|
174
|
+
*/
|
|
175
|
+
billing_phone?: (BillingPhone)[];
|
|
176
|
+
billing_address?: Address;
|
|
177
|
+
delivery_address?: Address;
|
|
178
|
+
/**
|
|
179
|
+
* The id of an existing contact.
|
|
180
|
+
*/
|
|
181
|
+
readonly contact?: string;
|
|
130
182
|
line_items?: PriceItems;
|
|
131
183
|
/**
|
|
132
184
|
* Total of all items before (discounts or) taxes are applied.
|
|
@@ -144,6 +196,23 @@ declare namespace Components {
|
|
|
144
196
|
readonly _id?: string;
|
|
145
197
|
readonly _created_at?: string;
|
|
146
198
|
readonly _updated_at?: string;
|
|
199
|
+
_tags?: string[];
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* A PaymentMethod represent your customer's payment instruments.
|
|
203
|
+
*
|
|
204
|
+
*/
|
|
205
|
+
export interface PaymentMethod {
|
|
206
|
+
/**
|
|
207
|
+
* The type of the PaymentMethod.
|
|
208
|
+
*/
|
|
209
|
+
type?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Contains relevant data associated with the payment method type.
|
|
212
|
+
*/
|
|
213
|
+
details?: {
|
|
214
|
+
[name: string]: any;
|
|
215
|
+
};
|
|
147
216
|
}
|
|
148
217
|
/**
|
|
149
218
|
* The price configuration
|
|
@@ -160,7 +229,18 @@ declare namespace Components {
|
|
|
160
229
|
tax_behavior?: "Inclusive (Price amount includes Tax)" | "Exclusive (Price amount excludes Tax)";
|
|
161
230
|
tiers_mode?: "Standard";
|
|
162
231
|
type?: "One Time" | "Recurring";
|
|
163
|
-
|
|
232
|
+
billing_period?: "Weekly" | "Monthly" | "Every Quarter" | "Every 6 months" | "Yearly";
|
|
233
|
+
unit_amount?: number;
|
|
234
|
+
unit_amount_decimal?: string;
|
|
235
|
+
unit_amount_currency?: string;
|
|
236
|
+
billing_duration_amount?: number;
|
|
237
|
+
billing_duration_unit?: "Weeks" | "Months" | "Years";
|
|
238
|
+
notice_time_amount?: number;
|
|
239
|
+
notice_time_unit?: "Weeks" | "Months" | "Years";
|
|
240
|
+
termination_time_amount?: number;
|
|
241
|
+
termination_time_unit?: "Weeks" | "Months" | "Years";
|
|
242
|
+
renewal_duration_amount?: number;
|
|
243
|
+
renewal_duration_unit?: "Weeks" | "Months" | "Years";
|
|
164
244
|
_created_at?: string;
|
|
165
245
|
_id?: string;
|
|
166
246
|
_title?: string;
|
|
@@ -175,6 +255,10 @@ declare namespace Components {
|
|
|
175
255
|
*/
|
|
176
256
|
readonly id?: string;
|
|
177
257
|
metadata?: MetaData;
|
|
258
|
+
/**
|
|
259
|
+
* The unit amount value
|
|
260
|
+
*/
|
|
261
|
+
readonly unit_amount?: number;
|
|
178
262
|
/**
|
|
179
263
|
* Total before any (discounts or) taxes are applied.
|
|
180
264
|
*/
|
|
@@ -184,11 +268,10 @@ declare namespace Components {
|
|
|
184
268
|
*/
|
|
185
269
|
readonly amount_total?: number;
|
|
186
270
|
/**
|
|
187
|
-
* Three-letter ISO currency code, in lowercase.
|
|
188
|
-
* Defaults to the customer currency when the customer or customer_email field is provided, or to EUR as a fallback.
|
|
271
|
+
* Three-letter ISO currency code, in lowercase. The currency is inferred from the price.
|
|
189
272
|
*
|
|
190
273
|
*/
|
|
191
|
-
currency?: string;
|
|
274
|
+
readonly currency?: string;
|
|
192
275
|
/**
|
|
193
276
|
* An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
|
|
194
277
|
*/
|
|
@@ -197,22 +280,60 @@ declare namespace Components {
|
|
|
197
280
|
* The quantity of products being purchased.
|
|
198
281
|
*/
|
|
199
282
|
quantity?: number;
|
|
200
|
-
|
|
201
|
-
|
|
283
|
+
/**
|
|
284
|
+
* The id of the product.
|
|
285
|
+
*/
|
|
286
|
+
product_id?: string;
|
|
287
|
+
/**
|
|
288
|
+
* The id of the price.
|
|
289
|
+
*/
|
|
290
|
+
price_id?: string;
|
|
291
|
+
_price?: Price;
|
|
202
292
|
/**
|
|
203
293
|
* The taxes applied to the price item.
|
|
204
294
|
*/
|
|
205
295
|
readonly taxes?: (TaxAmount)[];
|
|
206
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* Represents a valid price item from a client.
|
|
299
|
+
*/
|
|
300
|
+
export interface PriceItemDto {
|
|
301
|
+
metadata?: MetaData;
|
|
302
|
+
/**
|
|
303
|
+
* The quantity of products being purchased.
|
|
304
|
+
*/
|
|
305
|
+
quantity?: number;
|
|
306
|
+
/**
|
|
307
|
+
* The id of the product.
|
|
308
|
+
*/
|
|
309
|
+
product_id?: string;
|
|
310
|
+
/**
|
|
311
|
+
* The id of the price.
|
|
312
|
+
*/
|
|
313
|
+
price_id?: string;
|
|
314
|
+
/**
|
|
315
|
+
* The taxes applied to the price item.
|
|
316
|
+
*/
|
|
317
|
+
readonly taxes?: (TaxAmountDto)[];
|
|
318
|
+
_price?: Price;
|
|
319
|
+
}
|
|
207
320
|
/**
|
|
208
321
|
* Tracks a set of product prices, quantities, (discounts) and taxes.
|
|
209
322
|
*/
|
|
210
323
|
export type PriceItems = (PriceItem)[];
|
|
324
|
+
/**
|
|
325
|
+
* A valid set of product prices, quantities, (discounts) and taxes from a client.
|
|
326
|
+
*/
|
|
327
|
+
export type PriceItemsDto = (PriceItemDto)[];
|
|
211
328
|
/**
|
|
212
329
|
* The result from the calculation of a set of price items.
|
|
330
|
+
* example:
|
|
331
|
+
* {
|
|
332
|
+
* "$ref": "#/components/examples/pricingDetails"
|
|
333
|
+
* }
|
|
213
334
|
*/
|
|
214
|
-
export interface
|
|
215
|
-
items?: (
|
|
335
|
+
export interface PricingDetails {
|
|
336
|
+
items?: (PriceItem)[];
|
|
216
337
|
/**
|
|
217
338
|
* Total of all items before (discounts or) taxes are applied.
|
|
218
339
|
*/
|
|
@@ -223,31 +344,6 @@ declare namespace Components {
|
|
|
223
344
|
amount_total?: number;
|
|
224
345
|
total_details?: TotalDetails;
|
|
225
346
|
}
|
|
226
|
-
/**
|
|
227
|
-
* The product configuration
|
|
228
|
-
* example:
|
|
229
|
-
* {
|
|
230
|
-
* "$ref": "#/components/examples/product"
|
|
231
|
-
* }
|
|
232
|
-
*/
|
|
233
|
-
export interface Product {
|
|
234
|
-
code?: string;
|
|
235
|
-
type?: "Product" | "Service";
|
|
236
|
-
categories?: string[];
|
|
237
|
-
name?: string;
|
|
238
|
-
feature?: {
|
|
239
|
-
_tags?: string[];
|
|
240
|
-
feature?: string;
|
|
241
|
-
}[];
|
|
242
|
-
active?: boolean;
|
|
243
|
-
_id?: string;
|
|
244
|
-
_files?: FileField;
|
|
245
|
-
_images?: FileField;
|
|
246
|
-
_created_at?: string;
|
|
247
|
-
_updated_at?: string;
|
|
248
|
-
_title?: string;
|
|
249
|
-
_tags?: string[];
|
|
250
|
-
}
|
|
251
347
|
/**
|
|
252
348
|
* A tax amount associated with a specific tax rate.
|
|
253
349
|
*/
|
|
@@ -261,6 +357,15 @@ declare namespace Components {
|
|
|
261
357
|
*/
|
|
262
358
|
rate?: string;
|
|
263
359
|
}
|
|
360
|
+
/**
|
|
361
|
+
* A valid tax rate from a client.
|
|
362
|
+
*/
|
|
363
|
+
export interface TaxAmountDto {
|
|
364
|
+
/**
|
|
365
|
+
* The tax rate applied.
|
|
366
|
+
*/
|
|
367
|
+
rate?: string;
|
|
368
|
+
}
|
|
264
369
|
/**
|
|
265
370
|
* The total details with tax (and discount) aggregated totals.
|
|
266
371
|
*/
|
|
@@ -286,13 +391,6 @@ declare namespace Components {
|
|
|
286
391
|
}
|
|
287
392
|
}
|
|
288
393
|
declare namespace Paths {
|
|
289
|
-
namespace $CalculatePricing {
|
|
290
|
-
export type RequestBody = (Components.Schemas.PriceItems)[];
|
|
291
|
-
namespace Responses {
|
|
292
|
-
export type $200 = Components.Schemas.PriceItemsCalculateResult;
|
|
293
|
-
export type $400 = Components.Schemas.Error;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
394
|
namespace $CheckoutCart {
|
|
297
395
|
export interface HeaderParameters {
|
|
298
396
|
"X-Ivy-Org-ID": Parameters.XIvyOrgID;
|
|
@@ -300,17 +398,9 @@ declare namespace Paths {
|
|
|
300
398
|
namespace Parameters {
|
|
301
399
|
export type XIvyOrgID = string;
|
|
302
400
|
}
|
|
303
|
-
export type RequestBody =
|
|
304
|
-
cart?: string | Components.Schemas.Cart;
|
|
305
|
-
mode?: Components.Schemas.CheckoutMode;
|
|
306
|
-
};
|
|
401
|
+
export type RequestBody = Components.Schemas.CheckoutCart;
|
|
307
402
|
namespace Responses {
|
|
308
|
-
|
|
309
|
-
* The checkout result
|
|
310
|
-
*/
|
|
311
|
-
export interface $200 {
|
|
312
|
-
order?: Components.Schemas.Order;
|
|
313
|
-
}
|
|
403
|
+
export type $200 = Components.Schemas.CheckoutCartResult;
|
|
314
404
|
export type $400 = Components.Schemas.Error;
|
|
315
405
|
}
|
|
316
406
|
}
|
|
@@ -345,7 +435,7 @@ declare namespace Paths {
|
|
|
345
435
|
namespace Parameters {
|
|
346
436
|
export type XIvyOrgID = string;
|
|
347
437
|
}
|
|
348
|
-
export type RequestBody = Components.Schemas.
|
|
438
|
+
export type RequestBody = Components.Schemas.CartDto;
|
|
349
439
|
namespace Responses {
|
|
350
440
|
export type $200 = Components.Schemas.Cart;
|
|
351
441
|
export type $201 = Components.Schemas.Cart;
|
|
@@ -432,17 +522,6 @@ export interface OperationMethods {
|
|
|
432
522
|
data?: Paths.$UpsertOrder.RequestBody,
|
|
433
523
|
config?: AxiosRequestConfig
|
|
434
524
|
): OperationResponse<Paths.$UpsertOrder.Responses.$200 | Paths.$UpsertOrder.Responses.$201 | Paths.$UpsertOrder.Responses.$400>
|
|
435
|
-
/**
|
|
436
|
-
* $calculatePricing - calculatePricing
|
|
437
|
-
*
|
|
438
|
-
* Calculates the pricing amounts for a set of price items, including aggregated totals such as subtotal, total and aggregates per tax rate.
|
|
439
|
-
*
|
|
440
|
-
*/
|
|
441
|
-
'$calculatePricing'(
|
|
442
|
-
parameters?: Parameters<UnknownParamsObject> | null,
|
|
443
|
-
data?: Paths.$CalculatePricing.RequestBody,
|
|
444
|
-
config?: AxiosRequestConfig
|
|
445
|
-
): OperationResponse<Paths.$CalculatePricing.Responses.$200 | Paths.$CalculatePricing.Responses.$400>
|
|
446
525
|
}
|
|
447
526
|
|
|
448
527
|
export interface PathsDictionary {
|
|
@@ -523,19 +602,6 @@ export interface PathsDictionary {
|
|
|
523
602
|
config?: AxiosRequestConfig
|
|
524
603
|
): OperationResponse<Paths.$UpsertOrder.Responses.$200 | Paths.$UpsertOrder.Responses.$201 | Paths.$UpsertOrder.Responses.$400>
|
|
525
604
|
}
|
|
526
|
-
['/v1/public/pricing:calculate']: {
|
|
527
|
-
/**
|
|
528
|
-
* $calculatePricing - calculatePricing
|
|
529
|
-
*
|
|
530
|
-
* Calculates the pricing amounts for a set of price items, including aggregated totals such as subtotal, total and aggregates per tax rate.
|
|
531
|
-
*
|
|
532
|
-
*/
|
|
533
|
-
'post'(
|
|
534
|
-
parameters?: Parameters<UnknownParamsObject> | null,
|
|
535
|
-
data?: Paths.$CalculatePricing.RequestBody,
|
|
536
|
-
config?: AxiosRequestConfig
|
|
537
|
-
): OperationResponse<Paths.$CalculatePricing.Responses.$200 | Paths.$CalculatePricing.Responses.$400>
|
|
538
|
-
}
|
|
539
605
|
}
|
|
540
606
|
|
|
541
607
|
export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|