@gradientedge/commercetools-utils 5.18.1 → 5.19.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/cjs/api/CommercetoolsApi.d.ts +11 -11
- package/dist/cjs/api/CommercetoolsApi.d.ts.map +1 -1
- package/dist/cjs/api/CommercetoolsApi.js +7 -7
- package/dist/cjs/api/CommercetoolsApi.js.map +1 -1
- package/dist/cjs/index.d.ts +0 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types.d.ts +1 -0
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/cjs/utils/get-attribute-value.d.ts +1 -1
- package/dist/cjs/utils/get-attribute-value.d.ts.map +1 -1
- package/dist/cjs/utils/get-attribute-value.js.map +1 -1
- package/dist/mjs/api/CommercetoolsApi.d.ts +11 -11
- package/dist/mjs/api/CommercetoolsApi.d.ts.map +1 -1
- package/dist/mjs/api/CommercetoolsApi.js +8 -8
- package/dist/mjs/api/CommercetoolsApi.js.map +1 -1
- package/dist/mjs/index.d.ts +0 -1
- package/dist/mjs/index.d.ts.map +1 -1
- package/dist/mjs/index.js +0 -1
- package/dist/mjs/index.js.map +1 -1
- package/dist/mjs/types.d.ts +1 -0
- package/dist/mjs/types.d.ts.map +1 -1
- package/dist/mjs/utils/get-attribute-value.d.ts +1 -1
- package/dist/mjs/utils/get-attribute-value.d.ts.map +1 -1
- package/dist/mjs/utils/get-attribute-value.js.map +1 -1
- package/package.json +3 -2
- package/dist/cjs/models/associate-role.d.ts +0 -319
- package/dist/cjs/models/associate-role.d.ts.map +0 -1
- package/dist/cjs/models/associate-role.js +0 -8
- package/dist/cjs/models/associate-role.js.map +0 -1
- package/dist/cjs/models/attribute-group.d.ts +0 -253
- package/dist/cjs/models/attribute-group.d.ts.map +0 -1
- package/dist/cjs/models/attribute-group.js +0 -8
- package/dist/cjs/models/attribute-group.js.map +0 -1
- package/dist/cjs/models/business-unit.d.ts +0 -1197
- package/dist/cjs/models/business-unit.d.ts.map +0 -1
- package/dist/cjs/models/business-unit.js +0 -8
- package/dist/cjs/models/business-unit.js.map +0 -1
- package/dist/cjs/models/cart-discount.d.ts +0 -716
- package/dist/cjs/models/cart-discount.d.ts.map +0 -1
- package/dist/cjs/models/cart-discount.js +0 -8
- package/dist/cjs/models/cart-discount.js.map +0 -1
- package/dist/cjs/models/cart.d.ts +0 -3366
- package/dist/cjs/models/cart.d.ts.map +0 -1
- package/dist/cjs/models/cart.js +0 -8
- package/dist/cjs/models/cart.js.map +0 -1
- package/dist/cjs/models/category.d.ts +0 -634
- package/dist/cjs/models/category.d.ts.map +0 -1
- package/dist/cjs/models/category.js +0 -8
- package/dist/cjs/models/category.js.map +0 -1
- package/dist/cjs/models/channel.d.ts +0 -379
- package/dist/cjs/models/channel.d.ts.map +0 -1
- package/dist/cjs/models/channel.js +0 -8
- package/dist/cjs/models/channel.js.map +0 -1
- package/dist/cjs/models/common.d.ts +0 -1096
- package/dist/cjs/models/common.d.ts.map +0 -1
- package/dist/cjs/models/common.js +0 -8
- package/dist/cjs/models/common.js.map +0 -1
- package/dist/cjs/models/custom-object.d.ts +0 -151
- package/dist/cjs/models/custom-object.d.ts.map +0 -1
- package/dist/cjs/models/custom-object.js +0 -8
- package/dist/cjs/models/custom-object.js.map +0 -1
- package/dist/cjs/models/customer-group.d.ts +0 -235
- package/dist/cjs/models/customer-group.d.ts.map +0 -1
- package/dist/cjs/models/customer-group.js +0 -8
- package/dist/cjs/models/customer-group.js.map +0 -1
- package/dist/cjs/models/customer.d.ts +0 -1221
- package/dist/cjs/models/customer.d.ts.map +0 -1
- package/dist/cjs/models/customer.js +0 -8
- package/dist/cjs/models/customer.js.map +0 -1
- package/dist/cjs/models/discount-code.d.ts +0 -439
- package/dist/cjs/models/discount-code.d.ts.map +0 -1
- package/dist/cjs/models/discount-code.js +0 -8
- package/dist/cjs/models/discount-code.js.map +0 -1
- package/dist/cjs/models/error.d.ts +0 -3062
- package/dist/cjs/models/error.d.ts.map +0 -1
- package/dist/cjs/models/error.js +0 -8
- package/dist/cjs/models/error.js.map +0 -1
- package/dist/cjs/models/extension.d.ts +0 -335
- package/dist/cjs/models/extension.d.ts.map +0 -1
- package/dist/cjs/models/extension.js +0 -8
- package/dist/cjs/models/extension.js.map +0 -1
- package/dist/cjs/models/graph-ql.d.ts +0 -63
- package/dist/cjs/models/graph-ql.d.ts.map +0 -1
- package/dist/cjs/models/graph-ql.js +0 -8
- package/dist/cjs/models/graph-ql.js.map +0 -1
- package/dist/cjs/models/index.d.ts +0 -42
- package/dist/cjs/models/index.d.ts.map +0 -1
- package/dist/cjs/models/index.js +0 -58
- package/dist/cjs/models/index.js.map +0 -1
- package/dist/cjs/models/inventory.d.ts +0 -327
- package/dist/cjs/models/inventory.d.ts.map +0 -1
- package/dist/cjs/models/inventory.js +0 -8
- package/dist/cjs/models/inventory.js.map +0 -1
- package/dist/cjs/models/me.d.ts +0 -2483
- package/dist/cjs/models/me.d.ts.map +0 -1
- package/dist/cjs/models/me.js +0 -8
- package/dist/cjs/models/me.js.map +0 -1
- package/dist/cjs/models/message.d.ts +0 -15095
- package/dist/cjs/models/message.d.ts.map +0 -1
- package/dist/cjs/models/message.js +0 -8
- package/dist/cjs/models/message.js.map +0 -1
- package/dist/cjs/models/order-edit.d.ts +0 -1645
- package/dist/cjs/models/order-edit.d.ts.map +0 -1
- package/dist/cjs/models/order-edit.js +0 -8
- package/dist/cjs/models/order-edit.js.map +0 -1
- package/dist/cjs/models/order.d.ts +0 -2157
- package/dist/cjs/models/order.d.ts.map +0 -1
- package/dist/cjs/models/order.js +0 -8
- package/dist/cjs/models/order.js.map +0 -1
- package/dist/cjs/models/payment.d.ts +0 -734
- package/dist/cjs/models/payment.d.ts.map +0 -1
- package/dist/cjs/models/payment.js +0 -8
- package/dist/cjs/models/payment.js.map +0 -1
- package/dist/cjs/models/product-discount.d.ts +0 -461
- package/dist/cjs/models/product-discount.d.ts.map +0 -1
- package/dist/cjs/models/product-discount.js +0 -8
- package/dist/cjs/models/product-discount.js.map +0 -1
- package/dist/cjs/models/product-selection.d.ts +0 -638
- package/dist/cjs/models/product-selection.d.ts.map +0 -1
- package/dist/cjs/models/product-selection.js +0 -8
- package/dist/cjs/models/product-selection.js.map +0 -1
- package/dist/cjs/models/product-type.d.ts +0 -774
- package/dist/cjs/models/product-type.d.ts.map +0 -1
- package/dist/cjs/models/product-type.js +0 -8
- package/dist/cjs/models/product-type.js.map +0 -1
- package/dist/cjs/models/product.d.ts +0 -2282
- package/dist/cjs/models/product.d.ts.map +0 -1
- package/dist/cjs/models/product.js +0 -8
- package/dist/cjs/models/product.js.map +0 -1
- package/dist/cjs/models/project.d.ts +0 -381
- package/dist/cjs/models/project.d.ts.map +0 -1
- package/dist/cjs/models/project.js +0 -8
- package/dist/cjs/models/project.js.map +0 -1
- package/dist/cjs/models/quote-request.d.ts +0 -430
- package/dist/cjs/models/quote-request.d.ts.map +0 -1
- package/dist/cjs/models/quote-request.js +0 -8
- package/dist/cjs/models/quote-request.js.map +0 -1
- package/dist/cjs/models/quote.d.ts +0 -458
- package/dist/cjs/models/quote.d.ts.map +0 -1
- package/dist/cjs/models/quote.js +0 -8
- package/dist/cjs/models/quote.js.map +0 -1
- package/dist/cjs/models/review.d.ts +0 -435
- package/dist/cjs/models/review.d.ts.map +0 -1
- package/dist/cjs/models/review.js +0 -8
- package/dist/cjs/models/review.js.map +0 -1
- package/dist/cjs/models/scalar-types.d.ts +0 -9
- package/dist/cjs/models/scalar-types.d.ts.map +0 -1
- package/dist/cjs/models/scalar-types.js +0 -8
- package/dist/cjs/models/scalar-types.js.map +0 -1
- package/dist/cjs/models/shipping-method.d.ts +0 -569
- package/dist/cjs/models/shipping-method.d.ts.map +0 -1
- package/dist/cjs/models/shipping-method.js +0 -8
- package/dist/cjs/models/shipping-method.js.map +0 -1
- package/dist/cjs/models/shopping-list.d.ts +0 -844
- package/dist/cjs/models/shopping-list.d.ts.map +0 -1
- package/dist/cjs/models/shopping-list.js +0 -8
- package/dist/cjs/models/shopping-list.js.map +0 -1
- package/dist/cjs/models/staged-quote.d.ts +0 -338
- package/dist/cjs/models/staged-quote.d.ts.map +0 -1
- package/dist/cjs/models/staged-quote.js +0 -8
- package/dist/cjs/models/staged-quote.js.map +0 -1
- package/dist/cjs/models/standalone-price.d.ts +0 -410
- package/dist/cjs/models/standalone-price.d.ts.map +0 -1
- package/dist/cjs/models/standalone-price.js +0 -8
- package/dist/cjs/models/standalone-price.js.map +0 -1
- package/dist/cjs/models/state.d.ts +0 -341
- package/dist/cjs/models/state.d.ts.map +0 -1
- package/dist/cjs/models/state.js +0 -8
- package/dist/cjs/models/state.js.map +0 -1
- package/dist/cjs/models/store-country.d.ts +0 -14
- package/dist/cjs/models/store-country.d.ts.map +0 -1
- package/dist/cjs/models/store-country.js +0 -8
- package/dist/cjs/models/store-country.js.map +0 -1
- package/dist/cjs/models/store.d.ts +0 -547
- package/dist/cjs/models/store.d.ts.map +0 -1
- package/dist/cjs/models/store.js +0 -8
- package/dist/cjs/models/store.js.map +0 -1
- package/dist/cjs/models/subscription.d.ts +0 -717
- package/dist/cjs/models/subscription.d.ts.map +0 -1
- package/dist/cjs/models/subscription.js +0 -8
- package/dist/cjs/models/subscription.js.map +0 -1
- package/dist/cjs/models/tax-category.d.ts +0 -376
- package/dist/cjs/models/tax-category.d.ts.map +0 -1
- package/dist/cjs/models/tax-category.js +0 -8
- package/dist/cjs/models/tax-category.js.map +0 -1
- package/dist/cjs/models/type.d.ts +0 -645
- package/dist/cjs/models/type.d.ts.map +0 -1
- package/dist/cjs/models/type.js +0 -8
- package/dist/cjs/models/type.js.map +0 -1
- package/dist/cjs/models/zone.d.ts +0 -234
- package/dist/cjs/models/zone.d.ts.map +0 -1
- package/dist/cjs/models/zone.js +0 -8
- package/dist/cjs/models/zone.js.map +0 -1
- package/dist/mjs/models/associate-role.d.ts +0 -319
- package/dist/mjs/models/associate-role.d.ts.map +0 -1
- package/dist/mjs/models/associate-role.js +0 -7
- package/dist/mjs/models/associate-role.js.map +0 -1
- package/dist/mjs/models/attribute-group.d.ts +0 -253
- package/dist/mjs/models/attribute-group.d.ts.map +0 -1
- package/dist/mjs/models/attribute-group.js +0 -7
- package/dist/mjs/models/attribute-group.js.map +0 -1
- package/dist/mjs/models/business-unit.d.ts +0 -1197
- package/dist/mjs/models/business-unit.d.ts.map +0 -1
- package/dist/mjs/models/business-unit.js +0 -7
- package/dist/mjs/models/business-unit.js.map +0 -1
- package/dist/mjs/models/cart-discount.d.ts +0 -716
- package/dist/mjs/models/cart-discount.d.ts.map +0 -1
- package/dist/mjs/models/cart-discount.js +0 -7
- package/dist/mjs/models/cart-discount.js.map +0 -1
- package/dist/mjs/models/cart.d.ts +0 -3366
- package/dist/mjs/models/cart.d.ts.map +0 -1
- package/dist/mjs/models/cart.js +0 -7
- package/dist/mjs/models/cart.js.map +0 -1
- package/dist/mjs/models/category.d.ts +0 -634
- package/dist/mjs/models/category.d.ts.map +0 -1
- package/dist/mjs/models/category.js +0 -7
- package/dist/mjs/models/category.js.map +0 -1
- package/dist/mjs/models/channel.d.ts +0 -379
- package/dist/mjs/models/channel.d.ts.map +0 -1
- package/dist/mjs/models/channel.js +0 -7
- package/dist/mjs/models/channel.js.map +0 -1
- package/dist/mjs/models/common.d.ts +0 -1096
- package/dist/mjs/models/common.d.ts.map +0 -1
- package/dist/mjs/models/common.js +0 -7
- package/dist/mjs/models/common.js.map +0 -1
- package/dist/mjs/models/custom-object.d.ts +0 -151
- package/dist/mjs/models/custom-object.d.ts.map +0 -1
- package/dist/mjs/models/custom-object.js +0 -7
- package/dist/mjs/models/custom-object.js.map +0 -1
- package/dist/mjs/models/customer-group.d.ts +0 -235
- package/dist/mjs/models/customer-group.d.ts.map +0 -1
- package/dist/mjs/models/customer-group.js +0 -7
- package/dist/mjs/models/customer-group.js.map +0 -1
- package/dist/mjs/models/customer.d.ts +0 -1221
- package/dist/mjs/models/customer.d.ts.map +0 -1
- package/dist/mjs/models/customer.js +0 -7
- package/dist/mjs/models/customer.js.map +0 -1
- package/dist/mjs/models/discount-code.d.ts +0 -439
- package/dist/mjs/models/discount-code.d.ts.map +0 -1
- package/dist/mjs/models/discount-code.js +0 -7
- package/dist/mjs/models/discount-code.js.map +0 -1
- package/dist/mjs/models/error.d.ts +0 -3062
- package/dist/mjs/models/error.d.ts.map +0 -1
- package/dist/mjs/models/error.js +0 -7
- package/dist/mjs/models/error.js.map +0 -1
- package/dist/mjs/models/extension.d.ts +0 -335
- package/dist/mjs/models/extension.d.ts.map +0 -1
- package/dist/mjs/models/extension.js +0 -7
- package/dist/mjs/models/extension.js.map +0 -1
- package/dist/mjs/models/graph-ql.d.ts +0 -63
- package/dist/mjs/models/graph-ql.d.ts.map +0 -1
- package/dist/mjs/models/graph-ql.js +0 -7
- package/dist/mjs/models/graph-ql.js.map +0 -1
- package/dist/mjs/models/index.d.ts +0 -42
- package/dist/mjs/models/index.d.ts.map +0 -1
- package/dist/mjs/models/index.js +0 -42
- package/dist/mjs/models/index.js.map +0 -1
- package/dist/mjs/models/inventory.d.ts +0 -327
- package/dist/mjs/models/inventory.d.ts.map +0 -1
- package/dist/mjs/models/inventory.js +0 -7
- package/dist/mjs/models/inventory.js.map +0 -1
- package/dist/mjs/models/me.d.ts +0 -2483
- package/dist/mjs/models/me.d.ts.map +0 -1
- package/dist/mjs/models/me.js +0 -7
- package/dist/mjs/models/me.js.map +0 -1
- package/dist/mjs/models/message.d.ts +0 -15095
- package/dist/mjs/models/message.d.ts.map +0 -1
- package/dist/mjs/models/message.js +0 -7
- package/dist/mjs/models/message.js.map +0 -1
- package/dist/mjs/models/order-edit.d.ts +0 -1645
- package/dist/mjs/models/order-edit.d.ts.map +0 -1
- package/dist/mjs/models/order-edit.js +0 -7
- package/dist/mjs/models/order-edit.js.map +0 -1
- package/dist/mjs/models/order.d.ts +0 -2157
- package/dist/mjs/models/order.d.ts.map +0 -1
- package/dist/mjs/models/order.js +0 -7
- package/dist/mjs/models/order.js.map +0 -1
- package/dist/mjs/models/payment.d.ts +0 -734
- package/dist/mjs/models/payment.d.ts.map +0 -1
- package/dist/mjs/models/payment.js +0 -7
- package/dist/mjs/models/payment.js.map +0 -1
- package/dist/mjs/models/product-discount.d.ts +0 -461
- package/dist/mjs/models/product-discount.d.ts.map +0 -1
- package/dist/mjs/models/product-discount.js +0 -7
- package/dist/mjs/models/product-discount.js.map +0 -1
- package/dist/mjs/models/product-selection.d.ts +0 -638
- package/dist/mjs/models/product-selection.d.ts.map +0 -1
- package/dist/mjs/models/product-selection.js +0 -7
- package/dist/mjs/models/product-selection.js.map +0 -1
- package/dist/mjs/models/product-type.d.ts +0 -774
- package/dist/mjs/models/product-type.d.ts.map +0 -1
- package/dist/mjs/models/product-type.js +0 -7
- package/dist/mjs/models/product-type.js.map +0 -1
- package/dist/mjs/models/product.d.ts +0 -2282
- package/dist/mjs/models/product.d.ts.map +0 -1
- package/dist/mjs/models/product.js +0 -7
- package/dist/mjs/models/product.js.map +0 -1
- package/dist/mjs/models/project.d.ts +0 -381
- package/dist/mjs/models/project.d.ts.map +0 -1
- package/dist/mjs/models/project.js +0 -7
- package/dist/mjs/models/project.js.map +0 -1
- package/dist/mjs/models/quote-request.d.ts +0 -430
- package/dist/mjs/models/quote-request.d.ts.map +0 -1
- package/dist/mjs/models/quote-request.js +0 -7
- package/dist/mjs/models/quote-request.js.map +0 -1
- package/dist/mjs/models/quote.d.ts +0 -458
- package/dist/mjs/models/quote.d.ts.map +0 -1
- package/dist/mjs/models/quote.js +0 -7
- package/dist/mjs/models/quote.js.map +0 -1
- package/dist/mjs/models/review.d.ts +0 -435
- package/dist/mjs/models/review.d.ts.map +0 -1
- package/dist/mjs/models/review.js +0 -7
- package/dist/mjs/models/review.js.map +0 -1
- package/dist/mjs/models/scalar-types.d.ts +0 -9
- package/dist/mjs/models/scalar-types.d.ts.map +0 -1
- package/dist/mjs/models/scalar-types.js +0 -7
- package/dist/mjs/models/scalar-types.js.map +0 -1
- package/dist/mjs/models/shipping-method.d.ts +0 -569
- package/dist/mjs/models/shipping-method.d.ts.map +0 -1
- package/dist/mjs/models/shipping-method.js +0 -7
- package/dist/mjs/models/shipping-method.js.map +0 -1
- package/dist/mjs/models/shopping-list.d.ts +0 -844
- package/dist/mjs/models/shopping-list.d.ts.map +0 -1
- package/dist/mjs/models/shopping-list.js +0 -7
- package/dist/mjs/models/shopping-list.js.map +0 -1
- package/dist/mjs/models/staged-quote.d.ts +0 -338
- package/dist/mjs/models/staged-quote.d.ts.map +0 -1
- package/dist/mjs/models/staged-quote.js +0 -7
- package/dist/mjs/models/staged-quote.js.map +0 -1
- package/dist/mjs/models/standalone-price.d.ts +0 -410
- package/dist/mjs/models/standalone-price.d.ts.map +0 -1
- package/dist/mjs/models/standalone-price.js +0 -7
- package/dist/mjs/models/standalone-price.js.map +0 -1
- package/dist/mjs/models/state.d.ts +0 -341
- package/dist/mjs/models/state.d.ts.map +0 -1
- package/dist/mjs/models/state.js +0 -7
- package/dist/mjs/models/state.js.map +0 -1
- package/dist/mjs/models/store-country.d.ts +0 -14
- package/dist/mjs/models/store-country.d.ts.map +0 -1
- package/dist/mjs/models/store-country.js +0 -7
- package/dist/mjs/models/store-country.js.map +0 -1
- package/dist/mjs/models/store.d.ts +0 -547
- package/dist/mjs/models/store.d.ts.map +0 -1
- package/dist/mjs/models/store.js +0 -7
- package/dist/mjs/models/store.js.map +0 -1
- package/dist/mjs/models/subscription.d.ts +0 -717
- package/dist/mjs/models/subscription.d.ts.map +0 -1
- package/dist/mjs/models/subscription.js +0 -7
- package/dist/mjs/models/subscription.js.map +0 -1
- package/dist/mjs/models/tax-category.d.ts +0 -376
- package/dist/mjs/models/tax-category.d.ts.map +0 -1
- package/dist/mjs/models/tax-category.js +0 -7
- package/dist/mjs/models/tax-category.js.map +0 -1
- package/dist/mjs/models/type.d.ts +0 -645
- package/dist/mjs/models/type.d.ts.map +0 -1
- package/dist/mjs/models/type.js +0 -7
- package/dist/mjs/models/type.js.map +0 -1
- package/dist/mjs/models/zone.d.ts +0 -234
- package/dist/mjs/models/zone.d.ts.map +0 -1
- package/dist/mjs/models/zone.js +0 -7
- package/dist/mjs/models/zone.js.map +0 -1
|
@@ -1,3366 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
|
|
3
|
-
* Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
|
|
4
|
-
* For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
|
|
5
|
-
*/
|
|
6
|
-
import { BusinessUnitKeyReference, BusinessUnitResourceIdentifier } from './business-unit.js';
|
|
7
|
-
import { CartDiscountReference, CartDiscountTarget, CartDiscountValue } from './cart-discount.js';
|
|
8
|
-
import { ChannelReference, ChannelResourceIdentifier } from './channel.js';
|
|
9
|
-
import { Address, BaseAddress, BaseResource, CentPrecisionMoney, CreatedBy, LastModifiedBy, LocalizedString, Price, Reference, TypedMoney, _BaseAddress, _Money } from './common.js';
|
|
10
|
-
import { CustomerGroupReference, CustomerGroupResourceIdentifier } from './customer-group.js';
|
|
11
|
-
import { DiscountCodeReference } from './discount-code.js';
|
|
12
|
-
import { Delivery, DeliveryDraft, ItemState, OrderReference, PaymentInfo } from './order.js';
|
|
13
|
-
import { PaymentResourceIdentifier } from './payment.js';
|
|
14
|
-
import { ProductVariant } from './product.js';
|
|
15
|
-
import { ProductTypeReference } from './product-type.js';
|
|
16
|
-
import { ShippingMethodReference, ShippingMethodResourceIdentifier, ShippingRate, ShippingRateDraft } from './shipping-method.js';
|
|
17
|
-
import { ShoppingListResourceIdentifier } from './shopping-list.js';
|
|
18
|
-
import { StoreKeyReference, StoreResourceIdentifier } from './store.js';
|
|
19
|
-
import { SubRate, TaxCategoryReference, TaxCategoryResourceIdentifier, TaxRate } from './tax-category.js';
|
|
20
|
-
import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type.js';
|
|
21
|
-
export interface Cart extends BaseResource {
|
|
22
|
-
/**
|
|
23
|
-
* Unique identifier of the Cart.
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
readonly id: string;
|
|
28
|
-
/**
|
|
29
|
-
* Current version of the Cart.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
readonly version: number;
|
|
34
|
-
/**
|
|
35
|
-
* User-defined unique identifier of the Cart.
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
39
|
-
readonly key?: string;
|
|
40
|
-
/**
|
|
41
|
-
* `id` of the [Customer](ctp:api:type:Customer) that the Cart belongs to.
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*/
|
|
45
|
-
readonly customerId?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Email address of the Customer that the Cart belongs to.
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*/
|
|
51
|
-
readonly customerEmail?: string;
|
|
52
|
-
/**
|
|
53
|
-
* [Reference](ctp:api:type:Reference) to the Customer Group of the Customer that the Cart belongs to. Used for [LineItem Price selection](ctp:api:type:LineItemPriceSelection).
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*/
|
|
57
|
-
readonly customerGroup?: CustomerGroupReference;
|
|
58
|
-
/**
|
|
59
|
-
* [Anonymous session](ctp:api:type:AnonymousSession) associated with the Cart.
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*/
|
|
63
|
-
readonly anonymousId?: string;
|
|
64
|
-
/**
|
|
65
|
-
* [Reference](ctp:api:type:Reference) to a Business Unit the Cart belongs to.
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*/
|
|
69
|
-
readonly businessUnit?: BusinessUnitKeyReference;
|
|
70
|
-
/**
|
|
71
|
-
* [Reference](ctp:api:type:Reference) to a Store the Cart belongs to.
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*/
|
|
75
|
-
readonly store?: StoreKeyReference;
|
|
76
|
-
/**
|
|
77
|
-
* [Line Items](ctp:api:type:LineItems) added to the Cart.
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*/
|
|
81
|
-
readonly lineItems: LineItem[];
|
|
82
|
-
/**
|
|
83
|
-
* [Custom Line Items](ctp:api:type:CustomLineItems) added to the Cart.
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*/
|
|
87
|
-
readonly customLineItems: CustomLineItem[];
|
|
88
|
-
/**
|
|
89
|
-
* Sum of all [LineItem](ctp:api:type:LineItem) quantities, excluding [CustomLineItems](ctp:api:type:CustomLineItem). Only present when the Cart has at least one LineItem.
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*/
|
|
93
|
-
readonly totalLineItemQuantity?: number;
|
|
94
|
-
/**
|
|
95
|
-
* Sum of the `totalPrice` field of all [LineItems](ctp:api:type:LineItem) and [CustomLineItems](ctp:api:type:CustomLineItem), and if available, the `price` field of [ShippingInfo](ctp:api:type:ShippingInfo).
|
|
96
|
-
*
|
|
97
|
-
* Taxes are included if [TaxRate](ctp:api:type:TaxRate) `includedInPrice` is `true` for each price.
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*/
|
|
101
|
-
readonly totalPrice: CentPrecisionMoney;
|
|
102
|
-
/**
|
|
103
|
-
* - For a Cart with `Platform` [TaxMode](ctp:api:type:TaxMode), it is automatically set when a [shipping address is set](ctp:api:type:CartSetShippingAddressAction).
|
|
104
|
-
* - For a Cart with `External` [TaxMode](ctp:api:type:TaxMode), it is automatically set when the external Tax Rate for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set.
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*/
|
|
108
|
-
readonly taxedPrice?: TaxedPrice;
|
|
109
|
-
/**
|
|
110
|
-
* Sum of the `taxedPrice` field of [ShippingInfo](ctp:api:type:ShippingInfo) across all Shipping Methods.
|
|
111
|
-
*
|
|
112
|
-
*/
|
|
113
|
-
readonly taxedShippingPrice?: TaxedPrice;
|
|
114
|
-
/**
|
|
115
|
-
* Indicates how Tax Rates are set.
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*/
|
|
119
|
-
readonly taxMode: TaxMode;
|
|
120
|
-
/**
|
|
121
|
-
* Indicates how monetary values are rounded when calculating taxes for `taxedPrice`.
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*/
|
|
125
|
-
readonly taxRoundingMode: RoundingMode;
|
|
126
|
-
/**
|
|
127
|
-
* Indicates how taxes are calculated when calculating taxes for `taxedPrice`.
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*/
|
|
131
|
-
readonly taxCalculationMode: TaxCalculationMode;
|
|
132
|
-
/**
|
|
133
|
-
* Indicates how stock quantities are tracked for Line Items in the Cart.
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*/
|
|
137
|
-
readonly inventoryMode: InventoryMode;
|
|
138
|
-
/**
|
|
139
|
-
* Current status of the Cart.
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*/
|
|
143
|
-
readonly cartState: CartState;
|
|
144
|
-
/**
|
|
145
|
-
* Billing address associated with the Cart.
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*/
|
|
149
|
-
readonly billingAddress?: Address;
|
|
150
|
-
/**
|
|
151
|
-
* Shipping address associated with the Cart. Determines eligible [ShippingMethod](ctp:api:type:ShippingMethod) rates and Tax Rates of Line Items.
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*/
|
|
155
|
-
readonly shippingAddress?: Address;
|
|
156
|
-
/**
|
|
157
|
-
* Indicates whether the Cart has one or multiple Shipping Methods.
|
|
158
|
-
*
|
|
159
|
-
*/
|
|
160
|
-
readonly shippingMode: ShippingMode;
|
|
161
|
-
/**
|
|
162
|
-
* User-defined unique identifier of the Shipping Method in a Cart with `Single` [ShippingMode](ctp:api:type:ShippingMode).
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*/
|
|
166
|
-
readonly shippingKey?: string;
|
|
167
|
-
/**
|
|
168
|
-
* Shipping-related information of a Cart with `Single` [ShippingMode](ctp:api:type:ShippingMode). Automatically set when a [Shipping Method is set](ctp:api:type:CartSetShippingMethodAction).
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*/
|
|
172
|
-
readonly shippingInfo?: ShippingInfo;
|
|
173
|
-
/**
|
|
174
|
-
* Input used to select a [ShippingRatePriceTier](ctp:api:type:ShippingRatePriceTier).
|
|
175
|
-
* The data type of this field depends on the `shippingRateInputType.type` configured in the [Project](ctp:api:type:Project):
|
|
176
|
-
*
|
|
177
|
-
* - If `CartClassification`, it is [ClassificationShippingRateInput](ctp:api:type:ClassificationShippingRateInput).
|
|
178
|
-
* - If `CartScore`, it is [ScoreShippingRateInput](ctp:api:type:ScoreShippingRateInput).
|
|
179
|
-
* - If `CartValue`, it cannot be used.
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*/
|
|
183
|
-
readonly shippingRateInput?: ShippingRateInput;
|
|
184
|
-
/**
|
|
185
|
-
* Custom Fields of the Shipping Method in a Cart with `Single` [ShippingMode](ctp:api:type:ShippingMode).
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*/
|
|
189
|
-
readonly shippingCustomFields?: CustomFields;
|
|
190
|
-
/**
|
|
191
|
-
* Shipping-related information of a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). Updated automatically each time a new [Shipping Method is added](ctp:api:type:CartAddShippingMethodAction).
|
|
192
|
-
*
|
|
193
|
-
*/
|
|
194
|
-
readonly shipping: Shipping[];
|
|
195
|
-
/**
|
|
196
|
-
* Additional shipping addresses of the Cart as specified by [LineItems](ctp:api:type:LineItem) using the `shippingDetails` field.
|
|
197
|
-
*
|
|
198
|
-
* Eligible Shipping Methods or applicable Tax Rates are determined by the address in `shippingAddress`, and not `itemShippingAddresses`.
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*/
|
|
202
|
-
readonly itemShippingAddresses: Address[];
|
|
203
|
-
/**
|
|
204
|
-
* Discount Codes applied to the Cart. A Cart that has `directDiscounts` cannot have `discountCodes`.
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*/
|
|
208
|
-
readonly discountCodes: DiscountCodeInfo[];
|
|
209
|
-
/**
|
|
210
|
-
* Direct Discounts added to the Cart. A Cart that has `discountCodes` cannot have `directDiscounts`.
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*/
|
|
214
|
-
readonly directDiscounts: DirectDiscount[];
|
|
215
|
-
/**
|
|
216
|
-
* Automatically set when a Line Item with `GiftLineItem` [LineItemMode](ctp:api:type:LineItemMode) is [removed](ctp:api:type:CartRemoveLineItemAction) from the Cart.
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*/
|
|
220
|
-
readonly refusedGifts: CartDiscountReference[];
|
|
221
|
-
/**
|
|
222
|
-
* Payment information related to the Cart.
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*/
|
|
226
|
-
readonly paymentInfo?: PaymentInfo;
|
|
227
|
-
/**
|
|
228
|
-
* Used for [LineItem Price selection](ctp:api:type:LineItemPriceSelection).
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*/
|
|
232
|
-
readonly country?: string;
|
|
233
|
-
/**
|
|
234
|
-
* Languages of the Cart. Can only contain languages supported by the [Project](ctp:api:type:Project).
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*/
|
|
238
|
-
readonly locale?: string;
|
|
239
|
-
/**
|
|
240
|
-
* Indicates how the Cart was created.
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*/
|
|
244
|
-
readonly origin: CartOrigin;
|
|
245
|
-
/**
|
|
246
|
-
* Custom Fields of the Cart.
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*/
|
|
250
|
-
readonly custom?: CustomFields;
|
|
251
|
-
/**
|
|
252
|
-
* Number of days after which an active Cart is deleted since its last modification. Configured in [Project settings](ctp:api:type:CartsConfiguration).
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*/
|
|
256
|
-
readonly deleteDaysAfterLastModification?: number;
|
|
257
|
-
/**
|
|
258
|
-
* Date and time (UTC) the Cart was initially created.
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*/
|
|
262
|
-
readonly createdAt: string;
|
|
263
|
-
/**
|
|
264
|
-
* Date and time (UTC) the Cart was last updated.
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*/
|
|
268
|
-
readonly lastModifiedAt: string;
|
|
269
|
-
/**
|
|
270
|
-
* Present on resources updated after 1 February 2019 except for [events not tracked](/../api/client-logging#events-tracked).
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
*/
|
|
274
|
-
readonly lastModifiedBy?: LastModifiedBy;
|
|
275
|
-
/**
|
|
276
|
-
* Present on resources created after 1 February 2019 except for [events not tracked](/../api/client-logging#events-tracked).
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
*/
|
|
280
|
-
readonly createdBy?: CreatedBy;
|
|
281
|
-
}
|
|
282
|
-
export interface CartDraft {
|
|
283
|
-
/**
|
|
284
|
-
* Currency the Cart uses.
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*/
|
|
288
|
-
readonly currency: string;
|
|
289
|
-
/**
|
|
290
|
-
* User-defined unique identifier for the Cart.
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*/
|
|
294
|
-
readonly key?: string;
|
|
295
|
-
/**
|
|
296
|
-
* `id` of the [Customer](ctp:api:type:Customer) that the Cart belongs to.
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
*/
|
|
300
|
-
readonly customerId?: string;
|
|
301
|
-
/**
|
|
302
|
-
* Email address of the Customer that the Cart belongs to.
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*/
|
|
306
|
-
readonly customerEmail?: string;
|
|
307
|
-
/**
|
|
308
|
-
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to the Customer Group of the Customer that the Cart belongs to. Used for [LineItem Price selection](ctp:api:type:LineItemPriceSelection).
|
|
309
|
-
*
|
|
310
|
-
* It is automatically set if the Customer referenced in `customerId` belongs to a Customer Group.
|
|
311
|
-
* It can also be set explicitly when no `customerId` is present.
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*/
|
|
315
|
-
readonly customerGroup?: CustomerGroupResourceIdentifier;
|
|
316
|
-
/**
|
|
317
|
-
* [Anonymous session](ctp:api:type:AnonymousSession) associated with the Cart.
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
*/
|
|
321
|
-
readonly anonymousId?: string;
|
|
322
|
-
/**
|
|
323
|
-
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to the Business Unit the Cart should belong to. When the `customerId` of the Cart is also set, the [Customer](ctp:api:type:Customer) must be an [Associate](ctp:api:type:Associate) of the Business Unit.
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*/
|
|
327
|
-
readonly businessUnit?: BusinessUnitResourceIdentifier;
|
|
328
|
-
/**
|
|
329
|
-
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to the Store the Cart should belong to. Once set, it cannot be updated.
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*/
|
|
333
|
-
readonly store?: StoreResourceIdentifier;
|
|
334
|
-
/**
|
|
335
|
-
* [Line Items](ctp:api:type:LineItems) to add to the Cart.
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*/
|
|
339
|
-
readonly lineItems?: LineItemDraft[];
|
|
340
|
-
/**
|
|
341
|
-
* [Custom Line Items](ctp:api:type:CustomLineItems) to add to the Cart.
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
*/
|
|
345
|
-
readonly customLineItems?: CustomLineItemDraft[];
|
|
346
|
-
/**
|
|
347
|
-
* Determines how Tax Rates are set.
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*/
|
|
351
|
-
readonly taxMode?: TaxMode;
|
|
352
|
-
/**
|
|
353
|
-
* External Tax Rate for the `shippingMethod` if the Cart has `External` [TaxMode](ctp:api:type:TaxMode).
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*/
|
|
357
|
-
readonly externalTaxRateForShippingMethod?: ExternalTaxRateDraft;
|
|
358
|
-
/**
|
|
359
|
-
* Determines how monetary values are rounded when calculating taxes for `taxedPrice`.
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
*/
|
|
363
|
-
readonly taxRoundingMode?: RoundingMode;
|
|
364
|
-
/**
|
|
365
|
-
* Determines how taxes are calculated when calculating taxes for `taxedPrice`.
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
*/
|
|
369
|
-
readonly taxCalculationMode?: TaxCalculationMode;
|
|
370
|
-
/**
|
|
371
|
-
* Determines how stock quantities are tracked for Line Items in the Cart.
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
*/
|
|
375
|
-
readonly inventoryMode?: InventoryMode;
|
|
376
|
-
/**
|
|
377
|
-
* Billing address associated with the Cart.
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
*/
|
|
381
|
-
readonly billingAddress?: _BaseAddress;
|
|
382
|
-
/**
|
|
383
|
-
* Shipping address associated with the Cart. Determines eligible [ShippingMethod](ctp:api:type:ShippingMethod) rates and Tax Rates of Line Items.
|
|
384
|
-
*
|
|
385
|
-
*
|
|
386
|
-
*/
|
|
387
|
-
readonly shippingAddress?: _BaseAddress;
|
|
388
|
-
/**
|
|
389
|
-
* Shipping Method for a Cart with `Single` [ShippingMode](ctp:api:type:ShippingMode). If the referenced [ShippingMethod](ctp:api:type:ShippingMethod) has a `predicate` that does not match the Cart, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned when [creating a Cart](ctp:api:endpoint:/{projectKey}/carts:POST).
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
*/
|
|
393
|
-
readonly shippingMethod?: ShippingMethodResourceIdentifier;
|
|
394
|
-
/**
|
|
395
|
-
* Used as an input to select a [ShippingRatePriceTier](ctp:api:type:ShippingRatePriceTier).
|
|
396
|
-
* The data type of this field depends on the `shippingRateInputType.type` configured in the [Project](ctp:api:type:Project):
|
|
397
|
-
*
|
|
398
|
-
* - If `CartClassification`, it must be [ClassificationShippingRateInputDraft](ctp:api:type:ClassificationShippingRateInputDraft).
|
|
399
|
-
* - If `CartScore`, it must be [ScoreShippingRateInputDraft](ctp:api:type:ScoreShippingRateInputDraft).
|
|
400
|
-
* - If `CartValue`, it cannot be set.
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
*/
|
|
404
|
-
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
405
|
-
/**
|
|
406
|
-
* - If set to `Single`, only a single Shipping Method can be added to the Cart.
|
|
407
|
-
* - If set to `Multiple`, multiple Shipping Methods can be added to the Cart.
|
|
408
|
-
*
|
|
409
|
-
*/
|
|
410
|
-
readonly shippingMode?: ShippingMode;
|
|
411
|
-
/**
|
|
412
|
-
* Custom Shipping Methods for a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
413
|
-
*
|
|
414
|
-
*/
|
|
415
|
-
readonly customShipping?: CustomShippingDraft[];
|
|
416
|
-
/**
|
|
417
|
-
* Shipping Methods for a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
418
|
-
*
|
|
419
|
-
*/
|
|
420
|
-
readonly shipping?: ShippingDraft[];
|
|
421
|
-
/**
|
|
422
|
-
* Multiple shipping addresses of the Cart. Each address must contain a `key` that is unique in this Cart.
|
|
423
|
-
* The keys are used by [LineItems](ctp:api:type:LineItem) to reference these addresses under their `shippingDetails`.
|
|
424
|
-
*
|
|
425
|
-
* Eligible Shipping Methods or applicable Tax Rates are determined by the address `shippingAddress`, and not `itemShippingAddresses`.
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
*/
|
|
429
|
-
readonly itemShippingAddresses?: BaseAddress[];
|
|
430
|
-
/**
|
|
431
|
-
* `code` of the existing [DiscountCodes](ctp:api:type:DiscountCode) to add to the Cart.
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*/
|
|
435
|
-
readonly discountCodes?: string[];
|
|
436
|
-
/**
|
|
437
|
-
* Used for [LineItem Price selection](ctp:api:type:LineItemPriceSelection).
|
|
438
|
-
* If used for [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/carts:POST), the provided country must be one of the [Store's](ctp:api:type:Store) `countries`.
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
*/
|
|
442
|
-
readonly country?: string;
|
|
443
|
-
/**
|
|
444
|
-
* Languages of the Cart. Can only contain languages supported by the [Project](ctp:api:type:Project).
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
*/
|
|
448
|
-
readonly locale?: string;
|
|
449
|
-
/**
|
|
450
|
-
* Indicates how the Cart was created.
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
*/
|
|
454
|
-
readonly origin?: CartOrigin;
|
|
455
|
-
/**
|
|
456
|
-
* Number of days after which an active Cart is deleted since its last modification.
|
|
457
|
-
* If not provided, the default value for this field configured in [Project settings](ctp:api:type:CartsConfiguration) is assigned.
|
|
458
|
-
*
|
|
459
|
-
* Create a [ChangeSubscription](ctp:api:type:ChangeSubscription) for Carts to receive a [ResourceDeletedDeliveryPayload](ctp:api:type:ResourceDeletedDeliveryPayload) upon deletion of the Cart.
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
*/
|
|
463
|
-
readonly deleteDaysAfterLastModification?: number;
|
|
464
|
-
/**
|
|
465
|
-
* Custom Fields for the Cart.
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
*/
|
|
469
|
-
readonly custom?: CustomFieldsDraft;
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* Indicates who created the Cart.
|
|
473
|
-
*
|
|
474
|
-
*/
|
|
475
|
-
export type CartOrigin = 'Customer' | 'Merchant' | 'Quote' | string;
|
|
476
|
-
/**
|
|
477
|
-
* [PagedQueryResult](/../api/general-concepts#pagedqueryresult) with results containing an array of [Cart](ctp:api:type:Cart).
|
|
478
|
-
*
|
|
479
|
-
*/
|
|
480
|
-
export interface CartPagedQueryResponse {
|
|
481
|
-
/**
|
|
482
|
-
* Number of [results requested](/../api/general-concepts#limit).
|
|
483
|
-
*
|
|
484
|
-
*
|
|
485
|
-
*/
|
|
486
|
-
readonly limit: number;
|
|
487
|
-
/**
|
|
488
|
-
* Number of [elements skipped](/../api/general-concepts#offset).
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*/
|
|
492
|
-
readonly offset: number;
|
|
493
|
-
/**
|
|
494
|
-
* Actual number of results returned.
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*/
|
|
498
|
-
readonly count: number;
|
|
499
|
-
/**
|
|
500
|
-
* Total number of results matching the query.
|
|
501
|
-
* This number is an estimation that is not [strongly consistent](/../api/general-concepts#strong-consistency).
|
|
502
|
-
* This field is returned by default.
|
|
503
|
-
* For improved performance, calculating this field can be deactivated by using the query parameter `withTotal=false`.
|
|
504
|
-
* When the results are filtered with a [Query Predicate](/../api/predicates/query), `total` is subject to a [limit](/../api/limits#queries).
|
|
505
|
-
*
|
|
506
|
-
*
|
|
507
|
-
*/
|
|
508
|
-
readonly total?: number;
|
|
509
|
-
/**
|
|
510
|
-
* [Carts](ctp:api:type:Cart) matching the query.
|
|
511
|
-
*
|
|
512
|
-
*
|
|
513
|
-
*/
|
|
514
|
-
readonly results: Cart[];
|
|
515
|
-
}
|
|
516
|
-
/**
|
|
517
|
-
* [Reference](ctp:api:type:Reference) to a [Cart](ctp:api:type:Cart).
|
|
518
|
-
*
|
|
519
|
-
*/
|
|
520
|
-
export interface CartReference {
|
|
521
|
-
readonly typeId: 'cart';
|
|
522
|
-
/**
|
|
523
|
-
* Unique identifier of the referenced [Cart](ctp:api:type:Cart).
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
*/
|
|
527
|
-
readonly id: string;
|
|
528
|
-
/**
|
|
529
|
-
* Contains the representation of the expanded Cart. Only present in responses to requests with [Reference Expansion](/../api/general-concepts#reference-expansion) for Carts.
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
*/
|
|
533
|
-
readonly obj?: Cart;
|
|
534
|
-
}
|
|
535
|
-
/**
|
|
536
|
-
* [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to a [Cart](ctp:api:type:Cart).
|
|
537
|
-
*
|
|
538
|
-
*/
|
|
539
|
-
export interface CartResourceIdentifier {
|
|
540
|
-
readonly typeId: 'cart';
|
|
541
|
-
/**
|
|
542
|
-
* Unique identifier of the referenced [Cart](ctp:api:type:Cart). Either `id` or `key` is required.
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
*/
|
|
546
|
-
readonly id?: string;
|
|
547
|
-
/**
|
|
548
|
-
* User-defined unique identifier of the referenced [Cart](ctp:api:type:Cart). Either `id` or `key` is required.
|
|
549
|
-
*
|
|
550
|
-
*
|
|
551
|
-
*/
|
|
552
|
-
readonly key?: string;
|
|
553
|
-
}
|
|
554
|
-
/**
|
|
555
|
-
* Indicates the current status of a Cart.
|
|
556
|
-
*
|
|
557
|
-
*/
|
|
558
|
-
export type CartState = 'Active' | 'Frozen' | 'Merged' | 'Ordered' | string;
|
|
559
|
-
export interface CartUpdate {
|
|
560
|
-
/**
|
|
561
|
-
* Expected version of the Cart on which the changes apply.
|
|
562
|
-
* If the expected version does not match the actual version, a [409 Conflict](/../api/errors#409-conflict) is returned.
|
|
563
|
-
*
|
|
564
|
-
*
|
|
565
|
-
*/
|
|
566
|
-
readonly version: number;
|
|
567
|
-
/**
|
|
568
|
-
* Update actions to be performed on the Cart.
|
|
569
|
-
*
|
|
570
|
-
*
|
|
571
|
-
*/
|
|
572
|
-
readonly actions: CartUpdateAction[];
|
|
573
|
-
}
|
|
574
|
-
export type CartUpdateAction = CartAddCustomLineItemAction | CartAddCustomShippingMethodAction | CartAddDiscountCodeAction | CartAddItemShippingAddressAction | CartAddLineItemAction | CartAddPaymentAction | CartAddShippingMethodAction | CartAddShoppingListAction | CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction | CartApplyDeltaToLineItemShippingDetailsTargetsAction | CartChangeCustomLineItemMoneyAction | CartChangeCustomLineItemPriceModeAction | CartChangeCustomLineItemQuantityAction | CartChangeLineItemQuantityAction | CartChangeTaxCalculationModeAction | CartChangeTaxModeAction | CartChangeTaxRoundingModeAction | CartFreezeCartAction | CartRecalculateAction | CartRemoveCustomLineItemAction | CartRemoveDiscountCodeAction | CartRemoveItemShippingAddressAction | CartRemoveLineItemAction | CartRemovePaymentAction | CartRemoveShippingMethodAction | CartSetAnonymousIdAction | CartSetBillingAddressAction | CartSetBillingAddressCustomFieldAction | CartSetBillingAddressCustomTypeAction | CartSetBusinessUnitAction | CartSetCartTotalTaxAction | CartSetCountryAction | CartSetCustomFieldAction | CartSetCustomLineItemCustomFieldAction | CartSetCustomLineItemCustomTypeAction | CartSetCustomLineItemShippingDetailsAction | CartSetCustomLineItemTaxAmountAction | CartSetCustomLineItemTaxRateAction | CartSetCustomShippingMethodAction | CartSetCustomTypeAction | CartSetCustomerEmailAction | CartSetCustomerGroupAction | CartSetCustomerIdAction | CartSetDeleteDaysAfterLastModificationAction | CartSetDeliveryAddressCustomFieldAction | CartSetDeliveryAddressCustomTypeAction | CartSetDirectDiscountsAction | CartSetItemShippingAddressCustomFieldAction | CartSetItemShippingAddressCustomTypeAction | CartSetKeyAction | CartSetLineItemCustomFieldAction | CartSetLineItemCustomTypeAction | CartSetLineItemDistributionChannelAction | CartSetLineItemPriceAction | CartSetLineItemShippingDetailsAction | CartSetLineItemSupplyChannelAction | CartSetLineItemTaxAmountAction | CartSetLineItemTaxRateAction | CartSetLineItemTotalPriceAction | CartSetLocaleAction | CartSetShippingAddressAction | CartSetShippingAddressCustomFieldAction | CartSetShippingAddressCustomTypeAction | CartSetShippingCustomFieldAction | CartSetShippingCustomTypeAction | CartSetShippingMethodAction | CartSetShippingMethodTaxAmountAction | CartSetShippingMethodTaxRateAction | CartSetShippingRateInputAction | CartUnfreezeCartAction | CartUpdateItemShippingAddressAction;
|
|
575
|
-
/**
|
|
576
|
-
* A generic item that can be added to the Cart but is not bound to a Product that can be used for discounts (negative money), vouchers, complex cart rules, additional services, or fees.
|
|
577
|
-
* You control the lifecycle of this item.
|
|
578
|
-
*
|
|
579
|
-
*/
|
|
580
|
-
export interface CustomLineItem {
|
|
581
|
-
/**
|
|
582
|
-
* Unique identifier of the Custom Line Item.
|
|
583
|
-
*
|
|
584
|
-
*
|
|
585
|
-
*/
|
|
586
|
-
readonly id: string;
|
|
587
|
-
/**
|
|
588
|
-
* Name of the Custom Line Item.
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
*/
|
|
592
|
-
readonly name: LocalizedString;
|
|
593
|
-
/**
|
|
594
|
-
* Money value of the Custom Line Item.
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
*/
|
|
598
|
-
readonly money: TypedMoney;
|
|
599
|
-
/**
|
|
600
|
-
* Automatically set after the `taxRate` is set.
|
|
601
|
-
*
|
|
602
|
-
*
|
|
603
|
-
*/
|
|
604
|
-
readonly taxedPrice?: TaxedItemPrice;
|
|
605
|
-
/**
|
|
606
|
-
* Total price of the Custom Line Item (`money` multiplied by `quantity`).
|
|
607
|
-
* If the Custom Line Item is discounted, the total price is `discountedPricePerQuantity` multiplied by `quantity`.
|
|
608
|
-
*
|
|
609
|
-
* Includes taxes if the [TaxRate](ctp:api:type:TaxRate) `includedInPrice` is `true`.
|
|
610
|
-
*
|
|
611
|
-
*
|
|
612
|
-
*/
|
|
613
|
-
readonly totalPrice: CentPrecisionMoney;
|
|
614
|
-
/**
|
|
615
|
-
* User-defined identifier used in a deep-link URL for the Custom Line Item.
|
|
616
|
-
* It matches the pattern `[a-zA-Z0-9_-]{2,256}`.
|
|
617
|
-
*
|
|
618
|
-
*
|
|
619
|
-
*/
|
|
620
|
-
readonly slug: string;
|
|
621
|
-
/**
|
|
622
|
-
* Number of Custom Line Items in the Cart.
|
|
623
|
-
*
|
|
624
|
-
*
|
|
625
|
-
*/
|
|
626
|
-
readonly quantity: number;
|
|
627
|
-
/**
|
|
628
|
-
* State of the Custom Line Item in the Cart.
|
|
629
|
-
*
|
|
630
|
-
*
|
|
631
|
-
*/
|
|
632
|
-
readonly state: ItemState[];
|
|
633
|
-
/**
|
|
634
|
-
* Used to select a Tax Rate when a Cart has the `Platform` [TaxMode](ctp:api:type:TaxMode).
|
|
635
|
-
*
|
|
636
|
-
*
|
|
637
|
-
*/
|
|
638
|
-
readonly taxCategory?: TaxCategoryReference;
|
|
639
|
-
/**
|
|
640
|
-
* - For a Cart with `Platform` [TaxMode](ctp:api:type:TaxMode), the `taxRate` of Custom Line Items is set automatically once a shipping address is set. The rate is based on the [TaxCategory](ctp:api:type:TaxCategory) that applies for the shipping address.
|
|
641
|
-
* - For a Cart with `External` TaxMode, the `taxRate` of Custom Line Items can be set using [ExternalTaxRateDraft](ctp:api:type:ExternalTaxRateDraft).
|
|
642
|
-
*
|
|
643
|
-
*
|
|
644
|
-
*/
|
|
645
|
-
readonly taxRate?: TaxRate;
|
|
646
|
-
/**
|
|
647
|
-
* Discounted price of a single quantity of the Custom Line Item.
|
|
648
|
-
*
|
|
649
|
-
*
|
|
650
|
-
*/
|
|
651
|
-
readonly discountedPricePerQuantity: DiscountedLineItemPriceForQuantity[];
|
|
652
|
-
/**
|
|
653
|
-
* Custom Fields of the Custom Line Item.
|
|
654
|
-
*
|
|
655
|
-
*
|
|
656
|
-
*/
|
|
657
|
-
readonly custom?: CustomFields;
|
|
658
|
-
/**
|
|
659
|
-
* Container for Custom Line Item-specific addresses.
|
|
660
|
-
*
|
|
661
|
-
*
|
|
662
|
-
*/
|
|
663
|
-
readonly shippingDetails?: ItemShippingDetails;
|
|
664
|
-
/**
|
|
665
|
-
* Indicates whether Cart Discounts with a matching [CartDiscountCustomLineItemsTarget](ctp:api:type:CartDiscountCustomLineItemsTarget) are applied to the Custom Line Item.
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
*/
|
|
669
|
-
readonly priceMode: CustomLineItemPriceMode;
|
|
670
|
-
}
|
|
671
|
-
export interface CustomLineItemDraft {
|
|
672
|
-
/**
|
|
673
|
-
* Name of the Custom Line Item.
|
|
674
|
-
*
|
|
675
|
-
*
|
|
676
|
-
*/
|
|
677
|
-
readonly name: LocalizedString;
|
|
678
|
-
/**
|
|
679
|
-
* Number of Custom Line Items to add to the Cart.
|
|
680
|
-
*
|
|
681
|
-
*
|
|
682
|
-
*/
|
|
683
|
-
readonly quantity?: number;
|
|
684
|
-
/**
|
|
685
|
-
* Money value of the Custom Line Item.
|
|
686
|
-
* The value can be negative.
|
|
687
|
-
*
|
|
688
|
-
*
|
|
689
|
-
*/
|
|
690
|
-
readonly money: _Money;
|
|
691
|
-
/**
|
|
692
|
-
* User-defined identifier used in a deep-link URL for the Custom Line Item.
|
|
693
|
-
* It must match the pattern `[a-zA-Z0-9_-]{2,256}`.
|
|
694
|
-
*
|
|
695
|
-
*
|
|
696
|
-
*/
|
|
697
|
-
readonly slug: string;
|
|
698
|
-
/**
|
|
699
|
-
* Used to select a Tax Rate when a Cart has the `Platform` [TaxMode](ctp:api:type:TaxMode).
|
|
700
|
-
* This field is required for `Platform` [TaxMode](ctp:api:type:TaxMode).
|
|
701
|
-
*
|
|
702
|
-
*
|
|
703
|
-
*/
|
|
704
|
-
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
705
|
-
/**
|
|
706
|
-
* External Tax Rate for the Custom Line Item if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode).
|
|
707
|
-
*
|
|
708
|
-
*
|
|
709
|
-
*/
|
|
710
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
711
|
-
/**
|
|
712
|
-
* Custom Fields for the Custom Line Item.
|
|
713
|
-
*
|
|
714
|
-
*
|
|
715
|
-
*/
|
|
716
|
-
readonly custom?: CustomFieldsDraft;
|
|
717
|
-
/**
|
|
718
|
-
* Container for Custom Line Item-specific addresses.
|
|
719
|
-
*
|
|
720
|
-
*
|
|
721
|
-
*/
|
|
722
|
-
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
723
|
-
/**
|
|
724
|
-
* - If `Standard`, Cart Discounts with a matching [CartDiscountCustomLineItemsTarget](ctp:api:type:CartDiscountCustomLineItemsTarget)
|
|
725
|
-
* are applied to the Custom Line Item.
|
|
726
|
-
* - If `External`, Cart Discounts are not considered on the Custom Line Item.
|
|
727
|
-
*
|
|
728
|
-
*
|
|
729
|
-
*/
|
|
730
|
-
readonly priceMode: CustomLineItemPriceMode;
|
|
731
|
-
}
|
|
732
|
-
/**
|
|
733
|
-
* Determines if Cart Discounts can be applied to a Custom Line Item in the Cart.
|
|
734
|
-
*
|
|
735
|
-
*/
|
|
736
|
-
export type CustomLineItemPriceMode = 'External' | 'Standard' | string;
|
|
737
|
-
export interface CustomShippingDraft {
|
|
738
|
-
/**
|
|
739
|
-
* User-defined unique identifier of the custom Shipping Method in the Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
740
|
-
*
|
|
741
|
-
*
|
|
742
|
-
*/
|
|
743
|
-
readonly key: string;
|
|
744
|
-
/**
|
|
745
|
-
* Name of the custom Shipping Method.
|
|
746
|
-
*
|
|
747
|
-
*
|
|
748
|
-
*/
|
|
749
|
-
readonly shippingMethodName: string;
|
|
750
|
-
/**
|
|
751
|
-
* Determines the shipping rate and Tax Rate of the associated Line Items.
|
|
752
|
-
*
|
|
753
|
-
*
|
|
754
|
-
*/
|
|
755
|
-
readonly shippingAddress?: _BaseAddress;
|
|
756
|
-
/**
|
|
757
|
-
* Determines the shipping price.
|
|
758
|
-
*
|
|
759
|
-
*
|
|
760
|
-
*/
|
|
761
|
-
readonly shippingRate: ShippingRateDraft;
|
|
762
|
-
/**
|
|
763
|
-
* Input used to select a [ShippingRatePriceTier](ctp:api:type:ShippingRatePriceTier).
|
|
764
|
-
* The data type of this field depends on the `shippingRateInputType.type` configured in the [Project](ctp:api:type:Project):
|
|
765
|
-
*
|
|
766
|
-
* - If `CartClassification`, it must be [ClassificationShippingRateInputDraft](ctp:api:type:ClassificationShippingRateInputDraft).
|
|
767
|
-
* - If `CartScore`, it must be [ScoreShippingRateInputDraft](ctp:api:type:ScoreShippingRateInputDraft).
|
|
768
|
-
* - If `CartValue`, it cannot be set.
|
|
769
|
-
*
|
|
770
|
-
*
|
|
771
|
-
*/
|
|
772
|
-
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
773
|
-
/**
|
|
774
|
-
* Tax Category used to determine a shipping Tax Rate if the Cart has the `Platform` [TaxMode](ctp:api:type:TaxMode).
|
|
775
|
-
*
|
|
776
|
-
*
|
|
777
|
-
*/
|
|
778
|
-
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
779
|
-
/**
|
|
780
|
-
* Tax Rate used to tax a shipping expense if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode).
|
|
781
|
-
*
|
|
782
|
-
*
|
|
783
|
-
*/
|
|
784
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
785
|
-
/**
|
|
786
|
-
* Deliveries to be shipped with the custom Shipping Method.
|
|
787
|
-
*
|
|
788
|
-
*
|
|
789
|
-
*/
|
|
790
|
-
readonly deliveries?: DeliveryDraft[];
|
|
791
|
-
/**
|
|
792
|
-
* Custom Fields for the custom Shipping Method.
|
|
793
|
-
*
|
|
794
|
-
*
|
|
795
|
-
*/
|
|
796
|
-
readonly custom?: CustomFieldsDraft;
|
|
797
|
-
}
|
|
798
|
-
/**
|
|
799
|
-
* Represents a [CartDiscount](ctp:api:type:CartDiscount) that is only associated with a single Cart or Order.
|
|
800
|
-
*
|
|
801
|
-
*/
|
|
802
|
-
export interface DirectDiscount {
|
|
803
|
-
/**
|
|
804
|
-
* Unique identifier of the Direct Discount.
|
|
805
|
-
*
|
|
806
|
-
*
|
|
807
|
-
*/
|
|
808
|
-
readonly id: string;
|
|
809
|
-
/**
|
|
810
|
-
* Effect of the Discount on the Cart.
|
|
811
|
-
*
|
|
812
|
-
*
|
|
813
|
-
*/
|
|
814
|
-
readonly value: CartDiscountValue;
|
|
815
|
-
/**
|
|
816
|
-
* Part of the Cart that is discounted.
|
|
817
|
-
*
|
|
818
|
-
* Empty when the `value` is set to `giftLineItem`.
|
|
819
|
-
*
|
|
820
|
-
*
|
|
821
|
-
*/
|
|
822
|
-
readonly target?: CartDiscountTarget;
|
|
823
|
-
}
|
|
824
|
-
/**
|
|
825
|
-
* Represents a [CartDiscount](ctp:api:type:CartDiscount) that can only be associated with a single Cart or Order.
|
|
826
|
-
*
|
|
827
|
-
* Direct Discounts are always active and valid, and have the default `Stacking` [StackingMode](ctp:api:type:StackingMode).
|
|
828
|
-
* They apply in the order in which they are listed in the `directDiscounts` array of [Carts](ctp:api:type:Cart) or [Orders](ctp:api:type:Order), and do not have a sorting order like Cart Discounts.
|
|
829
|
-
*
|
|
830
|
-
* If a Direct Discount is present, any matching Cart Discounts in the Project are ignored.
|
|
831
|
-
* Additionally, a Cart or Order supports either Discount Codes or Direct Discounts at the same time.
|
|
832
|
-
*
|
|
833
|
-
*/
|
|
834
|
-
export interface DirectDiscountDraft {
|
|
835
|
-
/**
|
|
836
|
-
* Defines the effect the Discount will have.
|
|
837
|
-
*
|
|
838
|
-
*
|
|
839
|
-
*/
|
|
840
|
-
readonly value: CartDiscountValue;
|
|
841
|
-
/**
|
|
842
|
-
* Defines what part of the Cart will be discounted.
|
|
843
|
-
*
|
|
844
|
-
* If `value` is set to `giftLineItem`, this must not be set.
|
|
845
|
-
*
|
|
846
|
-
*
|
|
847
|
-
*/
|
|
848
|
-
readonly target?: CartDiscountTarget;
|
|
849
|
-
}
|
|
850
|
-
/**
|
|
851
|
-
* [Reference](ctp:api:type:Reference) to a [DirectDiscount](ctp:api:type:DirectDiscount).
|
|
852
|
-
*
|
|
853
|
-
*/
|
|
854
|
-
export interface DirectDiscountReference {
|
|
855
|
-
readonly typeId: 'direct-discount';
|
|
856
|
-
/**
|
|
857
|
-
* Unique identifier of the referenced [DirectDiscount](ctp:api:type:DirectDiscount).
|
|
858
|
-
*
|
|
859
|
-
*
|
|
860
|
-
*/
|
|
861
|
-
readonly id: string;
|
|
862
|
-
}
|
|
863
|
-
export interface DiscountCodeInfo {
|
|
864
|
-
/**
|
|
865
|
-
* Discount Code associated with the Cart or Order.
|
|
866
|
-
*
|
|
867
|
-
*
|
|
868
|
-
*/
|
|
869
|
-
readonly discountCode: DiscountCodeReference;
|
|
870
|
-
/**
|
|
871
|
-
* Indicates the state of the Discount Code applied to the Cart or Order.
|
|
872
|
-
*
|
|
873
|
-
*
|
|
874
|
-
*/
|
|
875
|
-
readonly state: DiscountCodeState;
|
|
876
|
-
}
|
|
877
|
-
/**
|
|
878
|
-
* Indicates the state of a Discount Code in a Cart.
|
|
879
|
-
*
|
|
880
|
-
* If an Order is created from a Cart with a state other than `MatchesCart`, a [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) error is returned.
|
|
881
|
-
*
|
|
882
|
-
*/
|
|
883
|
-
export type DiscountCodeState = 'ApplicationStoppedByPreviousDiscount' | 'DoesNotMatchCart' | 'MatchesCart' | 'MaxApplicationReached' | 'NotActive' | 'NotValid' | string;
|
|
884
|
-
export interface DiscountedLineItemPortion {
|
|
885
|
-
/**
|
|
886
|
-
* A [CartDiscountReference](ctp:api:type:CartDiscountReference) or [DirectDiscountReference](ctp:api:type:DirectDiscountReference) for the applicable discount on the Line Item.
|
|
887
|
-
*
|
|
888
|
-
*
|
|
889
|
-
*/
|
|
890
|
-
readonly discount: Reference;
|
|
891
|
-
/**
|
|
892
|
-
* Money value of the discount applicable.
|
|
893
|
-
*
|
|
894
|
-
*
|
|
895
|
-
*/
|
|
896
|
-
readonly discountedAmount: TypedMoney;
|
|
897
|
-
}
|
|
898
|
-
export interface DiscountedLineItemPrice {
|
|
899
|
-
/**
|
|
900
|
-
* Money value of the discounted Line Item or Custom Line Item.
|
|
901
|
-
*
|
|
902
|
-
*
|
|
903
|
-
*/
|
|
904
|
-
readonly value: TypedMoney;
|
|
905
|
-
/**
|
|
906
|
-
* Discount applicable on the Line Item or Custom Line Item.
|
|
907
|
-
*
|
|
908
|
-
*
|
|
909
|
-
*/
|
|
910
|
-
readonly includedDiscounts: DiscountedLineItemPortion[];
|
|
911
|
-
}
|
|
912
|
-
export interface DiscountedLineItemPriceForQuantity {
|
|
913
|
-
/**
|
|
914
|
-
* Number of Line Items or Custom Line Items in the Cart.
|
|
915
|
-
*
|
|
916
|
-
*
|
|
917
|
-
*/
|
|
918
|
-
readonly quantity: number;
|
|
919
|
-
/**
|
|
920
|
-
* Discounted price of the Line Item or Custom Line Item.
|
|
921
|
-
*
|
|
922
|
-
*
|
|
923
|
-
*/
|
|
924
|
-
readonly discountedPrice: DiscountedLineItemPrice;
|
|
925
|
-
}
|
|
926
|
-
export interface ExternalLineItemTotalPrice {
|
|
927
|
-
/**
|
|
928
|
-
* Price of the Line Item.
|
|
929
|
-
*
|
|
930
|
-
* The value is selected from the Product Variant according to the [Product](ctp:api:type:Product) `priceMode`.
|
|
931
|
-
*
|
|
932
|
-
*
|
|
933
|
-
*/
|
|
934
|
-
readonly price: _Money;
|
|
935
|
-
/**
|
|
936
|
-
* Total price of the Line Item.
|
|
937
|
-
*
|
|
938
|
-
*
|
|
939
|
-
*/
|
|
940
|
-
readonly totalPrice: _Money;
|
|
941
|
-
}
|
|
942
|
-
/**
|
|
943
|
-
* Cannot be used in [LineItemDraft](ctp:api:type:LineItemDraft) or [CustomLineItemDraft](ctp:api:type:CustomLineItemDraft).
|
|
944
|
-
*
|
|
945
|
-
* Can only be set by these update actions:
|
|
946
|
-
*
|
|
947
|
-
* - [Set LineItem TaxAmount](ctp:api:type:CartSetLineItemTaxAmountAction), [Set CustomLineItem TaxAmount](ctp:api:type:CartSetCustomLineItemTaxAmountAction), or [Set ShippingMethod TaxAmount](ctp:api:type:CartSetShippingMethodTaxAmountAction) on Carts
|
|
948
|
-
* - [Set LineItem TaxAmount](ctp:api:type:OrderEditSetLineItemTaxAmountAction), [Set CustomLineItem TaxAmount](ctp:api:type:OrderEditSetCustomLineItemTaxAmountAction), or [Set ShippingMethod TaxAmount](ctp:api:type:OrderEditSetShippingMethodTaxAmountAction) on Order Edits
|
|
949
|
-
*
|
|
950
|
-
*/
|
|
951
|
-
export interface ExternalTaxAmountDraft {
|
|
952
|
-
/**
|
|
953
|
-
* Total gross amount (`totalNet` + `taxPortions`) of the Line Item or Custom Line Item.
|
|
954
|
-
*
|
|
955
|
-
*
|
|
956
|
-
*/
|
|
957
|
-
readonly totalGross: _Money;
|
|
958
|
-
/**
|
|
959
|
-
* Tax Rates and subrates of states and countries.
|
|
960
|
-
*
|
|
961
|
-
*
|
|
962
|
-
*/
|
|
963
|
-
readonly taxRate: ExternalTaxRateDraft;
|
|
964
|
-
}
|
|
965
|
-
/**
|
|
966
|
-
* Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in [Cart tax calculation](ctp:api:type:CartTaxCalculation).
|
|
967
|
-
*
|
|
968
|
-
*/
|
|
969
|
-
export interface ExternalTaxRateDraft {
|
|
970
|
-
/**
|
|
971
|
-
* Name of the Tax Rate.
|
|
972
|
-
*
|
|
973
|
-
*
|
|
974
|
-
*/
|
|
975
|
-
readonly name: string;
|
|
976
|
-
/**
|
|
977
|
-
* Percentage in the range of 0-1.
|
|
978
|
-
*
|
|
979
|
-
* - If no `subRates` are specified, a value must be defined.
|
|
980
|
-
* - If `subRates` are specified, this can be omitted or its value must be the sum of all `subRates` amounts.
|
|
981
|
-
*
|
|
982
|
-
*
|
|
983
|
-
*/
|
|
984
|
-
readonly amount?: number;
|
|
985
|
-
/**
|
|
986
|
-
* - If set to `false`, the related price is considered the net price and the provided `amount` is applied to calculate the gross price.
|
|
987
|
-
* - If set to `true`, the related price is considered the gross price, and the provided `amount` is applied to calculate the net price.
|
|
988
|
-
*
|
|
989
|
-
*
|
|
990
|
-
*/
|
|
991
|
-
readonly includedInPrice?: boolean;
|
|
992
|
-
/**
|
|
993
|
-
* Country for which the tax applies.
|
|
994
|
-
*
|
|
995
|
-
*
|
|
996
|
-
*/
|
|
997
|
-
readonly country: string;
|
|
998
|
-
/**
|
|
999
|
-
* State within the specified country.
|
|
1000
|
-
*
|
|
1001
|
-
*
|
|
1002
|
-
*/
|
|
1003
|
-
readonly state?: string;
|
|
1004
|
-
/**
|
|
1005
|
-
* For countries (such as the US) where the total tax is a combination of multiple taxes (such as state and local taxes).
|
|
1006
|
-
*
|
|
1007
|
-
*
|
|
1008
|
-
*/
|
|
1009
|
-
readonly subRates?: SubRate[];
|
|
1010
|
-
}
|
|
1011
|
-
/**
|
|
1012
|
-
* Indicates how Line Items in a Cart are tracked.
|
|
1013
|
-
*
|
|
1014
|
-
*/
|
|
1015
|
-
export type InventoryMode = 'None' | 'ReserveOnOrder' | 'TrackOnly' | string;
|
|
1016
|
-
export interface ItemShippingDetails {
|
|
1017
|
-
/**
|
|
1018
|
-
* Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.
|
|
1019
|
-
*
|
|
1020
|
-
*
|
|
1021
|
-
*/
|
|
1022
|
-
readonly targets: ItemShippingTarget[];
|
|
1023
|
-
/**
|
|
1024
|
-
* - `true` if the quantity of Line Items or Custom Line Items is equal to the sum of sub-quantities defined in `targets`.
|
|
1025
|
-
* - `false` if the quantity of Line Items or Custom Line Items is not equal to the sum of sub-quantities defined in `targets`.
|
|
1026
|
-
* Ordering a Cart when the value is `false` returns an [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) error.
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1029
|
-
*/
|
|
1030
|
-
readonly valid: boolean;
|
|
1031
|
-
}
|
|
1032
|
-
/**
|
|
1033
|
-
* For order creation and updates, the sum of the `targets` must match the quantity of the Line Items or Custom Line Items.
|
|
1034
|
-
*
|
|
1035
|
-
*/
|
|
1036
|
-
export interface ItemShippingDetailsDraft {
|
|
1037
|
-
/**
|
|
1038
|
-
* Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.
|
|
1039
|
-
*
|
|
1040
|
-
* If multiple shipping addresses are present for a Line Item or Custom Line Item, sub-quantities must be specified.
|
|
1041
|
-
*
|
|
1042
|
-
*
|
|
1043
|
-
*/
|
|
1044
|
-
readonly targets: ItemShippingTarget[];
|
|
1045
|
-
}
|
|
1046
|
-
/**
|
|
1047
|
-
* Determines the address (as a reference to an address in `itemShippingAddresses`) and the quantity shipped to the address.
|
|
1048
|
-
*
|
|
1049
|
-
* If multiple shipping addresses are present for a Line Item or Custom Line Item, sub-quantities must be specified.
|
|
1050
|
-
* An array of addresses and sub-quantities is stored per Line Item or Custom Line Item.
|
|
1051
|
-
*
|
|
1052
|
-
*/
|
|
1053
|
-
export interface ItemShippingTarget {
|
|
1054
|
-
/**
|
|
1055
|
-
* Key of the address in the [Cart](ctp:api:type:Cart) `itemShippingAddresses`.
|
|
1056
|
-
* Duplicate address keys are not allowed.
|
|
1057
|
-
*
|
|
1058
|
-
*
|
|
1059
|
-
*/
|
|
1060
|
-
readonly addressKey: string;
|
|
1061
|
-
/**
|
|
1062
|
-
* Quantity of Line Items or Custom Line Items shipped to the address with the specified `addressKey`.
|
|
1063
|
-
*
|
|
1064
|
-
* If a quantity is updated to `0` when defining [ItemShippingDetailsDraft](ctp:api:type:ItemShippingDetailsDraft), the `targets` are removed from a Line Item or Custom Line Item in the resulting [ItemShippingDetails](ctp:api:type:ItemShippingDetails).
|
|
1065
|
-
*
|
|
1066
|
-
*
|
|
1067
|
-
*/
|
|
1068
|
-
readonly quantity: number;
|
|
1069
|
-
/**
|
|
1070
|
-
* User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
1071
|
-
*
|
|
1072
|
-
* It connects Line Item quantities with individual shipping addresses.
|
|
1073
|
-
*
|
|
1074
|
-
*/
|
|
1075
|
-
readonly shippingMethodKey?: string;
|
|
1076
|
-
}
|
|
1077
|
-
/**
|
|
1078
|
-
* The representation of a [Line Item](/../api/carts-orders-overview#line-items) in a Cart.
|
|
1079
|
-
*
|
|
1080
|
-
*/
|
|
1081
|
-
export interface LineItem {
|
|
1082
|
-
/**
|
|
1083
|
-
* Unique identifier of the Line Item.
|
|
1084
|
-
*
|
|
1085
|
-
*
|
|
1086
|
-
*/
|
|
1087
|
-
readonly id: string;
|
|
1088
|
-
/**
|
|
1089
|
-
* User-defined unique identifier of the LineItem
|
|
1090
|
-
*
|
|
1091
|
-
*/
|
|
1092
|
-
readonly key?: string;
|
|
1093
|
-
/**
|
|
1094
|
-
* `id` of the [Product](ctp:api:type:Product) the Line Item is based on.
|
|
1095
|
-
*
|
|
1096
|
-
*
|
|
1097
|
-
*/
|
|
1098
|
-
readonly productId: string;
|
|
1099
|
-
/**
|
|
1100
|
-
* `key` of the [Product](ctp:api:type:Product).
|
|
1101
|
-
*
|
|
1102
|
-
* This field is only present on:
|
|
1103
|
-
*
|
|
1104
|
-
* - Line Items in a [Cart](ctp:api:type:Cart) when the `key` is available on that specific Product at the time the Line Item was created or updated on the Cart.
|
|
1105
|
-
* - [Orders](ctp:api:type:Order) when the `key` is available on the specific Product at the time the Order was created from the Cart.
|
|
1106
|
-
*
|
|
1107
|
-
* Present on resources created or updated after 3 December 2021.
|
|
1108
|
-
*
|
|
1109
|
-
*
|
|
1110
|
-
*/
|
|
1111
|
-
readonly productKey?: string;
|
|
1112
|
-
/**
|
|
1113
|
-
* Name of the Product.
|
|
1114
|
-
*
|
|
1115
|
-
*
|
|
1116
|
-
*/
|
|
1117
|
-
readonly name: LocalizedString;
|
|
1118
|
-
/**
|
|
1119
|
-
* `slug` of the current version of the Product. Updated automatically if the `slug` changes. Empty if the Product has been deleted.
|
|
1120
|
-
* The `productSlug` field of LineItem is not expanded when using [Reference Expansion](/../api/general-concepts#reference-expansion).
|
|
1121
|
-
*
|
|
1122
|
-
*
|
|
1123
|
-
*/
|
|
1124
|
-
readonly productSlug?: LocalizedString;
|
|
1125
|
-
/**
|
|
1126
|
-
* Product Type of the Product.
|
|
1127
|
-
*
|
|
1128
|
-
*
|
|
1129
|
-
*/
|
|
1130
|
-
readonly productType: ProductTypeReference;
|
|
1131
|
-
/**
|
|
1132
|
-
* Holds the data of the Product Variant added to the Cart.
|
|
1133
|
-
*
|
|
1134
|
-
* The data is saved at the time the Product Variant is added to the Cart and is not updated automatically when Product Variant data changes.
|
|
1135
|
-
* Must be updated using the [Recalculate](ctp:api:type:CartRecalculateAction) update action.
|
|
1136
|
-
*
|
|
1137
|
-
*
|
|
1138
|
-
*/
|
|
1139
|
-
readonly variant: ProductVariant;
|
|
1140
|
-
/**
|
|
1141
|
-
* Price of a Line Item selected from the Product Variant according to the [Product](ctp:api:type:Product) `priceMode`. If the `priceMode` is `Embedded` [ProductPriceMode](ctp:api:type:ProductPriceModeEnum) and the `variant` field hasn't been updated, the price may not correspond to a price in `variant.prices`.
|
|
1142
|
-
*
|
|
1143
|
-
*
|
|
1144
|
-
*/
|
|
1145
|
-
readonly price: Price;
|
|
1146
|
-
/**
|
|
1147
|
-
* Number of Line Items of the given Product Variant present in the Cart.
|
|
1148
|
-
*
|
|
1149
|
-
*
|
|
1150
|
-
*/
|
|
1151
|
-
readonly quantity: number;
|
|
1152
|
-
/**
|
|
1153
|
-
* Total price of this Line Item equalling `price` multiplied by `quantity`. If the Line Item is discounted, the total price is the `discountedPricePerQuantity` multiplied by `quantity`.
|
|
1154
|
-
* Includes taxes if the [TaxRate](ctp:api:type:TaxRate) `includedInPrice` is `true`.
|
|
1155
|
-
*
|
|
1156
|
-
*
|
|
1157
|
-
*/
|
|
1158
|
-
readonly totalPrice: CentPrecisionMoney;
|
|
1159
|
-
/**
|
|
1160
|
-
* Discounted price of a single quantity of the Line Item.
|
|
1161
|
-
*
|
|
1162
|
-
*
|
|
1163
|
-
*/
|
|
1164
|
-
readonly discountedPricePerQuantity: DiscountedLineItemPriceForQuantity[];
|
|
1165
|
-
/**
|
|
1166
|
-
* Automatically set after `taxRate` is set.
|
|
1167
|
-
*
|
|
1168
|
-
*
|
|
1169
|
-
*/
|
|
1170
|
-
readonly taxedPrice?: TaxedItemPrice;
|
|
1171
|
-
/**
|
|
1172
|
-
* Taxed price of the Shipping Method that is automatically set after `perMethodTaxRate` is set.
|
|
1173
|
-
*
|
|
1174
|
-
*/
|
|
1175
|
-
readonly taxedPricePortions: MethodTaxedPrice[];
|
|
1176
|
-
/**
|
|
1177
|
-
* State of the Line Item in the Cart.
|
|
1178
|
-
*
|
|
1179
|
-
*
|
|
1180
|
-
*/
|
|
1181
|
-
readonly state: ItemState[];
|
|
1182
|
-
/**
|
|
1183
|
-
* - For a Cart with `Platform` [TaxMode](ctp:api:type:TaxMode), the `taxRate` of Line Items is set automatically once a shipping address is set. The rate is based on the [TaxCategory](ctp:api:type:TaxCategory) that applies for the shipping address.
|
|
1184
|
-
* - For a Cart with `External` TaxMode, the `taxRate` of Line Items can be set using [ExternalTaxRateDraft](ctp:api:type:ExternalTaxRateDraft).
|
|
1185
|
-
*
|
|
1186
|
-
*
|
|
1187
|
-
*/
|
|
1188
|
-
readonly taxRate?: TaxRate;
|
|
1189
|
-
/**
|
|
1190
|
-
* Tax Rate per Shipping Method for a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). For a Cart with `Platform` [TaxMode](ctp:api:type:TaxMode) it is automatically set after the [Shipping Method is added](ctp:api:type:CartAddShippingMethodAction).
|
|
1191
|
-
* For a Cart with `External` [TaxMode](ctp:api:type:TaxMode), the Tax Rate must be set with [ExternalTaxRateDraft](ctp:api:type:ExternalTaxRateDraft).
|
|
1192
|
-
*
|
|
1193
|
-
*/
|
|
1194
|
-
readonly perMethodTaxRate: MethodTaxRate[];
|
|
1195
|
-
/**
|
|
1196
|
-
* Identifies [Inventory entries](/../api/projects/inventory) that are reserved. The referenced Channel has the `InventorySupply` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum).
|
|
1197
|
-
*
|
|
1198
|
-
*
|
|
1199
|
-
*/
|
|
1200
|
-
readonly supplyChannel?: ChannelReference;
|
|
1201
|
-
/**
|
|
1202
|
-
* Used to [select](ctp:api:type:LineItemPriceSelection) a Product Price. The referenced Channel has the `ProductDistribution` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum).
|
|
1203
|
-
*
|
|
1204
|
-
*
|
|
1205
|
-
*/
|
|
1206
|
-
readonly distributionChannel?: ChannelReference;
|
|
1207
|
-
/**
|
|
1208
|
-
* Indicates how the Price for the Line Item is set.
|
|
1209
|
-
*
|
|
1210
|
-
*
|
|
1211
|
-
*/
|
|
1212
|
-
readonly priceMode: LineItemPriceMode;
|
|
1213
|
-
/**
|
|
1214
|
-
* Indicates how the Line Item is added to the Cart.
|
|
1215
|
-
*
|
|
1216
|
-
*
|
|
1217
|
-
*/
|
|
1218
|
-
readonly lineItemMode: LineItemMode;
|
|
1219
|
-
/**
|
|
1220
|
-
* Inventory mode specific to this Line Item only, and valid for the entire `quantity` of the Line Item.
|
|
1221
|
-
* Only present if the inventory mode is different from the `inventoryMode` specified on the [Cart](ctp:api:type:Cart).
|
|
1222
|
-
*
|
|
1223
|
-
*
|
|
1224
|
-
*/
|
|
1225
|
-
readonly inventoryMode?: InventoryMode;
|
|
1226
|
-
/**
|
|
1227
|
-
* Container for Line Item-specific addresses.
|
|
1228
|
-
*
|
|
1229
|
-
*
|
|
1230
|
-
*/
|
|
1231
|
-
readonly shippingDetails?: ItemShippingDetails;
|
|
1232
|
-
/**
|
|
1233
|
-
* Custom Fields of the Line Item.
|
|
1234
|
-
*
|
|
1235
|
-
*
|
|
1236
|
-
*/
|
|
1237
|
-
readonly custom?: CustomFields;
|
|
1238
|
-
/**
|
|
1239
|
-
* Date and time (UTC) the Line Item was added to the Cart.
|
|
1240
|
-
*
|
|
1241
|
-
*
|
|
1242
|
-
*/
|
|
1243
|
-
readonly addedAt?: string;
|
|
1244
|
-
/**
|
|
1245
|
-
* Date and time (UTC) the Line Item was last updated.
|
|
1246
|
-
*
|
|
1247
|
-
*
|
|
1248
|
-
*/
|
|
1249
|
-
readonly lastModifiedAt?: string;
|
|
1250
|
-
}
|
|
1251
|
-
/**
|
|
1252
|
-
* For Product Variant identification, either the `productId` and `variantId`, or `sku` must be provided.
|
|
1253
|
-
*
|
|
1254
|
-
*/
|
|
1255
|
-
export interface LineItemDraft {
|
|
1256
|
-
/**
|
|
1257
|
-
* User-defined unique identifier of the LineItem
|
|
1258
|
-
*
|
|
1259
|
-
*/
|
|
1260
|
-
readonly key?: string;
|
|
1261
|
-
/**
|
|
1262
|
-
* `id` of a published [Product](ctp:api:type:Product).
|
|
1263
|
-
*
|
|
1264
|
-
*
|
|
1265
|
-
*/
|
|
1266
|
-
readonly productId?: string;
|
|
1267
|
-
/**
|
|
1268
|
-
* `id` of the [ProductVariant](ctp:api:type:ProductVariant) in the Product.
|
|
1269
|
-
* If not provided, the Master Variant is used.
|
|
1270
|
-
*
|
|
1271
|
-
*
|
|
1272
|
-
*/
|
|
1273
|
-
readonly variantId?: number;
|
|
1274
|
-
/**
|
|
1275
|
-
* `sku` of the [ProductVariant](ctp:api:type:ProductVariant).
|
|
1276
|
-
*
|
|
1277
|
-
*
|
|
1278
|
-
*/
|
|
1279
|
-
readonly sku?: string;
|
|
1280
|
-
/**
|
|
1281
|
-
* Quantity of the Product Variant to add to the Cart.
|
|
1282
|
-
*
|
|
1283
|
-
*
|
|
1284
|
-
*/
|
|
1285
|
-
readonly quantity?: number;
|
|
1286
|
-
/**
|
|
1287
|
-
* Date and time (UTC) the Product Variant is added to the Cart.
|
|
1288
|
-
* If not set, it defaults to the current date and time.
|
|
1289
|
-
*
|
|
1290
|
-
* Optional for backwards compatibility reasons.
|
|
1291
|
-
*
|
|
1292
|
-
*
|
|
1293
|
-
*/
|
|
1294
|
-
readonly addedAt?: string;
|
|
1295
|
-
/**
|
|
1296
|
-
* Used to [select](ctp:api:type:LineItemPriceSelection) a Product Price.
|
|
1297
|
-
* The referenced Channel must have the `ProductDistribution` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum).
|
|
1298
|
-
*
|
|
1299
|
-
* If the Cart is bound to a [Store](ctp:api:type:Store) with `distributionChannels` set,
|
|
1300
|
-
* the Channel must match one of the Store's distribution channels.
|
|
1301
|
-
*
|
|
1302
|
-
*
|
|
1303
|
-
*/
|
|
1304
|
-
readonly distributionChannel?: ChannelResourceIdentifier;
|
|
1305
|
-
/**
|
|
1306
|
-
* Used to identify [Inventory entries](/../api/projects/inventory) that must be reserved.
|
|
1307
|
-
* The referenced Channel must have the `InventorySupply` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum).
|
|
1308
|
-
*
|
|
1309
|
-
*
|
|
1310
|
-
*/
|
|
1311
|
-
readonly supplyChannel?: ChannelResourceIdentifier;
|
|
1312
|
-
/**
|
|
1313
|
-
* Sets the [LineItem](ctp:api:type:LineItem) `price` value, and the `priceMode` to `ExternalPrice` [LineItemPriceMode](ctp:api:type:LineItemPriceMode).
|
|
1314
|
-
*
|
|
1315
|
-
*
|
|
1316
|
-
*/
|
|
1317
|
-
readonly externalPrice?: _Money;
|
|
1318
|
-
/**
|
|
1319
|
-
* Sets the [LineItem](ctp:api:type:LineItem) `price` and `totalPrice` values, and the `priceMode` to `ExternalTotal` [LineItemPriceMode](ctp:api:type:LineItemPriceMode).
|
|
1320
|
-
*
|
|
1321
|
-
*
|
|
1322
|
-
*/
|
|
1323
|
-
readonly externalTotalPrice?: ExternalLineItemTotalPrice;
|
|
1324
|
-
/**
|
|
1325
|
-
* External Tax Rate for the Line Item if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode).
|
|
1326
|
-
*
|
|
1327
|
-
*
|
|
1328
|
-
*/
|
|
1329
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
1330
|
-
/**
|
|
1331
|
-
* Inventory mode specific to the Line Item only, and valid for the entire `quantity` of the Line Item.
|
|
1332
|
-
* Set only if the inventory mode should be different from the `inventoryMode` specified on the [Cart](ctp:api:type:Cart).
|
|
1333
|
-
*
|
|
1334
|
-
*
|
|
1335
|
-
*/
|
|
1336
|
-
readonly inventoryMode?: InventoryMode;
|
|
1337
|
-
/**
|
|
1338
|
-
* Container for Line Item-specific addresses.
|
|
1339
|
-
*
|
|
1340
|
-
*
|
|
1341
|
-
*/
|
|
1342
|
-
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
1343
|
-
/**
|
|
1344
|
-
* Custom Fields for the Line Item.
|
|
1345
|
-
*
|
|
1346
|
-
*
|
|
1347
|
-
*/
|
|
1348
|
-
readonly custom?: CustomFieldsDraft;
|
|
1349
|
-
}
|
|
1350
|
-
/**
|
|
1351
|
-
* Indicates how a Line Item is added to a Cart.
|
|
1352
|
-
*
|
|
1353
|
-
*/
|
|
1354
|
-
export type LineItemMode = 'GiftLineItem' | 'Standard' | string;
|
|
1355
|
-
/**
|
|
1356
|
-
* This mode indicates how the price is set for the Line Item.
|
|
1357
|
-
*
|
|
1358
|
-
*/
|
|
1359
|
-
export type LineItemPriceMode = 'ExternalPrice' | 'ExternalTotal' | 'Platform' | string;
|
|
1360
|
-
export interface MethodTaxRate {
|
|
1361
|
-
/**
|
|
1362
|
-
* User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
1363
|
-
*
|
|
1364
|
-
*
|
|
1365
|
-
*/
|
|
1366
|
-
readonly shippingMethodKey: string;
|
|
1367
|
-
/**
|
|
1368
|
-
* Tax Rate for the Shipping Method.
|
|
1369
|
-
*
|
|
1370
|
-
*
|
|
1371
|
-
*/
|
|
1372
|
-
readonly taxRate?: TaxRate;
|
|
1373
|
-
}
|
|
1374
|
-
export interface MethodTaxedPrice {
|
|
1375
|
-
/**
|
|
1376
|
-
* User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
1377
|
-
*
|
|
1378
|
-
*
|
|
1379
|
-
*/
|
|
1380
|
-
readonly shippingMethodKey: string;
|
|
1381
|
-
/**
|
|
1382
|
-
* Taxed price for the Shipping Method.
|
|
1383
|
-
*
|
|
1384
|
-
*
|
|
1385
|
-
*/
|
|
1386
|
-
readonly taxedPrice?: TaxedItemPrice;
|
|
1387
|
-
}
|
|
1388
|
-
/**
|
|
1389
|
-
* Used for [replicating an existing Cart](/../api/projects/carts#replicate-cart) or Order.
|
|
1390
|
-
*
|
|
1391
|
-
*/
|
|
1392
|
-
export interface ReplicaCartDraft {
|
|
1393
|
-
/**
|
|
1394
|
-
* [Reference](ctp:api:type:Reference) to a [Cart](ctp:api:type:Cart) or [Order](ctp:api:type:Order) that is replicated.
|
|
1395
|
-
*
|
|
1396
|
-
*
|
|
1397
|
-
*/
|
|
1398
|
-
readonly reference: CartReference | OrderReference;
|
|
1399
|
-
/**
|
|
1400
|
-
* User-defined unique identifier for the Cart.
|
|
1401
|
-
*
|
|
1402
|
-
*
|
|
1403
|
-
*/
|
|
1404
|
-
readonly key?: string;
|
|
1405
|
-
}
|
|
1406
|
-
/**
|
|
1407
|
-
* Determines how monetary values are rounded.
|
|
1408
|
-
*
|
|
1409
|
-
*/
|
|
1410
|
-
export type RoundingMode = 'HalfDown' | 'HalfEven' | 'HalfUp' | string;
|
|
1411
|
-
export interface Shipping {
|
|
1412
|
-
/**
|
|
1413
|
-
* User-defined unique identifier of the Shipping in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
1414
|
-
*
|
|
1415
|
-
*
|
|
1416
|
-
*/
|
|
1417
|
-
readonly shippingKey: string;
|
|
1418
|
-
/**
|
|
1419
|
-
* Automatically set when the [Shipping Method is added](ctp:api:type:CartAddShippingMethodAction).
|
|
1420
|
-
*
|
|
1421
|
-
*
|
|
1422
|
-
*/
|
|
1423
|
-
readonly shippingInfo: ShippingInfo;
|
|
1424
|
-
/**
|
|
1425
|
-
* Determines the shipping rates and Tax Rates of associated Line Items.
|
|
1426
|
-
*
|
|
1427
|
-
*
|
|
1428
|
-
*/
|
|
1429
|
-
readonly shippingAddress: Address;
|
|
1430
|
-
/**
|
|
1431
|
-
* Used as an input to select a [ShippingRatePriceTier](ctp:api:type:ShippingRatePriceTier).
|
|
1432
|
-
* The data type of this field depends on the `shippingRateInputType.type` configured in the [Project](ctp:api:type:Project):
|
|
1433
|
-
*
|
|
1434
|
-
* - If `CartClassification`, it is [ClassificationShippingRateInput](ctp:api:type:ClassificationShippingRateInput).
|
|
1435
|
-
* - If `CartScore`, it is [ScoreShippingRateInput](ctp:api:type:ScoreShippingRateInput).
|
|
1436
|
-
* - If `CartValue`, it cannot be used.
|
|
1437
|
-
*
|
|
1438
|
-
*
|
|
1439
|
-
*/
|
|
1440
|
-
readonly shippingRateInput?: ShippingRateInput;
|
|
1441
|
-
/**
|
|
1442
|
-
* Custom Fields of Shipping with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
1443
|
-
*
|
|
1444
|
-
*
|
|
1445
|
-
*/
|
|
1446
|
-
readonly shippingCustomFields?: CustomFields;
|
|
1447
|
-
}
|
|
1448
|
-
/**
|
|
1449
|
-
* Wraps all shipping-related information (such as address, rate, deliveries) per Shipping Method for Carts with multiple Shipping Methods.
|
|
1450
|
-
*
|
|
1451
|
-
*/
|
|
1452
|
-
export interface ShippingDraft {
|
|
1453
|
-
/**
|
|
1454
|
-
* User-defined unique identifier for the Shipping in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
1455
|
-
*
|
|
1456
|
-
*
|
|
1457
|
-
*/
|
|
1458
|
-
readonly key: string;
|
|
1459
|
-
/**
|
|
1460
|
-
* Shipping Methods added to the Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
1461
|
-
*
|
|
1462
|
-
*
|
|
1463
|
-
*/
|
|
1464
|
-
readonly shippingMethod?: ShippingMethodReference;
|
|
1465
|
-
/**
|
|
1466
|
-
* Determines the shipping rate and Tax Rate of the associated Line Items.
|
|
1467
|
-
*
|
|
1468
|
-
*
|
|
1469
|
-
*/
|
|
1470
|
-
readonly shippingAddress: _BaseAddress;
|
|
1471
|
-
/**
|
|
1472
|
-
* Input used to select a [ShippingRatePriceTier](ctp:api:type:ShippingRatePriceTier).
|
|
1473
|
-
* The data type of this field depends on the `shippingRateInputType.type` configured in the [Project](ctp:api:type:Project):
|
|
1474
|
-
*
|
|
1475
|
-
* - If `CartClassification`, it must be [ClassificationShippingRateInputDraft](ctp:api:type:ClassificationShippingRateInputDraft).
|
|
1476
|
-
* - If `CartScore`, it must be [ScoreShippingRateInputDraft](ctp:api:type:ScoreShippingRateInputDraft).
|
|
1477
|
-
* - If `CartValue`, it cannot be set.
|
|
1478
|
-
*
|
|
1479
|
-
*
|
|
1480
|
-
*/
|
|
1481
|
-
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
1482
|
-
/**
|
|
1483
|
-
* Tax Rate used for taxing a shipping expense if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode).
|
|
1484
|
-
*
|
|
1485
|
-
*
|
|
1486
|
-
*/
|
|
1487
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
1488
|
-
/**
|
|
1489
|
-
* Deliveries to be shipped with the Shipping Method.
|
|
1490
|
-
*
|
|
1491
|
-
*
|
|
1492
|
-
*/
|
|
1493
|
-
readonly deliveries?: DeliveryDraft[];
|
|
1494
|
-
/**
|
|
1495
|
-
* Custom Fields for Shipping.
|
|
1496
|
-
*
|
|
1497
|
-
*
|
|
1498
|
-
*/
|
|
1499
|
-
readonly custom?: CustomFieldsDraft;
|
|
1500
|
-
}
|
|
1501
|
-
export interface ShippingInfo {
|
|
1502
|
-
/**
|
|
1503
|
-
* Name of the Shipping Method.
|
|
1504
|
-
*
|
|
1505
|
-
*
|
|
1506
|
-
*/
|
|
1507
|
-
readonly shippingMethodName: string;
|
|
1508
|
-
/**
|
|
1509
|
-
* Determined based on the [ShippingRate](ctp:api:type:ShippingRate) and its tiered prices, and either the sum of [LineItem](ctp:api:type:LineItem) prices or the `shippingRateInput` field.
|
|
1510
|
-
*
|
|
1511
|
-
*
|
|
1512
|
-
*/
|
|
1513
|
-
readonly price: CentPrecisionMoney;
|
|
1514
|
-
/**
|
|
1515
|
-
* Used to determine the price.
|
|
1516
|
-
*
|
|
1517
|
-
*
|
|
1518
|
-
*/
|
|
1519
|
-
readonly shippingRate: ShippingRate;
|
|
1520
|
-
/**
|
|
1521
|
-
* Automatically set after the `taxRate` is set.
|
|
1522
|
-
*
|
|
1523
|
-
*
|
|
1524
|
-
*/
|
|
1525
|
-
readonly taxedPrice?: TaxedItemPrice;
|
|
1526
|
-
/**
|
|
1527
|
-
* Automatically set in the `Platform` [TaxMode](ctp:api:type:TaxMode) after the [shipping address is set](ctp:api:type:CartSetShippingAddressAction).
|
|
1528
|
-
*
|
|
1529
|
-
* For the `External` [TaxMode](ctp:api:type:TaxMode) the Tax Rate must be set explicitly with the [ExternalTaxRateDraft](ctp:api:type:ExternalTaxRateDraft).
|
|
1530
|
-
*
|
|
1531
|
-
*
|
|
1532
|
-
*/
|
|
1533
|
-
readonly taxRate?: TaxRate;
|
|
1534
|
-
/**
|
|
1535
|
-
* Used to select a Tax Rate when a Cart has the `Platform` [TaxMode](ctp:api:type:TaxMode).
|
|
1536
|
-
*
|
|
1537
|
-
*
|
|
1538
|
-
*/
|
|
1539
|
-
readonly taxCategory?: TaxCategoryReference;
|
|
1540
|
-
/**
|
|
1541
|
-
* Not set if a custom Shipping Method is used.
|
|
1542
|
-
*
|
|
1543
|
-
*
|
|
1544
|
-
*/
|
|
1545
|
-
readonly shippingMethod?: ShippingMethodReference;
|
|
1546
|
-
/**
|
|
1547
|
-
* Information on how items are delivered to customers.
|
|
1548
|
-
*
|
|
1549
|
-
*
|
|
1550
|
-
*/
|
|
1551
|
-
readonly deliveries?: Delivery[];
|
|
1552
|
-
/**
|
|
1553
|
-
* Discounted price of the Shipping Method.
|
|
1554
|
-
*
|
|
1555
|
-
*
|
|
1556
|
-
*/
|
|
1557
|
-
readonly discountedPrice?: DiscountedLineItemPrice;
|
|
1558
|
-
/**
|
|
1559
|
-
* Indicates whether the [ShippingMethod](ctp:api:type:ShippingMethod) referenced in this ShippingInfo is allowed for the Cart.
|
|
1560
|
-
*
|
|
1561
|
-
*
|
|
1562
|
-
*/
|
|
1563
|
-
readonly shippingMethodState: ShippingMethodState;
|
|
1564
|
-
}
|
|
1565
|
-
/**
|
|
1566
|
-
* Determines whether a [ShippingMethod](ctp:api:type:ShippingMethod) is allowed for a Cart.
|
|
1567
|
-
*
|
|
1568
|
-
*/
|
|
1569
|
-
export type ShippingMethodState = 'DoesNotMatchCart' | 'MatchesCart' | string;
|
|
1570
|
-
export type ShippingMode = 'Multiple' | 'Single' | string;
|
|
1571
|
-
export type ShippingRateInput = ClassificationShippingRateInput | ScoreShippingRateInput;
|
|
1572
|
-
export interface ClassificationShippingRateInput {
|
|
1573
|
-
readonly type: 'Classification';
|
|
1574
|
-
/**
|
|
1575
|
-
* Key of the value used as a programmatic identifier.
|
|
1576
|
-
*
|
|
1577
|
-
*
|
|
1578
|
-
*/
|
|
1579
|
-
readonly key: string;
|
|
1580
|
-
/**
|
|
1581
|
-
* Descriptive localized label of the value.
|
|
1582
|
-
*
|
|
1583
|
-
*
|
|
1584
|
-
*/
|
|
1585
|
-
readonly label: LocalizedString;
|
|
1586
|
-
}
|
|
1587
|
-
export interface ScoreShippingRateInput {
|
|
1588
|
-
readonly type: 'Score';
|
|
1589
|
-
/**
|
|
1590
|
-
* Abstract value for categorizing a Cart.
|
|
1591
|
-
*
|
|
1592
|
-
*
|
|
1593
|
-
*/
|
|
1594
|
-
readonly score: number;
|
|
1595
|
-
}
|
|
1596
|
-
/**
|
|
1597
|
-
* Generic type holding specifc ShippingRateInputDraft types.
|
|
1598
|
-
*/
|
|
1599
|
-
export type ShippingRateInputDraft = ClassificationShippingRateInputDraft | ScoreShippingRateInputDraft;
|
|
1600
|
-
export interface ClassificationShippingRateInputDraft {
|
|
1601
|
-
readonly type: 'Classification';
|
|
1602
|
-
/**
|
|
1603
|
-
* Key of the value used as a programmatic identifier.
|
|
1604
|
-
*
|
|
1605
|
-
*
|
|
1606
|
-
*/
|
|
1607
|
-
readonly key: string;
|
|
1608
|
-
}
|
|
1609
|
-
export interface ScoreShippingRateInputDraft {
|
|
1610
|
-
readonly type: 'Score';
|
|
1611
|
-
/**
|
|
1612
|
-
* Abstract value for categorizing a Cart.
|
|
1613
|
-
*
|
|
1614
|
-
*
|
|
1615
|
-
*/
|
|
1616
|
-
readonly score: number;
|
|
1617
|
-
}
|
|
1618
|
-
/**
|
|
1619
|
-
* Determines in which [Tax calculation mode](/carts-orders-overview#tax-calculation-mode) taxed prices are calculated.
|
|
1620
|
-
*
|
|
1621
|
-
*/
|
|
1622
|
-
export type TaxCalculationMode = 'LineItemLevel' | 'UnitPriceLevel' | string;
|
|
1623
|
-
/**
|
|
1624
|
-
* Indicates how taxes are set on the Cart.
|
|
1625
|
-
*
|
|
1626
|
-
*/
|
|
1627
|
-
export type TaxMode = 'Disabled' | 'External' | 'ExternalAmount' | 'Platform' | string;
|
|
1628
|
-
/**
|
|
1629
|
-
* The tax portions are calculated from the [TaxRates](ctp:api:type:TaxRate).
|
|
1630
|
-
* If a Tax Rate has [SubRates](ctp:api:type:SubRate), they are used and can be identified by name.
|
|
1631
|
-
* Tax portions from Line Items with the same `rate` and `name` are accumulated to the same tax portion.
|
|
1632
|
-
*
|
|
1633
|
-
*/
|
|
1634
|
-
export interface TaxPortion {
|
|
1635
|
-
/**
|
|
1636
|
-
* Name of the tax portion.
|
|
1637
|
-
*
|
|
1638
|
-
*
|
|
1639
|
-
*/
|
|
1640
|
-
readonly name?: string;
|
|
1641
|
-
/**
|
|
1642
|
-
* A number in the range 0-1.
|
|
1643
|
-
*
|
|
1644
|
-
*
|
|
1645
|
-
*/
|
|
1646
|
-
readonly rate: number;
|
|
1647
|
-
/**
|
|
1648
|
-
* Money value of the tax portion.
|
|
1649
|
-
*
|
|
1650
|
-
*
|
|
1651
|
-
*/
|
|
1652
|
-
readonly amount: CentPrecisionMoney;
|
|
1653
|
-
}
|
|
1654
|
-
/**
|
|
1655
|
-
* Represents the portions that sum up to the `totalGross` field of a [TaxedPrice](ctp:api:type:TaxedPrice).
|
|
1656
|
-
*
|
|
1657
|
-
* The portions are calculated from the [TaxRates](ctp:api:type:TaxRate).
|
|
1658
|
-
* If a Tax Rate has [SubRates](ctp:api:type:SubRate), they are used and can be identified by name.
|
|
1659
|
-
* Tax portions from Line Items with the same `rate` and `name` will be accumulated to the same tax portion.
|
|
1660
|
-
*
|
|
1661
|
-
*/
|
|
1662
|
-
export interface TaxPortionDraft {
|
|
1663
|
-
/**
|
|
1664
|
-
* Name of the tax portion.
|
|
1665
|
-
*
|
|
1666
|
-
*
|
|
1667
|
-
*/
|
|
1668
|
-
readonly name?: string;
|
|
1669
|
-
/**
|
|
1670
|
-
* A number in the range 0-1.
|
|
1671
|
-
*
|
|
1672
|
-
*
|
|
1673
|
-
*/
|
|
1674
|
-
readonly rate: number;
|
|
1675
|
-
/**
|
|
1676
|
-
* Money value for the tax portion.
|
|
1677
|
-
*
|
|
1678
|
-
*
|
|
1679
|
-
*/
|
|
1680
|
-
readonly amount: _Money;
|
|
1681
|
-
}
|
|
1682
|
-
export interface TaxedItemPrice {
|
|
1683
|
-
/**
|
|
1684
|
-
* Total net amount of the Line Item or Custom Line Item.
|
|
1685
|
-
*
|
|
1686
|
-
*
|
|
1687
|
-
*/
|
|
1688
|
-
readonly totalNet: CentPrecisionMoney;
|
|
1689
|
-
/**
|
|
1690
|
-
* Total gross amount of the Line Item or Custom Line Item.
|
|
1691
|
-
*
|
|
1692
|
-
*
|
|
1693
|
-
*/
|
|
1694
|
-
readonly totalGross: CentPrecisionMoney;
|
|
1695
|
-
/**
|
|
1696
|
-
* Total tax applicable for the Line Item or Custom Line Item.
|
|
1697
|
-
* Automatically calculated as the difference between the `totalGross` and `totalNet` values.
|
|
1698
|
-
*
|
|
1699
|
-
*
|
|
1700
|
-
*/
|
|
1701
|
-
readonly totalTax?: CentPrecisionMoney;
|
|
1702
|
-
}
|
|
1703
|
-
export interface TaxedPrice {
|
|
1704
|
-
/**
|
|
1705
|
-
* Total net price of the Cart or Order.
|
|
1706
|
-
*
|
|
1707
|
-
*
|
|
1708
|
-
*/
|
|
1709
|
-
readonly totalNet: CentPrecisionMoney;
|
|
1710
|
-
/**
|
|
1711
|
-
* Total gross price of the Cart or Order.
|
|
1712
|
-
*
|
|
1713
|
-
*
|
|
1714
|
-
*/
|
|
1715
|
-
readonly totalGross: CentPrecisionMoney;
|
|
1716
|
-
/**
|
|
1717
|
-
* Taxable portions added to the total net price.
|
|
1718
|
-
*
|
|
1719
|
-
* Calculated from the [TaxRates](ctp:api:type:TaxRate).
|
|
1720
|
-
*
|
|
1721
|
-
*
|
|
1722
|
-
*/
|
|
1723
|
-
readonly taxPortions: TaxPortion[];
|
|
1724
|
-
/**
|
|
1725
|
-
* Total tax applicable for the Cart or Order.
|
|
1726
|
-
*
|
|
1727
|
-
* Automatically calculated as the difference between the `totalGross` and `totalNet` values.
|
|
1728
|
-
*
|
|
1729
|
-
*
|
|
1730
|
-
*/
|
|
1731
|
-
readonly totalTax?: CentPrecisionMoney;
|
|
1732
|
-
}
|
|
1733
|
-
export interface TaxedPriceDraft {
|
|
1734
|
-
/**
|
|
1735
|
-
* Total net price of the Line Item or Custom Line Item.
|
|
1736
|
-
*
|
|
1737
|
-
*
|
|
1738
|
-
*/
|
|
1739
|
-
readonly totalNet: _Money;
|
|
1740
|
-
/**
|
|
1741
|
-
* Total gross price of the Line Item or Custom Line Item.
|
|
1742
|
-
*
|
|
1743
|
-
*
|
|
1744
|
-
*/
|
|
1745
|
-
readonly totalGross: _Money;
|
|
1746
|
-
/**
|
|
1747
|
-
* Taxable portions added to the `totalGross`.
|
|
1748
|
-
*
|
|
1749
|
-
* Calculated from the [TaxRates](ctp:api:type:TaxRate).
|
|
1750
|
-
*
|
|
1751
|
-
*
|
|
1752
|
-
*/
|
|
1753
|
-
readonly taxPortions: TaxPortionDraft[];
|
|
1754
|
-
}
|
|
1755
|
-
/**
|
|
1756
|
-
* If the Cart already contains a [CustomLineItem](ctp:api:type:CustomLineItem) with the same `slug`, `name`, `money`, `taxCategory`, `state`,
|
|
1757
|
-
* and Custom Fields, then only the quantity of the existing Custom Line Item is increased.
|
|
1758
|
-
* If [CustomLineItem](ctp:api:type:CustomLineItem) `shippingDetails` are set, they are merged with the `targets` that already exist on the
|
|
1759
|
-
* [ItemShippingDetails](ctp:api:type:ItemShippingDetails) of the Custom Line Item.
|
|
1760
|
-
* In case of overlapping address keys the [ItemShippingTarget](ctp:api:type:ItemShippingTarget) `quantity` is summed up.
|
|
1761
|
-
*
|
|
1762
|
-
* If the Cart already contains a Custom Line Item with the same slug that is otherwise not identical, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned.
|
|
1763
|
-
*
|
|
1764
|
-
* If the Tax Rate is not set, a [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) error is returned.
|
|
1765
|
-
*
|
|
1766
|
-
*/
|
|
1767
|
-
export interface CartAddCustomLineItemAction {
|
|
1768
|
-
readonly action: 'addCustomLineItem';
|
|
1769
|
-
/**
|
|
1770
|
-
* Money value of the Custom Line Item.
|
|
1771
|
-
* The value can be negative.
|
|
1772
|
-
*
|
|
1773
|
-
*
|
|
1774
|
-
*/
|
|
1775
|
-
readonly money: _Money;
|
|
1776
|
-
/**
|
|
1777
|
-
* Name of the Custom Line Item.
|
|
1778
|
-
*
|
|
1779
|
-
*
|
|
1780
|
-
*/
|
|
1781
|
-
readonly name: LocalizedString;
|
|
1782
|
-
/**
|
|
1783
|
-
* Number of Custom Line Items to add to the Cart.
|
|
1784
|
-
*
|
|
1785
|
-
*
|
|
1786
|
-
*/
|
|
1787
|
-
readonly quantity?: number;
|
|
1788
|
-
/**
|
|
1789
|
-
* User-defined identifier used in a deep-link URL for the Custom Line Item.
|
|
1790
|
-
* It must match the pattern `[a-zA-Z0-9_-]{2,256}`.
|
|
1791
|
-
*
|
|
1792
|
-
*
|
|
1793
|
-
*/
|
|
1794
|
-
readonly slug: string;
|
|
1795
|
-
/**
|
|
1796
|
-
* Used to select a Tax Rate when a Cart has the `Platform` [TaxMode](ctp:api:type:TaxMode).
|
|
1797
|
-
*
|
|
1798
|
-
* If [TaxMode](ctp:api:type:TaxMode) is `Platform`, this field must not be empty.
|
|
1799
|
-
*
|
|
1800
|
-
*
|
|
1801
|
-
*/
|
|
1802
|
-
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
1803
|
-
/**
|
|
1804
|
-
* An external Tax Rate can be set if the Cart has `External` [TaxMode](ctp:api:type:TaxMode).
|
|
1805
|
-
*
|
|
1806
|
-
*
|
|
1807
|
-
*/
|
|
1808
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
1809
|
-
/**
|
|
1810
|
-
* Container for Custom Line Item-specific addresses.
|
|
1811
|
-
*
|
|
1812
|
-
*
|
|
1813
|
-
*/
|
|
1814
|
-
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
1815
|
-
/**
|
|
1816
|
-
* Custom Fields for the Custom Line Item.
|
|
1817
|
-
*
|
|
1818
|
-
*
|
|
1819
|
-
*/
|
|
1820
|
-
readonly custom?: CustomFieldsDraft;
|
|
1821
|
-
/**
|
|
1822
|
-
* - If `Standard`, Cart Discounts with a matching [CartDiscountCustomLineItemsTarget](ctp:api:type:CartDiscountCustomLineItemsTarget)
|
|
1823
|
-
* are applied to the Custom Line Item.
|
|
1824
|
-
* - If `External`, Cart Discounts are not considered on the Custom Line Item.
|
|
1825
|
-
*
|
|
1826
|
-
*
|
|
1827
|
-
*/
|
|
1828
|
-
readonly priceMode?: CustomLineItemPriceMode;
|
|
1829
|
-
}
|
|
1830
|
-
/**
|
|
1831
|
-
* To add a custom Shipping Method (independent of the [ShippingMethods](ctp:api:type:ShippingMethod) managed through
|
|
1832
|
-
* the [Shipping Methods API](/projects/shippingMethods)) to the Cart, it **must have** the `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
1833
|
-
*
|
|
1834
|
-
*/
|
|
1835
|
-
export interface CartAddCustomShippingMethodAction {
|
|
1836
|
-
readonly action: 'addCustomShippingMethod';
|
|
1837
|
-
/**
|
|
1838
|
-
* User-defined identifier for the custom Shipping Method that must be unique across the Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
1839
|
-
*
|
|
1840
|
-
*
|
|
1841
|
-
*/
|
|
1842
|
-
readonly shippingKey: string;
|
|
1843
|
-
/**
|
|
1844
|
-
* Name of the custom Shipping Method.
|
|
1845
|
-
*
|
|
1846
|
-
*
|
|
1847
|
-
*/
|
|
1848
|
-
readonly shippingMethodName: string;
|
|
1849
|
-
/**
|
|
1850
|
-
* Determines the shipping rate and Tax Rate of the associated Line Items.
|
|
1851
|
-
*
|
|
1852
|
-
*
|
|
1853
|
-
*/
|
|
1854
|
-
readonly shippingAddress: _BaseAddress;
|
|
1855
|
-
/**
|
|
1856
|
-
* Determines the shipping price.
|
|
1857
|
-
*
|
|
1858
|
-
*
|
|
1859
|
-
*/
|
|
1860
|
-
readonly shippingRate: ShippingRateDraft;
|
|
1861
|
-
/**
|
|
1862
|
-
* Input used to select a [ShippingRatePriceTier](ctp:api:type:ShippingRatePriceTier).
|
|
1863
|
-
* The data type of this field depends on the `shippingRateInputType.type` configured in the [Project](ctp:api:type:Project):
|
|
1864
|
-
*
|
|
1865
|
-
* - If `CartClassification`, it must be [ClassificationShippingRateInputDraft](ctp:api:type:ClassificationShippingRateInputDraft).
|
|
1866
|
-
* - If `CartScore`, it must be [ScoreShippingRateInputDraft](ctp:api:type:ScoreShippingRateInputDraft).
|
|
1867
|
-
* - If `CartValue`, it cannot be set.
|
|
1868
|
-
*
|
|
1869
|
-
*
|
|
1870
|
-
*/
|
|
1871
|
-
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
1872
|
-
/**
|
|
1873
|
-
* Tax Category used to determine a shipping Tax Rate if the Cart has the `Platform` [TaxMode](ctp:api:type:TaxMode).
|
|
1874
|
-
*
|
|
1875
|
-
*
|
|
1876
|
-
*/
|
|
1877
|
-
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
1878
|
-
/**
|
|
1879
|
-
* Tax Rate used to tax a shipping expense if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode).
|
|
1880
|
-
*
|
|
1881
|
-
*
|
|
1882
|
-
*/
|
|
1883
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
1884
|
-
/**
|
|
1885
|
-
* Deliveries to be shipped with the custom Shipping Method.
|
|
1886
|
-
*
|
|
1887
|
-
*
|
|
1888
|
-
*/
|
|
1889
|
-
readonly deliveries?: DeliveryDraft[];
|
|
1890
|
-
/**
|
|
1891
|
-
* Custom Fields for the custom Shipping Method.
|
|
1892
|
-
*
|
|
1893
|
-
*
|
|
1894
|
-
*/
|
|
1895
|
-
readonly custom?: CustomFieldsDraft;
|
|
1896
|
-
}
|
|
1897
|
-
/**
|
|
1898
|
-
* Adds a [DiscountCode](ctp:api:type:DiscountCode) to the Cart to activate the related [Cart Discounts](/../api/projects/cartDiscounts).
|
|
1899
|
-
* Adding a Discount Code is only possible if no [DirectDiscount](ctp:api:type:DirectDiscount) has been applied to the Cart.
|
|
1900
|
-
* Discount Codes can be added to [frozen Carts](ctp:api:type:FrozenCarts), but their [DiscountCodeState](ctp:api:type:DiscountCodeState) is then `DoesNotMatchCart`.
|
|
1901
|
-
*
|
|
1902
|
-
* The maximum number of Discount Codes in a Cart is restricted by a [limit](/../api/limits#carts).
|
|
1903
|
-
*
|
|
1904
|
-
* Specific Error Code: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
|
|
1905
|
-
*
|
|
1906
|
-
*/
|
|
1907
|
-
export interface CartAddDiscountCodeAction {
|
|
1908
|
-
readonly action: 'addDiscountCode';
|
|
1909
|
-
/**
|
|
1910
|
-
* `code` of a [DiscountCode](ctp:api:type:DiscountCode).
|
|
1911
|
-
*
|
|
1912
|
-
*
|
|
1913
|
-
*/
|
|
1914
|
-
readonly code: string;
|
|
1915
|
-
}
|
|
1916
|
-
/**
|
|
1917
|
-
* Adds an address to a Cart when shipping to multiple addresses is desired.
|
|
1918
|
-
*
|
|
1919
|
-
*/
|
|
1920
|
-
export interface CartAddItemShippingAddressAction {
|
|
1921
|
-
readonly action: 'addItemShippingAddress';
|
|
1922
|
-
/**
|
|
1923
|
-
* Address to append to `itemShippingAddresses`.
|
|
1924
|
-
*
|
|
1925
|
-
* The new Address must have a `key` that is unique accross this Cart.
|
|
1926
|
-
*
|
|
1927
|
-
*
|
|
1928
|
-
*/
|
|
1929
|
-
readonly address: _BaseAddress;
|
|
1930
|
-
}
|
|
1931
|
-
/**
|
|
1932
|
-
* If the Cart contains a [LineItem](ctp:api:type:LineItem) for a Product Variant with the same [LineItemMode](ctp:api:type:LineItemMode), [Custom Fields](/../api/projects/custom-fields), supply and distribution channel, then only the quantity of the existing Line Item is increased.
|
|
1933
|
-
* If [LineItem](ctp:api:type:LineItem) `shippingDetails` is set, it is merged. All addresses will be present afterwards and, for address keys present in both shipping details, the quantity will be summed up.
|
|
1934
|
-
* A new Line Item is added when the `externalPrice` or `externalTotalPrice` is set in this update action.
|
|
1935
|
-
* The [LineItem](ctp:api:type:LineItem) price is set as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection).
|
|
1936
|
-
*
|
|
1937
|
-
* If the Tax Rate is not set, a [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) error is returned.
|
|
1938
|
-
*
|
|
1939
|
-
* If the Line Items do not have a Price according to the [Product](ctp:api:type:Product) `priceMode` value for a selected currency and/or country, Customer Group, or Channel, a [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) error is returned.
|
|
1940
|
-
*
|
|
1941
|
-
*/
|
|
1942
|
-
export interface CartAddLineItemAction {
|
|
1943
|
-
readonly action: 'addLineItem';
|
|
1944
|
-
/**
|
|
1945
|
-
* User-defined unique identifier of the LineItem.
|
|
1946
|
-
*
|
|
1947
|
-
*
|
|
1948
|
-
*/
|
|
1949
|
-
readonly key?: string;
|
|
1950
|
-
/**
|
|
1951
|
-
* `id` of the published [Product](ctp:api:type:Product).
|
|
1952
|
-
*
|
|
1953
|
-
* Either the `productId` and `variantId`, or `sku` must be provided.
|
|
1954
|
-
*
|
|
1955
|
-
*
|
|
1956
|
-
*/
|
|
1957
|
-
readonly productId?: string;
|
|
1958
|
-
/**
|
|
1959
|
-
* `id` of the [ProductVariant](ctp:api:type:ProductVariant) in the Product.
|
|
1960
|
-
* If not provided, the Master Variant is used.
|
|
1961
|
-
*
|
|
1962
|
-
* Either the `productId` and `variantId`, or `sku` must be provided.
|
|
1963
|
-
*
|
|
1964
|
-
*
|
|
1965
|
-
*/
|
|
1966
|
-
readonly variantId?: number;
|
|
1967
|
-
/**
|
|
1968
|
-
* SKU of the [ProductVariant](ctp:api:type:ProductVariant).
|
|
1969
|
-
*
|
|
1970
|
-
* Either the `productId` and `variantId`, or `sku` must be provided.
|
|
1971
|
-
*
|
|
1972
|
-
*
|
|
1973
|
-
*/
|
|
1974
|
-
readonly sku?: string;
|
|
1975
|
-
/**
|
|
1976
|
-
* Quantity of the Product Variant to add to the Cart.
|
|
1977
|
-
*
|
|
1978
|
-
*
|
|
1979
|
-
*/
|
|
1980
|
-
readonly quantity?: number;
|
|
1981
|
-
/**
|
|
1982
|
-
* Date and time (UTC) the Product Variant is added to the Cart.
|
|
1983
|
-
* If not set, it defaults to the current date and time.
|
|
1984
|
-
*
|
|
1985
|
-
* Optional for backwards compatibility reasons.
|
|
1986
|
-
*
|
|
1987
|
-
*
|
|
1988
|
-
*/
|
|
1989
|
-
readonly addedAt?: string;
|
|
1990
|
-
/**
|
|
1991
|
-
* Used to [select](ctp:api:type:LineItemPriceSelection) a Product Price.
|
|
1992
|
-
* The Channel must have the `ProductDistribution` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum).
|
|
1993
|
-
* If the Cart is bound to a [Store](ctp:api:type:Store) with `distributionChannels` set, the Channel must match one of the Store's distribution channels.
|
|
1994
|
-
*
|
|
1995
|
-
*
|
|
1996
|
-
*/
|
|
1997
|
-
readonly distributionChannel?: ChannelResourceIdentifier;
|
|
1998
|
-
/**
|
|
1999
|
-
* Used to identify [Inventory entries](/../api/projects/inventory) that must be reserved.
|
|
2000
|
-
* The Channel must have the `InventorySupply` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum).
|
|
2001
|
-
*
|
|
2002
|
-
*
|
|
2003
|
-
*/
|
|
2004
|
-
readonly supplyChannel?: ChannelResourceIdentifier;
|
|
2005
|
-
/**
|
|
2006
|
-
* Sets the [LineItem](ctp:api:type:LineItem) `price` value, and the `priceMode` to `ExternalPrice` [LineItemPriceMode](ctp:api:type:LineItemPriceMode).
|
|
2007
|
-
*
|
|
2008
|
-
*
|
|
2009
|
-
*/
|
|
2010
|
-
readonly externalPrice?: _Money;
|
|
2011
|
-
/**
|
|
2012
|
-
* Sets the [LineItem](ctp:api:type:LineItem) `price` and `totalPrice` values, and the `priceMode` to `ExternalTotal` [LineItemPriceMode](ctp:api:type:LineItemPriceMode).
|
|
2013
|
-
*
|
|
2014
|
-
*
|
|
2015
|
-
*/
|
|
2016
|
-
readonly externalTotalPrice?: ExternalLineItemTotalPrice;
|
|
2017
|
-
/**
|
|
2018
|
-
* External Tax Rate for the Line Item, if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode).
|
|
2019
|
-
*
|
|
2020
|
-
*
|
|
2021
|
-
*/
|
|
2022
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
2023
|
-
/**
|
|
2024
|
-
* Inventory mode specific to the Line Item only, and valid for the entire `quantity` of the Line Item.
|
|
2025
|
-
* Set only if the inventory mode should be different from the `inventoryMode` specified on the [Cart](ctp:api:type:Cart).
|
|
2026
|
-
*
|
|
2027
|
-
*
|
|
2028
|
-
*/
|
|
2029
|
-
readonly inventoryMode?: InventoryMode;
|
|
2030
|
-
/**
|
|
2031
|
-
* Container for Line Item-specific addresses.
|
|
2032
|
-
*
|
|
2033
|
-
*
|
|
2034
|
-
*/
|
|
2035
|
-
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
2036
|
-
/**
|
|
2037
|
-
* Custom Fields for the Line Item.
|
|
2038
|
-
*
|
|
2039
|
-
*
|
|
2040
|
-
*/
|
|
2041
|
-
readonly custom?: CustomFieldsDraft;
|
|
2042
|
-
}
|
|
2043
|
-
export interface CartAddPaymentAction {
|
|
2044
|
-
readonly action: 'addPayment';
|
|
2045
|
-
/**
|
|
2046
|
-
* Payment to add to the Cart.
|
|
2047
|
-
* Must not be assigned to another Order or active Cart already.
|
|
2048
|
-
*
|
|
2049
|
-
*
|
|
2050
|
-
*/
|
|
2051
|
-
readonly payment: PaymentResourceIdentifier;
|
|
2052
|
-
}
|
|
2053
|
-
/**
|
|
2054
|
-
* Adds a Shipping Method for a specified shipping address to a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
2055
|
-
*
|
|
2056
|
-
*/
|
|
2057
|
-
export interface CartAddShippingMethodAction {
|
|
2058
|
-
readonly action: 'addShippingMethod';
|
|
2059
|
-
/**
|
|
2060
|
-
* User-defined identifier for the [Shipping](ctp:api:type:Shipping) that must be unique across the Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
2061
|
-
*
|
|
2062
|
-
*
|
|
2063
|
-
*/
|
|
2064
|
-
readonly shippingKey: string;
|
|
2065
|
-
/**
|
|
2066
|
-
* RecourceIdentifier to a [ShippingMethod](ctp:api:type:ShippingMethod) to add to the Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
2067
|
-
* If the referenced Shipping Method has a predicate that does not match the Cart, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned.
|
|
2068
|
-
*
|
|
2069
|
-
*
|
|
2070
|
-
*/
|
|
2071
|
-
readonly shippingMethod: ShippingMethodResourceIdentifier;
|
|
2072
|
-
/**
|
|
2073
|
-
* Determines the shipping rate and Tax Rate of the Line Items.
|
|
2074
|
-
*
|
|
2075
|
-
*
|
|
2076
|
-
*/
|
|
2077
|
-
readonly shippingAddress: _BaseAddress;
|
|
2078
|
-
/**
|
|
2079
|
-
* Input used to select a [ShippingRatePriceTier](ctp:api:type:ShippingRatePriceTier).
|
|
2080
|
-
* The data type of this field depends on the `shippingRateInputType.type` configured in the [Project](ctp:api:type:Project):
|
|
2081
|
-
*
|
|
2082
|
-
* - If `CartClassification`, it must be [ClassificationShippingRateInputDraft](ctp:api:type:ClassificationShippingRateInputDraft).
|
|
2083
|
-
* - If `CartScore`, it must be [ScoreShippingRateInputDraft](ctp:api:type:ScoreShippingRateInputDraft).
|
|
2084
|
-
* - If `CartValue`, it cannot be set.
|
|
2085
|
-
*
|
|
2086
|
-
*
|
|
2087
|
-
*/
|
|
2088
|
-
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
2089
|
-
/**
|
|
2090
|
-
* Tax Rate used to tax a shipping expense if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode).
|
|
2091
|
-
*
|
|
2092
|
-
*
|
|
2093
|
-
*/
|
|
2094
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
2095
|
-
/**
|
|
2096
|
-
* Deliveries to be shipped with the referenced Shipping Method.
|
|
2097
|
-
*
|
|
2098
|
-
*
|
|
2099
|
-
*/
|
|
2100
|
-
readonly deliveries?: DeliveryDraft[];
|
|
2101
|
-
/**
|
|
2102
|
-
* Custom Fields for the Shipping Method.
|
|
2103
|
-
*
|
|
2104
|
-
*
|
|
2105
|
-
*/
|
|
2106
|
-
readonly custom?: CustomFieldsDraft;
|
|
2107
|
-
}
|
|
2108
|
-
/**
|
|
2109
|
-
* Adds all [LineItems](ctp:api:type:LineItem) of a [ShoppingList](ctp:api:type:ShoppingList) to the Cart.
|
|
2110
|
-
*
|
|
2111
|
-
*/
|
|
2112
|
-
export interface CartAddShoppingListAction {
|
|
2113
|
-
readonly action: 'addShoppingList';
|
|
2114
|
-
/**
|
|
2115
|
-
* Shopping List that contains the Line Items to be added.
|
|
2116
|
-
*
|
|
2117
|
-
*
|
|
2118
|
-
*/
|
|
2119
|
-
readonly shoppingList: ShoppingListResourceIdentifier;
|
|
2120
|
-
/**
|
|
2121
|
-
* `distributionChannel` to set for all [LineItems](ctp:api:type:LineItem) that are added to the Cart.
|
|
2122
|
-
* The Channel must have the `ProductDistribution` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum).
|
|
2123
|
-
*
|
|
2124
|
-
*
|
|
2125
|
-
*/
|
|
2126
|
-
readonly distributionChannel?: ChannelResourceIdentifier;
|
|
2127
|
-
/**
|
|
2128
|
-
* `supplyChannel` to set for all [LineItems](ctp:api:type:LineItem) that are added to the Cart.
|
|
2129
|
-
* The Channel must have the `InventorySupply` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum).
|
|
2130
|
-
*
|
|
2131
|
-
*
|
|
2132
|
-
*/
|
|
2133
|
-
readonly supplyChannel?: ChannelResourceIdentifier;
|
|
2134
|
-
}
|
|
2135
|
-
export interface CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction {
|
|
2136
|
-
readonly action: 'applyDeltaToCustomLineItemShippingDetailsTargets';
|
|
2137
|
-
/**
|
|
2138
|
-
* `id` of the [CustomLineItem](ctp:api:type:CustomLineItem) to update.
|
|
2139
|
-
*
|
|
2140
|
-
*
|
|
2141
|
-
*/
|
|
2142
|
-
readonly customLineItemId: string;
|
|
2143
|
-
/**
|
|
2144
|
-
* Using positive or negative quantities increases or decreases the number of items shipped to an address.
|
|
2145
|
-
*
|
|
2146
|
-
*
|
|
2147
|
-
*/
|
|
2148
|
-
readonly targetsDelta: ItemShippingTarget[];
|
|
2149
|
-
}
|
|
2150
|
-
/**
|
|
2151
|
-
* To override the shipping details, see [Set LineItemShippingDetails](ctp:api:type:CartSetLineItemShippingDetailsAction).
|
|
2152
|
-
*
|
|
2153
|
-
*/
|
|
2154
|
-
export interface CartApplyDeltaToLineItemShippingDetailsTargetsAction {
|
|
2155
|
-
readonly action: 'applyDeltaToLineItemShippingDetailsTargets';
|
|
2156
|
-
/**
|
|
2157
|
-
* `id` of the [LineItem](ctp:api:type:LineItem) to update.
|
|
2158
|
-
*
|
|
2159
|
-
*
|
|
2160
|
-
*/
|
|
2161
|
-
readonly lineItemId: string;
|
|
2162
|
-
/**
|
|
2163
|
-
* Using positive or negative quantities increases or decreases the number of items shipped to an address.
|
|
2164
|
-
*
|
|
2165
|
-
*
|
|
2166
|
-
*/
|
|
2167
|
-
readonly targetsDelta: ItemShippingTarget[];
|
|
2168
|
-
}
|
|
2169
|
-
export interface CartChangeCustomLineItemMoneyAction {
|
|
2170
|
-
readonly action: 'changeCustomLineItemMoney';
|
|
2171
|
-
/**
|
|
2172
|
-
* `id` of the [CustomLineItem](ctp:api:type:CustomLineItem) to update.
|
|
2173
|
-
*
|
|
2174
|
-
*
|
|
2175
|
-
*/
|
|
2176
|
-
readonly customLineItemId: string;
|
|
2177
|
-
/**
|
|
2178
|
-
* Value to set. Must not be empty. Can be a negative amount.
|
|
2179
|
-
*
|
|
2180
|
-
*
|
|
2181
|
-
*/
|
|
2182
|
-
readonly money: _Money;
|
|
2183
|
-
}
|
|
2184
|
-
export interface CartChangeCustomLineItemPriceModeAction {
|
|
2185
|
-
readonly action: 'changeCustomLineItemPriceMode';
|
|
2186
|
-
/**
|
|
2187
|
-
* `id` of the [CustomLineItem](ctp:api:type:CustomLineItem) to update.
|
|
2188
|
-
*
|
|
2189
|
-
*
|
|
2190
|
-
*/
|
|
2191
|
-
readonly customLineItemId: string;
|
|
2192
|
-
/**
|
|
2193
|
-
* New value to set. Must not be empty.
|
|
2194
|
-
*
|
|
2195
|
-
*
|
|
2196
|
-
*/
|
|
2197
|
-
readonly mode: CustomLineItemPriceMode;
|
|
2198
|
-
}
|
|
2199
|
-
/**
|
|
2200
|
-
* When multiple shipping addresses are set for a Custom Line Item,
|
|
2201
|
-
* use the [Add CustomLineItem](ctp:api:type:CartAddCustomLineItemAction) update action to change the shipping details.
|
|
2202
|
-
* Since it is not possible for the API to infer how the overall change in the Custom Line Item quantity should be distributed over the sub-quantities,
|
|
2203
|
-
* the `shippingDetails` field is kept in its current state to avoid data loss.
|
|
2204
|
-
*
|
|
2205
|
-
* To change the Custom Line Item quantity and shipping details together,
|
|
2206
|
-
* use this update action in combination with the [Set CustomLineItemShippingDetails](ctp:api:type:CartSetCustomLineItemShippingDetailsAction) update action
|
|
2207
|
-
* in a single Cart update command.
|
|
2208
|
-
*
|
|
2209
|
-
*/
|
|
2210
|
-
export interface CartChangeCustomLineItemQuantityAction {
|
|
2211
|
-
readonly action: 'changeCustomLineItemQuantity';
|
|
2212
|
-
/**
|
|
2213
|
-
* `id` of the [CustomLineItem](ctp:api:type:CustomLineItem) to update.
|
|
2214
|
-
*
|
|
2215
|
-
*
|
|
2216
|
-
*/
|
|
2217
|
-
readonly customLineItemId: string;
|
|
2218
|
-
/**
|
|
2219
|
-
* New value to set.
|
|
2220
|
-
*
|
|
2221
|
-
* If `0`, the Custom Line Item is removed from the Cart.
|
|
2222
|
-
*
|
|
2223
|
-
*
|
|
2224
|
-
*/
|
|
2225
|
-
readonly quantity: number;
|
|
2226
|
-
}
|
|
2227
|
-
/**
|
|
2228
|
-
* When multiple shipping addresses are set for a Line Item,
|
|
2229
|
-
* use the [Remove LineItem](ctp:api:type:CartRemoveLineItemAction) and [Add LineItem](ctp:api:type:CartAddLineItemAction) update action
|
|
2230
|
-
* to change the shipping details.
|
|
2231
|
-
* Since it is not possible for the API to infer how the overall change in the Line Item quantity should be distributed over the sub-quantities,
|
|
2232
|
-
* the `shippingDetails` field is kept in its current state to avoid data loss.
|
|
2233
|
-
*
|
|
2234
|
-
* To change the Line Item quantity and shipping details together,
|
|
2235
|
-
* use this update action in combination with the [Set LineItemShippingDetails](ctp:api:type:CartSetCustomLineItemShippingDetailsAction) update action
|
|
2236
|
-
* in a single Cart update command.
|
|
2237
|
-
*
|
|
2238
|
-
* The [LineItem](ctp:api:type:LineItem) price is set as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection).
|
|
2239
|
-
*
|
|
2240
|
-
*/
|
|
2241
|
-
export interface CartChangeLineItemQuantityAction {
|
|
2242
|
-
readonly action: 'changeLineItemQuantity';
|
|
2243
|
-
/**
|
|
2244
|
-
* `id` of the [LineItem](ctp:api:type:LineItem) to update.
|
|
2245
|
-
*
|
|
2246
|
-
*
|
|
2247
|
-
*/
|
|
2248
|
-
readonly lineItemId: string;
|
|
2249
|
-
/**
|
|
2250
|
-
* New value to set.
|
|
2251
|
-
*
|
|
2252
|
-
* If `0`, the Line Item is removed from the Cart.
|
|
2253
|
-
*
|
|
2254
|
-
*
|
|
2255
|
-
*/
|
|
2256
|
-
readonly quantity: number;
|
|
2257
|
-
/**
|
|
2258
|
-
* Sets the [LineItem](ctp:api:type:LineItem) `price` to the given value when changing the quantity of a Line Item with the `ExternalPrice` [LineItemPriceMode](ctp:api:type:LineItemPriceMode).
|
|
2259
|
-
*
|
|
2260
|
-
* The LineItem price is updated as described in LineItem Price selection.
|
|
2261
|
-
*
|
|
2262
|
-
*
|
|
2263
|
-
*/
|
|
2264
|
-
readonly externalPrice?: _Money;
|
|
2265
|
-
/**
|
|
2266
|
-
* Sets the [LineItem](ctp:api:type:LineItem) `price` and `totalPrice` to the given value when changing the quantity of a Line Item with the `ExternalTotal` [LineItemPriceMode](ctp:api:type:LineItemPriceMode).
|
|
2267
|
-
*
|
|
2268
|
-
*
|
|
2269
|
-
*/
|
|
2270
|
-
readonly externalTotalPrice?: ExternalLineItemTotalPrice;
|
|
2271
|
-
}
|
|
2272
|
-
/**
|
|
2273
|
-
* Changing the tax calculation mode leads to [recalculation of taxes](/../api/carts-orders-overview#cart-tax-calculation).
|
|
2274
|
-
*
|
|
2275
|
-
*/
|
|
2276
|
-
export interface CartChangeTaxCalculationModeAction {
|
|
2277
|
-
readonly action: 'changeTaxCalculationMode';
|
|
2278
|
-
/**
|
|
2279
|
-
* New value to set.
|
|
2280
|
-
*
|
|
2281
|
-
*
|
|
2282
|
-
*/
|
|
2283
|
-
readonly taxCalculationMode: TaxCalculationMode;
|
|
2284
|
-
}
|
|
2285
|
-
/**
|
|
2286
|
-
* - When `External` [TaxMode](ctp:api:type:TaxMode) is changed to `Platform` or `Disabled`, all previously set external Tax Rates are removed.
|
|
2287
|
-
* - When set to `Platform`, Line Items, Custom Line Items, and Shipping Method require a Tax Category with a Tax Rate for the Cart's `shippingAddress`.
|
|
2288
|
-
*
|
|
2289
|
-
*/
|
|
2290
|
-
export interface CartChangeTaxModeAction {
|
|
2291
|
-
readonly action: 'changeTaxMode';
|
|
2292
|
-
/**
|
|
2293
|
-
* The new TaxMode.
|
|
2294
|
-
*
|
|
2295
|
-
*
|
|
2296
|
-
*/
|
|
2297
|
-
readonly taxMode: TaxMode;
|
|
2298
|
-
}
|
|
2299
|
-
/**
|
|
2300
|
-
* Changing the tax rounding mode leads to [recalculation of taxes](/../api/carts-orders-overview#cart-tax-calculation).
|
|
2301
|
-
*
|
|
2302
|
-
*/
|
|
2303
|
-
export interface CartChangeTaxRoundingModeAction {
|
|
2304
|
-
readonly action: 'changeTaxRoundingMode';
|
|
2305
|
-
/**
|
|
2306
|
-
* New value to set.
|
|
2307
|
-
*
|
|
2308
|
-
*
|
|
2309
|
-
*/
|
|
2310
|
-
readonly taxRoundingMode: RoundingMode;
|
|
2311
|
-
}
|
|
2312
|
-
/**
|
|
2313
|
-
* Changes the [CartState](ctp:api:type:CartState) from `Active` to `Frozen`. Results in a [Frozen Cart](ctp:api:type:FrozenCarts).
|
|
2314
|
-
* Fails with [InvalidOperation](ctp:api:type:InvalidOperation) error when the Cart is empty.
|
|
2315
|
-
*
|
|
2316
|
-
*/
|
|
2317
|
-
export interface CartFreezeCartAction {
|
|
2318
|
-
readonly action: 'freezeCart';
|
|
2319
|
-
}
|
|
2320
|
-
/**
|
|
2321
|
-
* This update action does not set any Cart field in particular, but it triggers several [Cart updates](/../api/carts-orders-overview#cart-updates)
|
|
2322
|
-
* to bring prices and discounts to the latest state. Those can become stale over time when no Cart updates have been performed for a while and
|
|
2323
|
-
* prices on related Products have changed in the meanwhile.
|
|
2324
|
-
*
|
|
2325
|
-
* If the `priceMode` of the [Product](ctp:api:type:Product) related to a Line Item is of `Embedded` [ProductPriceMode](ctp:api:type:ProductPriceModeEnum),
|
|
2326
|
-
* the updated `price` of that [LineItem](ctp:api:type:LineItem) may not correspond to a Price in the `variant.prices` anymore.
|
|
2327
|
-
*
|
|
2328
|
-
*/
|
|
2329
|
-
export interface CartRecalculateAction {
|
|
2330
|
-
readonly action: 'recalculate';
|
|
2331
|
-
/**
|
|
2332
|
-
* - Leave empty or set to `false` to only update the Prices and TaxRates of the Line Items.
|
|
2333
|
-
* - Set to `true` to update the Line Items' product data (like `name`, `variant` and `productType`) also.
|
|
2334
|
-
*
|
|
2335
|
-
*
|
|
2336
|
-
*/
|
|
2337
|
-
readonly updateProductData?: boolean;
|
|
2338
|
-
}
|
|
2339
|
-
/**
|
|
2340
|
-
* This update action does not support specifying quantities, unlike the [Remove LineItem](ctp:api:type:CartRemoveLineItemAction) update action.
|
|
2341
|
-
*
|
|
2342
|
-
* If `shippingDetails` must be partially removed, use the [Change CustomLineItem Quantity](ctp:api:type:CartChangeCustomLineItemQuantityAction) update action.
|
|
2343
|
-
*
|
|
2344
|
-
*/
|
|
2345
|
-
export interface CartRemoveCustomLineItemAction {
|
|
2346
|
-
readonly action: 'removeCustomLineItem';
|
|
2347
|
-
/**
|
|
2348
|
-
* `id` of the Custom Line Item to remove.
|
|
2349
|
-
*
|
|
2350
|
-
*
|
|
2351
|
-
*/
|
|
2352
|
-
readonly customLineItemId: string;
|
|
2353
|
-
}
|
|
2354
|
-
export interface CartRemoveDiscountCodeAction {
|
|
2355
|
-
readonly action: 'removeDiscountCode';
|
|
2356
|
-
/**
|
|
2357
|
-
* Discount Code to remove from the Cart.
|
|
2358
|
-
*
|
|
2359
|
-
*
|
|
2360
|
-
*/
|
|
2361
|
-
readonly discountCode: DiscountCodeReference;
|
|
2362
|
-
}
|
|
2363
|
-
/**
|
|
2364
|
-
* An address can only be removed if it is not referenced in any [ItemShippingTarget](ctp:api:type:ItemShippingTarget) of the Cart.
|
|
2365
|
-
*
|
|
2366
|
-
*/
|
|
2367
|
-
export interface CartRemoveItemShippingAddressAction {
|
|
2368
|
-
readonly action: 'removeItemShippingAddress';
|
|
2369
|
-
/**
|
|
2370
|
-
* `key` of the Address to remove from `itemShippingAddresses`.
|
|
2371
|
-
*
|
|
2372
|
-
*
|
|
2373
|
-
*/
|
|
2374
|
-
readonly addressKey: string;
|
|
2375
|
-
}
|
|
2376
|
-
/**
|
|
2377
|
-
* The [LineItem](ctp:api:type:LineItem) price is updated as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection).
|
|
2378
|
-
*
|
|
2379
|
-
*/
|
|
2380
|
-
export interface CartRemoveLineItemAction {
|
|
2381
|
-
readonly action: 'removeLineItem';
|
|
2382
|
-
/**
|
|
2383
|
-
* `id` of the Line Item to remove.
|
|
2384
|
-
*
|
|
2385
|
-
*
|
|
2386
|
-
*/
|
|
2387
|
-
readonly lineItemId: string;
|
|
2388
|
-
/**
|
|
2389
|
-
* New value to set.
|
|
2390
|
-
* If absent or `0`, the Line Item is removed from the Cart.
|
|
2391
|
-
*
|
|
2392
|
-
*
|
|
2393
|
-
*/
|
|
2394
|
-
readonly quantity?: number;
|
|
2395
|
-
/**
|
|
2396
|
-
* Sets the [LineItem](ctp:api:type:LineItem) `price` to the given value when decreasing the quantity of a Line Item with the `ExternalPrice` [LineItemPriceMode](ctp:api:type:LineItemPriceMode).
|
|
2397
|
-
*
|
|
2398
|
-
*
|
|
2399
|
-
*/
|
|
2400
|
-
readonly externalPrice?: _Money;
|
|
2401
|
-
/**
|
|
2402
|
-
* Sets the [LineItem](ctp:api:type:LineItem) `price` and `totalPrice` to the given value when decreasing the quantity of a Line Item with the `ExternalTotal` [LineItemPriceMode](ctp:api:type:LineItemPriceMode).
|
|
2403
|
-
*
|
|
2404
|
-
*
|
|
2405
|
-
*/
|
|
2406
|
-
readonly externalTotalPrice?: ExternalLineItemTotalPrice;
|
|
2407
|
-
/**
|
|
2408
|
-
* Container for Line Item-specific addresses to remove.
|
|
2409
|
-
*
|
|
2410
|
-
*
|
|
2411
|
-
*/
|
|
2412
|
-
readonly shippingDetailsToRemove?: ItemShippingDetailsDraft;
|
|
2413
|
-
}
|
|
2414
|
-
export interface CartRemovePaymentAction {
|
|
2415
|
-
readonly action: 'removePayment';
|
|
2416
|
-
/**
|
|
2417
|
-
* Payment to remove from the Cart.
|
|
2418
|
-
*
|
|
2419
|
-
*
|
|
2420
|
-
*/
|
|
2421
|
-
readonly payment: PaymentResourceIdentifier;
|
|
2422
|
-
}
|
|
2423
|
-
/**
|
|
2424
|
-
* Removes a Shipping Method from a Cart that has the `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
2425
|
-
*
|
|
2426
|
-
*/
|
|
2427
|
-
export interface CartRemoveShippingMethodAction {
|
|
2428
|
-
readonly action: 'removeShippingMethod';
|
|
2429
|
-
/**
|
|
2430
|
-
* User-defined unique identifier of the Shipping Method to remove from the Cart.
|
|
2431
|
-
*
|
|
2432
|
-
*
|
|
2433
|
-
*/
|
|
2434
|
-
readonly shippingKey: string;
|
|
2435
|
-
}
|
|
2436
|
-
export interface CartSetAnonymousIdAction {
|
|
2437
|
-
readonly action: 'setAnonymousId';
|
|
2438
|
-
/**
|
|
2439
|
-
* Value to set.
|
|
2440
|
-
* If empty, any existing value is removed.
|
|
2441
|
-
*
|
|
2442
|
-
*
|
|
2443
|
-
*/
|
|
2444
|
-
readonly anonymousId?: string;
|
|
2445
|
-
}
|
|
2446
|
-
export interface CartSetBillingAddressAction {
|
|
2447
|
-
readonly action: 'setBillingAddress';
|
|
2448
|
-
/**
|
|
2449
|
-
* Value to set.
|
|
2450
|
-
* If empty, any existing value is removed.
|
|
2451
|
-
*
|
|
2452
|
-
*
|
|
2453
|
-
*/
|
|
2454
|
-
readonly address?: _BaseAddress;
|
|
2455
|
-
}
|
|
2456
|
-
export interface CartSetBillingAddressCustomFieldAction {
|
|
2457
|
-
readonly action: 'setBillingAddressCustomField';
|
|
2458
|
-
/**
|
|
2459
|
-
* Name of the [Custom Field](/../api/projects/custom-fields).
|
|
2460
|
-
*
|
|
2461
|
-
*
|
|
2462
|
-
*/
|
|
2463
|
-
readonly name: string;
|
|
2464
|
-
/**
|
|
2465
|
-
* If `value` is absent or `null`, this field will be removed if it exists.
|
|
2466
|
-
* Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
|
|
2467
|
-
* If `value` is provided, it is set for the field defined by `name`.
|
|
2468
|
-
*
|
|
2469
|
-
*
|
|
2470
|
-
*/
|
|
2471
|
-
readonly value?: any;
|
|
2472
|
-
}
|
|
2473
|
-
export interface CartSetBillingAddressCustomTypeAction {
|
|
2474
|
-
readonly action: 'setBillingAddressCustomType';
|
|
2475
|
-
/**
|
|
2476
|
-
* Defines the [Type](ctp:api:type:Type) that extends the `billingAddress` with [Custom Fields](/../api/projects/custom-fields).
|
|
2477
|
-
* If absent, any existing Type and Custom Fields are removed from the `billingAddress`.
|
|
2478
|
-
*
|
|
2479
|
-
*
|
|
2480
|
-
*/
|
|
2481
|
-
readonly type?: TypeResourceIdentifier;
|
|
2482
|
-
/**
|
|
2483
|
-
* Sets the [Custom Fields](/../api/projects/custom-fields) fields for the `billingAddress`.
|
|
2484
|
-
*
|
|
2485
|
-
*
|
|
2486
|
-
*/
|
|
2487
|
-
readonly fields?: FieldContainer;
|
|
2488
|
-
}
|
|
2489
|
-
/**
|
|
2490
|
-
* Updates the Business Unit on the Cart. The Cart must have an existing Business Unit assigned already.
|
|
2491
|
-
*
|
|
2492
|
-
*/
|
|
2493
|
-
export interface CartSetBusinessUnitAction {
|
|
2494
|
-
readonly action: 'setBusinessUnit';
|
|
2495
|
-
/**
|
|
2496
|
-
* New Business Unit to assign to the Cart, which must have access to the [Store](/../api/projects/stores) that is set on the Cart.
|
|
2497
|
-
*
|
|
2498
|
-
*
|
|
2499
|
-
*/
|
|
2500
|
-
readonly businessUnit: BusinessUnitResourceIdentifier;
|
|
2501
|
-
}
|
|
2502
|
-
/**
|
|
2503
|
-
* This update action results in the `taxedPrice` field being added to the Cart when the `ExternalAmount` [TaxMode](ctp:api:type:TaxMode) is used.
|
|
2504
|
-
*
|
|
2505
|
-
*/
|
|
2506
|
-
export interface CartSetCartTotalTaxAction {
|
|
2507
|
-
readonly action: 'setCartTotalTax';
|
|
2508
|
-
/**
|
|
2509
|
-
* The Cart's total gross price becoming the `totalGross` field (`totalNet` + taxes) on the Cart's `taxedPrice`.
|
|
2510
|
-
*
|
|
2511
|
-
*
|
|
2512
|
-
*/
|
|
2513
|
-
readonly externalTotalGross: _Money;
|
|
2514
|
-
/**
|
|
2515
|
-
* Set if the `externalTotalGross` price is a sum of portions with different tax rates.
|
|
2516
|
-
*
|
|
2517
|
-
*
|
|
2518
|
-
*/
|
|
2519
|
-
readonly externalTaxPortions?: TaxPortionDraft[];
|
|
2520
|
-
}
|
|
2521
|
-
/**
|
|
2522
|
-
* Setting the country can lead to changes in the [LineItem](ctp:api:type:LineItem) prices.
|
|
2523
|
-
*
|
|
2524
|
-
*/
|
|
2525
|
-
export interface CartSetCountryAction {
|
|
2526
|
-
readonly action: 'setCountry';
|
|
2527
|
-
/**
|
|
2528
|
-
* Value to set.
|
|
2529
|
-
* If empty, any existing value is removed.
|
|
2530
|
-
*
|
|
2531
|
-
* If the Cart is bound to a `store`, the provided value must be included in the [Store's](ctp:api:type:Store) `countries`.
|
|
2532
|
-
* Otherwise a [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) error is returned.
|
|
2533
|
-
*
|
|
2534
|
-
*
|
|
2535
|
-
*/
|
|
2536
|
-
readonly country?: string;
|
|
2537
|
-
}
|
|
2538
|
-
export interface CartSetCustomFieldAction {
|
|
2539
|
-
readonly action: 'setCustomField';
|
|
2540
|
-
/**
|
|
2541
|
-
* Name of the [Custom Field](/../api/projects/custom-fields).
|
|
2542
|
-
*
|
|
2543
|
-
*
|
|
2544
|
-
*/
|
|
2545
|
-
readonly name: string;
|
|
2546
|
-
/**
|
|
2547
|
-
* If `value` is absent or `null`, this field will be removed if it exists.
|
|
2548
|
-
* Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
|
|
2549
|
-
* If `value` is provided, it is set for the field defined by `name`.
|
|
2550
|
-
*
|
|
2551
|
-
*
|
|
2552
|
-
*/
|
|
2553
|
-
readonly value?: any;
|
|
2554
|
-
}
|
|
2555
|
-
export interface CartSetCustomLineItemCustomFieldAction {
|
|
2556
|
-
readonly action: 'setCustomLineItemCustomField';
|
|
2557
|
-
/**
|
|
2558
|
-
* `id` of the [CustomLineItem](ctp:api:type:CustomLineItem) to update.
|
|
2559
|
-
*
|
|
2560
|
-
*
|
|
2561
|
-
*/
|
|
2562
|
-
readonly customLineItemId: string;
|
|
2563
|
-
/**
|
|
2564
|
-
* Name of the [Custom Field](/../api/projects/custom-fields).
|
|
2565
|
-
*
|
|
2566
|
-
*
|
|
2567
|
-
*/
|
|
2568
|
-
readonly name: string;
|
|
2569
|
-
/**
|
|
2570
|
-
* If `value` is absent or `null`, this field will be removed if it exists.
|
|
2571
|
-
* Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
|
|
2572
|
-
* If `value` is provided, it is set for the field defined by `name`.
|
|
2573
|
-
*
|
|
2574
|
-
*
|
|
2575
|
-
*/
|
|
2576
|
-
readonly value?: any;
|
|
2577
|
-
}
|
|
2578
|
-
export interface CartSetCustomLineItemCustomTypeAction {
|
|
2579
|
-
readonly action: 'setCustomLineItemCustomType';
|
|
2580
|
-
/**
|
|
2581
|
-
* `id` of the [CustomLineItem](ctp:api:type:CustomLineItem) to update.
|
|
2582
|
-
*
|
|
2583
|
-
*
|
|
2584
|
-
*/
|
|
2585
|
-
readonly customLineItemId: string;
|
|
2586
|
-
/**
|
|
2587
|
-
* Defines the [Type](ctp:api:type:Type) that extends the CustomLineItem with [Custom Fields](/../api/projects/custom-fields).
|
|
2588
|
-
* If absent, any existing Type and Custom Fields are removed from the CustomLineItem.
|
|
2589
|
-
*
|
|
2590
|
-
*
|
|
2591
|
-
*/
|
|
2592
|
-
readonly type?: TypeResourceIdentifier;
|
|
2593
|
-
/**
|
|
2594
|
-
* Sets the [Custom Fields](/../api/projects/custom-fields) fields for the CustomLineItem.
|
|
2595
|
-
*
|
|
2596
|
-
*
|
|
2597
|
-
*/
|
|
2598
|
-
readonly fields?: FieldContainer;
|
|
2599
|
-
}
|
|
2600
|
-
export interface CartSetCustomLineItemShippingDetailsAction {
|
|
2601
|
-
readonly action: 'setCustomLineItemShippingDetails';
|
|
2602
|
-
/**
|
|
2603
|
-
* `id` of the [CustomLineItem](ctp:api:type:CustomLineItem) to update.
|
|
2604
|
-
*
|
|
2605
|
-
*
|
|
2606
|
-
*/
|
|
2607
|
-
readonly customLineItemId: string;
|
|
2608
|
-
/**
|
|
2609
|
-
* Value to set.
|
|
2610
|
-
* If empty, any existing value is removed.
|
|
2611
|
-
*
|
|
2612
|
-
*
|
|
2613
|
-
*/
|
|
2614
|
-
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
2615
|
-
}
|
|
2616
|
-
/**
|
|
2617
|
-
* Can be used if the Cart has the `ExternalAmount` [TaxMode](ctp:api:type:TaxMode).
|
|
2618
|
-
*
|
|
2619
|
-
*/
|
|
2620
|
-
export interface CartSetCustomLineItemTaxAmountAction {
|
|
2621
|
-
readonly action: 'setCustomLineItemTaxAmount';
|
|
2622
|
-
/**
|
|
2623
|
-
* `id` of the [CustomLineItem](ctp:api:type:CustomLineItem) to update.
|
|
2624
|
-
*
|
|
2625
|
-
*
|
|
2626
|
-
*/
|
|
2627
|
-
readonly customLineItemId: string;
|
|
2628
|
-
/**
|
|
2629
|
-
* Value to set.
|
|
2630
|
-
* If empty, any existing value is removed.
|
|
2631
|
-
*
|
|
2632
|
-
*
|
|
2633
|
-
*/
|
|
2634
|
-
readonly externalTaxAmount?: ExternalTaxAmountDraft;
|
|
2635
|
-
}
|
|
2636
|
-
/**
|
|
2637
|
-
* Can be used if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode).
|
|
2638
|
-
*
|
|
2639
|
-
*/
|
|
2640
|
-
export interface CartSetCustomLineItemTaxRateAction {
|
|
2641
|
-
readonly action: 'setCustomLineItemTaxRate';
|
|
2642
|
-
/**
|
|
2643
|
-
* `id` of the [CustomLineItem](ctp:api:type:CustomLineItem) to update.
|
|
2644
|
-
*
|
|
2645
|
-
*
|
|
2646
|
-
*/
|
|
2647
|
-
readonly customLineItemId: string;
|
|
2648
|
-
/**
|
|
2649
|
-
* Value to set.
|
|
2650
|
-
* If empty, an existing value is removed.
|
|
2651
|
-
*
|
|
2652
|
-
*
|
|
2653
|
-
*/
|
|
2654
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
2655
|
-
}
|
|
2656
|
-
/**
|
|
2657
|
-
* To set the Cart's custom Shipping Method (independent of the [ShippingMethods](ctp:api:type:ShippingMethod) managed through
|
|
2658
|
-
* the [Shipping Methods API](/projects/shippingMethods)) the Cart must have
|
|
2659
|
-
* the `Single` [ShippingMode](ctp:api:type:ShippingMode) and a `shippingAddress`.
|
|
2660
|
-
*
|
|
2661
|
-
* To unset a custom Shipping Method on a Cart, use the [Set ShippingMethod](ctp:api:type:CartSetShippingMethodAction) update action
|
|
2662
|
-
* without the `shippingMethod` field instead.
|
|
2663
|
-
*
|
|
2664
|
-
*/
|
|
2665
|
-
export interface CartSetCustomShippingMethodAction {
|
|
2666
|
-
readonly action: 'setCustomShippingMethod';
|
|
2667
|
-
/**
|
|
2668
|
-
* Name of the custom Shipping Method.
|
|
2669
|
-
*
|
|
2670
|
-
*
|
|
2671
|
-
*/
|
|
2672
|
-
readonly shippingMethodName: string;
|
|
2673
|
-
/**
|
|
2674
|
-
* Determines the shipping price.
|
|
2675
|
-
*
|
|
2676
|
-
*
|
|
2677
|
-
*/
|
|
2678
|
-
readonly shippingRate: ShippingRateDraft;
|
|
2679
|
-
/**
|
|
2680
|
-
* Tax Category used to determine the Tax Rate when the Cart has the `Platform` [TaxMode](ctp:api:type:TaxMode).
|
|
2681
|
-
*
|
|
2682
|
-
*
|
|
2683
|
-
*/
|
|
2684
|
-
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
2685
|
-
/**
|
|
2686
|
-
* External Tax Rate for the `shippingRate` to be set if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode).
|
|
2687
|
-
*
|
|
2688
|
-
*
|
|
2689
|
-
*/
|
|
2690
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
2691
|
-
}
|
|
2692
|
-
export interface CartSetCustomTypeAction {
|
|
2693
|
-
readonly action: 'setCustomType';
|
|
2694
|
-
/**
|
|
2695
|
-
* Defines the [Type](ctp:api:type:Type) that extends the Cart with [Custom Fields](/../api/projects/custom-fields).
|
|
2696
|
-
* If absent, any existing Type and Custom Fields are removed from the Cart.
|
|
2697
|
-
*
|
|
2698
|
-
*
|
|
2699
|
-
*/
|
|
2700
|
-
readonly type?: TypeResourceIdentifier;
|
|
2701
|
-
/**
|
|
2702
|
-
* Sets the [Custom Fields](/../api/projects/custom-fields) fields for the Cart.
|
|
2703
|
-
*
|
|
2704
|
-
*
|
|
2705
|
-
*/
|
|
2706
|
-
readonly fields?: FieldContainer;
|
|
2707
|
-
}
|
|
2708
|
-
export interface CartSetCustomerEmailAction {
|
|
2709
|
-
readonly action: 'setCustomerEmail';
|
|
2710
|
-
/**
|
|
2711
|
-
* Value to set.
|
|
2712
|
-
* If empty, any existing value is removed.
|
|
2713
|
-
*
|
|
2714
|
-
*
|
|
2715
|
-
*/
|
|
2716
|
-
readonly email?: string;
|
|
2717
|
-
}
|
|
2718
|
-
/**
|
|
2719
|
-
* This update action can only be used if a Customer is not assigned to a Cart.
|
|
2720
|
-
* If a Customer is already assigned, the Cart has the same Customer Group as the assigned Customer.
|
|
2721
|
-
*
|
|
2722
|
-
* Setting the Customer Group also updates the [LineItem](ctp:api:type:LineItem) `prices` according to the Customer Group.
|
|
2723
|
-
*
|
|
2724
|
-
*/
|
|
2725
|
-
export interface CartSetCustomerGroupAction {
|
|
2726
|
-
readonly action: 'setCustomerGroup';
|
|
2727
|
-
/**
|
|
2728
|
-
* Value to set.
|
|
2729
|
-
* If empty, any existing value is removed.
|
|
2730
|
-
*
|
|
2731
|
-
*
|
|
2732
|
-
*/
|
|
2733
|
-
readonly customerGroup?: CustomerGroupResourceIdentifier;
|
|
2734
|
-
}
|
|
2735
|
-
/**
|
|
2736
|
-
* Setting the Cart's `customerId` can lead to updates on all its [LineItem](ctp:api:type:LineItem) `prices`.
|
|
2737
|
-
*
|
|
2738
|
-
* If the Customer with the specified `id` cannot be found, this update action returns a
|
|
2739
|
-
* [ReferencedResourceNotFound](ctp:api:type:ReferencedResourceNotFoundError) error.
|
|
2740
|
-
*
|
|
2741
|
-
*/
|
|
2742
|
-
export interface CartSetCustomerIdAction {
|
|
2743
|
-
readonly action: 'setCustomerId';
|
|
2744
|
-
/**
|
|
2745
|
-
* `id` of an existing [Customer](ctp:api:type:Customer). If empty, any value is removed.
|
|
2746
|
-
*
|
|
2747
|
-
*
|
|
2748
|
-
*/
|
|
2749
|
-
readonly customerId?: string;
|
|
2750
|
-
}
|
|
2751
|
-
/**
|
|
2752
|
-
* Number of days after which a Cart with `Active` [CartState](ctp:api:type:CartState) is deleted since its last modification.
|
|
2753
|
-
*
|
|
2754
|
-
* If a [ChangeSubscription](ctp:api:type:ChangeSubscription) exists for Carts, a [ResourceDeletedDeliveryPayload](ctp:api:type:ResourceDeletedDeliveryPayload) is sent.
|
|
2755
|
-
*
|
|
2756
|
-
*/
|
|
2757
|
-
export interface CartSetDeleteDaysAfterLastModificationAction {
|
|
2758
|
-
readonly action: 'setDeleteDaysAfterLastModification';
|
|
2759
|
-
/**
|
|
2760
|
-
* Value to set.
|
|
2761
|
-
* If not provided, the default value for this field configured in [Project settings](ctp:api:type:CartsConfiguration) is assigned.
|
|
2762
|
-
*
|
|
2763
|
-
*
|
|
2764
|
-
*/
|
|
2765
|
-
readonly deleteDaysAfterLastModification?: number;
|
|
2766
|
-
}
|
|
2767
|
-
export interface CartSetDeliveryAddressCustomFieldAction {
|
|
2768
|
-
readonly action: 'setDeliveryAddressCustomField';
|
|
2769
|
-
/**
|
|
2770
|
-
* `id` of the [Delivery](ctp:api:type:Delivery).
|
|
2771
|
-
*
|
|
2772
|
-
*
|
|
2773
|
-
*/
|
|
2774
|
-
readonly deliveryId: string;
|
|
2775
|
-
/**
|
|
2776
|
-
* Name of the [Custom Field](/../api/projects/custom-fields).
|
|
2777
|
-
*
|
|
2778
|
-
*
|
|
2779
|
-
*/
|
|
2780
|
-
readonly name: string;
|
|
2781
|
-
/**
|
|
2782
|
-
* If `value` is absent or `null`, this field will be removed if it exists.
|
|
2783
|
-
* Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
|
|
2784
|
-
* If `value` is provided, it is set for the field defined by `name`.
|
|
2785
|
-
*
|
|
2786
|
-
*
|
|
2787
|
-
*/
|
|
2788
|
-
readonly value?: any;
|
|
2789
|
-
}
|
|
2790
|
-
export interface CartSetDeliveryAddressCustomTypeAction {
|
|
2791
|
-
readonly action: 'setDeliveryAddressCustomType';
|
|
2792
|
-
/**
|
|
2793
|
-
* `id` of the [Delivery](ctp:api:type:Delivery).
|
|
2794
|
-
*
|
|
2795
|
-
*
|
|
2796
|
-
*/
|
|
2797
|
-
readonly deliveryId: string;
|
|
2798
|
-
/**
|
|
2799
|
-
* Defines the [Type](ctp:api:type:Type) that extends the [Delivery](ctp:api:type:Delivery) `address` with [Custom Fields](/../api/projects/custom-fields).
|
|
2800
|
-
* If absent, any existing Type and Custom Fields are removed from the [Delivery](ctp:api:type:Delivery) `address`.
|
|
2801
|
-
*
|
|
2802
|
-
*
|
|
2803
|
-
*/
|
|
2804
|
-
readonly type?: TypeResourceIdentifier;
|
|
2805
|
-
/**
|
|
2806
|
-
* Sets the [Custom Fields](/../api/projects/custom-fields) fields for the [Delivery](ctp:api:type:Delivery) `address`.
|
|
2807
|
-
*
|
|
2808
|
-
*
|
|
2809
|
-
*/
|
|
2810
|
-
readonly fields?: FieldContainer;
|
|
2811
|
-
}
|
|
2812
|
-
/**
|
|
2813
|
-
* Adds a [DirectDiscount](ctp:api:type:DirectDiscount), but only if no [DiscountCode](ctp:api:type:DiscountCode) has been added to the Cart.
|
|
2814
|
-
* Either a Discount Code or a Direct Discount can exist on a Cart at the same time.
|
|
2815
|
-
*
|
|
2816
|
-
*/
|
|
2817
|
-
export interface CartSetDirectDiscountsAction {
|
|
2818
|
-
readonly action: 'setDirectDiscounts';
|
|
2819
|
-
/**
|
|
2820
|
-
* - If set, all existing Direct Discounts are replaced.
|
|
2821
|
-
* The discounts apply in the order they are added to the list.
|
|
2822
|
-
* - If empty, all existing Direct Discounts are removed and all affected prices on the Cart or Order are recalculated.
|
|
2823
|
-
*
|
|
2824
|
-
*
|
|
2825
|
-
*/
|
|
2826
|
-
readonly discounts: DirectDiscountDraft[];
|
|
2827
|
-
}
|
|
2828
|
-
export interface CartSetItemShippingAddressCustomFieldAction {
|
|
2829
|
-
readonly action: 'setItemShippingAddressCustomField';
|
|
2830
|
-
/**
|
|
2831
|
-
* `key` of the [Address](ctp:api:type:Address) in `itemShippingAddress`.
|
|
2832
|
-
*
|
|
2833
|
-
*
|
|
2834
|
-
*/
|
|
2835
|
-
readonly addressKey: string;
|
|
2836
|
-
/**
|
|
2837
|
-
* Name of the [Custom Field](/../api/projects/custom-fields).
|
|
2838
|
-
*
|
|
2839
|
-
*
|
|
2840
|
-
*/
|
|
2841
|
-
readonly name: string;
|
|
2842
|
-
/**
|
|
2843
|
-
* If `value` is absent or `null`, this field will be removed if it exists.
|
|
2844
|
-
* Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
|
|
2845
|
-
* If `value` is provided, it is set for the field defined by `name`.
|
|
2846
|
-
*
|
|
2847
|
-
*
|
|
2848
|
-
*/
|
|
2849
|
-
readonly value?: any;
|
|
2850
|
-
}
|
|
2851
|
-
export interface CartSetItemShippingAddressCustomTypeAction {
|
|
2852
|
-
readonly action: 'setItemShippingAddressCustomType';
|
|
2853
|
-
/**
|
|
2854
|
-
* `key` of the [Address](ctp:api:type:Address) in `itemShippingAddress`.
|
|
2855
|
-
*
|
|
2856
|
-
*
|
|
2857
|
-
*/
|
|
2858
|
-
readonly addressKey: string;
|
|
2859
|
-
/**
|
|
2860
|
-
* Defines the [Type](ctp:api:type:Type) that extends the `itemShippingAddress` with [Custom Fields](/../api/projects/custom-fields).
|
|
2861
|
-
* If absent, any existing Type and Custom Fields are removed from the `itemShippingAddress`.
|
|
2862
|
-
*
|
|
2863
|
-
*
|
|
2864
|
-
*/
|
|
2865
|
-
readonly type?: TypeResourceIdentifier;
|
|
2866
|
-
/**
|
|
2867
|
-
* Sets the [Custom Fields](/../api/projects/custom-fields) fields for the `itemShippingAddress`.
|
|
2868
|
-
*
|
|
2869
|
-
*
|
|
2870
|
-
*/
|
|
2871
|
-
readonly fields?: FieldContainer;
|
|
2872
|
-
}
|
|
2873
|
-
export interface CartSetKeyAction {
|
|
2874
|
-
readonly action: 'setKey';
|
|
2875
|
-
/**
|
|
2876
|
-
* Value to set.
|
|
2877
|
-
* If empty, any existing key will be removed.
|
|
2878
|
-
*
|
|
2879
|
-
*
|
|
2880
|
-
*/
|
|
2881
|
-
readonly key?: string;
|
|
2882
|
-
}
|
|
2883
|
-
export interface CartSetLineItemCustomFieldAction {
|
|
2884
|
-
readonly action: 'setLineItemCustomField';
|
|
2885
|
-
/**
|
|
2886
|
-
* `id` of the [LineItem](ctp:api:type:LineItem) to update.
|
|
2887
|
-
*
|
|
2888
|
-
*
|
|
2889
|
-
*/
|
|
2890
|
-
readonly lineItemId: string;
|
|
2891
|
-
/**
|
|
2892
|
-
* Name of the [Custom Field](/../api/projects/custom-fields).
|
|
2893
|
-
*
|
|
2894
|
-
*
|
|
2895
|
-
*/
|
|
2896
|
-
readonly name: string;
|
|
2897
|
-
/**
|
|
2898
|
-
* If `value` is absent or `null`, this field will be removed if it exists.
|
|
2899
|
-
* Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
|
|
2900
|
-
* If `value` is provided, it is set for the field defined by `name`.
|
|
2901
|
-
*
|
|
2902
|
-
*
|
|
2903
|
-
*/
|
|
2904
|
-
readonly value?: any;
|
|
2905
|
-
}
|
|
2906
|
-
export interface CartSetLineItemCustomTypeAction {
|
|
2907
|
-
readonly action: 'setLineItemCustomType';
|
|
2908
|
-
/**
|
|
2909
|
-
* `id` of the [LineItem](ctp:api:type:LineItem) to update.
|
|
2910
|
-
*
|
|
2911
|
-
*
|
|
2912
|
-
*/
|
|
2913
|
-
readonly lineItemId: string;
|
|
2914
|
-
/**
|
|
2915
|
-
* Defines the [Type](ctp:api:type:Type) that extends the Line Item with [Custom Fields](/../api/projects/custom-fields).
|
|
2916
|
-
* If absent, any existing Type and Custom Fields are removed from the Line Item.
|
|
2917
|
-
*
|
|
2918
|
-
*
|
|
2919
|
-
*/
|
|
2920
|
-
readonly type?: TypeResourceIdentifier;
|
|
2921
|
-
/**
|
|
2922
|
-
* Sets the [Custom Fields](/../api/projects/custom-fields) fields for the Line Item.
|
|
2923
|
-
*
|
|
2924
|
-
*
|
|
2925
|
-
*/
|
|
2926
|
-
readonly fields?: FieldContainer;
|
|
2927
|
-
}
|
|
2928
|
-
/**
|
|
2929
|
-
* Setting a distribution channel for a [LineItem](ctp:api:type:LineItem) can lead to an updated `price` as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection).
|
|
2930
|
-
*
|
|
2931
|
-
*/
|
|
2932
|
-
export interface CartSetLineItemDistributionChannelAction {
|
|
2933
|
-
readonly action: 'setLineItemDistributionChannel';
|
|
2934
|
-
/**
|
|
2935
|
-
* `id` of the [LineItem](ctp:api:type:LineItem) to update.
|
|
2936
|
-
*
|
|
2937
|
-
*
|
|
2938
|
-
*/
|
|
2939
|
-
readonly lineItemId: string;
|
|
2940
|
-
/**
|
|
2941
|
-
* - If present, a [Reference](ctp:api:type:Reference) to the Channel is set for the [LineItem](ctp:api:type:LineItem) specified by `lineItemId`.
|
|
2942
|
-
* - If not present, the current [Reference](ctp:api:type:Reference) to a distribution channel is removed from the [LineItem](ctp:api:type:LineItem) specified by `lineItemId`.
|
|
2943
|
-
* The Channel must have the `ProductDistribution` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum).
|
|
2944
|
-
*
|
|
2945
|
-
*
|
|
2946
|
-
*/
|
|
2947
|
-
readonly distributionChannel?: ChannelResourceIdentifier;
|
|
2948
|
-
}
|
|
2949
|
-
/**
|
|
2950
|
-
* Sets the [LineItem](ctp:api:type:LineItem) `price` and changes the `priceMode` to `ExternalPrice` [LineItemPriceMode](ctp:api:type:LineItemPriceMode).
|
|
2951
|
-
*
|
|
2952
|
-
*/
|
|
2953
|
-
export interface CartSetLineItemPriceAction {
|
|
2954
|
-
readonly action: 'setLineItemPrice';
|
|
2955
|
-
/**
|
|
2956
|
-
* `id` of the [LineItem](ctp:api:type:LineItem) to update.
|
|
2957
|
-
*
|
|
2958
|
-
*
|
|
2959
|
-
*/
|
|
2960
|
-
readonly lineItemId: string;
|
|
2961
|
-
/**
|
|
2962
|
-
* Value to set.
|
|
2963
|
-
* If `externalPrice` is not given and the `priceMode` is `ExternalPrice`, the external price is unset and the `priceMode` is set to `Platform`.
|
|
2964
|
-
*
|
|
2965
|
-
*
|
|
2966
|
-
*/
|
|
2967
|
-
readonly externalPrice?: _Money;
|
|
2968
|
-
}
|
|
2969
|
-
export interface CartSetLineItemShippingDetailsAction {
|
|
2970
|
-
readonly action: 'setLineItemShippingDetails';
|
|
2971
|
-
/**
|
|
2972
|
-
* `id` of the [LineItem](ctp:api:type:LineItem) to update.
|
|
2973
|
-
*
|
|
2974
|
-
*
|
|
2975
|
-
*/
|
|
2976
|
-
readonly lineItemId: string;
|
|
2977
|
-
/**
|
|
2978
|
-
* Value to set.
|
|
2979
|
-
* If empty, the existing value is removed.
|
|
2980
|
-
*
|
|
2981
|
-
*
|
|
2982
|
-
*/
|
|
2983
|
-
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
2984
|
-
}
|
|
2985
|
-
/**
|
|
2986
|
-
* Performing this action has no impact on inventory that should be reserved.
|
|
2987
|
-
*
|
|
2988
|
-
*/
|
|
2989
|
-
export interface CartSetLineItemSupplyChannelAction {
|
|
2990
|
-
readonly action: 'setLineItemSupplyChannel';
|
|
2991
|
-
/**
|
|
2992
|
-
* `id` of the [LineItem](ctp:api:type:LineItem) to update.
|
|
2993
|
-
*
|
|
2994
|
-
*
|
|
2995
|
-
*/
|
|
2996
|
-
readonly lineItemId: string;
|
|
2997
|
-
/**
|
|
2998
|
-
* - If present, a [Reference](ctp:api:type:Reference) to the Channel is set for the [LineItem](ctp:api:type:LineItem) specified by `lineItemId`.
|
|
2999
|
-
* - If not present, the current [Reference](ctp:api:type:Reference) to a supply channel will be removed from the [LineItem](ctp:api:type:LineItem) specified by `lineItemId`.
|
|
3000
|
-
* The Channel must have the `InventorySupply` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum).
|
|
3001
|
-
*
|
|
3002
|
-
*
|
|
3003
|
-
*/
|
|
3004
|
-
readonly supplyChannel?: ChannelResourceIdentifier;
|
|
3005
|
-
}
|
|
3006
|
-
/**
|
|
3007
|
-
* Can be used if the Cart has the `ExternalAmount` [TaxMode](ctp:api:type:TaxMode).
|
|
3008
|
-
*
|
|
3009
|
-
*/
|
|
3010
|
-
export interface CartSetLineItemTaxAmountAction {
|
|
3011
|
-
readonly action: 'setLineItemTaxAmount';
|
|
3012
|
-
/**
|
|
3013
|
-
* `id` of the [LineItem](ctp:api:type:LineItem) to update.
|
|
3014
|
-
*
|
|
3015
|
-
*
|
|
3016
|
-
*/
|
|
3017
|
-
readonly lineItemId: string;
|
|
3018
|
-
/**
|
|
3019
|
-
* Value to set.
|
|
3020
|
-
* If empty, any existing value is removed.
|
|
3021
|
-
*
|
|
3022
|
-
*
|
|
3023
|
-
*/
|
|
3024
|
-
readonly externalTaxAmount?: ExternalTaxAmountDraft;
|
|
3025
|
-
/**
|
|
3026
|
-
* `key` of the [ShippingMethod](ctp:api:type:ShippingMethod) used for this Line Item.
|
|
3027
|
-
* This is required for Carts with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
3028
|
-
*
|
|
3029
|
-
*
|
|
3030
|
-
*/
|
|
3031
|
-
readonly shippingKey?: string;
|
|
3032
|
-
}
|
|
3033
|
-
/**
|
|
3034
|
-
* Can be used if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode).
|
|
3035
|
-
*
|
|
3036
|
-
*/
|
|
3037
|
-
export interface CartSetLineItemTaxRateAction {
|
|
3038
|
-
readonly action: 'setLineItemTaxRate';
|
|
3039
|
-
/**
|
|
3040
|
-
* `id` of the [LineItem](ctp:api:type:LineItem) to update.
|
|
3041
|
-
*
|
|
3042
|
-
*
|
|
3043
|
-
*/
|
|
3044
|
-
readonly lineItemId: string;
|
|
3045
|
-
/**
|
|
3046
|
-
* Value to set.
|
|
3047
|
-
* If empty, any existing value is removed.
|
|
3048
|
-
*
|
|
3049
|
-
*
|
|
3050
|
-
*/
|
|
3051
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
3052
|
-
/**
|
|
3053
|
-
* `key` of the [ShippingMethod](ctp:api:type:ShippingMethod) used for this Line Item.
|
|
3054
|
-
* This is required for Carts with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
3055
|
-
*
|
|
3056
|
-
*
|
|
3057
|
-
*/
|
|
3058
|
-
readonly shippingKey?: string;
|
|
3059
|
-
}
|
|
3060
|
-
/**
|
|
3061
|
-
* Sets the [LineItem](ctp:api:type:LineItem) `totalPrice` and `price`, and changes the `priceMode` to `ExternalTotal` [LineItemPriceMode](ctp:api:type:LineItemPriceMode).
|
|
3062
|
-
*
|
|
3063
|
-
*/
|
|
3064
|
-
export interface CartSetLineItemTotalPriceAction {
|
|
3065
|
-
readonly action: 'setLineItemTotalPrice';
|
|
3066
|
-
/**
|
|
3067
|
-
* `id` of the [LineItem](ctp:api:type:LineItem) to update.
|
|
3068
|
-
*
|
|
3069
|
-
*
|
|
3070
|
-
*/
|
|
3071
|
-
readonly lineItemId: string;
|
|
3072
|
-
/**
|
|
3073
|
-
* Value to set.
|
|
3074
|
-
* If `externalTotalPrice` is not given and the `priceMode` is `ExternalTotal`, the external price is unset and the `priceMode` is set to `Platform`.
|
|
3075
|
-
*
|
|
3076
|
-
*
|
|
3077
|
-
*/
|
|
3078
|
-
readonly externalTotalPrice?: ExternalLineItemTotalPrice;
|
|
3079
|
-
}
|
|
3080
|
-
export interface CartSetLocaleAction {
|
|
3081
|
-
readonly action: 'setLocale';
|
|
3082
|
-
/**
|
|
3083
|
-
* Value to set.
|
|
3084
|
-
* Must be one of the [Project](ctp:api:type:Project)'s `languages`.
|
|
3085
|
-
* If empty, any existing value will be removed.
|
|
3086
|
-
*
|
|
3087
|
-
*
|
|
3088
|
-
*/
|
|
3089
|
-
readonly locale?: string;
|
|
3090
|
-
}
|
|
3091
|
-
/**
|
|
3092
|
-
* Setting the shipping address also sets the [TaxRate](ctp:api:type:TaxRate) of Line Items and calculates the [TaxedPrice](ctp:api:type:TaxedPrice).
|
|
3093
|
-
*
|
|
3094
|
-
* If a matching price cannot be found for the given shipping address during [Line Item Price selection](ctp:api:type:LineItemPriceSelection),
|
|
3095
|
-
* a [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) error is returned.
|
|
3096
|
-
*
|
|
3097
|
-
* If you want to allow shipping to states inside a country that are not explicitly covered by a TaxRate,
|
|
3098
|
-
* set the `countryTaxRateFallbackEnabled` field to `true` in the [CartsConfiguration](ctp:api:type:CartsConfiguration) by using
|
|
3099
|
-
* the [Change CountryTaxRateFallbackEnabled](ctp:api:type:ProjectChangeCountryTaxRateFallbackEnabledAction) update action.
|
|
3100
|
-
*
|
|
3101
|
-
*/
|
|
3102
|
-
export interface CartSetShippingAddressAction {
|
|
3103
|
-
readonly action: 'setShippingAddress';
|
|
3104
|
-
/**
|
|
3105
|
-
* Value to set.
|
|
3106
|
-
* If not set, the shipping address is unset, and the `taxedPrice` and `taxRate` are unset in all Line Items of the Cart.
|
|
3107
|
-
*
|
|
3108
|
-
*
|
|
3109
|
-
*/
|
|
3110
|
-
readonly address?: _BaseAddress;
|
|
3111
|
-
}
|
|
3112
|
-
export interface CartSetShippingAddressAndShippingMethodAction {
|
|
3113
|
-
readonly action: 'setShippingAddressAndShippingMethod';
|
|
3114
|
-
/**
|
|
3115
|
-
* Value to set.
|
|
3116
|
-
* If not set, the shipping address is unset, and the `taxedPrice` and `taxRate` are unset in all Line Items of the Cart.
|
|
3117
|
-
*
|
|
3118
|
-
*
|
|
3119
|
-
*/
|
|
3120
|
-
readonly address?: _BaseAddress;
|
|
3121
|
-
readonly shippingMethod?: ShippingMethodReference;
|
|
3122
|
-
}
|
|
3123
|
-
export interface CartSetShippingAddressAndCustomShippingMethodAction {
|
|
3124
|
-
readonly action: 'setShippingAddressAndCustomShippingMethod';
|
|
3125
|
-
/**
|
|
3126
|
-
* Value to set.
|
|
3127
|
-
* If not set, the shipping address is unset, and the `taxedPrice` and `taxRate` are unset in all Line Items of the Cart.
|
|
3128
|
-
*
|
|
3129
|
-
*
|
|
3130
|
-
*/
|
|
3131
|
-
readonly address?: _BaseAddress;
|
|
3132
|
-
readonly shippingMethodName: string;
|
|
3133
|
-
readonly shippingRate: ShippingRateDraft;
|
|
3134
|
-
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
3135
|
-
externalTaxRate?: ExternalTaxRateDraft;
|
|
3136
|
-
}
|
|
3137
|
-
export interface CartSetShippingAddressCustomFieldAction {
|
|
3138
|
-
readonly action: 'setShippingAddressCustomField';
|
|
3139
|
-
/**
|
|
3140
|
-
* Name of the [Custom Field](/../api/projects/custom-fields).
|
|
3141
|
-
*
|
|
3142
|
-
*
|
|
3143
|
-
*/
|
|
3144
|
-
readonly name: string;
|
|
3145
|
-
/**
|
|
3146
|
-
* If `value` is absent or `null`, this field will be removed if it exists.
|
|
3147
|
-
* Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
|
|
3148
|
-
* If `value` is provided, it is set for the field defined by `name`.
|
|
3149
|
-
*
|
|
3150
|
-
*
|
|
3151
|
-
*/
|
|
3152
|
-
readonly value?: any;
|
|
3153
|
-
}
|
|
3154
|
-
export interface CartSetShippingAddressCustomTypeAction {
|
|
3155
|
-
readonly action: 'setShippingAddressCustomType';
|
|
3156
|
-
/**
|
|
3157
|
-
* Defines the [Type](ctp:api:type:Type) that extends the `shippingAddress` with [Custom Fields](/../api/projects/custom-fields).
|
|
3158
|
-
* If absent, any existing Type and Custom Fields are removed from the `shippingAddress`.
|
|
3159
|
-
*
|
|
3160
|
-
*
|
|
3161
|
-
*/
|
|
3162
|
-
readonly type?: TypeResourceIdentifier;
|
|
3163
|
-
/**
|
|
3164
|
-
* Sets the [Custom Fields](/../api/projects/custom-fields) fields for the `shippingAddress`.
|
|
3165
|
-
*
|
|
3166
|
-
*
|
|
3167
|
-
*/
|
|
3168
|
-
readonly fields?: FieldContainer;
|
|
3169
|
-
}
|
|
3170
|
-
export interface CartSetShippingCustomFieldAction {
|
|
3171
|
-
readonly action: 'setShippingCustomField';
|
|
3172
|
-
/**
|
|
3173
|
-
* The `shippingKey` of the [Shipping](ctp:api:type:Shipping) to customize. Used to specify which Shipping Method to customize
|
|
3174
|
-
* on a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
3175
|
-
* Leave this empty to customize the one and only ShippingMethod on a `Single` ShippingMode Cart.
|
|
3176
|
-
*
|
|
3177
|
-
*
|
|
3178
|
-
*/
|
|
3179
|
-
readonly shippingKey?: string;
|
|
3180
|
-
/**
|
|
3181
|
-
* Name of the [Custom Field](/../api/projects/custom-fields).
|
|
3182
|
-
*
|
|
3183
|
-
*
|
|
3184
|
-
*/
|
|
3185
|
-
readonly name: string;
|
|
3186
|
-
/**
|
|
3187
|
-
* If `value` is absent or `null`, this field will be removed if it exists.
|
|
3188
|
-
* Trying to remove a field that does not exist will fail with an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
|
|
3189
|
-
* If `value` is provided, it is set for the field defined by `name`.
|
|
3190
|
-
*
|
|
3191
|
-
*
|
|
3192
|
-
*/
|
|
3193
|
-
readonly value?: any;
|
|
3194
|
-
}
|
|
3195
|
-
/**
|
|
3196
|
-
* This action sets, overwrites, or removes any existing Custom Type and Custom Fields for the Cart's `shippingMethod` or `shipping`.
|
|
3197
|
-
*
|
|
3198
|
-
*/
|
|
3199
|
-
export interface CartSetShippingCustomTypeAction {
|
|
3200
|
-
readonly action: 'setShippingCustomType';
|
|
3201
|
-
/**
|
|
3202
|
-
* The `shippingKey` of the [Shipping](ctp:api:type:Shipping) to customize. Used to specify which Shipping Method to customize
|
|
3203
|
-
* on a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode).
|
|
3204
|
-
* Leave this empty to customize the one and only ShippingMethod on a `Single` ShippingMode Cart.
|
|
3205
|
-
*
|
|
3206
|
-
*
|
|
3207
|
-
*/
|
|
3208
|
-
readonly shippingKey?: string;
|
|
3209
|
-
/**
|
|
3210
|
-
* Defines the [Type](ctp:api:type:Type) that extends the specified ShippingMethod with [Custom Fields](/../api/projects/custom-fields).
|
|
3211
|
-
* If absent, any existing Type and Custom Fields are removed from the ShippingMethod.
|
|
3212
|
-
*
|
|
3213
|
-
*
|
|
3214
|
-
*/
|
|
3215
|
-
readonly type?: TypeResourceIdentifier;
|
|
3216
|
-
/**
|
|
3217
|
-
* Sets the [Custom Fields](/../api/projects/custom-fields) fields for the `shippingMethod`.
|
|
3218
|
-
*
|
|
3219
|
-
*
|
|
3220
|
-
*/
|
|
3221
|
-
readonly fields?: FieldContainer;
|
|
3222
|
-
}
|
|
3223
|
-
/**
|
|
3224
|
-
* To set the Cart's Shipping Method the Cart must have the `Single` [ShippingMode](ctp:api:type:ShippingMode) and a `shippingAddress`.
|
|
3225
|
-
*
|
|
3226
|
-
*/
|
|
3227
|
-
export interface CartSetShippingMethodAction {
|
|
3228
|
-
readonly action: 'setShippingMethod';
|
|
3229
|
-
/**
|
|
3230
|
-
* Value to set.
|
|
3231
|
-
* If empty, any existing value is removed.
|
|
3232
|
-
*
|
|
3233
|
-
* If the referenced Shipping Method has a predicate that does not match the Cart, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned.
|
|
3234
|
-
*
|
|
3235
|
-
*
|
|
3236
|
-
*/
|
|
3237
|
-
readonly shippingMethod?: ShippingMethodResourceIdentifier;
|
|
3238
|
-
/**
|
|
3239
|
-
* An external Tax Rate can be set if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode).
|
|
3240
|
-
*
|
|
3241
|
-
*
|
|
3242
|
-
*/
|
|
3243
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
3244
|
-
}
|
|
3245
|
-
/**
|
|
3246
|
-
* A Shipping Method tax amount can be set if the Cart has the `ExternalAmount` [TaxMode](ctp:api:type:TaxMode).
|
|
3247
|
-
*
|
|
3248
|
-
*/
|
|
3249
|
-
export interface CartSetShippingMethodTaxAmountAction {
|
|
3250
|
-
readonly action: 'setShippingMethodTaxAmount';
|
|
3251
|
-
/**
|
|
3252
|
-
* Value to set.
|
|
3253
|
-
* If empty, any existing value is removed.
|
|
3254
|
-
*
|
|
3255
|
-
*
|
|
3256
|
-
*/
|
|
3257
|
-
readonly externalTaxAmount?: ExternalTaxAmountDraft;
|
|
3258
|
-
}
|
|
3259
|
-
/**
|
|
3260
|
-
* A Shipping Method Tax Rate can be set if the Cart has the `External` [TaxMode](ctp:api:type:TaxMode).
|
|
3261
|
-
*
|
|
3262
|
-
*/
|
|
3263
|
-
export interface CartSetShippingMethodTaxRateAction {
|
|
3264
|
-
readonly action: 'setShippingMethodTaxRate';
|
|
3265
|
-
/**
|
|
3266
|
-
* Value to set.
|
|
3267
|
-
* If empty, any existing value is removed.
|
|
3268
|
-
*
|
|
3269
|
-
*
|
|
3270
|
-
*/
|
|
3271
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
3272
|
-
}
|
|
3273
|
-
/**
|
|
3274
|
-
* Input used to select a [ShippingRatePriceTier](ctp:api:type:ShippingRatePriceTier).
|
|
3275
|
-
* If no matching tier can be found, or the input is not set, the default price for the shipping rate is used.
|
|
3276
|
-
*
|
|
3277
|
-
*/
|
|
3278
|
-
export interface CartSetShippingRateInputAction {
|
|
3279
|
-
readonly action: 'setShippingRateInput';
|
|
3280
|
-
/**
|
|
3281
|
-
* The data type of this field depends on the `shippingRateInputType.type` configured in the [Project](ctp:api:type:Project):
|
|
3282
|
-
*
|
|
3283
|
-
* - If `CartClassification`, it must be [ClassificationShippingRateInputDraft](ctp:api:type:ClassificationShippingRateInputDraft).
|
|
3284
|
-
* - If `CartScore`, it must be [ScoreShippingRateInputDraft](ctp:api:type:ScoreShippingRateInputDraft).
|
|
3285
|
-
* - If `CartValue`, it cannot be set.
|
|
3286
|
-
*
|
|
3287
|
-
*
|
|
3288
|
-
*/
|
|
3289
|
-
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
3290
|
-
}
|
|
3291
|
-
/**
|
|
3292
|
-
* Changes the [CartState](ctp:api:type:CartState) from `Frozen` to `Active`. Reactivates a [Frozen Cart](ctp:api:type:FrozenCarts).
|
|
3293
|
-
* This action updates all prices in the Cart according to latest Prices on related Product Variants and Shipping Methods and by applying all discounts currently being active and applicable for the Cart.
|
|
3294
|
-
*
|
|
3295
|
-
*/
|
|
3296
|
-
export interface CartUnfreezeCartAction {
|
|
3297
|
-
readonly action: 'unfreezeCart';
|
|
3298
|
-
}
|
|
3299
|
-
/**
|
|
3300
|
-
* Updates an address in `itemShippingAddresses` by keeping the Address `key`.
|
|
3301
|
-
*
|
|
3302
|
-
*/
|
|
3303
|
-
export interface CartUpdateItemShippingAddressAction {
|
|
3304
|
-
readonly action: 'updateItemShippingAddress';
|
|
3305
|
-
/**
|
|
3306
|
-
* The new Address with the same `key` as the Address it will replace.
|
|
3307
|
-
*
|
|
3308
|
-
*
|
|
3309
|
-
*/
|
|
3310
|
-
readonly address: _BaseAddress;
|
|
3311
|
-
}
|
|
3312
|
-
export interface CustomLineItemImportDraft {
|
|
3313
|
-
/**
|
|
3314
|
-
*
|
|
3315
|
-
*/
|
|
3316
|
-
readonly name: LocalizedString;
|
|
3317
|
-
/**
|
|
3318
|
-
* The amount of a CustomLineItem in the cart.
|
|
3319
|
-
* Must be a positive integer.
|
|
3320
|
-
*
|
|
3321
|
-
*/
|
|
3322
|
-
readonly quantity: number;
|
|
3323
|
-
/**
|
|
3324
|
-
* The cost to add to the cart. The amount can be negative.
|
|
3325
|
-
*
|
|
3326
|
-
*/
|
|
3327
|
-
readonly money: _Money;
|
|
3328
|
-
/**
|
|
3329
|
-
*
|
|
3330
|
-
*/
|
|
3331
|
-
readonly slug: string;
|
|
3332
|
-
/**
|
|
3333
|
-
*
|
|
3334
|
-
*/
|
|
3335
|
-
readonly state?: ItemState[];
|
|
3336
|
-
/**
|
|
3337
|
-
*
|
|
3338
|
-
*/
|
|
3339
|
-
readonly taxRate?: TaxRate;
|
|
3340
|
-
/**
|
|
3341
|
-
*
|
|
3342
|
-
*/
|
|
3343
|
-
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
3344
|
-
/**
|
|
3345
|
-
* The custom fields.
|
|
3346
|
-
*
|
|
3347
|
-
*/
|
|
3348
|
-
readonly custom?: CustomFieldsDraft;
|
|
3349
|
-
/**
|
|
3350
|
-
*
|
|
3351
|
-
*/
|
|
3352
|
-
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
3353
|
-
/**
|
|
3354
|
-
* - If `Standard`, Cart Discounts with a matching [CartDiscountCustomLineItemsTarget](ctp:api:type:CartDiscountCustomLineItemsTarget)
|
|
3355
|
-
* are applied to the Custom Line Item.
|
|
3356
|
-
* - If `External`, Cart Discounts are not considered on the Custom Line Item.
|
|
3357
|
-
*
|
|
3358
|
-
*
|
|
3359
|
-
*/
|
|
3360
|
-
readonly priceMode: CustomLineItemPriceMode;
|
|
3361
|
-
}
|
|
3362
|
-
/**
|
|
3363
|
-
* The scope controls which part of the product information is published.
|
|
3364
|
-
*/
|
|
3365
|
-
export type ProductPublishScope = 'All' | 'Prices' | string;
|
|
3366
|
-
//# sourceMappingURL=cart.d.ts.map
|