Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .changeset/changes_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
'@commercetools/platform-sdk': minor
---

**Api changes**

<details>
<summary>Added Type(s)</summary>

- added type `PaymentTransactionInterfaceIdSetMessage`
- added type `PaymentTransactionInterfaceIdSetMessagePayload`
- added type `PaymentSetTransactionInterfaceIdAction`
- added type `DiscountCombinationMode`
- added type `DiscountsConfiguration`
- added type `ProjectSetDiscountsConfigurationAction`
- added type `SearchFuzzyExpression`
- added type `SearchFuzzyValue`
</details>

<details>
<summary>Added QueryParameter(s)</summary>

- added query parameter `filter[attributes]` to method `get /{projectKey}/product-projections`
- added query parameter `filter[attributes]` to method `get /{projectKey}/product-projections/key={key}`
- added query parameter `filter[attributes]` to method `get /{projectKey}/product-projections/{ID}`
- added query parameter `filter[attributes]` to method `get /{projectKey}/in-store/key={storeKey}/product-projections/key={key}`
- added query parameter `filter[attributes]` to method `get /{projectKey}/in-store/key={storeKey}/product-projections/{ID}`
</details>

<details>
<summary>Required Property(s)</summary>

- changed property `variantSelection` of type `ProductSelectionProductAddedMessage` to be optional
- changed property `variantExclusion` of type `ProductSelectionProductExcludedMessage` to be optional
- changed property `oldVariantExclusion` of type `ProductSelectionVariantExclusionChangedMessage` to be optional
- changed property `newVariantExclusion` of type `ProductSelectionVariantExclusionChangedMessage` to be optional
- changed property `oldVariantSelection` of type `ProductSelectionVariantSelectionChangedMessage` to be optional
- changed property `newVariantSelection` of type `ProductSelectionVariantSelectionChangedMessage` to be optional
- changed property `variantSelection` of type `ProductSelectionProductAddedMessagePayload` to be optional
- changed property `variantExclusion` of type `ProductSelectionProductExcludedMessagePayload` to be optional
- changed property `oldVariantExclusion` of type `ProductSelectionVariantExclusionChangedMessagePayload` to be optional
- changed property `newVariantExclusion` of type `ProductSelectionVariantExclusionChangedMessagePayload` to be optional
- changed property `oldVariantSelection` of type `ProductSelectionVariantSelectionChangedMessagePayload` to be optional
- changed property `newVariantSelection` of type `ProductSelectionVariantSelectionChangedMessagePayload` to be optional
- changed property `startsAt` of type `RecurringOrderDraft` to be optional
</details>

<details>
<summary>Removed Property(s)</summary>

- :warning: removed property `skipConfiguration` from type `RecurringOrderSetOrderSkipConfigurationAction`
</details>

<details>
<summary>Added Property(s)</summary>

- added property `applicationMode` to type `CartDiscountValueRelative`
- added property `applicationMode` to type `CartDiscountValueRelativeDraft`
- added property `interfaceId` to type `MyTransactionDraft`
- added property `interfaceId` to type `Transaction`
- added property `interfaceId` to type `TransactionDraft`
- added property `discounts` to type `Project`
- added property `skipConfigurationInputDraft` to type `RecurringOrderSetOrderSkipConfigurationAction`
</details>
1 change: 0 additions & 1 deletion BEST_PRACTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
## Contents

- [General](#general)

- [Use up-to-date SDK](#use-up-to-date-sdk)
- [Documentation](#documentation)
- [Issues](#issues)
Expand Down
42 changes: 34 additions & 8 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
**Api changes**

<details>
<summary>Added Type(s)</summary>

- added type `PaymentTransactionInterfaceIdSetMessage`
- added type `PaymentTransactionInterfaceIdSetMessagePayload`
- added type `PaymentSetTransactionInterfaceIdAction`
- added type `DiscountCombinationMode`
- added type `DiscountsConfiguration`
- added type `ProjectSetDiscountsConfigurationAction`
- added type `SearchFuzzyExpression`
- added type `SearchFuzzyValue`
</details>

<details>
<summary>Added QueryParameter(s)</summary>

- added query parameter `filter[attributes]` to method `get /{projectKey}/product-projections`
- added query parameter `filter[attributes]` to method `get /{projectKey}/product-projections/key={key}`
- added query parameter `filter[attributes]` to method `get /{projectKey}/product-projections/{ID}`
- added query parameter `filter[attributes]` to method `get /{projectKey}/in-store/key={storeKey}/product-projections/key={key}`
- added query parameter `filter[attributes]` to method `get /{projectKey}/in-store/key={storeKey}/product-projections/{ID}`
</details>

<details>
<summary>Required Property(s)</summary>

Expand All @@ -15,20 +38,23 @@
- changed property `newVariantExclusion` of type `ProductSelectionVariantExclusionChangedMessagePayload` to be optional
- changed property `oldVariantSelection` of type `ProductSelectionVariantSelectionChangedMessagePayload` to be optional
- changed property `newVariantSelection` of type `ProductSelectionVariantSelectionChangedMessagePayload` to be optional
- changed property `startsAt` of type `RecurringOrderDraft` to be optional
</details>

<details>
<summary>Added Property(s)</summary>
<summary>Removed Property(s)</summary>

- added property `interfaceId` to type `MyTransactionDraft`
- added property `interfaceId` to type `Transaction`
- added property `interfaceId` to type `TransactionDraft`
- :warning: removed property `skipConfiguration` from type `RecurringOrderSetOrderSkipConfigurationAction`
</details>

<details>
<summary>Added Type(s)</summary>
<summary>Added Property(s)</summary>

- added type `PaymentTransactionInterfaceIdSetMessage`
- added type `PaymentTransactionInterfaceIdSetMessagePayload`
- added type `PaymentSetTransactionInterfaceIdAction`
- added property `applicationMode` to type `CartDiscountValueRelative`
- added property `applicationMode` to type `CartDiscountValueRelativeDraft`
- added property `interfaceId` to type `MyTransactionDraft`
- added property `interfaceId` to type `Transaction`
- added property `interfaceId` to type `TransactionDraft`
- added property `discounts` to type `Project`
- added property `skipConfigurationInputDraft` to type `RecurringOrderSetOrderSkipConfigurationAction`
</details>
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export class ByProjectKeyCartDiscountsRequestBuilder {
}
/**
* Creating a Cart Discount produces the [CartDiscountCreated](ctp:api:type:CartDiscountCreatedMessage) Message.
*
*/
public post(methodArgs: {
queryArgs?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDRequestBuilde
priceChannel?: string
priceRecurrencePolicy?: string
localeProjection?: string | string[]
'filter[attributes]'?: string | string[]
expand?: string | string[]
[key: string]: QueryParam
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyRequestBu
priceChannel?: string
priceRecurrencePolicy?: string
localeProjection?: string | string[]
'filter[attributes]'?: string | string[]
expand?: string | string[]
[key: string]: QueryParam
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class ByProjectKeyProductProjectionsByIDRequestBuilder {
priceRecurrencePolicy?: string
localeProjection?: string | string[]
storeProjection?: string
'filter[attributes]'?: string | string[]
expand?: string | string[]
[key: string]: QueryParam
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class ByProjectKeyProductProjectionsKeyByKeyRequestBuilder {
priceRecurrencePolicy?: string
localeProjection?: string | string[]
storeProjection?: string
'filter[attributes]'?: string | string[]
expand?: string | string[]
[key: string]: QueryParam
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export class ByProjectKeyProductProjectionsRequestBuilder {
priceRecurrencePolicy?: string
localeProjection?: string | string[]
storeProjection?: string
'filter[attributes]'?: string | string[]
expand?: string | string[]
sort?: string | string[]
limit?: number
Expand Down
25 changes: 24 additions & 1 deletion packages/platform-sdk/src/generated/models/cart-discount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,15 @@ export interface CartDiscountValueRelative extends ICartDiscountValue {
*
*/
readonly permyriad: number
/**
* Indicates how the discount applies when using [CartDiscountPatternTarget](ctp:api:type:CartDiscountPatternTarget).
*
* - If the mode is `IndividualApplication`, the discounted percentage is applied on each unit's price. The units matching the `triggerPattern` are not considered.
* - If the mode is `ProportionateDistribution` and `EvenDistribution` the discounted value is calculated from the total value of the units matching the `targetPattern` and distributed among the units matching the `targetPattern` or `triggerPattern`. These modes are allowed only if [CartDiscountPatternTarget](ctp:api:type:CartDiscountPatternTarget) `triggerPattern` is non-empty.
*
*
*/
readonly applicationMode?: DiscountApplicationMode
}
export interface CartDiscountValueRelativeDraft
extends ICartDiscountValueDraft {
Expand All @@ -687,9 +696,18 @@ export interface CartDiscountValueRelativeDraft
*
*/
readonly permyriad: number
/**
* Determines how the discount applies when using [CartDiscountPatternTarget](ctp:api:type:CartDiscountPatternTarget).
*
* - If the mode is `IndividualApplication`, the discounted percentage is applied on each unit's price. The units matching the `triggerPattern` are not considered.
* - If the mode is `ProportionateDistribution` and `EvenDistribution` the discounted value is calculated from the total value of the units matching the `targetPattern` and distributed among the units matching the `targetPattern` or `triggerPattern`. These modes are allowed only if [CartDiscountPatternTarget](ctp:api:type:CartDiscountPatternTarget) `triggerPattern` is non-empty.
*
*
*/
readonly applicationMode?: DiscountApplicationMode
}
/**
* This mode determines how absolute Discounts are applied on Line Items or Custom Line Items.
* This mode determines how Discounts are distributed among items in a Cart.
*
*/
export enum DiscountApplicationModeValues {
Expand Down Expand Up @@ -973,6 +991,10 @@ export interface CartDiscountChangeTargetAction
/**
* New value to set.
*
* For a [CartDiscountValueRelative](ctp:api:type:CartDiscountValueRelative), if `applicationMode` is set, the target must be [CartDiscountPatternTarget](ctp:api:type:CartDiscountPatternTarget).
* If `applicationMode` is `ProportionateDistribution` or `EvenDistribution`, the [CartDiscountPatternTarget](ctp:api:type:CartDiscountPatternTarget) `triggerPattern` must be non-empty.
* If either conditions are not met, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned.
*
*
*/
readonly target: CartDiscountTarget
Expand All @@ -987,6 +1009,7 @@ export interface CartDiscountChangeValueAction
readonly action: 'changeValue'
/**
* New value to set.
*
* When trying to set a [CartDiscountValueGiftLineItemDraft](ctp:api:type:CartDiscountValueGiftLineItemDraft) an [InvalidInput](ctp:api:type:InvalidInputError) error is returned.
*
*
Expand Down
2 changes: 2 additions & 0 deletions packages/platform-sdk/src/generated/models/cart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3427,6 +3427,8 @@ export interface CartSetCustomerIdAction extends ICartUpdateAction {
/**
* Number of days after the last modification before a Cart is deleted.
*
* Carts with [CartOrigin](ctp:api:type:CartOrigin) `RecurringOrder` are not affected by this update action.
*
* If a [ChangeSubscription](ctp:api:type:ChangeSubscription) exists for Carts, a [ResourceDeletedDeliveryPayload](ctp:api:type:ResourceDeletedDeliveryPayload) is sent.
*
*/
Expand Down
45 changes: 43 additions & 2 deletions packages/platform-sdk/src/generated/models/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ export type BusinessUnitSearchStatus =
export interface CartsConfiguration {
/**
* Default value for the `deleteDaysAfterLastModification` parameter of the [CartDraft](ctp:api:type:CartDraft) and [MyCartDraft](ctp:api:type:MyCartDraft).
* If a [ChangeSubscription](ctp:api:type:ChangeSubscription) for Carts exists, a [ResourceDeletedDeliveryPayload](ctp:api:type:ResourceDeletedDeliveryPayload) is sent upon deletion of a Cart.
*
* This field may not be present on Projects created before January 2020.
* - If a [ChangeSubscription](ctp:api:type:ChangeSubscription) for Carts exists, a [ResourceDeletedDeliveryPayload](ctp:api:type:ResourceDeletedDeliveryPayload) is sent upon deletion of a Cart.
* - Carts with [CartOrigin](ctp:api:type:CartOrigin) `Quote` or `RecurringOrder` are not affected by this configuration value.
* - Changing this value doesn't affect the retention of existing Carts. To update an existing Cart's retention use [`setDeleteDaysAfterLastModification`](/projects/carts#set-deletedaysafterlastmodification) on the Carts API.
* - This field may not be present on Projects created before January 2020.
*
*
*/
Expand Down Expand Up @@ -129,6 +131,28 @@ export enum CustomerSearchStatusValues {
}

export type CustomerSearchStatus = 'Activated' | 'Deactivated' | (string & {})
/**
* Defines how Product Discounts and Cart Discounts are combined for every Cart in a Project.
*
*/
export enum DiscountCombinationModeValues {
BestDeal = 'BestDeal',
Stacking = 'Stacking',
}

export type DiscountCombinationMode = 'BestDeal' | 'Stacking' | (string & {})
/**
* Holds the configuration for behavior of Product and Cart Discounts.
*
*/
export interface DiscountsConfiguration {
/**
* Indicates how Product Discounts and Cart Discounts should be combined. Default value is `Stacking`.
*
*
*/
readonly discountCombinationMode: DiscountCombinationMode
}
/**
* Represents a RFC 7662 compliant [OAuth 2.0 Token Introspection](https://datatracker.ietf.org/doc/html/rfc7662) endpoint. For more information, see [Requesting an access token using an external OAuth 2.0 server](/../api/authorization#request-an-access-token-using-an-external-oauth-server).
*
Expand Down Expand Up @@ -257,6 +281,12 @@ export interface Project {
*
*/
readonly businessUnits?: BusinessUnitConfiguration
/**
* Holds configuration specific to discounts, including how Product and Cart Discounts are combined in every Cart of the Project.
*
*
*/
readonly discounts: DiscountsConfiguration
}
export interface ProjectUpdate {
/**
Expand Down Expand Up @@ -290,6 +320,7 @@ export type ProjectUpdateAction =
| ProjectChangeShoppingListsConfigurationAction
| ProjectChangeTaxRoundingModeAction
| ProjectSetBusinessUnitAssociateRoleOnCreationAction
| ProjectSetDiscountsConfigurationAction
| ProjectSetExternalOAuthAction
| ProjectSetShippingRateInputTypeAction
export interface IProjectUpdateAction {
Expand Down Expand Up @@ -571,6 +602,16 @@ export interface ProjectSetBusinessUnitAssociateRoleOnCreationAction
*/
readonly associateRole: AssociateRoleResourceIdentifier
}
export interface ProjectSetDiscountsConfigurationAction
extends IProjectUpdateAction {
readonly action: 'setDiscountsConfiguration'
/**
* Configuration for the behavior of Cart and Product Discounts in the Project.
*
*
*/
readonly discountsConfiguration: DiscountsConfiguration
}
export interface ProjectSetExternalOAuthAction extends IProjectUpdateAction {
readonly action: 'setExternalOAuth'
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ export interface RecurringOrderDraft {
*/
readonly cartVersion: number
/**
* Date and time (UTC) when the RecurringOrder will start.
* Date and time (UTC) when the RecurringOrder will start. When specified, the date and time must be in the future. If not specified, the recurring order will start immediately.
*
*
*/
readonly startsAt: string
readonly startsAt?: string
/**
* Date and time (UTC) when the RecurringOrder will expire.
*
Expand Down Expand Up @@ -614,7 +614,7 @@ export interface RecurringOrderSetOrderSkipConfigurationAction
*
*
*/
readonly skipConfiguration?: SkipConfigurationDraft
readonly skipConfigurationInputDraft?: SkipConfigurationDraft
/**
* Date and time (UTC) the Recurring Order will expire and stop generating new orders.
*
Expand Down
Loading
Loading