diff --git a/.changeset/changes_api.md b/.changeset/changes_api.md new file mode 100644 index 000000000..57a4e6577 --- /dev/null +++ b/.changeset/changes_api.md @@ -0,0 +1,54 @@ +--- +'@commercetools/platform-sdk': minor +--- + +**Api changes** + +
+Added Type(s) + +- added type `CartMergeMode` +- added type `MergeCartDraft` +- added type `RecurringOrderFailureError` +- added type `GraphQLRecurringOrderFailureError` +- added type `CartFrozenMessage` +- added type `CartUnfrozenMessage` +- added type `OrderPaymentRemovedMessage` +- added type `RecurringOrderFailedMessage` +- added type `CartFrozenMessagePayload` +- added type `CartUnfrozenMessagePayload` +- added type `OrderPaymentRemovedMessagePayload` +- added type `RecurringOrderFailedMessagePayload` +
+ +
+Added Method(s) + +- added method `apiRoot.withProjectKey().carts().customerIdWithCustomerIdValueMerge().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().carts().customerIdWithCustomerIdValueMerge().post()` +
+ +
+Removed Property(s) + +- :warning: removed property `payment` from type `OrderPaymentAddedMessage` +- :warning: removed property `payment` from type `OrderPaymentAddedMessagePayload` +- :warning: removed property `tierMinimumQuantity` from type `StandalonePriceRemovePriceTierAction` +
+ +
+Added Property(s) + +- added property `sku` to type `InventoryEntryQuantitySetMessage` +- added property `paymentRef` to type `OrderPaymentAddedMessage` +- added property `sku` to type `InventoryEntryQuantitySetMessagePayload` +- added property `paymentRef` to type `OrderPaymentAddedMessagePayload` +- added property `minimumQuantity` to type `StandalonePriceRemovePriceTierAction` +
+ +
+Added Resource(s) + +- added resource `/{projectKey}/carts/customer-id={customerId}/merge` +- added resource `/{projectKey}/in-store/key={storeKey}/carts/customer-id={customerId}/merge` +
diff --git a/.changeset/changes_checkout.md b/.changeset/changes_checkout.md new file mode 100644 index 000000000..10ea9c6cc --- /dev/null +++ b/.changeset/changes_checkout.md @@ -0,0 +1,159 @@ +--- +'@commercetools/checkout-sdk': minor +--- + +**Checkout changes** + +
+Added Type(s) + +- added type `AllowedOrigins` +- added type `Application` +- added type `ApplicationAgreement` +- added type `ApplicationAgreementDraft` +- added type `ApplicationAgreementStatus` +- added type `ApplicationAgreementType` +- added type `ApplicationDraft` +- added type `ApplicationLogo` +- added type `ApplicationMode` +- added type `ApplicationStatus` +- added type `ApplicationUpdateAction` +- added type `ApplicationUpdateActions` +- added type `DiscountsConfiguration` +- added type `PaginatedApplication` +- added type `PaymentsConfiguration` +- added type `AddAllowedOriginUpdateAction` +- added type `AddApplicationAgreementUpdateAction` +- added type `AddCountryUpdateAction` +- added type `RemoveAllowedOriginUpdateAction` +- added type `RemoveApplicationAgreementUpdateAction` +- added type `RemoveCountryUpdateAction` +- added type `ReorderApplicationAgreementUpdateAction` +- added type `SetActivePaymentComponentTypeUpdateAction` +- added type `SetAllowAllOriginsUpdateAction` +- added type `SetAllowedOriginsUpdateAction` +- added type `SetApplicationAgreementNameUpdateAction` +- added type `SetApplicationAgreementStatusUpdateAction` +- added type `SetApplicationAgreementTextUpdateAction` +- added type `SetApplicationAgreementTypeUpdateAction` +- added type `SetApplicationAgreementsUpdateAction` +- added type `SetApplicationLogoUpdateAction` +- added type `SetApplicationNameUpdateAction` +- added type `SetApplicationStatusUpdateAction` +- added type `SetCountriesUpdateAction` +- added type `SetDescriptionUpdateAction` +- added type `SetDiscountsConfigurationUpdateAction` +- added type `SetPaymentReturnUrlUpdateAction` +- added type `SetPaymentsConfigurationUpdateAction` +- added type `CreatedBy` +- added type `LastModifiedBy` +- added type `LocalizedString` +- added type `LocalizedUrl` +- added type `ConcurrentModificationError` +- added type `DuplicateFieldWithConflictingResourceError` +- added type `ErrorResponse` +- added type `InvalidFieldError` +- added type `InvalidOperationError` +- added type `MaxResourceLimitExceededError` +- added type `MissingProjectKeyError` +- added type `ReferencedResourceNotFoundError` +- added type `ServiceUnavailableError` +- added type `SyntaxErrorError` +- added type `AutomatedReversalConfiguration` +- added type `ConnectorDeploymentReference` +- added type `DisplayInfo` +- added type `PaginatedPaymentIntegration` +- added type `PaymentComponentType` +- added type `PaymentIntegration` +- added type `PaymentIntegrationDraft` +- added type `PaymentIntegrationStatus` +- added type `PaymentIntegrationType` +- added type `SortingInfo` +- added type `PaymentIntegrationUpdateAction` +- added type `PaymentIntegrationUpdateActions` +- added type `SetAutomatedReversalConfigurationPredicateUpdateAction` +- added type `SetAutomatedReversalConfigurationStatusUpdateAction` +- added type `SetAutomatedReversalConfigurationUpdateAction` +- added type `SetConnectorDeploymentUpdateAction` +- added type `SetDisplayInfoDescriptionUpdateAction` +- added type `SetDisplayInfoLabelUpdateAction` +- added type `SetDisplayInfoLogoUrlUpdateAction` +- added type `SetDisplayInfoPayButtonTextUpdateAction` +- added type `SetDisplayInfoUpdateAction` +- added type `SetKeyUpdateAction` +- added type `SetNameUpdateAction` +- added type `SetPredicateUpdateAction` +- added type `SetSortingInfoUpdateAction` +- added type `SetStatusUpdateAction` +- added type `SetTypeUpdateAction` +
+ +
+Added Enum(s) + +- added enum `deployment` to type `ReferenceTypeId` +
+ +
+Required Property(s) + +- changed property `detailedErrorMessage` of type `InvalidJsonInputError` to be optional +
+ +
+Changed Property(s) + +- :warning: changed property `application` of type `Transaction` from type `ApplicationResourceIdentifier` to `ApplicationReference` +
+ +
+Added Property(s) + +- added property `resourceIdentifier` to type `ResourceNotFoundError` +- added property `resourceId` to type `ResourceNotFoundError` +
+ +
+Changed MethodResponseBody(s) + +- :warning: changed response body for `400: application/json` of method `post /{projectKey}/transactions` from type `null` to `ErrorResponse` +- :warning: changed response body for `400: application/json` of method `post /{projectKey}/payment-intents/{paymentId}` from type `null` to `ErrorResponse` +- :warning: changed response body for `400: application/json` of method `get /{projectKey}/transactions/{id}` from type `null` to `ErrorResponse` +- :warning: changed response body for `400: application/json` of method `get /{projectKey}/transactions/key={key}` from type `null` to `ErrorResponse` +
+ +
+Added Method(s) + +- added method `apiRoot.withProjectKey().paymentIntegrations().get()` +- added method `apiRoot.withProjectKey().paymentIntegrations().post()` +- added method `apiRoot.withProjectKey().applications().get()` +- added method `apiRoot.withProjectKey().applications().post()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withId().get()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withId().head()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withId().post()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withId().delete()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withKey().get()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withKey().post()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withKey().head()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withKey().delete()` +- added method `apiRoot.withProjectKey().applications().withId().get()` +- added method `apiRoot.withProjectKey().applications().withId().head()` +- added method `apiRoot.withProjectKey().applications().withId().post()` +- added method `apiRoot.withProjectKey().applications().withId().delete()` +- added method `apiRoot.withProjectKey().applications().withKey().get()` +- added method `apiRoot.withProjectKey().applications().withKey().post()` +- added method `apiRoot.withProjectKey().applications().withKey().head()` +- added method `apiRoot.withProjectKey().applications().withKey().delete()` +
+ +
+Added Resource(s) + +- added resource `/{projectKey}/payment-integrations` +- added resource `/{projectKey}/applications` +- added resource `/{projectKey}/payment-integrations/{id}` +- added resource `/{projectKey}/payment-integrations/key={key}` +- added resource `/{projectKey}/applications/{id}` +- added resource `/{projectKey}/applications/key={key}` +
diff --git a/.changeset/changes_history.md b/.changeset/changes_history.md new file mode 100644 index 000000000..828484cf3 --- /dev/null +++ b/.changeset/changes_history.md @@ -0,0 +1,545 @@ +--- +'@commercetools/history-sdk': minor +--- + +**History changes** + +
+Added Type(s) + +- added type `AddShippingChange` +- added type `ChangeApprovalRuleModeChange` +- added type `ChangeCustomerChange` +- added type `ChangeIncludedInStatisticsChange` +- added type `ChangeLastVariantIdChange` +- added type `ChangeLineItemNameChange` +- added type `ChangeLineItemPublishedChange` +- added type `ExcludeProductChange` +- added type `RemoveShippingChange` +- added type `ReplaceTaxRateChange` +- added type `RevertStagedChangesChange` +- added type `RevertStagedVariantChangesChange` +- added type `SetAncestorsChange` +- added type `SetBillingAddressCustomFieldChange` +- added type `SetBillingAddressCustomTypeChange` +- added type `SetBusinessUnitChange` +- added type `SetCustomLineItemDiscountedPriceChange` +- added type `SetCustomLineItemDiscountedPricePerQuantityChange` +- added type `SetCustomerGroupAssignmentsChange` +- added type `SetDeliveryAddressCustomFieldChange` +- added type `SetDeliveryAddressCustomTypeChange` +- added type `SetDeliveryCustomFieldChange` +- added type `SetDeliveryCustomTypeChange` +- added type `SetDiscountOnTotalPriceChange` +- added type `SetInheritedStoresChange` +- added type `SetItemShippingAddressCustomFieldChange` +- added type `SetItemShippingAddressCustomTypeChange` +- added type `SetMaxCartQuantityChange` +- added type `SetMinCartQuantityChange` +- added type `SetParcelCustomFieldChange` +- added type `SetParcelCustomTypeChange` +- added type `SetPasswordChange` +- added type `SetPriceKeyChange` +- added type `SetPriceModeChange` +- added type `SetProductAttributeChange` +- added type `SetReturnInfoChange` +- added type `SetReturnItemCustomLineItemCustomFieldChange` +- added type `SetReturnItemCustomLineItemCustomTypeChange` +- added type `SetReturnItemLineItemCustomFieldChange` +- added type `SetReturnItemLineItemCustomTypeChange` +- added type `SetShippingAddressCustomFieldChange` +- added type `SetShippingAddressCustomTypeChange` +- added type `SetShippingCustomFieldChange` +- added type `SetShippingCustomTypeChange` +- added type `SetTransactionCustomFieldChange` +- added type `SetTransactionCustomTypeChange` +- added type `SetUnitTypeChange` +- added type `SetVariantExclusionChange` +- added type `UpdateItemShippingAddressChange` +- added type `SetAssociatesChange` +- added type `SetInheritedAssociatesChange` +- added type `ChangeTopLevelUnitChange` +- added type `Attribute` +- added type `BusinessUnitApprovalRuleMode` +- added type `BusinessUnitResourceIdentifier` +- added type `BusinessUnitType` +- added type `CustomFieldEnumValue` +- added type `CustomFieldLocalizedEnumValue` +- added type `CustomerGroupAssignment` +- added type `DiscountOnTotalPrice` +- added type `DiscountedTotalPricePortion` +- added type `ProductPriceModeEnum` +- added type `ProductVariantExclusion` +- added type `Shipping` +- added type `ShippingInfo` +- added type `ShippingRateInput` +- added type `ShoppingListLineItem` +- added type `TypeTextInputHint` +- added type `TypedMoney` +- added type `CentPrecisionMoney` +- added type `DiscountedPrice` +- added type `ShippingMethodState` +- added type `AssociateRoleDeprecated` +- added type `AssociateRoleKeyReference` +- added type `AttributeLevelEnum` +- added type `BaseAddress` +- added type `BusinessUnitKeyReference` +- added type `CartDiscountReference` +- added type `CartDiscountTarget` +- added type `CartDiscountValue` +- added type `CategoryReference` +- added type `ChannelReference` +- added type `CustomFieldValue` +- added type `CustomLineItemPriceMode` +- added type `CustomLineItemRecurrenceInfo` +- added type `CustomerGroupReference` +- added type `CustomerReference` +- added type `DiscountCodeReference` +- added type `FieldContainer` +- added type `GeoJson` +- added type `InventoryMode` +- added type `LineItemMode` +- added type `LineItemPriceMode` +- added type `LineItemRecurrenceInfo` +- added type `MethodTaxRate` +- added type `MethodTaxedPrice` +- added type `PaymentReference` +- added type `PriceSelectionMode` +- added type `PriceTier` +- added type `ProductDiscountReference` +- added type `ProductDiscountValue` +- added type `ProductReference` +- added type `ProductSelectionReference` +- added type `ProductTypeReference` +- added type `ProductVariant` +- added type `RecurrencePolicyReference` +- added type `ResourceTypeId` +- added type `ScopedPrice` +- added type `ShippingMethodReference` +- added type `StateReference` +- added type `StoreKeyReference` +- added type `TaxCategoryReference` +- added type `TaxPortion` +- added type `TypeReference` +- added type `ClientLogging` +- added type `ChangePriceRoundingModeChange` +
+ +
+Changed Type(s) + +- :warning: changed type `Address` from type `object` to `BaseAddress` +- :warning: changed type `GeoLocation` from type `object` to `GeoJson` +
+ +
+MarkDeprecated Type(s) + +- marked type `AddAssociateChange` as deprecated +- marked type `AddPriceChange` as deprecated +- marked type `AddProductSelectionChange` as deprecated +- marked type `AddStateRolesChange` as deprecated +- marked type `ChangeAmountAuthorizedChange` as deprecated +- marked type `RemoveAssociateChange` as deprecated +- marked type `RemovePriceChange` as deprecated +- marked type `RemoveProductSelectionChange` as deprecated +- marked type `RemoveStateRolesChange` as deprecated +
+ +
+Added Enum(s) + +- added enum `addInheritedAssociate` to type `PlatformInitiatedChange` +- added enum `changeIncludedInStatistics` to type `PlatformInitiatedChange` +- added enum `changeInheritedAssociate` to type `PlatformInitiatedChange` +- added enum `changeLastVariantId` to type `PlatformInitiatedChange` +- added enum `changeLineItemPublished` to type `PlatformInitiatedChange` +- added enum `changeTopLevelUnit` to type `PlatformInitiatedChange` +- added enum `removeInheritedAssociate` to type `PlatformInitiatedChange` +- added enum `setAncestors` to type `PlatformInitiatedChange` +- added enum `setInheritedAssociates` to type `PlatformInitiatedChange` +- added enum `setInheritedStores` to type `PlatformInitiatedChange` +- added enum `setLineItemDeactivatedAt` to type `PlatformInitiatedChange` +- added enum `setProductCount` to type `PlatformInitiatedChange` +- added enum `setReservations` to type `PlatformInitiatedChange` +- added enum `CreateApprovalRules` to type `Permission` +- added enum `UpdateApprovalRules` to type `Permission` +- added enum `UpdateApprovalFlows` to type `Permission` +- added enum `ViewMyShoppingLists` to type `Permission` +- added enum `ViewOthersShoppingLists` to type `Permission` +- added enum `UpdateMyShoppingLists` to type `Permission` +- added enum `UpdateOthersShoppingLists` to type `Permission` +- added enum `CreateMyShoppingLists` to type `Permission` +- added enum `CreateOthersShoppingLists` to type `Permission` +- added enum `DeleteMyShoppingLists` to type `Permission` +- added enum `DeleteOthersShoppingLists` to type `Permission` +- added enum `includeOnly` to type `ProductVariantSelectionTypeEnum` +- added enum `includeAllExcept` to type `ProductVariantSelectionTypeEnum` +- added enum `RenegotiationAddressed` to type `QuoteState` +- added enum `approval-flow` to type `ReferenceTypeId` +- added enum `approval-rule` to type `ReferenceTypeId` +- added enum `attribute-group` to type `ReferenceTypeId` +- added enum `direct-discount` to type `ReferenceTypeId` +- added enum `discount-group` to type `ReferenceTypeId` +- added enum `product-price` to type `ReferenceTypeId` +- added enum `product-tailoring` to type `ReferenceTypeId` +- added enum `recurrence-policy` to type `ReferenceTypeId` +- added enum `recurring-order` to type `ReferenceTypeId` +- added enum `standalone-price` to type `ReferenceTypeId` +- added enum `Delivered` to type `ShipmentState` +- added enum `Canceled` to type `ShipmentState` +
+ +
+Removed Enum(s) + +- :warning: removed enum `changeAmountAuthorized` from type `UpdateType` +- :warning: removed enum `Failed` from type `QuoteState` +
+ +
+Required Property(s) + +- changed property `id` of type `Address` to be optional +- changed property `key` of type `Address` to be optional +- changed property `title` of type `Address` to be optional +- changed property `salutation` of type `Address` to be optional +- changed property `firstName` of type `Address` to be optional +- changed property `lastName` of type `Address` to be optional +- changed property `streetName` of type `Address` to be optional +- changed property `streetNumber` of type `Address` to be optional +- changed property `additionalStreetInfo` of type `Address` to be optional +- changed property `postalCode` of type `Address` to be optional +- changed property `city` of type `Address` to be optional +- changed property `region` of type `Address` to be optional +- changed property `state` of type `Address` to be optional +- changed property `company` of type `Address` to be optional +- changed property `department` of type `Address` to be optional +- changed property `building` of type `Address` to be optional +- changed property `apartment` of type `Address` to be optional +- changed property `pOBox` of type `Address` to be optional +- changed property `phone` of type `Address` to be optional +- changed property `mobile` of type `Address` to be optional +- changed property `email` of type `Address` to be optional +- changed property `fax` of type `Address` to be optional +- changed property `additionalAddressInfo` of type `Address` to be optional +- changed property `externalId` of type `Address` to be optional +- changed property `description` of type `Asset` to be optional +- changed property `custom` of type `Asset` to be optional +- changed property `key` of type `Asset` to be optional +- changed property `key` of type `AssetSource` to be optional +- changed property `dimensions` of type `AssetSource` to be optional +- changed property `contentType` of type `AssetSource` to be optional +- changed property `inputTip` of type `AttributeDefinition` to be optional +- changed property `taxedPrice` of type `CustomLineItem` to be optional +- changed property `inputHint` of type `FieldDefinition` to be optional +- changed property `label` of type `Image` to be optional +- changed property `productSlug` of type `LineItem` to be optional +- changed property `custom` of type `LineItem` to be optional +- changed property `addedAt` of type `LineItem` to be optional +- changed property `state` of type `Location` to be optional +- changed property `measurements` of type `Parcel` to be optional +- changed property `trackingData` of type `Parcel` to be optional +- changed property `items` of type `Parcel` to be optional +- changed property `heightInMillimeter` of type `ParcelMeasurements` to be optional +- changed property `lengthInMillimeter` of type `ParcelMeasurements` to be optional +- changed property `widthInMillimeter` of type `ParcelMeasurements` to be optional +- changed property `weightInGram` of type `ParcelMeasurements` to be optional +- changed property `channels` of type `ProductVariantAvailability` to be optional +- changed property `isOnStock` of type `ProductVariantAvailability` to be optional +- changed property `restockableInDays` of type `ProductVariantAvailability` to be optional +- changed property `availableQuantity` of type `ProductVariantAvailability` to be optional +- changed property `isOnStock` of type `ProductVariantChannelAvailability` to be optional +- changed property `restockableInDays` of type `ProductVariantChannelAvailability` to be optional +- changed property `availableQuantity` of type `ProductVariantChannelAvailability` to be optional +- changed property `id` of type `ResourceIdentifier` to be optional +- changed property `key` of type `ResourceIdentifier` to be optional +- changed property `returnTrackingId` of type `ReturnInfo` to be optional +- changed property `returnDate` of type `ReturnInfo` to be optional +- changed property `comment` of type `ReturnItem` to be optional +- changed property `suggestTokenizer` of type `SearchKeyword` to be optional +- changed property `freeAbove` of type `ShippingRate` to be optional +- changed property `isMatching` of type `ShippingRate` to be optional +- changed property `externalId` of type `SyncInfo` to be optional +- changed property `id` of type `TaxRate` to be optional +- changed property `state` of type `TaxRate` to be optional +- changed property `subRates` of type `TaxRate` to be optional +- changed property `custom` of type `TextLineItem` to be optional +- changed property `description` of type `TextLineItem` to be optional +- changed property `trackingId` of type `TrackingData` to be optional +- changed property `carrier` of type `TrackingData` to be optional +- changed property `provider` of type `TrackingData` to be optional +- changed property `providerTransaction` of type `TrackingData` to be optional +- changed property `isReturn` of type `TrackingData` to be optional +- changed property `timestamp` of type `Transaction` to be optional +- changed property `interactionId` of type `Transaction` to be optional +
+ +
+Changed Property(s) + +- :warning: changed property `nextValue` of type `AddEnumValueChange` from type `EnumValue` to `CustomFieldEnumValue` +- :warning: changed property `nextValue` of type `AddInterfaceInteractionChange` from type `CustomFieldExpandedValue` to `CustomFields` +- :warning: changed property `nextValue` of type `AddLocalizedEnumValueChange` from type `AttributeLocalizedEnumValue` to `CustomFieldLocalizedEnumValue` +- :warning: changed property `previousValue` of type `AddShoppingListLineItemChange` from type `LineItem` to `ShoppingListLineItem` +- :warning: changed property `nextValue` of type `AddShoppingListLineItemChange` from type `LineItem` to `ShoppingListLineItem` +- :warning: changed property `w` of type `AssetDimensions` from type `integer` to `number` +- :warning: changed property `h` of type `AssetDimensions` from type `integer` to `number` +- :warning: changed property `customer` of type `Associate` from type `Reference` to `CustomerReference` +- :warning: changed property `associateRole` of type `AssociateRoleAssignment` from type `KeyReference` to `AssociateRoleKeyReference` +- :warning: changed property `previousValue` of type `ChangeEnumValueOrderChange` from type `EnumValue[]` to `CustomFieldEnumValue[]` +- :warning: changed property `nextValue` of type `ChangeEnumValueOrderChange` from type `EnumValue[]` to `CustomFieldEnumValue[]` +- :warning: changed property `previousValue` of type `ChangeInputHintChange` from type `TextInputHint` to `TypeTextInputHint` +- :warning: changed property `nextValue` of type `ChangeInputHintChange` from type `TextInputHint` to `TypeTextInputHint` +- :warning: changed property `previousValue` of type `ChangeLocalizedEnumValueOrderChange` from type `LocalizedEnumValue[]` to `AttributeLocalizedEnumValue[]` +- :warning: changed property `nextValue` of type `ChangeLocalizedEnumValueOrderChange` from type `LocalizedEnumValue[]` to `AttributeLocalizedEnumValue[]` +- :warning: changed property `previousValue` of type `ChangePlainEnumValueOrderChange` from type `EnumValue[]` to `AttributePlainEnumValue[]` +- :warning: changed property `nextValue` of type `ChangePlainEnumValueOrderChange` from type `EnumValue[]` to `AttributePlainEnumValue[]` +- :warning: changed property `type` of type `CustomFields` from type `Reference` to `TypeReference` +- :warning: changed property `fields` of type `CustomFields` from type `object` to `FieldContainer` +- :warning: changed property `money` of type `CustomLineItem` from type `Money` to `TypedMoney` +- :warning: changed property `totalPrice` of type `CustomLineItem` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `quantity` of type `CustomLineItem` from type `integer` to `number` +- :warning: changed property `createdAt` of type `Delivery` from type `string` to `datetime` +- :warning: changed property `quantity` of type `DeliveryItem` from type `integer` to `number` +- :warning: changed property `discountCode` of type `DiscountCodeInfo` from type `Reference` to `DiscountCodeReference` +- :warning: changed property `discountedAmount` of type `DiscountedLineItemPortion` from type `Money` to `TypedMoney` +- :warning: changed property `value` of type `DiscountedLineItemPrice` from type `Money` to `TypedMoney` +- :warning: changed property `quantity` of type `DiscountedLineItemPriceForQuantity` from type `integer` to `number` +- :warning: changed property `inputHint` of type `FieldDefinition` from type `TextInputHint` to `TypeTextInputHint` +- :warning: changed property `w` of type `ImageDimensions` from type `integer` to `number` +- :warning: changed property `h` of type `ImageDimensions` from type `integer` to `number` +- :warning: changed property `customer` of type `InheritedAssociate` from type `Reference` to `CustomerReference` +- :warning: changed property `associateRole` of type `InheritedAssociateRoleAssignment` from type `KeyReference` to `AssociateRoleKeyReference` +- :warning: changed property `source` of type `InheritedAssociateRoleAssignment` from type `KeyReference` to `BusinessUnitKeyReference` +- :warning: changed property `quantity` of type `ItemShippingTarget` from type `integer` to `number` +- :warning: changed property `quantity` of type `ItemState` from type `integer` to `number` +- :warning: changed property `state` of type `ItemState` from type `Reference` to `StateReference` +- :warning: changed property `productType` of type `LineItem` from type `Reference` to `ProductTypeReference` +- :warning: changed property `variant` of type `LineItem` from type `Variant` to `ProductVariant` +- :warning: changed property `quantity` of type `LineItem` from type `integer` to `number` +- :warning: changed property `addedAt` of type `LineItem` from type `string` to `datetime` +- :warning: changed property `centAmount` of type `Money` from type `integer` to `number` +- :warning: changed property `createdAt` of type `Parcel` from type `string` to `datetime` +- :warning: changed property `heightInMillimeter` of type `ParcelMeasurements` from type `integer` to `number` +- :warning: changed property `lengthInMillimeter` of type `ParcelMeasurements` from type `integer` to `number` +- :warning: changed property `widthInMillimeter` of type `ParcelMeasurements` from type `integer` to `number` +- :warning: changed property `weightInGram` of type `ParcelMeasurements` from type `integer` to `number` +- :warning: changed property `payments` of type `PaymentInfo` from type `Reference[]` to `PaymentReference[]` +- :warning: changed property `value` of type `Price` from type `Money` to `TypedMoney` +- :warning: changed property `productSelection` of type `ProductSelectionSetting` from type `Reference` to `ProductSelectionReference` +- :warning: changed property `restockableInDays` of type `ProductVariantAvailability` from type `integer` to `number` +- :warning: changed property `availableQuantity` of type `ProductVariantAvailability` from type `integer` to `number` +- :warning: changed property `restockableInDays` of type `ProductVariantChannelAvailability` from type `integer` to `number` +- :warning: changed property `availableQuantity` of type `ProductVariantChannelAvailability` from type `integer` to `number` +- :warning: changed property `previousValue` of type `RemoveDeliveryItemsChange` from type `Delivery` to `DeliveryChangeValue` +- :warning: changed property `previousValue` of type `RemoveEnumValuesChange` from type `EnumValue` to `AttributePlainEnumValue` +- :warning: changed property `previousValue` of type `RemoveLocalizedEnumValuesChange` from type `LocalizedEnumValue` to `AttributeLocalizedEnumValue` +- :warning: changed property `previousValue` of type `RemoveShoppingListLineItemChange` from type `LineItem` to `ShoppingListLineItem` +- :warning: changed property `nextValue` of type `RemoveShoppingListLineItemChange` from type `LineItem` to `ShoppingListLineItem` +- :warning: changed property `returnDate` of type `ReturnInfo` from type `string` to `datetime` +- :warning: changed property `quantity` of type `ReturnItem` from type `integer` to `number` +- :warning: changed property `lastModifiedAt` of type `ReturnItem` from type `string` to `datetime` +- :warning: changed property `createdAt` of type `ReturnItem` from type `string` to `datetime` +- :warning: changed property `averageRating` of type `ReviewRatingStatistics` from type `integer` to `number` +- :warning: changed property `highestRating` of type `ReviewRatingStatistics` from type `integer` to `number` +- :warning: changed property `lowestRating` of type `ReviewRatingStatistics` from type `integer` to `number` +- :warning: changed property `previousValue` of type `SetAttributeChange` from type `AttributeValue` to `Attribute` +- :warning: changed property `nextValue` of type `SetAttributeChange` from type `AttributeValue` to `Attribute` +- :warning: changed property `previousValue` of type `SetCustomLineItemTaxedPriceChange` from type `Money` to `TaxedItemPrice` +- :warning: changed property `nextValue` of type `SetCustomLineItemTaxedPriceChange` from type `Money` to `TaxedItemPrice` +- :warning: changed property `previousValue` of type `SetDiscountedPriceChange` from type `Price` to `DiscountedPrice` +- :warning: changed property `nextValue` of type `SetDiscountedPriceChange` from type `Price` to `DiscountedPrice` +- :warning: changed property `previousValue` of type `SetOrderTaxedPriceChange` from type `TaxedItemPrice` to `TaxedPrice` +- :warning: changed property `nextValue` of type `SetOrderTaxedPriceChange` from type `TaxedItemPrice` to `TaxedPrice` +- :warning: changed property `previousValue` of type `SetShippingInfoTaxedPriceChange` from type `TaxedPrice` to `TaxedItemPrice` +- :warning: changed property `nextValue` of type `SetShippingInfoTaxedPriceChange` from type `TaxedPrice` to `TaxedItemPrice` +- :warning: changed property `previousValue` of type `SetShippingRateChange` from type `Money` to `ShippingRate` +- :warning: changed property `nextValue` of type `SetShippingRateChange` from type `Money` to `ShippingRate` +- :warning: changed property `previousValue` of type `SetStoreChange` from type `Reference` to `KeyReference` +- :warning: changed property `nextValue` of type `SetStoreChange` from type `Reference` to `KeyReference` +- :warning: changed property `price` of type `ShippingRate` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `freeAbove` of type `ShippingRate` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `amount` of type `SubRate` from type `integer` to `number` +- :warning: changed property `channel` of type `SyncInfo` from type `Reference` to `ChannelReference` +- :warning: changed property `syncedAt` of type `SyncInfo` from type `string` to `datetime` +- :warning: changed property `amount` of type `TaxRate` from type `integer` to `number` +- :warning: changed property `totalNet` of type `TaxedItemPrice` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `totalGross` of type `TaxedItemPrice` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `totalNet` of type `TaxedPrice` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `totalGross` of type `TaxedPrice` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `addedAt` of type `TextLineItem` from type `string` to `datetime` +- :warning: changed property `quantity` of type `TextLineItem` from type `integer` to `number` +- :warning: changed property `timestamp` of type `Transaction` from type `string` to `datetime` +- :warning: changed property `amount` of type `Transaction` from type `Money` to `CentPrecisionMoney` +
+ +
+Removed Property(s) + +- :warning: removed property `/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/` from type `CategoryOrderHints` +- :warning: removed property `variantId` from type `LineItem` +- :warning: removed property `fractionDigits` from type `Money` +- :warning: removed property `type` from type `Money` +- :warning: removed property `//` from type `ProductVariantChannelAvailabilityMap` +- :warning: removed property `skus` from type `ProductVariantSelection` +
+ +
+Added Property(s) + +- added property `catalogData` to type `AddAssetChange` +- added property `variant` to type `AddAssetChange` +- added property `attributeName` to type `AddEnumValueChange` +- added property `variant` to type `AddExternalImageChange` +- added property `variant` to type `AddPriceChange` +- added property `catalogData` to type `AddToCategoryChange` +- added property `custom` to type `Address` +- added property `sources` to type `Asset` +- added property `tags` to type `Asset` +- added property `roles` to type `Associate` +- added property `level` to type `AttributeDefinition` +- added property `/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/` to type `CategoryOrderHints` +- added property `catalogData` to type `ChangeAssetNameChange` +- added property `variant` to type `ChangeAssetNameChange` +- added property `catalogData` to type `ChangeAssetOrderChange` +- added property `variant` to type `ChangeAssetOrderChange` +- added property `addedItems` to type `ChangeCartDiscountsChange` +- added property `removedItems` to type `ChangeCartDiscountsChange` +- added property `attributeName` to type `ChangeEnumValueLabelChange` +- added property `attributeName` to type `ChangeEnumValueOrderChange` +- added property `addedItems` to type `ChangeGroupsChange` +- added property `removedItems` to type `ChangeGroupsChange` +- added property `variant` to type `ChangePriceChange` +- added property `catalogData` to type `ChangeSlugChange` +- added property `key` to type `CustomLineItem` +- added property `taxedPricePortions` to type `CustomLineItem` +- added property `state` to type `CustomLineItem` +- added property `taxCategory` to type `CustomLineItem` +- added property `taxRate` to type `CustomLineItem` +- added property `perMethodTaxRate` to type `CustomLineItem` +- added property `discountedPricePerQuantity` to type `CustomLineItem` +- added property `custom` to type `CustomLineItem` +- added property `shippingDetails` to type `CustomLineItem` +- added property `priceMode` to type `CustomLineItem` +- added property `recurrenceInfo` to type `CustomLineItem` +- added property `key` to type `Delivery` +- added property `required` to type `FieldDefinition` +- added property `shippingMethodKey` to type `ItemShippingTarget` +- added property `key` to type `LineItem` +- added property `productKey` to type `LineItem` +- added property `price` to type `LineItem` +- added property `totalPrice` to type `LineItem` +- added property `discountedPricePerQuantity` to type `LineItem` +- added property `taxedPrice` to type `LineItem` +- added property `taxedPricePortions` to type `LineItem` +- added property `state` to type `LineItem` +- added property `taxRate` to type `LineItem` +- added property `perMethodTaxRate` to type `LineItem` +- added property `supplyChannel` to type `LineItem` +- added property `distributionChannel` to type `LineItem` +- added property `priceMode` to type `LineItem` +- added property `lineItemMode` to type `LineItem` +- added property `inventoryMode` to type `LineItem` +- added property `shippingDetails` to type `LineItem` +- added property `lastModifiedAt` to type `LineItem` +- added property `recurrenceInfo` to type `LineItem` +- added property `variant` to type `MoveImageToPositionChange` +- added property `key` to type `Parcel` +- added property `custom` to type `Parcel` +- added property `key` to type `Price` +- added property `country` to type `Price` +- added property `customerGroup` to type `Price` +- added property `channel` to type `Price` +- added property `validFrom` to type `Price` +- added property `validUntil` to type `Price` +- added property `discounted` to type `Price` +- added property `tiers` to type `Price` +- added property `custom` to type `Price` +- added property `recurrencePolicy` to type `Price` +- added property `id` to type `ProductVariantAvailability` +- added property `version` to type `ProductVariantAvailability` +- added property `id` to type `ProductVariantChannelAvailability` +- added property `version` to type `ProductVariantChannelAvailability` +- added property `/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/` to type `ProductVariantChannelAvailabilityMap` +- added property `catalogData` to type `RemoveAssetChange` +- added property `variant` to type `RemoveAssetChange` +- added property `catalogData` to type `RemoveFromCategoryChange` +- added property `variant` to type `RemoveImageChange` +- added property `variant` to type `RemovePriceChange` +- added property `key` to type `ReturnItem` +- added property `custom` to type `ReturnItem` +- added property `catalogData` to type `SetAssetCustomFieldChange` +- added property `variant` to type `SetAssetCustomFieldChange` +- added property `catalogData` to type `SetAssetCustomTypeChange` +- added property `variant` to type `SetAssetCustomTypeChange` +- added property `catalogData` to type `SetAssetDescriptionChange` +- added property `variant` to type `SetAssetDescriptionChange` +- added property `catalogData` to type `SetAssetKeyChange` +- added property `variant` to type `SetAssetKeyChange` +- added property `catalogData` to type `SetAssetSourcesChange` +- added property `variant` to type `SetAssetSourcesChange` +- added property `catalogData` to type `SetAssetTagsChange` +- added property `variant` to type `SetAssetTagsChange` +- added property `variant` to type `SetAttributeChange` +- added property `addedItems` to type `SetChannelRolesChange` +- added property `removedItems` to type `SetChannelRolesChange` +- added property `addedItems` to type `SetCountriesChange` +- added property `removedItems` to type `SetCountriesChange` +- added property `customTypeId` to type `SetCustomLineItemCustomFieldChange` +- added property `customLineItem` to type `SetCustomLineItemShippingDetailsChange` +- added property `price` to type `SetDiscountedPriceChange` +- added property `addedItems` to type `SetDistributionChannelsChange` +- added property `removedItems` to type `SetDistributionChannelsChange` +- added property `variant` to type `SetImageLabelChange` +- added property `addedItems` to type `SetLanguagesChange` +- added property `removedItems` to type `SetLanguagesChange` +- added property `lineItemId` to type `SetLineItemDiscountedPriceChange` +- added property `lineItemId` to type `SetLineItemDiscountedPricePerQuantityChange` +- added property `lineItemId` to type `SetLineItemPriceChange` +- added property `lineItemId` to type `SetLineItemProductSlugChange` +- added property `lineItem` to type `SetLineItemShippingDetailsChange` +- added property `variant` to type `SetLineItemShippingDetailsChange` +- added property `lineItemId` to type `SetLineItemTaxAmountChange` +- added property `lineItemId` to type `SetLineItemTaxRateChange` +- added property `variant` to type `SetLineItemTaxedPriceChange` +- added property `lineItemId` to type `SetLineItemTotalPriceChange` +- added property `variant` to type `SetLineItemTotalPriceChange` +- added property `catalogData` to type `SetMetaDescriptionChange` +- added property `catalogData` to type `SetMetaKeywordsChange` +- added property `catalogData` to type `SetMetaTitleChange` +- added property `lineItemId` to type `SetOrderLineItemCustomFieldChange` +- added property `lineItemId` to type `SetOrderLineItemCustomTypeChange` +- added property `addedItems` to type `SetPermissionsChange` +- added property `removedItems` to type `SetPermissionsChange` +- added property `addedItems` to type `SetPricesChange` +- added property `removedItems` to type `SetPricesChange` +- added property `variant` to type `SetProductPriceCustomFieldChange` +- added property `priceId` to type `SetProductPriceCustomFieldChange` +- added property `customTypeId` to type `SetProductPriceCustomFieldChange` +- added property `name` to type `SetProductPriceCustomFieldChange` +- added property `variant` to type `SetProductPriceCustomTypeChange` +- added property `priceId` to type `SetProductPriceCustomTypeChange` +- added property `addedItems` to type `SetProductSelectionsChange` +- added property `removedItems` to type `SetProductSelectionsChange` +- added property `variant` to type `SetProductVariantKeyChange` +- added property `addedItems` to type `SetReservationsChange` +- added property `removedItems` to type `SetReservationsChange` +- added property `variant` to type `SetSkuChange` +- added property `addedItems` to type `SetStateRolesChange` +- added property `removedItems` to type `SetStateRolesChange` +- added property `addedItems` to type `SetStoresChange` +- added property `removedItems` to type `SetStoresChange` +- added property `addedItems` to type `SetSupplyChannelsChange` +- added property `removedItems` to type `SetSupplyChannelsChange` +- added property `addedItems` to type `SetTransitionsChange` +- added property `removedItems` to type `SetTransitionsChange` +- added property `key` to type `TaxRate` +- added property `taxPortions` to type `TaxedItemPrice` +- added property `totalTax` to type `TaxedItemPrice` +- added property `taxPortions` to type `TaxedPrice` +- added property `totalTax` to type `TaxedPrice` +- added property `key` to type `TextLineItem` +- added property `custom` to type `Transaction` +- added property `customLineItemId` to type `TransitionCustomLineItemStateChange` +
diff --git a/BEST_PRACTICES.md b/BEST_PRACTICES.md index bf6debb27..7a1cfab29 100644 --- a/BEST_PRACTICES.md +++ b/BEST_PRACTICES.md @@ -3,7 +3,6 @@ ## Contents - [General](#general) - - [Use up-to-date SDK](#use-up-to-date-sdk) - [Documentation](#documentation) - [Issues](#issues) diff --git a/changes.md b/changes.md index b31117c1e..29fb58e1a 100644 --- a/changes.md +++ b/changes.md @@ -1,34 +1,748 @@ **Api changes** +
+Added Type(s) + +- added type `CartMergeMode` +- added type `MergeCartDraft` +- added type `RecurringOrderFailureError` +- added type `GraphQLRecurringOrderFailureError` +- added type `CartFrozenMessage` +- added type `CartUnfrozenMessage` +- added type `OrderPaymentRemovedMessage` +- added type `RecurringOrderFailedMessage` +- added type `CartFrozenMessagePayload` +- added type `CartUnfrozenMessagePayload` +- added type `OrderPaymentRemovedMessagePayload` +- added type `RecurringOrderFailedMessagePayload` +
+ +
+Added Method(s) + +- added method `apiRoot.withProjectKey().carts().customerIdWithCustomerIdValueMerge().post()` +- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().carts().customerIdWithCustomerIdValueMerge().post()` +
+ +
+Removed Property(s) + +- :warning: removed property `payment` from type `OrderPaymentAddedMessage` +- :warning: removed property `payment` from type `OrderPaymentAddedMessagePayload` +- :warning: removed property `tierMinimumQuantity` from type `StandalonePriceRemovePriceTierAction` +
+ +
+Added Property(s) + +- added property `sku` to type `InventoryEntryQuantitySetMessage` +- added property `paymentRef` to type `OrderPaymentAddedMessage` +- added property `sku` to type `InventoryEntryQuantitySetMessagePayload` +- added property `paymentRef` to type `OrderPaymentAddedMessagePayload` +- added property `minimumQuantity` to type `StandalonePriceRemovePriceTierAction` +
+ +
+Added Resource(s) + +- added resource `/{projectKey}/carts/customer-id={customerId}/merge` +- added resource `/{projectKey}/in-store/key={storeKey}/carts/customer-id={customerId}/merge` +
+ +**History changes** + +
+Added Type(s) + +- added type `AddShippingChange` +- added type `ChangeApprovalRuleModeChange` +- added type `ChangeCustomerChange` +- added type `ChangeIncludedInStatisticsChange` +- added type `ChangeLastVariantIdChange` +- added type `ChangeLineItemNameChange` +- added type `ChangeLineItemPublishedChange` +- added type `ExcludeProductChange` +- added type `RemoveShippingChange` +- added type `ReplaceTaxRateChange` +- added type `RevertStagedChangesChange` +- added type `RevertStagedVariantChangesChange` +- added type `SetAncestorsChange` +- added type `SetBillingAddressCustomFieldChange` +- added type `SetBillingAddressCustomTypeChange` +- added type `SetBusinessUnitChange` +- added type `SetCustomLineItemDiscountedPriceChange` +- added type `SetCustomLineItemDiscountedPricePerQuantityChange` +- added type `SetCustomerGroupAssignmentsChange` +- added type `SetDeliveryAddressCustomFieldChange` +- added type `SetDeliveryAddressCustomTypeChange` +- added type `SetDeliveryCustomFieldChange` +- added type `SetDeliveryCustomTypeChange` +- added type `SetDiscountOnTotalPriceChange` +- added type `SetInheritedStoresChange` +- added type `SetItemShippingAddressCustomFieldChange` +- added type `SetItemShippingAddressCustomTypeChange` +- added type `SetMaxCartQuantityChange` +- added type `SetMinCartQuantityChange` +- added type `SetParcelCustomFieldChange` +- added type `SetParcelCustomTypeChange` +- added type `SetPasswordChange` +- added type `SetPriceKeyChange` +- added type `SetPriceModeChange` +- added type `SetProductAttributeChange` +- added type `SetReturnInfoChange` +- added type `SetReturnItemCustomLineItemCustomFieldChange` +- added type `SetReturnItemCustomLineItemCustomTypeChange` +- added type `SetReturnItemLineItemCustomFieldChange` +- added type `SetReturnItemLineItemCustomTypeChange` +- added type `SetShippingAddressCustomFieldChange` +- added type `SetShippingAddressCustomTypeChange` +- added type `SetShippingCustomFieldChange` +- added type `SetShippingCustomTypeChange` +- added type `SetTransactionCustomFieldChange` +- added type `SetTransactionCustomTypeChange` +- added type `SetUnitTypeChange` +- added type `SetVariantExclusionChange` +- added type `UpdateItemShippingAddressChange` +- added type `SetAssociatesChange` +- added type `SetInheritedAssociatesChange` +- added type `ChangeTopLevelUnitChange` +- added type `Attribute` +- added type `BusinessUnitApprovalRuleMode` +- added type `BusinessUnitResourceIdentifier` +- added type `BusinessUnitType` +- added type `CustomFieldEnumValue` +- added type `CustomFieldLocalizedEnumValue` +- added type `CustomerGroupAssignment` +- added type `DiscountOnTotalPrice` +- added type `DiscountedTotalPricePortion` +- added type `ProductPriceModeEnum` +- added type `ProductVariantExclusion` +- added type `Shipping` +- added type `ShippingInfo` +- added type `ShippingRateInput` +- added type `ShoppingListLineItem` +- added type `TypeTextInputHint` +- added type `TypedMoney` +- added type `CentPrecisionMoney` +- added type `DiscountedPrice` +- added type `ShippingMethodState` +- added type `AssociateRoleDeprecated` +- added type `AssociateRoleKeyReference` +- added type `AttributeLevelEnum` +- added type `BaseAddress` +- added type `BusinessUnitKeyReference` +- added type `CartDiscountReference` +- added type `CartDiscountTarget` +- added type `CartDiscountValue` +- added type `CategoryReference` +- added type `ChannelReference` +- added type `CustomFieldValue` +- added type `CustomLineItemPriceMode` +- added type `CustomLineItemRecurrenceInfo` +- added type `CustomerGroupReference` +- added type `CustomerReference` +- added type `DiscountCodeReference` +- added type `FieldContainer` +- added type `GeoJson` +- added type `InventoryMode` +- added type `LineItemMode` +- added type `LineItemPriceMode` +- added type `LineItemRecurrenceInfo` +- added type `MethodTaxRate` +- added type `MethodTaxedPrice` +- added type `PaymentReference` +- added type `PriceSelectionMode` +- added type `PriceTier` +- added type `ProductDiscountReference` +- added type `ProductDiscountValue` +- added type `ProductReference` +- added type `ProductSelectionReference` +- added type `ProductTypeReference` +- added type `ProductVariant` +- added type `RecurrencePolicyReference` +- added type `ResourceTypeId` +- added type `ScopedPrice` +- added type `ShippingMethodReference` +- added type `StateReference` +- added type `StoreKeyReference` +- added type `TaxCategoryReference` +- added type `TaxPortion` +- added type `TypeReference` +- added type `ClientLogging` +- added type `ChangePriceRoundingModeChange` +
+ +
+Changed Type(s) + +- :warning: changed type `Address` from type `object` to `BaseAddress` +- :warning: changed type `GeoLocation` from type `object` to `GeoJson` +
+ +
+MarkDeprecated Type(s) + +- marked type `AddAssociateChange` as deprecated +- marked type `AddPriceChange` as deprecated +- marked type `AddProductSelectionChange` as deprecated +- marked type `AddStateRolesChange` as deprecated +- marked type `ChangeAmountAuthorizedChange` as deprecated +- marked type `RemoveAssociateChange` as deprecated +- marked type `RemovePriceChange` as deprecated +- marked type `RemoveProductSelectionChange` as deprecated +- marked type `RemoveStateRolesChange` as deprecated +
+ +
+Added Enum(s) + +- added enum `addInheritedAssociate` to type `PlatformInitiatedChange` +- added enum `changeIncludedInStatistics` to type `PlatformInitiatedChange` +- added enum `changeInheritedAssociate` to type `PlatformInitiatedChange` +- added enum `changeLastVariantId` to type `PlatformInitiatedChange` +- added enum `changeLineItemPublished` to type `PlatformInitiatedChange` +- added enum `changeTopLevelUnit` to type `PlatformInitiatedChange` +- added enum `removeInheritedAssociate` to type `PlatformInitiatedChange` +- added enum `setAncestors` to type `PlatformInitiatedChange` +- added enum `setInheritedAssociates` to type `PlatformInitiatedChange` +- added enum `setInheritedStores` to type `PlatformInitiatedChange` +- added enum `setLineItemDeactivatedAt` to type `PlatformInitiatedChange` +- added enum `setProductCount` to type `PlatformInitiatedChange` +- added enum `setReservations` to type `PlatformInitiatedChange` +- added enum `CreateApprovalRules` to type `Permission` +- added enum `UpdateApprovalRules` to type `Permission` +- added enum `UpdateApprovalFlows` to type `Permission` +- added enum `ViewMyShoppingLists` to type `Permission` +- added enum `ViewOthersShoppingLists` to type `Permission` +- added enum `UpdateMyShoppingLists` to type `Permission` +- added enum `UpdateOthersShoppingLists` to type `Permission` +- added enum `CreateMyShoppingLists` to type `Permission` +- added enum `CreateOthersShoppingLists` to type `Permission` +- added enum `DeleteMyShoppingLists` to type `Permission` +- added enum `DeleteOthersShoppingLists` to type `Permission` +- added enum `includeOnly` to type `ProductVariantSelectionTypeEnum` +- added enum `includeAllExcept` to type `ProductVariantSelectionTypeEnum` +- added enum `RenegotiationAddressed` to type `QuoteState` +- added enum `approval-flow` to type `ReferenceTypeId` +- added enum `approval-rule` to type `ReferenceTypeId` +- added enum `attribute-group` to type `ReferenceTypeId` +- added enum `direct-discount` to type `ReferenceTypeId` +- added enum `discount-group` to type `ReferenceTypeId` +- added enum `product-price` to type `ReferenceTypeId` +- added enum `product-tailoring` to type `ReferenceTypeId` +- added enum `recurrence-policy` to type `ReferenceTypeId` +- added enum `recurring-order` to type `ReferenceTypeId` +- added enum `standalone-price` to type `ReferenceTypeId` +- added enum `Delivered` to type `ShipmentState` +- added enum `Canceled` to type `ShipmentState` +
+ +
+Removed Enum(s) + +- :warning: removed enum `changeAmountAuthorized` from type `UpdateType` +- :warning: removed enum `Failed` from type `QuoteState` +
+
Required Property(s) -- 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 `id` of type `Address` to be optional +- changed property `key` of type `Address` to be optional +- changed property `title` of type `Address` to be optional +- changed property `salutation` of type `Address` to be optional +- changed property `firstName` of type `Address` to be optional +- changed property `lastName` of type `Address` to be optional +- changed property `streetName` of type `Address` to be optional +- changed property `streetNumber` of type `Address` to be optional +- changed property `additionalStreetInfo` of type `Address` to be optional +- changed property `postalCode` of type `Address` to be optional +- changed property `city` of type `Address` to be optional +- changed property `region` of type `Address` to be optional +- changed property `state` of type `Address` to be optional +- changed property `company` of type `Address` to be optional +- changed property `department` of type `Address` to be optional +- changed property `building` of type `Address` to be optional +- changed property `apartment` of type `Address` to be optional +- changed property `pOBox` of type `Address` to be optional +- changed property `phone` of type `Address` to be optional +- changed property `mobile` of type `Address` to be optional +- changed property `email` of type `Address` to be optional +- changed property `fax` of type `Address` to be optional +- changed property `additionalAddressInfo` of type `Address` to be optional +- changed property `externalId` of type `Address` to be optional +- changed property `description` of type `Asset` to be optional +- changed property `custom` of type `Asset` to be optional +- changed property `key` of type `Asset` to be optional +- changed property `key` of type `AssetSource` to be optional +- changed property `dimensions` of type `AssetSource` to be optional +- changed property `contentType` of type `AssetSource` to be optional +- changed property `inputTip` of type `AttributeDefinition` to be optional +- changed property `taxedPrice` of type `CustomLineItem` to be optional +- changed property `inputHint` of type `FieldDefinition` to be optional +- changed property `label` of type `Image` to be optional +- changed property `productSlug` of type `LineItem` to be optional +- changed property `custom` of type `LineItem` to be optional +- changed property `addedAt` of type `LineItem` to be optional +- changed property `state` of type `Location` to be optional +- changed property `measurements` of type `Parcel` to be optional +- changed property `trackingData` of type `Parcel` to be optional +- changed property `items` of type `Parcel` to be optional +- changed property `heightInMillimeter` of type `ParcelMeasurements` to be optional +- changed property `lengthInMillimeter` of type `ParcelMeasurements` to be optional +- changed property `widthInMillimeter` of type `ParcelMeasurements` to be optional +- changed property `weightInGram` of type `ParcelMeasurements` to be optional +- changed property `channels` of type `ProductVariantAvailability` to be optional +- changed property `isOnStock` of type `ProductVariantAvailability` to be optional +- changed property `restockableInDays` of type `ProductVariantAvailability` to be optional +- changed property `availableQuantity` of type `ProductVariantAvailability` to be optional +- changed property `isOnStock` of type `ProductVariantChannelAvailability` to be optional +- changed property `restockableInDays` of type `ProductVariantChannelAvailability` to be optional +- changed property `availableQuantity` of type `ProductVariantChannelAvailability` to be optional +- changed property `id` of type `ResourceIdentifier` to be optional +- changed property `key` of type `ResourceIdentifier` to be optional +- changed property `returnTrackingId` of type `ReturnInfo` to be optional +- changed property `returnDate` of type `ReturnInfo` to be optional +- changed property `comment` of type `ReturnItem` to be optional +- changed property `suggestTokenizer` of type `SearchKeyword` to be optional +- changed property `freeAbove` of type `ShippingRate` to be optional +- changed property `isMatching` of type `ShippingRate` to be optional +- changed property `externalId` of type `SyncInfo` to be optional +- changed property `id` of type `TaxRate` to be optional +- changed property `state` of type `TaxRate` to be optional +- changed property `subRates` of type `TaxRate` to be optional +- changed property `custom` of type `TextLineItem` to be optional +- changed property `description` of type `TextLineItem` to be optional +- changed property `trackingId` of type `TrackingData` to be optional +- changed property `carrier` of type `TrackingData` to be optional +- changed property `provider` of type `TrackingData` to be optional +- changed property `providerTransaction` of type `TrackingData` to be optional +- changed property `isReturn` of type `TrackingData` to be optional +- changed property `timestamp` of type `Transaction` to be optional +- changed property `interactionId` of type `Transaction` to be optional +
+ +
+Changed Property(s) + +- :warning: changed property `nextValue` of type `AddEnumValueChange` from type `EnumValue` to `CustomFieldEnumValue` +- :warning: changed property `nextValue` of type `AddInterfaceInteractionChange` from type `CustomFieldExpandedValue` to `CustomFields` +- :warning: changed property `nextValue` of type `AddLocalizedEnumValueChange` from type `AttributeLocalizedEnumValue` to `CustomFieldLocalizedEnumValue` +- :warning: changed property `previousValue` of type `AddShoppingListLineItemChange` from type `LineItem` to `ShoppingListLineItem` +- :warning: changed property `nextValue` of type `AddShoppingListLineItemChange` from type `LineItem` to `ShoppingListLineItem` +- :warning: changed property `w` of type `AssetDimensions` from type `integer` to `number` +- :warning: changed property `h` of type `AssetDimensions` from type `integer` to `number` +- :warning: changed property `customer` of type `Associate` from type `Reference` to `CustomerReference` +- :warning: changed property `associateRole` of type `AssociateRoleAssignment` from type `KeyReference` to `AssociateRoleKeyReference` +- :warning: changed property `previousValue` of type `ChangeEnumValueOrderChange` from type `EnumValue[]` to `CustomFieldEnumValue[]` +- :warning: changed property `nextValue` of type `ChangeEnumValueOrderChange` from type `EnumValue[]` to `CustomFieldEnumValue[]` +- :warning: changed property `previousValue` of type `ChangeInputHintChange` from type `TextInputHint` to `TypeTextInputHint` +- :warning: changed property `nextValue` of type `ChangeInputHintChange` from type `TextInputHint` to `TypeTextInputHint` +- :warning: changed property `previousValue` of type `ChangeLocalizedEnumValueOrderChange` from type `LocalizedEnumValue[]` to `AttributeLocalizedEnumValue[]` +- :warning: changed property `nextValue` of type `ChangeLocalizedEnumValueOrderChange` from type `LocalizedEnumValue[]` to `AttributeLocalizedEnumValue[]` +- :warning: changed property `previousValue` of type `ChangePlainEnumValueOrderChange` from type `EnumValue[]` to `AttributePlainEnumValue[]` +- :warning: changed property `nextValue` of type `ChangePlainEnumValueOrderChange` from type `EnumValue[]` to `AttributePlainEnumValue[]` +- :warning: changed property `type` of type `CustomFields` from type `Reference` to `TypeReference` +- :warning: changed property `fields` of type `CustomFields` from type `object` to `FieldContainer` +- :warning: changed property `money` of type `CustomLineItem` from type `Money` to `TypedMoney` +- :warning: changed property `totalPrice` of type `CustomLineItem` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `quantity` of type `CustomLineItem` from type `integer` to `number` +- :warning: changed property `createdAt` of type `Delivery` from type `string` to `datetime` +- :warning: changed property `quantity` of type `DeliveryItem` from type `integer` to `number` +- :warning: changed property `discountCode` of type `DiscountCodeInfo` from type `Reference` to `DiscountCodeReference` +- :warning: changed property `discountedAmount` of type `DiscountedLineItemPortion` from type `Money` to `TypedMoney` +- :warning: changed property `value` of type `DiscountedLineItemPrice` from type `Money` to `TypedMoney` +- :warning: changed property `quantity` of type `DiscountedLineItemPriceForQuantity` from type `integer` to `number` +- :warning: changed property `inputHint` of type `FieldDefinition` from type `TextInputHint` to `TypeTextInputHint` +- :warning: changed property `w` of type `ImageDimensions` from type `integer` to `number` +- :warning: changed property `h` of type `ImageDimensions` from type `integer` to `number` +- :warning: changed property `customer` of type `InheritedAssociate` from type `Reference` to `CustomerReference` +- :warning: changed property `associateRole` of type `InheritedAssociateRoleAssignment` from type `KeyReference` to `AssociateRoleKeyReference` +- :warning: changed property `source` of type `InheritedAssociateRoleAssignment` from type `KeyReference` to `BusinessUnitKeyReference` +- :warning: changed property `quantity` of type `ItemShippingTarget` from type `integer` to `number` +- :warning: changed property `quantity` of type `ItemState` from type `integer` to `number` +- :warning: changed property `state` of type `ItemState` from type `Reference` to `StateReference` +- :warning: changed property `productType` of type `LineItem` from type `Reference` to `ProductTypeReference` +- :warning: changed property `variant` of type `LineItem` from type `Variant` to `ProductVariant` +- :warning: changed property `quantity` of type `LineItem` from type `integer` to `number` +- :warning: changed property `addedAt` of type `LineItem` from type `string` to `datetime` +- :warning: changed property `centAmount` of type `Money` from type `integer` to `number` +- :warning: changed property `createdAt` of type `Parcel` from type `string` to `datetime` +- :warning: changed property `heightInMillimeter` of type `ParcelMeasurements` from type `integer` to `number` +- :warning: changed property `lengthInMillimeter` of type `ParcelMeasurements` from type `integer` to `number` +- :warning: changed property `widthInMillimeter` of type `ParcelMeasurements` from type `integer` to `number` +- :warning: changed property `weightInGram` of type `ParcelMeasurements` from type `integer` to `number` +- :warning: changed property `payments` of type `PaymentInfo` from type `Reference[]` to `PaymentReference[]` +- :warning: changed property `value` of type `Price` from type `Money` to `TypedMoney` +- :warning: changed property `productSelection` of type `ProductSelectionSetting` from type `Reference` to `ProductSelectionReference` +- :warning: changed property `restockableInDays` of type `ProductVariantAvailability` from type `integer` to `number` +- :warning: changed property `availableQuantity` of type `ProductVariantAvailability` from type `integer` to `number` +- :warning: changed property `restockableInDays` of type `ProductVariantChannelAvailability` from type `integer` to `number` +- :warning: changed property `availableQuantity` of type `ProductVariantChannelAvailability` from type `integer` to `number` +- :warning: changed property `previousValue` of type `RemoveDeliveryItemsChange` from type `Delivery` to `DeliveryChangeValue` +- :warning: changed property `previousValue` of type `RemoveEnumValuesChange` from type `EnumValue` to `AttributePlainEnumValue` +- :warning: changed property `previousValue` of type `RemoveLocalizedEnumValuesChange` from type `LocalizedEnumValue` to `AttributeLocalizedEnumValue` +- :warning: changed property `previousValue` of type `RemoveShoppingListLineItemChange` from type `LineItem` to `ShoppingListLineItem` +- :warning: changed property `nextValue` of type `RemoveShoppingListLineItemChange` from type `LineItem` to `ShoppingListLineItem` +- :warning: changed property `returnDate` of type `ReturnInfo` from type `string` to `datetime` +- :warning: changed property `quantity` of type `ReturnItem` from type `integer` to `number` +- :warning: changed property `lastModifiedAt` of type `ReturnItem` from type `string` to `datetime` +- :warning: changed property `createdAt` of type `ReturnItem` from type `string` to `datetime` +- :warning: changed property `averageRating` of type `ReviewRatingStatistics` from type `integer` to `number` +- :warning: changed property `highestRating` of type `ReviewRatingStatistics` from type `integer` to `number` +- :warning: changed property `lowestRating` of type `ReviewRatingStatistics` from type `integer` to `number` +- :warning: changed property `previousValue` of type `SetAttributeChange` from type `AttributeValue` to `Attribute` +- :warning: changed property `nextValue` of type `SetAttributeChange` from type `AttributeValue` to `Attribute` +- :warning: changed property `previousValue` of type `SetCustomLineItemTaxedPriceChange` from type `Money` to `TaxedItemPrice` +- :warning: changed property `nextValue` of type `SetCustomLineItemTaxedPriceChange` from type `Money` to `TaxedItemPrice` +- :warning: changed property `previousValue` of type `SetDiscountedPriceChange` from type `Price` to `DiscountedPrice` +- :warning: changed property `nextValue` of type `SetDiscountedPriceChange` from type `Price` to `DiscountedPrice` +- :warning: changed property `previousValue` of type `SetOrderTaxedPriceChange` from type `TaxedItemPrice` to `TaxedPrice` +- :warning: changed property `nextValue` of type `SetOrderTaxedPriceChange` from type `TaxedItemPrice` to `TaxedPrice` +- :warning: changed property `previousValue` of type `SetShippingInfoTaxedPriceChange` from type `TaxedPrice` to `TaxedItemPrice` +- :warning: changed property `nextValue` of type `SetShippingInfoTaxedPriceChange` from type `TaxedPrice` to `TaxedItemPrice` +- :warning: changed property `previousValue` of type `SetShippingRateChange` from type `Money` to `ShippingRate` +- :warning: changed property `nextValue` of type `SetShippingRateChange` from type `Money` to `ShippingRate` +- :warning: changed property `previousValue` of type `SetStoreChange` from type `Reference` to `KeyReference` +- :warning: changed property `nextValue` of type `SetStoreChange` from type `Reference` to `KeyReference` +- :warning: changed property `price` of type `ShippingRate` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `freeAbove` of type `ShippingRate` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `amount` of type `SubRate` from type `integer` to `number` +- :warning: changed property `channel` of type `SyncInfo` from type `Reference` to `ChannelReference` +- :warning: changed property `syncedAt` of type `SyncInfo` from type `string` to `datetime` +- :warning: changed property `amount` of type `TaxRate` from type `integer` to `number` +- :warning: changed property `totalNet` of type `TaxedItemPrice` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `totalGross` of type `TaxedItemPrice` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `totalNet` of type `TaxedPrice` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `totalGross` of type `TaxedPrice` from type `Money` to `CentPrecisionMoney` +- :warning: changed property `addedAt` of type `TextLineItem` from type `string` to `datetime` +- :warning: changed property `quantity` of type `TextLineItem` from type `integer` to `number` +- :warning: changed property `timestamp` of type `Transaction` from type `string` to `datetime` +- :warning: changed property `amount` of type `Transaction` from type `Money` to `CentPrecisionMoney` +
+ +
+Removed Property(s) + +- :warning: removed property `/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/` from type `CategoryOrderHints` +- :warning: removed property `variantId` from type `LineItem` +- :warning: removed property `fractionDigits` from type `Money` +- :warning: removed property `type` from type `Money` +- :warning: removed property `//` from type `ProductVariantChannelAvailabilityMap` +- :warning: removed property `skus` from type `ProductVariantSelection`
Added Property(s) -- added property `interfaceId` to type `MyTransactionDraft` -- added property `interfaceId` to type `Transaction` -- added property `interfaceId` to type `TransactionDraft` +- added property `catalogData` to type `AddAssetChange` +- added property `variant` to type `AddAssetChange` +- added property `attributeName` to type `AddEnumValueChange` +- added property `variant` to type `AddExternalImageChange` +- added property `variant` to type `AddPriceChange` +- added property `catalogData` to type `AddToCategoryChange` +- added property `custom` to type `Address` +- added property `sources` to type `Asset` +- added property `tags` to type `Asset` +- added property `roles` to type `Associate` +- added property `level` to type `AttributeDefinition` +- added property `/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/` to type `CategoryOrderHints` +- added property `catalogData` to type `ChangeAssetNameChange` +- added property `variant` to type `ChangeAssetNameChange` +- added property `catalogData` to type `ChangeAssetOrderChange` +- added property `variant` to type `ChangeAssetOrderChange` +- added property `addedItems` to type `ChangeCartDiscountsChange` +- added property `removedItems` to type `ChangeCartDiscountsChange` +- added property `attributeName` to type `ChangeEnumValueLabelChange` +- added property `attributeName` to type `ChangeEnumValueOrderChange` +- added property `addedItems` to type `ChangeGroupsChange` +- added property `removedItems` to type `ChangeGroupsChange` +- added property `variant` to type `ChangePriceChange` +- added property `catalogData` to type `ChangeSlugChange` +- added property `key` to type `CustomLineItem` +- added property `taxedPricePortions` to type `CustomLineItem` +- added property `state` to type `CustomLineItem` +- added property `taxCategory` to type `CustomLineItem` +- added property `taxRate` to type `CustomLineItem` +- added property `perMethodTaxRate` to type `CustomLineItem` +- added property `discountedPricePerQuantity` to type `CustomLineItem` +- added property `custom` to type `CustomLineItem` +- added property `shippingDetails` to type `CustomLineItem` +- added property `priceMode` to type `CustomLineItem` +- added property `recurrenceInfo` to type `CustomLineItem` +- added property `key` to type `Delivery` +- added property `required` to type `FieldDefinition` +- added property `shippingMethodKey` to type `ItemShippingTarget` +- added property `key` to type `LineItem` +- added property `productKey` to type `LineItem` +- added property `price` to type `LineItem` +- added property `totalPrice` to type `LineItem` +- added property `discountedPricePerQuantity` to type `LineItem` +- added property `taxedPrice` to type `LineItem` +- added property `taxedPricePortions` to type `LineItem` +- added property `state` to type `LineItem` +- added property `taxRate` to type `LineItem` +- added property `perMethodTaxRate` to type `LineItem` +- added property `supplyChannel` to type `LineItem` +- added property `distributionChannel` to type `LineItem` +- added property `priceMode` to type `LineItem` +- added property `lineItemMode` to type `LineItem` +- added property `inventoryMode` to type `LineItem` +- added property `shippingDetails` to type `LineItem` +- added property `lastModifiedAt` to type `LineItem` +- added property `recurrenceInfo` to type `LineItem` +- added property `variant` to type `MoveImageToPositionChange` +- added property `key` to type `Parcel` +- added property `custom` to type `Parcel` +- added property `key` to type `Price` +- added property `country` to type `Price` +- added property `customerGroup` to type `Price` +- added property `channel` to type `Price` +- added property `validFrom` to type `Price` +- added property `validUntil` to type `Price` +- added property `discounted` to type `Price` +- added property `tiers` to type `Price` +- added property `custom` to type `Price` +- added property `recurrencePolicy` to type `Price` +- added property `id` to type `ProductVariantAvailability` +- added property `version` to type `ProductVariantAvailability` +- added property `id` to type `ProductVariantChannelAvailability` +- added property `version` to type `ProductVariantChannelAvailability` +- added property `/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/` to type `ProductVariantChannelAvailabilityMap` +- added property `catalogData` to type `RemoveAssetChange` +- added property `variant` to type `RemoveAssetChange` +- added property `catalogData` to type `RemoveFromCategoryChange` +- added property `variant` to type `RemoveImageChange` +- added property `variant` to type `RemovePriceChange` +- added property `key` to type `ReturnItem` +- added property `custom` to type `ReturnItem` +- added property `catalogData` to type `SetAssetCustomFieldChange` +- added property `variant` to type `SetAssetCustomFieldChange` +- added property `catalogData` to type `SetAssetCustomTypeChange` +- added property `variant` to type `SetAssetCustomTypeChange` +- added property `catalogData` to type `SetAssetDescriptionChange` +- added property `variant` to type `SetAssetDescriptionChange` +- added property `catalogData` to type `SetAssetKeyChange` +- added property `variant` to type `SetAssetKeyChange` +- added property `catalogData` to type `SetAssetSourcesChange` +- added property `variant` to type `SetAssetSourcesChange` +- added property `catalogData` to type `SetAssetTagsChange` +- added property `variant` to type `SetAssetTagsChange` +- added property `variant` to type `SetAttributeChange` +- added property `addedItems` to type `SetChannelRolesChange` +- added property `removedItems` to type `SetChannelRolesChange` +- added property `addedItems` to type `SetCountriesChange` +- added property `removedItems` to type `SetCountriesChange` +- added property `customTypeId` to type `SetCustomLineItemCustomFieldChange` +- added property `customLineItem` to type `SetCustomLineItemShippingDetailsChange` +- added property `price` to type `SetDiscountedPriceChange` +- added property `addedItems` to type `SetDistributionChannelsChange` +- added property `removedItems` to type `SetDistributionChannelsChange` +- added property `variant` to type `SetImageLabelChange` +- added property `addedItems` to type `SetLanguagesChange` +- added property `removedItems` to type `SetLanguagesChange` +- added property `lineItemId` to type `SetLineItemDiscountedPriceChange` +- added property `lineItemId` to type `SetLineItemDiscountedPricePerQuantityChange` +- added property `lineItemId` to type `SetLineItemPriceChange` +- added property `lineItemId` to type `SetLineItemProductSlugChange` +- added property `lineItem` to type `SetLineItemShippingDetailsChange` +- added property `variant` to type `SetLineItemShippingDetailsChange` +- added property `lineItemId` to type `SetLineItemTaxAmountChange` +- added property `lineItemId` to type `SetLineItemTaxRateChange` +- added property `variant` to type `SetLineItemTaxedPriceChange` +- added property `lineItemId` to type `SetLineItemTotalPriceChange` +- added property `variant` to type `SetLineItemTotalPriceChange` +- added property `catalogData` to type `SetMetaDescriptionChange` +- added property `catalogData` to type `SetMetaKeywordsChange` +- added property `catalogData` to type `SetMetaTitleChange` +- added property `lineItemId` to type `SetOrderLineItemCustomFieldChange` +- added property `lineItemId` to type `SetOrderLineItemCustomTypeChange` +- added property `addedItems` to type `SetPermissionsChange` +- added property `removedItems` to type `SetPermissionsChange` +- added property `addedItems` to type `SetPricesChange` +- added property `removedItems` to type `SetPricesChange` +- added property `variant` to type `SetProductPriceCustomFieldChange` +- added property `priceId` to type `SetProductPriceCustomFieldChange` +- added property `customTypeId` to type `SetProductPriceCustomFieldChange` +- added property `name` to type `SetProductPriceCustomFieldChange` +- added property `variant` to type `SetProductPriceCustomTypeChange` +- added property `priceId` to type `SetProductPriceCustomTypeChange` +- added property `addedItems` to type `SetProductSelectionsChange` +- added property `removedItems` to type `SetProductSelectionsChange` +- added property `variant` to type `SetProductVariantKeyChange` +- added property `addedItems` to type `SetReservationsChange` +- added property `removedItems` to type `SetReservationsChange` +- added property `variant` to type `SetSkuChange` +- added property `addedItems` to type `SetStateRolesChange` +- added property `removedItems` to type `SetStateRolesChange` +- added property `addedItems` to type `SetStoresChange` +- added property `removedItems` to type `SetStoresChange` +- added property `addedItems` to type `SetSupplyChannelsChange` +- added property `removedItems` to type `SetSupplyChannelsChange` +- added property `addedItems` to type `SetTransitionsChange` +- added property `removedItems` to type `SetTransitionsChange` +- added property `key` to type `TaxRate` +- added property `taxPortions` to type `TaxedItemPrice` +- added property `totalTax` to type `TaxedItemPrice` +- added property `taxPortions` to type `TaxedPrice` +- added property `totalTax` to type `TaxedPrice` +- added property `key` to type `TextLineItem` +- added property `custom` to type `Transaction` +- added property `customLineItemId` to type `TransitionCustomLineItemStateChange`
+**Checkout changes** +
Added Type(s) -- added type `PaymentTransactionInterfaceIdSetMessage` -- added type `PaymentTransactionInterfaceIdSetMessagePayload` -- added type `PaymentSetTransactionInterfaceIdAction` +- added type `AllowedOrigins` +- added type `Application` +- added type `ApplicationAgreement` +- added type `ApplicationAgreementDraft` +- added type `ApplicationAgreementStatus` +- added type `ApplicationAgreementType` +- added type `ApplicationDraft` +- added type `ApplicationLogo` +- added type `ApplicationMode` +- added type `ApplicationStatus` +- added type `ApplicationUpdateAction` +- added type `ApplicationUpdateActions` +- added type `DiscountsConfiguration` +- added type `PaginatedApplication` +- added type `PaymentsConfiguration` +- added type `AddAllowedOriginUpdateAction` +- added type `AddApplicationAgreementUpdateAction` +- added type `AddCountryUpdateAction` +- added type `RemoveAllowedOriginUpdateAction` +- added type `RemoveApplicationAgreementUpdateAction` +- added type `RemoveCountryUpdateAction` +- added type `ReorderApplicationAgreementUpdateAction` +- added type `SetActivePaymentComponentTypeUpdateAction` +- added type `SetAllowAllOriginsUpdateAction` +- added type `SetAllowedOriginsUpdateAction` +- added type `SetApplicationAgreementNameUpdateAction` +- added type `SetApplicationAgreementStatusUpdateAction` +- added type `SetApplicationAgreementTextUpdateAction` +- added type `SetApplicationAgreementTypeUpdateAction` +- added type `SetApplicationAgreementsUpdateAction` +- added type `SetApplicationLogoUpdateAction` +- added type `SetApplicationNameUpdateAction` +- added type `SetApplicationStatusUpdateAction` +- added type `SetCountriesUpdateAction` +- added type `SetDescriptionUpdateAction` +- added type `SetDiscountsConfigurationUpdateAction` +- added type `SetPaymentReturnUrlUpdateAction` +- added type `SetPaymentsConfigurationUpdateAction` +- added type `CreatedBy` +- added type `LastModifiedBy` +- added type `LocalizedString` +- added type `LocalizedUrl` +- added type `ConcurrentModificationError` +- added type `DuplicateFieldWithConflictingResourceError` +- added type `ErrorResponse` +- added type `InvalidFieldError` +- added type `InvalidOperationError` +- added type `MaxResourceLimitExceededError` +- added type `MissingProjectKeyError` +- added type `ReferencedResourceNotFoundError` +- added type `ServiceUnavailableError` +- added type `SyntaxErrorError` +- added type `AutomatedReversalConfiguration` +- added type `ConnectorDeploymentReference` +- added type `DisplayInfo` +- added type `PaginatedPaymentIntegration` +- added type `PaymentComponentType` +- added type `PaymentIntegration` +- added type `PaymentIntegrationDraft` +- added type `PaymentIntegrationStatus` +- added type `PaymentIntegrationType` +- added type `SortingInfo` +- added type `PaymentIntegrationUpdateAction` +- added type `PaymentIntegrationUpdateActions` +- added type `SetAutomatedReversalConfigurationPredicateUpdateAction` +- added type `SetAutomatedReversalConfigurationStatusUpdateAction` +- added type `SetAutomatedReversalConfigurationUpdateAction` +- added type `SetConnectorDeploymentUpdateAction` +- added type `SetDisplayInfoDescriptionUpdateAction` +- added type `SetDisplayInfoLabelUpdateAction` +- added type `SetDisplayInfoLogoUrlUpdateAction` +- added type `SetDisplayInfoPayButtonTextUpdateAction` +- added type `SetDisplayInfoUpdateAction` +- added type `SetKeyUpdateAction` +- added type `SetNameUpdateAction` +- added type `SetPredicateUpdateAction` +- added type `SetSortingInfoUpdateAction` +- added type `SetStatusUpdateAction` +- added type `SetTypeUpdateAction` +
+ +
+Added Enum(s) + +- added enum `deployment` to type `ReferenceTypeId` +
+ +
+Required Property(s) + +- changed property `detailedErrorMessage` of type `InvalidJsonInputError` to be optional +
+ +
+Changed Property(s) + +- :warning: changed property `application` of type `Transaction` from type `ApplicationResourceIdentifier` to `ApplicationReference` +
+ +
+Added Property(s) + +- added property `resourceIdentifier` to type `ResourceNotFoundError` +- added property `resourceId` to type `ResourceNotFoundError` +
+ +
+Changed MethodResponseBody(s) + +- :warning: changed response body for `400: application/json` of method `post /{projectKey}/transactions` from type `null` to `ErrorResponse` +- :warning: changed response body for `400: application/json` of method `post /{projectKey}/payment-intents/{paymentId}` from type `null` to `ErrorResponse` +- :warning: changed response body for `400: application/json` of method `get /{projectKey}/transactions/{id}` from type `null` to `ErrorResponse` +- :warning: changed response body for `400: application/json` of method `get /{projectKey}/transactions/key={key}` from type `null` to `ErrorResponse` +
+ +
+Added Method(s) + +- added method `apiRoot.withProjectKey().paymentIntegrations().get()` +- added method `apiRoot.withProjectKey().paymentIntegrations().post()` +- added method `apiRoot.withProjectKey().applications().get()` +- added method `apiRoot.withProjectKey().applications().post()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withId().get()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withId().head()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withId().post()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withId().delete()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withKey().get()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withKey().post()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withKey().head()` +- added method `apiRoot.withProjectKey().paymentIntegrations().withKey().delete()` +- added method `apiRoot.withProjectKey().applications().withId().get()` +- added method `apiRoot.withProjectKey().applications().withId().head()` +- added method `apiRoot.withProjectKey().applications().withId().post()` +- added method `apiRoot.withProjectKey().applications().withId().delete()` +- added method `apiRoot.withProjectKey().applications().withKey().get()` +- added method `apiRoot.withProjectKey().applications().withKey().post()` +- added method `apiRoot.withProjectKey().applications().withKey().head()` +- added method `apiRoot.withProjectKey().applications().withKey().delete()` +
+ +
+Added Resource(s) + +- added resource `/{projectKey}/payment-integrations` +- added resource `/{projectKey}/applications` +- added resource `/{projectKey}/payment-integrations/{id}` +- added resource `/{projectKey}/payment-integrations/key={key}` +- added resource `/{projectKey}/applications/{id}` +- added resource `/{projectKey}/applications/key={key}`
diff --git a/packages/checkout-sdk/src/generated/client/applications/by-project-key-applications-by-id-request-builder.ts b/packages/checkout-sdk/src/generated/client/applications/by-project-key-applications-by-id-request-builder.ts new file mode 100644 index 000000000..d0969ff75 --- /dev/null +++ b/packages/checkout-sdk/src/generated/client/applications/by-project-key-applications-by-id-request-builder.ts @@ -0,0 +1,112 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ +import { Application, ApplicationUpdateActions } from '../../models/application' +import { executeRequest, QueryParam } from '../../shared/utils/common-types' +import { ApiRequest } from '../../shared/utils/requests-utils' +/** + **/ +export class ByProjectKeyApplicationsByIdRequestBuilder { + constructor( + protected readonly args: { + pathArgs: { + projectKey: string + id: string + } + executeRequest: executeRequest + baseUri?: string + } + ) {} + /** + * Retrieves an [Application](ctp:checkout:type:Application) by a given `id`. + * + */ + public get(methodArgs?: { + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'GET', + uriTemplate: '/{projectKey}/applications/{id}', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + }, + this.args.executeRequest + ) + } + /** + * Checks if an [Application](/applications-api#application) with a given `id` exists. Returns `200 OK` if the Application exists, or `404 Not Found` if it doesn't. Specific Error Codes: + * - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError) + * - [GeneralError](ctp:checkout:type:GeneralError) + * + */ + public head(methodArgs?: { + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'HEAD', + uriTemplate: '/{projectKey}/applications/{id}', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + }, + this.args.executeRequest + ) + } + public post(methodArgs: { + body: ApplicationUpdateActions + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'POST', + uriTemplate: '/{projectKey}/applications/{id}', + pathVariables: this.args.pathArgs, + headers: { + 'Content-Type': 'application/json', + ...methodArgs?.headers, + }, + body: methodArgs?.body, + }, + this.args.executeRequest + ) + } + public delete(methodArgs: { + queryArgs: { + version: number + [key: string]: QueryParam + } + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'DELETE', + uriTemplate: '/{projectKey}/applications/{id}', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + queryParams: methodArgs?.queryArgs, + }, + this.args.executeRequest + ) + } +} diff --git a/packages/checkout-sdk/src/generated/client/applications/by-project-key-applications-key-by-key-request-builder.ts b/packages/checkout-sdk/src/generated/client/applications/by-project-key-applications-key-by-key-request-builder.ts new file mode 100644 index 000000000..477ce0aab --- /dev/null +++ b/packages/checkout-sdk/src/generated/client/applications/by-project-key-applications-key-by-key-request-builder.ts @@ -0,0 +1,115 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ +import { Application, ApplicationUpdateActions } from '../../models/application' +import { executeRequest, QueryParam } from '../../shared/utils/common-types' +import { ApiRequest } from '../../shared/utils/requests-utils' +/** + **/ +export class ByProjectKeyApplicationsKeyByKeyRequestBuilder { + constructor( + protected readonly args: { + pathArgs: { + projectKey: string + key: string + } + executeRequest: executeRequest + baseUri?: string + } + ) {} + /** + * Retrieves an [Application](ctp:checkout:type:Application) with a given `key`. + * Specific Error Codes: + * - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError) + * - [GeneralError](ctp:checkout:type:GeneralError) + * + */ + public get(methodArgs?: { + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'GET', + uriTemplate: '/{projectKey}/applications/key={key}', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + }, + this.args.executeRequest + ) + } + public post(methodArgs: { + body: ApplicationUpdateActions + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'POST', + uriTemplate: '/{projectKey}/applications/key={key}', + pathVariables: this.args.pathArgs, + headers: { + 'Content-Type': 'application/json', + ...methodArgs?.headers, + }, + body: methodArgs?.body, + }, + this.args.executeRequest + ) + } + /** + * Checks if an [Application](ctp:checkout:type:Application) with a given `key` exists. Returns `200 OK` if the Application exists, or `404 Not Found` if it doesn't. Specific Error Codes: + * - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError) + * - [GeneralError](ctp:checkout:type:GeneralError) + * + */ + public head(methodArgs?: { + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'HEAD', + uriTemplate: '/{projectKey}/applications/key={key}', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + }, + this.args.executeRequest + ) + } + public delete(methodArgs: { + queryArgs: { + version: number + [key: string]: QueryParam + } + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'DELETE', + uriTemplate: '/{projectKey}/applications/key={key}', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + queryParams: methodArgs?.queryArgs, + }, + this.args.executeRequest + ) + } +} diff --git a/packages/checkout-sdk/src/generated/client/applications/by-project-key-applications-request-builder.ts b/packages/checkout-sdk/src/generated/client/applications/by-project-key-applications-request-builder.ts new file mode 100644 index 000000000..88b7e0130 --- /dev/null +++ b/packages/checkout-sdk/src/generated/client/applications/by-project-key-applications-request-builder.ts @@ -0,0 +1,107 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ +import { + Application, + ApplicationDraft, + PaginatedApplication, +} from '../../models/application' +import { executeRequest, QueryParam } from '../../shared/utils/common-types' +import { ApiRequest } from '../../shared/utils/requests-utils' +import { ByProjectKeyApplicationsByIdRequestBuilder } from './by-project-key-applications-by-id-request-builder' +import { ByProjectKeyApplicationsKeyByKeyRequestBuilder } from './by-project-key-applications-key-by-key-request-builder' +/** + **/ +export class ByProjectKeyApplicationsRequestBuilder { + constructor( + protected readonly args: { + pathArgs: { + projectKey: string + } + executeRequest: executeRequest + baseUri?: string + } + ) {} + public withId(childPathArgs: { + id: string + }): ByProjectKeyApplicationsByIdRequestBuilder { + return new ByProjectKeyApplicationsByIdRequestBuilder({ + pathArgs: { + ...this.args.pathArgs, + ...childPathArgs, + }, + executeRequest: this.args.executeRequest, + baseUri: this.args.baseUri, + }) + } + public withKey(childPathArgs: { + key: string + }): ByProjectKeyApplicationsKeyByKeyRequestBuilder { + return new ByProjectKeyApplicationsKeyByKeyRequestBuilder({ + pathArgs: { + ...this.args.pathArgs, + ...childPathArgs, + }, + executeRequest: this.args.executeRequest, + baseUri: this.args.baseUri, + }) + } + + /** + * Retrieves Applications + * + */ + public get(methodArgs?: { + queryArgs?: { + sort?: string | string[] + limit?: number + offset?: number + withTotal?: boolean + [key: string]: QueryParam + } + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'GET', + uriTemplate: '/{projectKey}/applications', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + queryParams: methodArgs?.queryArgs, + }, + this.args.executeRequest + ) + } + /** + * Creates a new [Application](ctp:checkout:type:Application). + * + */ + public post(methodArgs: { + body: ApplicationDraft + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'POST', + uriTemplate: '/{projectKey}/applications', + pathVariables: this.args.pathArgs, + headers: { + 'Content-Type': 'application/json', + ...methodArgs?.headers, + }, + body: methodArgs?.body, + }, + this.args.executeRequest + ) + } +} diff --git a/packages/checkout-sdk/src/generated/client/by-project-key-request-builder.ts b/packages/checkout-sdk/src/generated/client/by-project-key-request-builder.ts index f7956717e..fb0a78683 100644 --- a/packages/checkout-sdk/src/generated/client/by-project-key-request-builder.ts +++ b/packages/checkout-sdk/src/generated/client/by-project-key-request-builder.ts @@ -4,6 +4,8 @@ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. */ import { executeRequest } from '../shared/utils/common-types' +import { ByProjectKeyApplicationsRequestBuilder } from './applications/by-project-key-applications-request-builder' +import { ByProjectKeyPaymentIntegrationsRequestBuilder } from './payment-integrations/by-project-key-payment-integrations-request-builder' import { ByProjectKeyPaymentIntentsRequestBuilder } from './payment-intents/by-project-key-payment-intents-request-builder' import { ByProjectKeyTransactionsRequestBuilder } from './transactions/by-project-key-transactions-request-builder' /** @@ -36,4 +38,22 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } + public paymentIntegrations(): ByProjectKeyPaymentIntegrationsRequestBuilder { + return new ByProjectKeyPaymentIntegrationsRequestBuilder({ + pathArgs: { + ...this.args.pathArgs, + }, + executeRequest: this.args.executeRequest, + baseUri: this.args.baseUri, + }) + } + public applications(): ByProjectKeyApplicationsRequestBuilder { + return new ByProjectKeyApplicationsRequestBuilder({ + pathArgs: { + ...this.args.pathArgs, + }, + executeRequest: this.args.executeRequest, + baseUri: this.args.baseUri, + }) + } } diff --git a/packages/checkout-sdk/src/generated/client/payment-integrations/by-project-key-payment-integrations-by-id-request-builder.ts b/packages/checkout-sdk/src/generated/client/payment-integrations/by-project-key-payment-integrations-by-id-request-builder.ts new file mode 100644 index 000000000..0140485da --- /dev/null +++ b/packages/checkout-sdk/src/generated/client/payment-integrations/by-project-key-payment-integrations-by-id-request-builder.ts @@ -0,0 +1,115 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ +import { + PaymentIntegration, + PaymentIntegrationUpdateActions, +} from '../../models/payment-integration' +import { executeRequest, QueryParam } from '../../shared/utils/common-types' +import { ApiRequest } from '../../shared/utils/requests-utils' +/** + **/ +export class ByProjectKeyPaymentIntegrationsByIdRequestBuilder { + constructor( + protected readonly args: { + pathArgs: { + projectKey: string + id: string + } + executeRequest: executeRequest + baseUri?: string + } + ) {} + /** + * Retrieves Payment Integrations in a [Project](ctp:api:type:Project) with a given `id`. + * + */ + public get(methodArgs?: { + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'GET', + uriTemplate: '/{projectKey}/payment-integrations/{id}', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + }, + this.args.executeRequest + ) + } + /** + * Checks if a PaymentIntegration with a given `id` exists. Returns `200 OK` if the PaymentIntegration exists, or `404 Not Found` if it doesn't. Specific Error Codes: + * - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError) + * - [GeneralError](ctp:checkout:type:GeneralError) + * + */ + public head(methodArgs?: { + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'HEAD', + uriTemplate: '/{projectKey}/payment-integrations/{id}', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + }, + this.args.executeRequest + ) + } + public post(methodArgs: { + body: PaymentIntegrationUpdateActions + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'POST', + uriTemplate: '/{projectKey}/payment-integrations/{id}', + pathVariables: this.args.pathArgs, + headers: { + 'Content-Type': 'application/json', + ...methodArgs?.headers, + }, + body: methodArgs?.body, + }, + this.args.executeRequest + ) + } + public delete(methodArgs: { + queryArgs: { + version: number + [key: string]: QueryParam + } + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'DELETE', + uriTemplate: '/{projectKey}/payment-integrations/{id}', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + queryParams: methodArgs?.queryArgs, + }, + this.args.executeRequest + ) + } +} diff --git a/packages/checkout-sdk/src/generated/client/payment-integrations/by-project-key-payment-integrations-key-by-key-request-builder.ts b/packages/checkout-sdk/src/generated/client/payment-integrations/by-project-key-payment-integrations-key-by-key-request-builder.ts new file mode 100644 index 000000000..681125091 --- /dev/null +++ b/packages/checkout-sdk/src/generated/client/payment-integrations/by-project-key-payment-integrations-key-by-key-request-builder.ts @@ -0,0 +1,117 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ +import { + PaymentIntegration, + PaymentIntegrationUpdateActions, +} from '../../models/payment-integration' +import { executeRequest, QueryParam } from '../../shared/utils/common-types' +import { ApiRequest } from '../../shared/utils/requests-utils' +/** + **/ +export class ByProjectKeyPaymentIntegrationsKeyByKeyRequestBuilder { + constructor( + protected readonly args: { + pathArgs: { + projectKey: string + key: string + } + executeRequest: executeRequest + baseUri?: string + } + ) {} + /** + * Retrieves Payment Integrations in a [Project](ctp:api:type:Project) with a given `key`. Specific Error Codes: + * - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError) + * - [GeneralError](ctp:checkout:type:GeneralError) + * + */ + public get(methodArgs?: { + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'GET', + uriTemplate: '/{projectKey}/payment-integrations/key={key}', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + }, + this.args.executeRequest + ) + } + public post(methodArgs: { + body: PaymentIntegrationUpdateActions + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'POST', + uriTemplate: '/{projectKey}/payment-integrations/key={key}', + pathVariables: this.args.pathArgs, + headers: { + 'Content-Type': 'application/json', + ...methodArgs?.headers, + }, + body: methodArgs?.body, + }, + this.args.executeRequest + ) + } + /** + * Checks if a PaymentIntegration with a given `key` exists. Returns `200 OK` if the PaymentIntegration exists, or `404 Not Found` if it doesn't. Specific Error Codes: + * - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError) + * - [GeneralError](ctp:checkout:type:GeneralError) + * + */ + public head(methodArgs?: { + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'HEAD', + uriTemplate: '/{projectKey}/payment-integrations/key={key}', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + }, + this.args.executeRequest + ) + } + public delete(methodArgs: { + queryArgs: { + version: number + [key: string]: QueryParam + } + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'DELETE', + uriTemplate: '/{projectKey}/payment-integrations/key={key}', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + queryParams: methodArgs?.queryArgs, + }, + this.args.executeRequest + ) + } +} diff --git a/packages/checkout-sdk/src/generated/client/payment-integrations/by-project-key-payment-integrations-request-builder.ts b/packages/checkout-sdk/src/generated/client/payment-integrations/by-project-key-payment-integrations-request-builder.ts new file mode 100644 index 000000000..83ad9100b --- /dev/null +++ b/packages/checkout-sdk/src/generated/client/payment-integrations/by-project-key-payment-integrations-request-builder.ts @@ -0,0 +1,109 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ +import { + PaginatedPaymentIntegration, + PaymentIntegration, +} from '../../models/payment-integration' +import { PaymentIntegrationDraft } from '../../models/payment-integration-draft' +import { executeRequest, QueryParam } from '../../shared/utils/common-types' +import { ApiRequest } from '../../shared/utils/requests-utils' +import { ByProjectKeyPaymentIntegrationsByIdRequestBuilder } from './by-project-key-payment-integrations-by-id-request-builder' +import { ByProjectKeyPaymentIntegrationsKeyByKeyRequestBuilder } from './by-project-key-payment-integrations-key-by-key-request-builder' +/** + **/ +export class ByProjectKeyPaymentIntegrationsRequestBuilder { + constructor( + protected readonly args: { + pathArgs: { + projectKey: string + } + executeRequest: executeRequest + baseUri?: string + } + ) {} + public withId(childPathArgs: { + id: string + }): ByProjectKeyPaymentIntegrationsByIdRequestBuilder { + return new ByProjectKeyPaymentIntegrationsByIdRequestBuilder({ + pathArgs: { + ...this.args.pathArgs, + ...childPathArgs, + }, + executeRequest: this.args.executeRequest, + baseUri: this.args.baseUri, + }) + } + public withKey(childPathArgs: { + key: string + }): ByProjectKeyPaymentIntegrationsKeyByKeyRequestBuilder { + return new ByProjectKeyPaymentIntegrationsKeyByKeyRequestBuilder({ + pathArgs: { + ...this.args.pathArgs, + ...childPathArgs, + }, + executeRequest: this.args.executeRequest, + baseUri: this.args.baseUri, + }) + } + + /** + * Retrieves Payment Integrations in a [Project](ctp:api:type:Project). + * + * The results are [paginated](/../api/general-concepts#pagination). + * + */ + public get(methodArgs?: { + queryArgs?: { + sort?: string | string[] + limit?: number + offset?: number + withTotal?: boolean + [key: string]: QueryParam + } + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'GET', + uriTemplate: '/{projectKey}/payment-integrations', + pathVariables: this.args.pathArgs, + headers: { + ...methodArgs?.headers, + }, + queryParams: methodArgs?.queryArgs, + }, + this.args.executeRequest + ) + } + /** + * Creates a new PaymentIntegration. + * + */ + public post(methodArgs: { + body: PaymentIntegrationDraft + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'POST', + uriTemplate: '/{projectKey}/payment-integrations', + pathVariables: this.args.pathArgs, + headers: { + 'Content-Type': 'application/json', + ...methodArgs?.headers, + }, + body: methodArgs?.body, + }, + this.args.executeRequest + ) + } +} diff --git a/packages/checkout-sdk/src/generated/index.ts b/packages/checkout-sdk/src/generated/index.ts index b76be8d0a..8d9241d44 100644 --- a/packages/checkout-sdk/src/generated/index.ts +++ b/packages/checkout-sdk/src/generated/index.ts @@ -7,7 +7,13 @@ // resources export * from './client/api-root'; //Root client that is used to access all the endpoints in the API +export * from './client/applications/by-project-key-applications-by-id-request-builder' +export * from './client/applications/by-project-key-applications-key-by-key-request-builder' +export * from './client/applications/by-project-key-applications-request-builder' export * from './client/by-project-key-request-builder' +export * from './client/payment-integrations/by-project-key-payment-integrations-by-id-request-builder' +export * from './client/payment-integrations/by-project-key-payment-integrations-key-by-key-request-builder' +export * from './client/payment-integrations/by-project-key-payment-integrations-request-builder' export * from './client/payment-intents/by-project-key-payment-intents-by-payment-id-request-builder' export * from './client/payment-intents/by-project-key-payment-intents-request-builder' export * from './client/transactions/by-project-key-transactions-by-id-request-builder' @@ -21,6 +27,7 @@ export * from './models/error' export * from './models/order' export * from './models/payment' export * from './models/payment-integration' +export * from './models/payment-integration-draft' export * from './models/payment-intents' export * from './models/responses' export * from './models/transaction' diff --git a/packages/checkout-sdk/src/generated/models/application.ts b/packages/checkout-sdk/src/generated/models/application.ts index 4bd199d78..837822129 100644 --- a/packages/checkout-sdk/src/generated/models/application.ts +++ b/packages/checkout-sdk/src/generated/models/application.ts @@ -4,10 +4,292 @@ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. */ -import { IReference, IResourceIdentifier } from './common' +import { IReference, IResourceIdentifier, LocalizedString } from './common' +import { + CreatedBy, + LastModifiedBy, + PaymentComponentType, +} from './payment-integration' +export interface AllowedOrigins { + /** + * Indicates whether all the origin URLs are allowed or not. + * + * + */ + readonly allowAll: boolean + /** + * Value of the URL to set. If empty, any existing value will be removed. + * + * + */ + readonly origins?: string[] +} +export interface Application { + /** + * Unique identifier of the Application. + * + * + */ + readonly id: string + /** + * Current version of the Application. + * + * + */ + readonly version: number + /** + * User-defined unique identifier of the Application. `MinLength: 2 ​MaxLength: 256 ​Pattern: ^[A-Za-z0-9_-]+$` + * + * + */ + readonly key: string + /** + * Indicates whether the Application is active or not. + * + * + */ + readonly status?: ApplicationStatus + /** + * Name of the Application. + * + * + */ + readonly name: string + /** + * Description of the Application. + * + * + */ + readonly description?: string + /** + * Details of the application logo. It is required if the `mode = CompleteFlow`. + * + * + */ + readonly logo?: ApplicationLogo + /** + * List of countries that the Application supports. Each country is represented by two-digit country code as per ISO 3166-1 alpha-2. + * + * + */ + readonly countries: string[] + /** + * Allowed origin URLs for the Application. + * + * + */ + readonly allowedOrigins: AllowedOrigins + /** + * Checkout mode to use for the Application. + * + * + */ + readonly mode: ApplicationMode + /** + * Sets the payment configuration options of the Application. + * + * + */ + readonly paymentsConfiguration: PaymentsConfiguration + /** + * User agreements to display. It is only applicable if the `mode` is `CompleteFlow`. + * + * + */ + readonly agreements?: ApplicationAgreement[] + /** + * Sets the discounts configuration options of the Application. It is only applicable if the `mode` is `CompleteFlow`. + * + * + */ + readonly discountsConfiguration?: DiscountsConfiguration + /** + * Date and time (UTC) the Application was initially created. + * + * + */ + readonly createdAt: string + /** + * IDs and references that created the Application. + * + * + */ + readonly createdBy?: CreatedBy + /** + * Date and time (UTC) the Application was last updated. + * + * + */ + readonly lastModifiedAt: string + /** + * IDs and references that last modified the Application. + * + * + */ + readonly lastModifiedBy?: LastModifiedBy +} +export interface ApplicationAgreement { + /** + * Unique identifier of the ApplicationAgreement. + * + * + */ + readonly id: string + /** + * Unique name identifier for the ApplicationAgreement. + * + * + */ + readonly name: string + /** + * Type of agreement. + * + * + */ + readonly type: ApplicationAgreementType + /** + * Indicates whether the agreement is active or not. + * + * + */ + readonly status: ApplicationAgreementStatus + /** + * Text to display in checkout in Markdown format. + * + * + */ + readonly text: LocalizedString +} +export interface ApplicationAgreementDraft { + /** + * Unique name for identifying the agreement. + * + * + */ + readonly name: string + /** + * Type of agreement. + * + * + */ + readonly type: ApplicationAgreementType + /** + * Indicates whether the agreement is active or not. + * + * + */ + readonly status: ApplicationAgreementStatus + /** + * Text to display in checkout in Markdown format. + * + * + */ + readonly text: LocalizedString +} +export enum ApplicationAgreementStatusValues { + Active = 'Active', + Inactive = 'Inactive', +} + +export type ApplicationAgreementStatus = 'Active' | 'Inactive' | (string & {}) +export enum ApplicationAgreementTypeValues { + MandatoryCheckbox = 'MandatoryCheckbox', + Text = 'Text', +} + +export type ApplicationAgreementType = + | 'MandatoryCheckbox' + | 'Text' + | (string & {}) +export interface ApplicationDraft { + /** + * User-defined unique identifier of the Application. `MinLength: 2 ​MaxLength: 256 ​Pattern: ^[A-Za-z0-9_-]+$` + * + * + */ + readonly key: string + /** + * Indicates whether the Application is active or not. + * + * + */ + readonly status?: ApplicationStatus + /** + * Name of the Application. + * + * + */ + readonly name: string + /** + * Description of the Application. + * + * + */ + readonly description?: string + /** + * Details of the Application logo. It is required if the `mode` is `CompleteFlow`. + * + * + */ + readonly logo?: ApplicationLogo + /** + * List of countries that the Application supports. Each country is represented by two-digit country code as per ISO 3166-1 alpha-2. + * + * + */ + readonly countries: string[] + /** + * Allowed origin URLs for the Application. + * + * + */ + readonly allowedOrigins: AllowedOrigins + /** + * Checkout mode to use for the Application. + * + * + */ + readonly mode: ApplicationMode + /** + * Sets the payment configuration options of the Application. + * + * + */ + readonly paymentsConfiguration: PaymentsConfiguration + /** + * User agreements to display. It is only applicable if the `mode` is `CompleteFlow`. + * + * + */ + readonly agreements?: ApplicationAgreement[] + /** + * Sets the discounts configuration options of the Application. It is only applicable if the `mode` is `CompleteFlow`. + * + * + */ + readonly discountsConfiguration?: DiscountsConfiguration +} /** - * Reference to an [Application](/connectors-and-applications#applications). + * Details of the Application logo. It is required if the `mode` is `CompleteFlow`. + * + */ +export interface ApplicationLogo { + /** + * URL of the logo. + * + * + */ + readonly url?: string +} +export enum ApplicationModeValues { + CompleteFlow = 'CompleteFlow', + PaymentOnly = 'PaymentOnly', +} + +export type ApplicationMode = 'CompleteFlow' | 'PaymentOnly' | (string & {}) +/** + * Reference to an [Application](ctp:checkout:type:Application). * */ export interface ApplicationReference extends IReference { @@ -20,7 +302,7 @@ export interface ApplicationReference extends IReference { readonly id: string } /** - * Resource identifier to an [Application](/connectors-and-applications#applications). Either `id` or `key` is required. If both are set, an [InvalidJsonInput](/errors#invalidjsoninput) error is returned. + * Resource identifier to an [Application](ctp:checkout:type:Application). Either `id` or `key` is required. If both are set, an [InvalidJsonInput](/errors#invalidjsoninput) error is returned. * */ export interface ApplicationResourceIdentifier extends IResourceIdentifier { @@ -38,3 +320,371 @@ export interface ApplicationResourceIdentifier extends IResourceIdentifier { */ readonly key?: string } +export enum ApplicationStatusValues { + Active = 'Active', + Inactive = 'Inactive', +} + +export type ApplicationStatus = 'Active' | 'Inactive' | (string & {}) +/** + * Base type for all Application update actions. + * + */ +export type ApplicationUpdateAction = + | AddAllowedOriginUpdateAction + | AddApplicationAgreementUpdateAction + | AddCountryUpdateAction + | RemoveAllowedOriginUpdateAction + | RemoveApplicationAgreementUpdateAction + | RemoveCountryUpdateAction + | ReorderApplicationAgreementUpdateAction + | SetActivePaymentComponentTypeUpdateAction + | SetAllowAllOriginsUpdateAction + | SetAllowedOriginsUpdateAction + | SetApplicationAgreementNameUpdateAction + | SetApplicationAgreementStatusUpdateAction + | SetApplicationAgreementTextUpdateAction + | SetApplicationAgreementTypeUpdateAction + | SetApplicationAgreementsUpdateAction + | SetApplicationLogoUpdateAction + | SetApplicationNameUpdateAction + | SetApplicationStatusUpdateAction + | SetCountriesUpdateAction + | SetDescriptionUpdateAction + | SetDiscountsConfigurationUpdateAction + | SetPaymentReturnUrlUpdateAction + | SetPaymentsConfigurationUpdateAction +export interface IApplicationUpdateAction { + /** + * Type of update action to be performed on the Application. + * + * + */ + readonly action: string +} +/** + * Update actions for Applications. + * + */ +export interface ApplicationUpdateActions { + /** + * Expected version of the Application on which the changes should be applied. + * If the expected version does not match the actual version, a [ConcurrentModification](ctp:checkout:type:ConcurrentModificationError) error will be returned. + * + * + */ + readonly version: number + /** + * Update actions to be performed on the Application. + * + * + */ + readonly actions: ApplicationUpdateAction[] +} +export interface DiscountsConfiguration { + /** + * Indicates if the buyer is able to apply discounts to the cart. It is only applicable if the `mode = CompleteFlow`. + * + * + */ + readonly allowDiscounts: boolean +} +/** + * Paginated result containing Application. + * + */ +export interface PaginatedApplication { + /** + * Number of results requested. + * + * + */ + readonly limit: number + /** + * Number of elements skipped. + * + * + */ + readonly offset: number + /** + * Actual number of results returned. + * + * + */ + readonly count: number + /** + * Total number of results matching the query. + * + * + */ + readonly total: number + /** + * Applications matching the query. + * + * + */ + readonly results: Application[] +} +export interface PaymentsConfiguration { + /** + * URL where the buyer will be redirected back to after an offsite payment. + * + * + */ + readonly paymentReturnUrl?: string + /** + * Indicates the type of payment components that the Application will use. + * + * + */ + readonly activePaymentComponentType: PaymentComponentType +} +export interface AddAllowedOriginUpdateAction extends IApplicationUpdateAction { + readonly action: 'addAllowedOrigin' + /** + * Origin URL to add to the allowed origins list. + * + * + */ + readonly origin: string +} +export interface AddApplicationAgreementUpdateAction + extends IApplicationUpdateAction { + readonly action: 'addAgreement' + /** + * Agreement to add to the Application. + * + * + */ + readonly agreement: ApplicationAgreementDraft +} +export interface AddCountryUpdateAction extends IApplicationUpdateAction { + readonly action: 'addCountry' + /** + * Country to add. Represented by two-digit country code as per ISO 3166-1 alpha-2. + * + * + */ + readonly country: string +} +export interface RemoveAllowedOriginUpdateAction + extends IApplicationUpdateAction { + readonly action: 'removeAllowedOrigin' + /** + * Origin URL to remove from the allowed origins list. + * + * + */ + readonly origin: string +} +export interface RemoveApplicationAgreementUpdateAction + extends IApplicationUpdateAction { + readonly action: 'removeAgreement' + /** + * ID of the agreement to remove from the Application. + * + * + */ + readonly agreementId: string +} +export interface RemoveCountryUpdateAction extends IApplicationUpdateAction { + readonly action: 'removeCountry' + /** + * Country to remove. Represented by two-digit country code as per ISO 3166-1 alpha-2. + * + * + */ + readonly country: string +} +export interface ReorderApplicationAgreementUpdateAction + extends IApplicationUpdateAction { + readonly action: 'reorderAgreement' + /** + * Array of agreement IDs. + * + * + */ + readonly agreementIds: string[] +} +export interface SetActivePaymentComponentTypeUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setActivePaymentComponentType' + /** + * Type of payment components that the Application will use. + * + * + */ + readonly activePaymentComponentType: PaymentComponentType +} +export interface SetAllowAllOriginsUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setAllowAllOrigins' + /** + * Whether to allow all origins or not. + * + * + */ + readonly allowAll: boolean +} +export interface SetAllowedOriginsUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setAllowedOrigins' + /** + * New allowed origins configuration. + * + * + */ + readonly allowedOrigins: AllowedOrigins +} +export interface SetApplicationAgreementNameUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setAgreementName' + /** + * ID of the agreement to update. + * + * + */ + readonly agreementId: string + /** + * New name for the agreement. + * + * + */ + readonly name: string +} +export interface SetApplicationAgreementStatusUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setAgreementStatus' + /** + * ID of the agreement to update. + * + * + */ + readonly agreementId: string + /** + * New status for the agreement. + * + * + */ + readonly status: ApplicationAgreementStatus +} +export interface SetApplicationAgreementTextUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setAgreementText' + /** + * ID of the agreement to update. + * + * + */ + readonly agreementId: string + /** + * New text for the agreement. + * + * + */ + readonly text: LocalizedString +} +export interface SetApplicationAgreementTypeUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setAgreementType' + /** + * ID of the agreement to update. + * + * + */ + readonly agreementId: string + /** + * New type for the agreement. + * + * + */ + readonly type: ApplicationAgreementType +} +export interface SetApplicationAgreementsUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setAgreements' + /** + * Value to set. If empty, any existing value will be removed. + * + * + */ + readonly agreements?: ApplicationAgreementDraft[] +} +export interface SetApplicationLogoUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setApplicationLogo' + /** + * New logo to assign to the Application, which must be a valid url. + * + * + */ + readonly logo: ApplicationLogo +} +export interface SetApplicationNameUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setName' + /** + * New name to assign to the Application. + * + * + */ + readonly name: string +} +export interface SetApplicationStatusUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setStatus' + /** + * New status to assign to the Application. + * + * + */ + readonly status: ApplicationStatus +} +export interface SetCountriesUpdateAction extends IApplicationUpdateAction { + readonly action: 'setCountries' + /** + * Sets a list of countries to the Application. Each country is represented by two-digit country code as per ISO 3166-1 alpha-2. + * + * + */ + readonly countries: string[] +} +export interface SetDescriptionUpdateAction extends IApplicationUpdateAction { + readonly action: 'setDescription' + /** + * Value to set. If empty, any existing value will be removed. + * + * + */ + readonly description: LocalizedString +} +export interface SetDiscountsConfigurationUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setDiscountsConfiguration' + /** + * New discounts configuration for the Application. + * + * + */ + readonly discountsConfiguration: DiscountsConfiguration +} +export interface SetPaymentReturnUrlUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setPaymentReturnUrl' + /** + * Value to set. If empty, any existing value will be removed. + * + * + */ + readonly paymentReturnUrl?: string +} +export interface SetPaymentsConfigurationUpdateAction + extends IApplicationUpdateAction { + readonly action: 'setPaymentsConfiguration' + /** + * New payments configuration for the Application. + * + * + */ + readonly paymentsConfiguration: PaymentsConfiguration +} diff --git a/packages/checkout-sdk/src/generated/models/common.ts b/packages/checkout-sdk/src/generated/models/common.ts index 1a20c0d36..5e4e17d20 100644 --- a/packages/checkout-sdk/src/generated/models/common.ts +++ b/packages/checkout-sdk/src/generated/models/common.ts @@ -17,7 +17,7 @@ import { } from './payment-integration' /** - * A Reference represents a loose reference to another resource in the same Project identified by its `id`. The `typeId` indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like [ChannelReference](ctp:api:type:ChannelReference). A referenced resource can be embedded through [Reference Expansion](/general-concepts#reference-expansion). The expanded reference is the value of an additional `obj` field then. + * A Reference represents a loose reference to another resource in the same Project identified by its `id`. The `typeId` indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like [ApplicationReference](ctp:checkout:type:ApplicationReference). * */ export type Reference = @@ -47,6 +47,7 @@ export interface IReference { export enum ReferenceTypeIdValues { Application = 'application', Cart = 'cart', + Deployment = 'deployment', Order = 'order', Payment = 'payment', PaymentIntegration = 'payment-integration', @@ -55,14 +56,15 @@ export enum ReferenceTypeIdValues { export type ReferenceTypeId = | 'application' | 'cart' + | 'deployment' | 'order' | 'payment' | 'payment-integration' | (string & {}) /** - * Draft type to create a [Reference](ctp:api:type:Reference) or a [KeyReference](ctp:api:type:KeyReference) to a resource. Provide either the `id` or (wherever supported) the `key` of the resource to reference, but depending on the API endpoint the response returns either a Reference or a KeyReference. For example, the field `parent` of a [CategoryDraft](ctp:api:type:CategoryDraft) takes a ResourceIdentifier for its value while the value of the corresponding field of a [Category](ctp:api:type:Category) is a Reference. + * Draft type to create a [Reference](ctp:checkout:type:Reference) to a resource. Provide either the `id` or (wherever supported) the `key` of the resource to reference, but depending on the API endpoint the response returns a Reference. * - * Each resource type has its corresponding ResourceIdentifier, like [ChannelResourceIdentifier](ctp:api:type:ChannelResourceIdentifier). + * Each resource type has its corresponding ResourceIdentifier, like [PaymentResourceIdentifier](ctp:checkout:type:PaymentResourceIdentifier). * */ export type ResourceIdentifier = @@ -73,7 +75,7 @@ export type ResourceIdentifier = | PaymentResourceIdentifier export interface IResourceIdentifier { /** - * Type of referenced resource. If given, it must match the expected [ReferenceTypeId](/../api/types#ctp:api:type:ReferenceTypeId) of the referenced resource. + * Type of referenced resource. If given, it must match the expected [ReferenceTypeId](ctp:checkout:type:ReferenceTypeId) of the referenced resource. * * */ @@ -112,6 +114,20 @@ export interface Amount { */ readonly currencyCode: string } +/** + * JSON object where the keys are of type [Locale](ctp:api:type:Locale), and the values are the strings used for the corresponding language. + * + */ +export interface LocalizedString { + [key: string]: string +} +/** + * A localized URL that provides different URL values for different locales. + * + */ +export interface LocalizedUrl { + [key: string]: string +} /** * The Region in which the Checkout application is [hosted](/hosts-and-authorization). * diff --git a/packages/checkout-sdk/src/generated/models/error.ts b/packages/checkout-sdk/src/generated/models/error.ts index 7971ef6eb..e425da510 100644 --- a/packages/checkout-sdk/src/generated/models/error.ts +++ b/packages/checkout-sdk/src/generated/models/error.ts @@ -8,14 +8,23 @@ * This is the representation of a single error. */ export type ErrorObject = + | ConcurrentModificationError | ConnectorFailedError + | DuplicateFieldWithConflictingResourceError | GeneralError + | InvalidFieldError | InvalidInputError | InvalidJsonInputError + | InvalidOperationError + | MaxResourceLimitExceededError + | MissingProjectKeyError | MultipleActionsNotAllowedError | PaymentFailureError + | ReferencedResourceNotFoundError | RequiredFieldError | ResourceNotFoundError + | ServiceUnavailableError + | SyntaxErrorError export interface IErrorObject { /** * Error identifier. @@ -30,6 +39,38 @@ export interface IErrorObject { */ readonly message: string } +/** + * Returned when the request conflicts with the current state of the involved resources. Typically, the request attempts to modify a resource that is out of date (that is modified by another client since it was last retrieved). + * The client application should resolve the conflict (with or without involving the end user) before retrying the request. + * + */ +export interface ConcurrentModificationError extends IErrorObject { + readonly code: 'ConcurrentModification' + /** + * `"Object $resourceId has a different version than expected. Expected: $expectedVersion - Actual: $currentVersion."` + * + * + */ + readonly message: string + /** + * The ID of the resource that has a version conflict. + * + * + */ + readonly resourceId: string + /** + * Expected version of the resource. + * + * + */ + readonly expectedVersion: number + /** + * Current version of the resource. + * + * + */ + readonly currentVersion: number +} /** * Returned when the payment [Connector](/connectors-and-applications#payment-connectors) cannot be reached. * @@ -43,6 +84,46 @@ export interface ConnectorFailedError extends IErrorObject { */ readonly message: string } +/** + * Returned when a field value conflicts with an existing value stored in a particular resource causing a duplicate. + * + */ +export interface DuplicateFieldWithConflictingResourceError + extends IErrorObject { + readonly code: 'DuplicateFieldWithConflictingResource' + /** + * `"A duplicate value $duplicateValue exists for field $field in request."` + * + * + */ + readonly message: string +} +/** + * Base representation of an error response containing common fields to all errors. + * + */ +export interface ErrorResponse { + /** + * HTTP status code corresponding to the error. + * + * + */ + readonly statusCode: number + /** + * First error message in the `errors` array. + * + * + */ + readonly message: string + /** + * Errors returned for a request. + * + * A single error response can contain multiple errors if the errors are related to the same HTTP status code such as `400`. + * + * + */ + readonly errors?: ErrorObject[] +} /** * Returned when a server-side problem occurs. In some cases, the requested action may successfully complete after the error is returned. Therefore, it is recommended to verify the status of the requested resource after receiving a 500 error. * @@ -59,7 +140,38 @@ export interface GeneralError extends IErrorObject { readonly message: string } /** - * Returned when input is not valid. + * Returned when a field has an invalid value. + * + */ +export interface InvalidFieldError extends IErrorObject { + readonly code: 'InvalidField' + /** + * `"The value $invalidValue is not valid for field $field."` + * + * + */ + readonly message: string + /** + * Name of the field with the invalid value. + * + * + */ + readonly field: string + /** + * Value invalid for the field. + * + * + */ + readonly invalidValue: any + /** + * Fixed set of allowed values for the field, if any. + * + * + */ + readonly allowedValues?: string[] +} +/** + * Returned when an invalid input has been sent. * */ export interface InvalidInputError extends IErrorObject { @@ -90,7 +202,62 @@ export interface InvalidJsonInputError extends IErrorObject { * Further explanation about why the JSON is invalid. * */ - readonly detailedErrorMessage: string + readonly detailedErrorMessage?: string +} +/** + * Returned when the resources involved in the request are not in a valid state for the operation. + * + * The client application should validate the constraints described in the error message before sending the request. + * + */ +export interface InvalidOperationError extends IErrorObject { + readonly code: 'InvalidOperation' + /** + * Description of the error. + * + * + */ + readonly message: string +} +/** + * Returned when a resource type cannot be created as it has reached its [limits](/limits). + * + * The limits must be adjusted for this resource before sending the request again. + * + */ +export interface MaxResourceLimitExceededError extends IErrorObject { + readonly code: 'MaxResourceLimitExceeded' + /** + * `"You have exceeded the limit of $limit resources of type $resourceTypeId."` + * + * + */ + readonly message: string + /** + * The limit that was exceeded. + * + * + */ + readonly limit: number + /** + * The resource type that reached its limit. + * + * + */ + readonly resourceTypeId: string +} +/** + * Returned when the project key is missing from the request. + * + */ +export interface MissingProjectKeyError extends IErrorObject { + readonly code: 'MissingProjectKey' + /** + * `"Missing project key in the request path."` + * + * + */ + readonly message: string } /** * Returned when `actions` in the request body contains more than one object. @@ -118,6 +285,37 @@ export interface PaymentFailureError extends IErrorObject { */ readonly message: string } +/** + * Returned when a resource referenced by a [Reference](ctp:checkout:type:Reference) or a [ResourceIdentifier](ctp:checkout:type:ResourceIdentifier) could not be found. + * + */ +export interface ReferencedResourceNotFoundError extends IErrorObject { + readonly code: 'ReferencedResourceNotFound' + /** + * `"The referenced object of type $typeId $id || key was not found. It either doesn't exist, or it can't be accessed from this endpoint (e.g., if the endpoint filters by store or customer account)."` + * + * + */ + readonly message: string + /** + * Type of referenced resource. + * + * + */ + readonly typeId: string + /** + * Unique identifier of the referenced resource, if known. + * + * + */ + readonly id?: string + /** + * User-defined unique identifier of the referenced resource, if known. + * + * + */ + readonly key?: string +} /** * Returned when a value is not defined for a required field. * @@ -144,7 +342,45 @@ export interface RequiredFieldError extends IErrorObject { export interface ResourceNotFoundError extends IErrorObject { readonly code: 'ResourceNotFound' /** - * `"The Resource with ID $resourceId was not found."` + * `"The Resource with $resourceIdentifier $resourceId was not found."` + * + * + */ + readonly message: string + /** + * The identifier type used (e.g., `id`, `key`). + * + * + */ + readonly resourceIdentifier: string + /** + * The actual identifier value. + * + * + */ + readonly resourceId: string +} +/** + * Returned when the service is unavailable, for example when the Notification Service is down. + * + */ +export interface ServiceUnavailableError extends IErrorObject { + readonly code: 'ServiceUnavailable' + /** + * `"Service is unavailable."` + * + * + */ + readonly message: string +} +/** + * Returned when a [Payment Predicate](/payment-integration-predicates) does not have the correct syntax. + * + */ +export interface SyntaxErrorError extends IErrorObject { + readonly code: 'SyntaxError' + /** + * `"Syntax error while parsing $fieldDefinition."` * * */ diff --git a/packages/checkout-sdk/src/generated/models/payment-integration-draft.ts b/packages/checkout-sdk/src/generated/models/payment-integration-draft.ts new file mode 100644 index 000000000..6538ec2dd --- /dev/null +++ b/packages/checkout-sdk/src/generated/models/payment-integration-draft.ts @@ -0,0 +1,84 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ + +import { ApplicationReference } from './application' +import { + AutomatedReversalConfiguration, + ConnectorDeploymentReference, + DisplayInfo, + PaymentComponentType, + PaymentIntegrationStatus, + SortingInfo, +} from './payment-integration' + +export interface PaymentIntegrationDraft { + /** + * User-defined unique identifier of the PaymentIntegration. `MinLength: 2 ​MaxLength: 256 ​Pattern: ^[A-Za-z0-9_-]+$` + * + * + */ + readonly key?: string + /** + * Reference to an Application associated with the PaymentIntegration. + * + * + */ + readonly application: ApplicationReference + /** + * Indicates whether the Payment Integration is active or not. By default in Inactive. + * + * + */ + readonly status?: PaymentIntegrationStatus + /** + * Type of the PaymentIntegration. ie. card, paypal, applepay. + * + * + */ + readonly type: string + /** + * Name of the PaymentIntegration in the Merchant Center. + * + * + */ + readonly name: string + /** + * Predicate in JSONata format. Applies only when `componentType` is `Component`. + * + * + */ + readonly predicate?: string + /** + * Indicates the component type of payment integration. + * + * + */ + readonly componentType: PaymentComponentType + /** + * Connector deployment info for the payment integration. + * + * + */ + readonly connectorDeployment: ConnectorDeploymentReference + /** + * Customization for the information that is displayed in the UI. Applies only when `componentType` is `Component` + * + * + */ + readonly displayInfo?: DisplayInfo + /** + * Sorting info of the payment integration. + * + * + */ + readonly sortingInfo?: SortingInfo + /** + * Configuration of the payment integration automatic reversal. + * + * + */ + readonly automatedReversalConfiguration?: AutomatedReversalConfiguration +} diff --git a/packages/checkout-sdk/src/generated/models/payment-integration.ts b/packages/checkout-sdk/src/generated/models/payment-integration.ts index 37526d14e..0dbbe24b3 100644 --- a/packages/checkout-sdk/src/generated/models/payment-integration.ts +++ b/packages/checkout-sdk/src/generated/models/payment-integration.ts @@ -4,10 +4,315 @@ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. */ -import { IReference, IResourceIdentifier } from './common' +import { ApplicationReference } from './application' +import { + IReference, + IResourceIdentifier, + LocalizedString, + LocalizedUrl, + Reference, +} from './common' /** - * Reference to a [Payment Integration](/connectors-and-applications#payment-integrations). + * Information regarding IDs and references that created the Payment Integration. + * + */ +export interface CreatedBy { + /** + * ID of the API client that created the PaymentIntegration. + * + * + */ + readonly clientId?: string + /** + * External user ID that created the PaymentIntegration. + * + * + */ + readonly externalUserId?: string + /** + * Customer reference if created by a customer. + * + * + */ + readonly customer?: Reference + /** + * Anonymous ID if created by an anonymous user. + * + * + */ + readonly anonymousId?: string +} +/** + * Information regarding IDs and references that last modified the Payment Integration. + * + */ +export interface LastModifiedBy { + /** + * ID of the API client that last modified the PaymentIntegration. + * + * + */ + readonly clientId?: string + /** + * Session ID associated with the modification of the PaymentIntegration. + * + * + */ + readonly sessionId?: string + /** + * External user ID that last modified the PaymentIntegration. + * + * + */ + readonly externalUserId?: string + /** + * Anonymous ID if the resource was last modified by an anonymous user. + * + * + */ + readonly anonymousId?: string + /** + * Customer reference or customer ID if the resource was last modified by a customer. + * + * + */ + readonly customer?: Reference + /** + * Associate (customer) reference if the resource was last modified by an associate. + * + * + */ + readonly associate?: Reference + /** + * User reference if the resource was last modified by a platform user. + * + * + */ + readonly user?: Reference + /** + * Indicates whether the resource was last modified by a platform client. + * + * + */ + readonly isPlatformClient?: boolean +} +/** + * Configuration for automated reversal of payments. + * + */ +export interface AutomatedReversalConfiguration { + /** + * Indicates whether the automated reversal configuration is active or not. + * + * + */ + readonly status: string + /** + * Cart-based predicate in JSONata format to determine when automated reversal should be applied. + * + * + */ + readonly predicate?: string +} +/** + * Reference to a connector deployment for the payment integration. + * + */ +export interface ConnectorDeploymentReference { + /** + * Unique identifier of the referenced Connect Deployment. + * + * + */ + readonly id: string + /** + * Type identifier, always `deployment` for Connector deployment references. + * + * + */ + readonly typeId: string +} +/** + * Display information for the payment integration in the UI. + * + */ +export interface DisplayInfo { + /** + * Label of the payment method displayed in the UI. + * + * + */ + readonly label?: LocalizedString + /** + * Logo of the payment method displayed in the UI. + * + * + */ + readonly logoUrl?: LocalizedUrl + /** + * Description of the payment method displayed in the UI. + * + * + */ + readonly description?: LocalizedString + /** + * Text of the Pay button displayed in the UI when paying with the payment method. + * + * + */ + readonly payButtonText?: LocalizedString +} +/** + * Paginated result containing PaymentIntegrations. + * + */ +export interface PaginatedPaymentIntegration { + /** + * Number of results requested. + * + * + */ + readonly limit: number + /** + * Number of elements skipped. + * + * + */ + readonly offset: number + /** + * Actual number of results returned. + * + * + */ + readonly count: number + /** + * Total number of results matching the query. + * + * + */ + readonly total: number + /** + * PaymentIntegrations matching the query. + * + * + */ + readonly results: PaymentIntegration[] +} +export enum PaymentComponentTypeValues { + Component = 'Component', + DropIn = 'DropIn', +} + +export type PaymentComponentType = 'Component' | 'DropIn' | (string & {}) +export interface PaymentIntegration { + /** + * Unique identifier of the PaymentIntegration. + * + * + */ + readonly id: string + /** + * Current version of the PaymentIntegration. + * + * + */ + readonly version: number + /** + * User-defined unique identifier of the PaymentIntegration. `MinLength: 2 ​MaxLength: 256 ​Pattern: ^[A-Za-z0-9_-]+$` + * + * + */ + readonly key?: string + /** + * Reference to an Application associated with the PaymentIntegration. + * + * + */ + readonly application: ApplicationReference + /** + * Indicates whether the Payment Integration is active or not. + * + * + */ + readonly status?: PaymentIntegrationStatus + /** + * Type of the PaymentIntegration, for example, card, Paypal, or Applepay. This field must be same as used by the payment service provider (PSP) and must be supported by the Connector. + * + * Use `drop-in` for drop-in Payment Integrations. + * + * + */ + readonly type: string + /** + * Name of the PaymentIntegration in the Merchant Center. + * + * + */ + readonly name: string + /** + * Predicate in JSONata format. Applies only when `componentType` is `Component`. + * + * + */ + readonly predicate?: string + /** + * Indicates the component type of Payment Integration. + * + * + */ + readonly componentType: PaymentComponentType + /** + * Connector deployment info for the Payment Integration. + * + * + */ + readonly connectorDeployment: ConnectorDeploymentReference + /** + * Customization for the information that is displayed in the UI. Applies only when `componentType` is `Component` + * + * + */ + readonly displayInfo?: DisplayInfo + /** + * Sorting information of the Payment Integration. + * + * + */ + readonly sortingInfo?: SortingInfo + /** + * Configuration of the Payment Integration automatic reversal. + * + * + */ + readonly automatedReversalConfiguration?: AutomatedReversalConfiguration + /** + * Date and time (UTC) the PaymentIntegration was initially created. + * + * + */ + readonly createdAt: string + /** + * IDs and references that created the PaymentIntegration. + * + * + */ + readonly createdBy?: CreatedBy + /** + * Date and time (UTC) the PaymentIntegration was last updated. + * + * + */ + readonly lastModifiedAt: string + /** + * IDs and references that last modified the PaymentIntegration. + * + * + */ + readonly lastModifiedBy?: LastModifiedBy +} +/** + * Reference to a [Payment Integration](ctp:checkout:type:PaymentIntegration). * */ export interface PaymentIntegrationReference extends IReference { @@ -20,7 +325,7 @@ export interface PaymentIntegrationReference extends IReference { readonly id: string } /** - * Resource identifier to a [Payment Integration](/connectors-and-applications#payment-integrations). Either `id` or `key` is required. If both are set, an [InvalidJsonInput](/errors#invalidjsoninput) error is returned. + * Resource identifier to a [Payment Integration](ctp:checkout:type:PaymentIntegration). Either `id` or `key` is required. If both are set, an [InvalidJsonInput](/errors#invalidjsoninput) error is returned. * */ export interface PaymentIntegrationResourceIdentifier @@ -39,3 +344,271 @@ export interface PaymentIntegrationResourceIdentifier */ readonly key?: string } +export enum PaymentIntegrationStatusValues { + Active = 'Active', + Inactive = 'Inactive', +} + +export type PaymentIntegrationStatus = 'Active' | 'Inactive' | (string & {}) +export enum PaymentIntegrationTypeValues { + GiftCard = 'GiftCard', + Psp = 'Psp', +} + +export type PaymentIntegrationType = 'GiftCard' | 'Psp' | (string & {}) +export interface SortingInfo { + /** + * Sorting priority of the Payment Integration. + * + * + */ + readonly priority: number +} +/** + * Base type for all PaymentIntegration update actions. + * + */ +export type PaymentIntegrationUpdateAction = + | SetAutomatedReversalConfigurationPredicateUpdateAction + | SetAutomatedReversalConfigurationStatusUpdateAction + | SetAutomatedReversalConfigurationUpdateAction + | SetConnectorDeploymentUpdateAction + | SetDisplayInfoDescriptionUpdateAction + | SetDisplayInfoLabelUpdateAction + | SetDisplayInfoLogoUrlUpdateAction + | SetDisplayInfoPayButtonTextUpdateAction + | SetDisplayInfoUpdateAction + | SetKeyUpdateAction + | SetNameUpdateAction + | SetPredicateUpdateAction + | SetSortingInfoUpdateAction + | SetStatusUpdateAction + | SetTypeUpdateAction +export interface IPaymentIntegrationUpdateAction { + /** + * Type of update action to be performed on the PaymentIntegration. + * + * + */ + readonly action: string +} +/** + * PaymentIntegrationUpdateActions + * + */ +export interface PaymentIntegrationUpdateActions { + /** + * Expected version of the PaymentIntegration on which the changes should be applied. If the expected version does not match the actual version, a [ConcurrentModification](ctp:checkout:type:ConcurrentModificationError) error will be returned. + * + * + */ + readonly version: number + /** + * Update actions to be performed on the PaymentIntegration. + * + * + */ + readonly actions: PaymentIntegrationUpdateAction[] +} +/** + * Sets the automated reversal configuration predicate of a PaymentIntegration. + * + */ +export interface SetAutomatedReversalConfigurationPredicateUpdateAction + extends IPaymentIntegrationUpdateAction { + readonly action: 'setAutomatedReversalConfigurationPredicate' + /** + * Value to set. If empty, any existing value will be removed. + * + * + */ + readonly predicate?: string +} +/** + * Sets the automated reversal configuration status of a PaymentIntegration. + * + */ +export interface SetAutomatedReversalConfigurationStatusUpdateAction + extends IPaymentIntegrationUpdateAction { + readonly action: 'setAutomatedReversalConfigurationStatus' + /** + * Value to set as the automated reversal configuration status of the PaymentIntegration. + * + * + */ + readonly status: string +} +/** + * Sets the automated reversal configuration of a PaymentIntegration. + * + */ +export interface SetAutomatedReversalConfigurationUpdateAction + extends IPaymentIntegrationUpdateAction { + readonly action: 'setAutomatedReversalConfiguration' + /** + * Value to set as the automated reversal configuration of the PaymentIntegration. + * + * + */ + readonly automatedReversalConfiguration?: AutomatedReversalConfiguration +} +/** + * Sets the connector deployment reference of a PaymentIntegration. + * + */ +export interface SetConnectorDeploymentUpdateAction + extends IPaymentIntegrationUpdateAction { + readonly action: 'setConnectorDeployment' + /** + * Value to set as the connector deployment reference of the PaymentIntegration. + * + * + */ + readonly connectorDeployment: ConnectorDeploymentReference +} +/** + * Sets the display info description of a PaymentIntegration. + * + */ +export interface SetDisplayInfoDescriptionUpdateAction + extends IPaymentIntegrationUpdateAction { + readonly action: 'setDisplayInfoDescription' + /** + * Value to set. If empty, any existing value will be removed. + * + * + */ + readonly description?: LocalizedString +} +/** + * Sets the display info label of a PaymentIntegration. + * + */ +export interface SetDisplayInfoLabelUpdateAction + extends IPaymentIntegrationUpdateAction { + readonly action: 'setDisplayInfoLabel' + /** + * Value to set. If empty, any existing value will be removed. + * + * + */ + readonly label?: LocalizedString +} +/** + * Sets the display info logo URL of a PaymentIntegration. + * + */ +export interface SetDisplayInfoLogoUrlUpdateAction + extends IPaymentIntegrationUpdateAction { + readonly action: 'setDisplayInfoLogoUrl' + /** + * Value to set. If empty, any existing value will be removed. + * + * + */ + readonly logoUrl?: LocalizedString +} +/** + * Sets the display info pay button text of a PaymentIntegration. + * + */ +export interface SetDisplayInfoPayButtonTextUpdateAction + extends IPaymentIntegrationUpdateAction { + readonly action: 'setDisplayInfoPayButtonText' + /** + * Value to set. If empty, any existing value will be removed. + * + * + */ + readonly payButtonText?: LocalizedString +} +export interface SetDisplayInfoUpdateAction + extends IPaymentIntegrationUpdateAction { + readonly action: 'setDisplayInfo' + /** + * Value to set. If empty, any existing value will be removed. + * + * + */ + readonly displayInfo?: DisplayInfo +} +/** + * Sets or unsets the key of a PaymentIntegration. + * + */ +export interface SetKeyUpdateAction extends IPaymentIntegrationUpdateAction { + readonly action: 'setKey' + /** + * Value to set. If empty, any existing value will be removed. + * + * + */ + readonly key?: string +} +/** + * Sets the name of a PaymentIntegration. + * + */ +export interface SetNameUpdateAction extends IPaymentIntegrationUpdateAction { + readonly action: 'setName' + /** + * Value to set as the name of the PaymentIntegration. + * + * + */ + readonly name: string +} +/** + * Sets the predicate of a PaymentIntegration. + * + */ +export interface SetPredicateUpdateAction + extends IPaymentIntegrationUpdateAction { + readonly action: 'setPredicate' + /** + * Value to set. If empty, any existing value will be removed. + * + * + */ + readonly predicate?: string +} +/** + * Sets the sorting info of a PaymentIntegration. + * + */ +export interface SetSortingInfoUpdateAction + extends IPaymentIntegrationUpdateAction { + readonly action: 'setSortingInfo' + /** + * Value to set. If empty, any existing value will be removed. + * + * + */ + readonly sortingInfo?: SortingInfo +} +/** + * Sets the status of a PaymentIntegration. + * + */ +export interface SetStatusUpdateAction extends IPaymentIntegrationUpdateAction { + readonly action: 'setStatus' + /** + * Value to set as the status of the PaymentIntegration. + * + * + */ + readonly status: PaymentIntegrationStatus +} +/** + * Sets the type of a PaymentIntegration. + * + */ +export interface SetTypeUpdateAction extends IPaymentIntegrationUpdateAction { + readonly action: 'setType' + /** + * Value to set as the type of the PaymentIntegration. + * + * + */ + readonly type: string +} diff --git a/packages/checkout-sdk/src/generated/models/responses.ts b/packages/checkout-sdk/src/generated/models/responses.ts index b0c138893..7501db5fd 100644 --- a/packages/checkout-sdk/src/generated/models/responses.ts +++ b/packages/checkout-sdk/src/generated/models/responses.ts @@ -812,7 +812,7 @@ export interface CartNotFound extends IResponseMessage { * */ export interface CartWithExistingPayment extends IResponseMessage { - readonly code: 'cart_with_exisiting_payment' + readonly code: 'cart_with_existing_payment' /** * \`error` * diff --git a/packages/checkout-sdk/src/generated/models/transaction.ts b/packages/checkout-sdk/src/generated/models/transaction.ts index 0696c19ad..4e1f4a074 100644 --- a/packages/checkout-sdk/src/generated/models/transaction.ts +++ b/packages/checkout-sdk/src/generated/models/transaction.ts @@ -4,7 +4,10 @@ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. */ -import { ApplicationResourceIdentifier } from './application' +import { + ApplicationReference, + ApplicationResourceIdentifier, +} from './application' import { CartReference, CartResourceIdentifier, OrderReference } from './cart' import { Amount } from './common' import { PaymentReference } from './payment' @@ -34,11 +37,11 @@ export interface Transaction { */ readonly version: number /** - * [Application](/connectors-and-applications#applications) for which the payment must be executed. + * [Application](ctp:checkout:type:Application) for which the payment must be executed. * * */ - readonly application: ApplicationResourceIdentifier + readonly application: ApplicationReference /** * Transaction Item associated with the Transaction. * @@ -77,7 +80,7 @@ export interface TransactionDraft { */ readonly key?: string /** - * [Application](/connectors-and-applications#applications) for which the payment is executed. + * [Application](ctp:checkout:type:Application) for which the payment is executed. * * */ @@ -88,7 +91,7 @@ export interface TransactionDraft { */ readonly transactionItems: TransactionItemDraft[] /** - * [Cart](/../api/projects/carts#cart) for which the payment must be executed. + * [Cart](ctp:api:type:Cart) for which the payment must be executed. * * */ @@ -123,12 +126,12 @@ export interface TransactionItem { */ readonly amount?: Amount /** - * Reference to the [Payment](/../api/projects/payments#payment) associated with the Transaction Item. + * Reference to the [Payment](ctp:api:type:Payment) associated with the Transaction Item. * */ readonly payment?: PaymentReference /** - * Reference to the [Payment Integration](/connectors-and-applications#payment-integrations) to use to execute the payment. + * Reference to the [Payment Integration](ctp:checkout:type:PaymentIntegration) to use to execute the payment. * */ readonly paymentIntegration: PaymentIntegrationReference diff --git a/packages/checkout-sdk/test/generated/client/applications/by-project-key-applications-by-id-request-builder.test.ts b/packages/checkout-sdk/test/generated/client/applications/by-project-key-applications-by-id-request-builder.test.ts new file mode 100644 index 000000000..e36c32504 --- /dev/null +++ b/packages/checkout-sdk/test/generated/client/applications/by-project-key-applications-by-id-request-builder.test.ts @@ -0,0 +1,65 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ + +import { RequestWithMethod } from '../../../request-with-method' +import { ApiRoot } from '../../../../src' + +const apiRoot: ApiRoot = new ApiRoot({ executeRequest: null }) + +export function getRequestsWithMethodParameters(): RequestWithMethod[] { + return [ + { + method: 'get', + uri: '/test_projectKey/applications/test_id', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .withId({ id: 'test_id' }) + .get(), + }, + { + method: 'head', + uri: '/test_projectKey/applications/test_id', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .withId({ id: 'test_id' }) + .head(), + }, + { + method: 'post', + uri: '/test_projectKey/applications/test_id', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .withId({ id: 'test_id' }) + .post({ body: null, headers: null }), + }, + { + method: 'delete', + uri: '/test_projectKey/applications/test_id?version=2', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .withId({ id: 'test_id' }) + .delete({ queryArgs: { version: 2 } }), + }, + ] +} + +describe('Testing ByProjectKeyApplicationsByIdRequestBuilder Requests', () => { + const requestsToTest = getRequestsWithMethodParameters() + requestsToTest.forEach((rm) => { + test(`Testing => request method: ${rm.method} and url: ${rm.uri}`, async () => { + expect(rm.method.toLowerCase()).toBe( + rm.request.clientRequest().method.toLowerCase() + ) + expect(rm.uri.toLowerCase()).toBe( + rm.request.clientRequest().uri.toLowerCase() + ) + }) + }) +}) diff --git a/packages/checkout-sdk/test/generated/client/applications/by-project-key-applications-key-by-key-request-builder.test.ts b/packages/checkout-sdk/test/generated/client/applications/by-project-key-applications-key-by-key-request-builder.test.ts new file mode 100644 index 000000000..cd18bcb5d --- /dev/null +++ b/packages/checkout-sdk/test/generated/client/applications/by-project-key-applications-key-by-key-request-builder.test.ts @@ -0,0 +1,65 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ + +import { RequestWithMethod } from '../../../request-with-method' +import { ApiRoot } from '../../../../src' + +const apiRoot: ApiRoot = new ApiRoot({ executeRequest: null }) + +export function getRequestsWithMethodParameters(): RequestWithMethod[] { + return [ + { + method: 'get', + uri: '/test_projectKey/applications/key=test_key', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .withKey({ key: 'test_key' }) + .get(), + }, + { + method: 'post', + uri: '/test_projectKey/applications/key=test_key', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .withKey({ key: 'test_key' }) + .post({ body: null, headers: null }), + }, + { + method: 'head', + uri: '/test_projectKey/applications/key=test_key', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .withKey({ key: 'test_key' }) + .head(), + }, + { + method: 'delete', + uri: '/test_projectKey/applications/key=test_key?version=2', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .withKey({ key: 'test_key' }) + .delete({ queryArgs: { version: 2 } }), + }, + ] +} + +describe('Testing ByProjectKeyApplicationsKeyByKeyRequestBuilder Requests', () => { + const requestsToTest = getRequestsWithMethodParameters() + requestsToTest.forEach((rm) => { + test(`Testing => request method: ${rm.method} and url: ${rm.uri}`, async () => { + expect(rm.method.toLowerCase()).toBe( + rm.request.clientRequest().method.toLowerCase() + ) + expect(rm.uri.toLowerCase()).toBe( + rm.request.clientRequest().uri.toLowerCase() + ) + }) + }) +}) diff --git a/packages/checkout-sdk/test/generated/client/applications/by-project-key-applications-request-builder.test.ts b/packages/checkout-sdk/test/generated/client/applications/by-project-key-applications-request-builder.test.ts new file mode 100644 index 000000000..84a1be28a --- /dev/null +++ b/packages/checkout-sdk/test/generated/client/applications/by-project-key-applications-request-builder.test.ts @@ -0,0 +1,77 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ + +import { RequestWithMethod } from '../../../request-with-method' +import { ApiRoot } from '../../../../src' + +const apiRoot: ApiRoot = new ApiRoot({ executeRequest: null }) + +export function getRequestsWithMethodParameters(): RequestWithMethod[] { + return [ + { + method: 'get', + uri: '/test_projectKey/applications?sort=sort', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .get({ queryArgs: { sort: 'sort' } }), + }, + { + method: 'get', + uri: '/test_projectKey/applications?limit=7', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .get({ queryArgs: { limit: 7 } }), + }, + { + method: 'get', + uri: '/test_projectKey/applications?offset=3', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .get({ queryArgs: { offset: 3 } }), + }, + { + method: 'get', + uri: '/test_projectKey/applications?withTotal=true', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .get({ queryArgs: { withTotal: true } }), + }, + { + method: 'get', + uri: '/test_projectKey/applications', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .get(), + }, + { + method: 'post', + uri: '/test_projectKey/applications', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .applications() + .post({ body: null, headers: null }), + }, + ] +} + +describe('Testing ByProjectKeyApplicationsRequestBuilder Requests', () => { + const requestsToTest = getRequestsWithMethodParameters() + requestsToTest.forEach((rm) => { + test(`Testing => request method: ${rm.method} and url: ${rm.uri}`, async () => { + expect(rm.method.toLowerCase()).toBe( + rm.request.clientRequest().method.toLowerCase() + ) + expect(rm.uri.toLowerCase()).toBe( + rm.request.clientRequest().uri.toLowerCase() + ) + }) + }) +}) diff --git a/packages/checkout-sdk/test/generated/client/payment-integrations/by-project-key-payment-integrations-by-id-request-builder.test.ts b/packages/checkout-sdk/test/generated/client/payment-integrations/by-project-key-payment-integrations-by-id-request-builder.test.ts new file mode 100644 index 000000000..fd871fd83 --- /dev/null +++ b/packages/checkout-sdk/test/generated/client/payment-integrations/by-project-key-payment-integrations-by-id-request-builder.test.ts @@ -0,0 +1,65 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ + +import { RequestWithMethod } from '../../../request-with-method' +import { ApiRoot } from '../../../../src' + +const apiRoot: ApiRoot = new ApiRoot({ executeRequest: null }) + +export function getRequestsWithMethodParameters(): RequestWithMethod[] { + return [ + { + method: 'get', + uri: '/test_projectKey/payment-integrations/test_id', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .withId({ id: 'test_id' }) + .get(), + }, + { + method: 'head', + uri: '/test_projectKey/payment-integrations/test_id', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .withId({ id: 'test_id' }) + .head(), + }, + { + method: 'post', + uri: '/test_projectKey/payment-integrations/test_id', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .withId({ id: 'test_id' }) + .post({ body: null, headers: null }), + }, + { + method: 'delete', + uri: '/test_projectKey/payment-integrations/test_id?version=2', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .withId({ id: 'test_id' }) + .delete({ queryArgs: { version: 2 } }), + }, + ] +} + +describe('Testing ByProjectKeyPaymentIntegrationsByIdRequestBuilder Requests', () => { + const requestsToTest = getRequestsWithMethodParameters() + requestsToTest.forEach((rm) => { + test(`Testing => request method: ${rm.method} and url: ${rm.uri}`, async () => { + expect(rm.method.toLowerCase()).toBe( + rm.request.clientRequest().method.toLowerCase() + ) + expect(rm.uri.toLowerCase()).toBe( + rm.request.clientRequest().uri.toLowerCase() + ) + }) + }) +}) diff --git a/packages/checkout-sdk/test/generated/client/payment-integrations/by-project-key-payment-integrations-key-by-key-request-builder.test.ts b/packages/checkout-sdk/test/generated/client/payment-integrations/by-project-key-payment-integrations-key-by-key-request-builder.test.ts new file mode 100644 index 000000000..e9a9bb982 --- /dev/null +++ b/packages/checkout-sdk/test/generated/client/payment-integrations/by-project-key-payment-integrations-key-by-key-request-builder.test.ts @@ -0,0 +1,65 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ + +import { RequestWithMethod } from '../../../request-with-method' +import { ApiRoot } from '../../../../src' + +const apiRoot: ApiRoot = new ApiRoot({ executeRequest: null }) + +export function getRequestsWithMethodParameters(): RequestWithMethod[] { + return [ + { + method: 'get', + uri: '/test_projectKey/payment-integrations/key=test_key', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .withKey({ key: 'test_key' }) + .get(), + }, + { + method: 'post', + uri: '/test_projectKey/payment-integrations/key=test_key', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .withKey({ key: 'test_key' }) + .post({ body: null, headers: null }), + }, + { + method: 'head', + uri: '/test_projectKey/payment-integrations/key=test_key', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .withKey({ key: 'test_key' }) + .head(), + }, + { + method: 'delete', + uri: '/test_projectKey/payment-integrations/key=test_key?version=2', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .withKey({ key: 'test_key' }) + .delete({ queryArgs: { version: 2 } }), + }, + ] +} + +describe('Testing ByProjectKeyPaymentIntegrationsKeyByKeyRequestBuilder Requests', () => { + const requestsToTest = getRequestsWithMethodParameters() + requestsToTest.forEach((rm) => { + test(`Testing => request method: ${rm.method} and url: ${rm.uri}`, async () => { + expect(rm.method.toLowerCase()).toBe( + rm.request.clientRequest().method.toLowerCase() + ) + expect(rm.uri.toLowerCase()).toBe( + rm.request.clientRequest().uri.toLowerCase() + ) + }) + }) +}) diff --git a/packages/checkout-sdk/test/generated/client/payment-integrations/by-project-key-payment-integrations-request-builder.test.ts b/packages/checkout-sdk/test/generated/client/payment-integrations/by-project-key-payment-integrations-request-builder.test.ts new file mode 100644 index 000000000..5d815001c --- /dev/null +++ b/packages/checkout-sdk/test/generated/client/payment-integrations/by-project-key-payment-integrations-request-builder.test.ts @@ -0,0 +1,77 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ + +import { RequestWithMethod } from '../../../request-with-method' +import { ApiRoot } from '../../../../src' + +const apiRoot: ApiRoot = new ApiRoot({ executeRequest: null }) + +export function getRequestsWithMethodParameters(): RequestWithMethod[] { + return [ + { + method: 'get', + uri: '/test_projectKey/payment-integrations?sort=sort', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .get({ queryArgs: { sort: 'sort' } }), + }, + { + method: 'get', + uri: '/test_projectKey/payment-integrations?limit=7', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .get({ queryArgs: { limit: 7 } }), + }, + { + method: 'get', + uri: '/test_projectKey/payment-integrations?offset=3', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .get({ queryArgs: { offset: 3 } }), + }, + { + method: 'get', + uri: '/test_projectKey/payment-integrations?withTotal=true', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .get({ queryArgs: { withTotal: true } }), + }, + { + method: 'get', + uri: '/test_projectKey/payment-integrations', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .get(), + }, + { + method: 'post', + uri: '/test_projectKey/payment-integrations', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .paymentIntegrations() + .post({ body: null, headers: null }), + }, + ] +} + +describe('Testing ByProjectKeyPaymentIntegrationsRequestBuilder Requests', () => { + const requestsToTest = getRequestsWithMethodParameters() + requestsToTest.forEach((rm) => { + test(`Testing => request method: ${rm.method} and url: ${rm.uri}`, async () => { + expect(rm.method.toLowerCase()).toBe( + rm.request.clientRequest().method.toLowerCase() + ) + expect(rm.uri.toLowerCase()).toBe( + rm.request.clientRequest().uri.toLowerCase() + ) + }) + }) +}) diff --git a/packages/history-sdk/src/generated/index.ts b/packages/history-sdk/src/generated/index.ts index 014c916f2..8a66bf284 100644 --- a/packages/history-sdk/src/generated/index.ts +++ b/packages/history-sdk/src/generated/index.ts @@ -7,22 +7,24 @@ // resources export * from './client/api-root'; //Root client that is used to access all the endpoints in the API -export * from './client/by-project-key-by-resource-type-by-id-request-builder'; -export * from './client/by-project-key-by-resource-type-request-builder'; -export * from './client/by-project-key-request-builder'; -export * from './client/graphql/by-project-key-graphql-request-builder'; -export * from './models/cart-discount'; -export * from './models/change'; +export * from './client/by-project-key-by-resource-type-by-id-request-builder' +export * from './client/by-project-key-by-resource-type-request-builder' +export * from './client/by-project-key-request-builder' +export * from './client/graphql/by-project-key-graphql-request-builder' +export * from './models/cart-discount' +export * from './models/change' //models -export * from './models/change-history'; -export * from './models/change-value'; -export * from './models/common'; -export * from './models/error'; -export * from './models/graph-ql'; -export * from './models/label'; -export * from './models/scalar-types'; +export * from './models/change-history' +export * from './models/change-value' +export * from './models/common' +export * from './models/error' +export * from './models/graph-ql' +export * from './models/label' +export * from './models/scalar-types' //Common package -export * from './shared/utils/common-types'; -export * from './shared/utils/middleware'; -export * from './shared/utils/requests-utils'; -export * from './shared/utils/uri-utils'; +export * from './shared/utils/common-types' +export * from './shared/utils/middleware' +export * from './shared/utils/requests-utils' +export * from './shared/utils/uri-utils' + + diff --git a/packages/history-sdk/src/generated/models/change-history.ts b/packages/history-sdk/src/generated/models/change-history.ts index c32b9c647..cf1223db5 100644 --- a/packages/history-sdk/src/generated/models/change-history.ts +++ b/packages/history-sdk/src/generated/models/change-history.ts @@ -5,7 +5,7 @@ */ import { Change } from './change' -import { KeyReference, Reference, ResourceIdentifier } from './common' +import { KeyReference, Reference, _ResourceIdentifier } from './common' import { TooManyRequestsError } from './error' import { Label } from './label' @@ -69,7 +69,7 @@ export interface Record { * * */ - readonly resource: ResourceIdentifier + readonly resource: _ResourceIdentifier /** * References to the [Stores](ctp:api:type:Store) associated with the [Change](ctp:history:type:Change). * @@ -293,20 +293,46 @@ export interface ModifiedBy { * Updates that are triggered automatically as a result of a user-initiated change. */ export enum PlatformInitiatedChangeValues { + AddInheritedAssociate = 'addInheritedAssociate', + ChangeIncludedInStatistics = 'changeIncludedInStatistics', + ChangeInheritedAssociate = 'changeInheritedAssociate', + ChangeLastVariantId = 'changeLastVariantId', ChangeLineItemName = 'changeLineItemName', + ChangeLineItemPublished = 'changeLineItemPublished', ChangeReviewRatingStatistics = 'changeReviewRatingStatistics', + ChangeTopLevelUnit = 'changeTopLevelUnit', ExcludeAll = 'excludeAll', + RemoveInheritedAssociate = 'removeInheritedAssociate', + SetAncestors = 'setAncestors', SetApplicationVersion = 'setApplicationVersion', + SetInheritedAssociates = 'setInheritedAssociates', + SetInheritedStores = 'setInheritedStores', SetIsValid = 'setIsValid', + SetLineItemDeactivatedAt = 'setLineItemDeactivatedAt', + SetProductCount = 'setProductCount', + SetReservations = 'setReservations', SetVariantAvailability = 'setVariantAvailability', } export type PlatformInitiatedChange = + | 'addInheritedAssociate' + | 'changeIncludedInStatistics' + | 'changeInheritedAssociate' + | 'changeLastVariantId' | 'changeLineItemName' + | 'changeLineItemPublished' | 'changeReviewRatingStatistics' + | 'changeTopLevelUnit' | 'excludeAll' + | 'removeInheritedAssociate' + | 'setAncestors' | 'setApplicationVersion' + | 'setInheritedAssociates' + | 'setInheritedStores' | 'setIsValid' + | 'setLineItemDeactivatedAt' + | 'setProductCount' + | 'setReservations' | 'setVariantAvailability' | (string & {}) /** @@ -352,7 +378,6 @@ export enum UpdateTypeValues { AddTransaction = 'addTransaction', AddVariant = 'addVariant', ChangeAddress = 'changeAddress', - ChangeAmountAuthorized = 'changeAmountAuthorized', ChangeAmountPlanned = 'changeAmountPlanned', ChangeAssetName = 'changeAssetName', ChangeAssetOrder = 'changeAssetOrder', @@ -628,7 +653,6 @@ export type UpdateType = | 'addTransaction' | 'addVariant' | 'changeAddress' - | 'changeAmountAuthorized' | 'changeAmountPlanned' | 'changeAssetName' | 'changeAssetOrder' diff --git a/packages/history-sdk/src/generated/models/change.ts b/packages/history-sdk/src/generated/models/change.ts index 74a4c6e22..14d2284a4 100644 --- a/packages/history-sdk/src/generated/models/change.ts +++ b/packages/history-sdk/src/generated/models/change.ts @@ -6,16 +6,12 @@ import { AssetChangeValue, - AttributeValue, ChangeTargetChangeValue, ChangeValueChangeValue, - CustomFieldExpandedValue, CustomShippingMethodChangeValue, DeliveryChangeValue, - EnumValue, FieldDefinitionOrderValue, InventoryQuantityValue, - LocalizedEnumValue, ParcelChangeValue, SetCartClassificationShippingRateInputValue, SetCartScoreShippingRateInputValue, @@ -31,23 +27,31 @@ import { Asset, AssetSource, Associate, + Attribute, AttributeConstraintEnum, AttributeDefinition, AttributeLocalizedEnumValue, AttributePlainEnumValue, AuthenticationMode, + BusinessUnitApprovalRuleMode, BusinessUnitAssociateMode, + BusinessUnitResourceIdentifier, BusinessUnitStatus, BusinessUnitStoreMode, + BusinessUnitType, CategoryOrderHints, ChannelRoleEnum, + CustomerGroupAssignment, + CustomFieldEnumValue, + CustomFieldLocalizedEnumValue, CustomFields, CustomLineItem, - Delivery, DeliveryItem, DiscountCodeInfo, DiscountedLineItemPrice, DiscountedLineItemPriceForQuantity, + DiscountedPrice, + DiscountOnTotalPrice, FieldDefinition, GeoLocation, Image, @@ -58,7 +62,6 @@ import { LineItem, LocalizedString, Location, - Money, OrderState, Parcel, ParcelMeasurements, @@ -66,8 +69,10 @@ import { PaymentState, Permission, Price, + ProductPriceModeEnum, ProductSelectionSetting, ProductVariantAvailability, + ProductVariantExclusion, ProductVariantSelection, QuoteRequestState, QuoteState, @@ -80,6 +85,9 @@ import { RoundingMode, SearchKeywords, ShipmentState, + Shipping, + ShippingRate, + ShoppingListLineItem, StackingMode, StagedQuoteState, StateRoleEnum, @@ -91,12 +99,13 @@ import { TaxedPrice, TaxMode, TaxRate, - TextInputHint, TextLineItem, TrackingData, Transaction, TransactionState, + TypeTextInputHint, Variant, + _Money, } from './common' /** @@ -133,6 +142,7 @@ export type Change = | AddPropertyChange | AddReturnInfoChange | AddShippingAddressIdChange + | AddShippingChange | AddShoppingListLineItemChange | AddStateRolesChange | AddTaxRateChange @@ -143,6 +153,7 @@ export type Change = | ChangeAddressChange | ChangeAmountAuthorizedChange | ChangeAmountPlannedChange + | ChangeApprovalRuleModeChange | ChangeAssetNameChange | ChangeAssetOrderChange | ChangeAssociateChange @@ -153,12 +164,14 @@ export type Change = | ChangeCartDiscountsChange | ChangeCartPredicateChange | ChangeCustomLineItemQuantityChange + | ChangeCustomerChange | ChangeDescriptionChange | ChangeEmailChange | ChangeEnumValueLabelChange | ChangeEnumValueOrderChange | ChangeFieldDefinitionOrderChange | ChangeGroupsChange + | ChangeIncludedInStatisticsChange | ChangeInheritedAssociateChange | ChangeInitialChange | ChangeInputHintChange @@ -166,6 +179,9 @@ export type Change = | ChangeIsSearchableChange | ChangeKeyChange | ChangeLabelChange + | ChangeLastVariantIdChange + | ChangeLineItemNameChange + | ChangeLineItemPublishedChange | ChangeLineItemQuantityChange | ChangeLocalizedDescriptionChange | ChangeLocalizedEnumValueLabelChange @@ -182,6 +198,7 @@ export type Change = | ChangePlainEnumValueOrderChange | ChangePredicateChange | ChangePriceChange + | ChangePriceRoundingModeChange | ChangeProductSelectionActiveChange | ChangeQuantityChange | ChangeQuoteRequestStateChange @@ -204,10 +221,12 @@ export type Change = | ChangeTextLineItemNameChange | ChangeTextLineItemQuantityChange | ChangeTextLineItemsOrderChange + | ChangeTopLevelUnitChange | ChangeTransactionInteractionIdChange | ChangeTransactionStateChange | ChangeTransactionTimestampChange | ChangeValueChange + | ExcludeProductChange | MoveImageToPositionChange | PublishChange | RemoveAddressChange @@ -235,15 +254,20 @@ export type Change = | RemoveProductSelectionChange | RemovePropertyChange | RemoveShippingAddressIdChange + | RemoveShippingChange | RemoveShoppingListLineItemChange | RemoveStateRolesChange | RemoveTaxRateChange | RemoveTextLineItemChange | RemoveVariantChange + | ReplaceTaxRateChange | RequestQuoteRenegotiationChange + | RevertStagedChangesChange + | RevertStagedVariantChangesChange | SetAddressChange | SetAddressCustomFieldChange | SetAddressCustomTypeChange + | SetAncestorsChange | SetAnonymousIdChange | SetApplicationVersionChange | SetAssetCustomFieldChange @@ -252,10 +276,14 @@ export type Change = | SetAssetKeyChange | SetAssetSourcesChange | SetAssetTagsChange + | SetAssociatesChange | SetAttributeChange | SetAuthenticationModeChange | SetAuthorNameChange | SetBillingAddressChange + | SetBillingAddressCustomFieldChange + | SetBillingAddressCustomTypeChange + | SetBusinessUnitChange | SetCartPredicateChange | SetCategoryOrderHintChange | SetChannelRolesChange @@ -266,6 +294,8 @@ export type Change = | SetCustomFieldChange | SetCustomLineItemCustomFieldChange | SetCustomLineItemCustomTypeChange + | SetCustomLineItemDiscountedPriceChange + | SetCustomLineItemDiscountedPricePerQuantityChange | SetCustomLineItemMoneyChange | SetCustomLineItemShippingDetailsChange | SetCustomLineItemTaxAmountChange @@ -277,6 +307,7 @@ export type Change = | SetCustomTypeChange | SetCustomerChange | SetCustomerEmailChange + | SetCustomerGroupAssignmentsChange | SetCustomerGroupChange | SetCustomerIdChange | SetCustomerNumberChange @@ -285,8 +316,13 @@ export type Change = | SetDefaultShippingAddressChange | SetDeleteDaysAfterLastModificationChange | SetDeliveryAddressChange + | SetDeliveryAddressCustomFieldChange + | SetDeliveryAddressCustomTypeChange + | SetDeliveryCustomFieldChange + | SetDeliveryCustomTypeChange | SetDeliveryItemsChange | SetDescriptionChange + | SetDiscountOnTotalPriceChange | SetDiscountedPriceChange | SetDistributionChannelsChange | SetExpectedDeliveryChange @@ -294,9 +330,13 @@ export type Change = | SetFirstNameChange | SetGeoLocationChange | SetImageLabelChange + | SetInheritedAssociatesChange + | SetInheritedStoresChange | SetInputTipChange | SetInterfaceIdChange | SetIsValidChange + | SetItemShippingAddressCustomFieldChange + | SetItemShippingAddressCustomTypeChange | SetKeyChange | SetLanguagesChange | SetLastNameChange @@ -317,6 +357,7 @@ export type Change = | SetLocalizedNameChange | SetMaxApplicationsChange | SetMaxApplicationsPerCustomerChange + | SetMaxCartQuantityChange | SetMetaDescriptionChange | SetMetaKeywordsChange | SetMetaTitleChange @@ -324,6 +365,7 @@ export type Change = | SetMethodInfoMethodChange | SetMethodInfoNameChange | SetMiddleNameChange + | SetMinCartQuantityChange | SetNameChange | SetOrderLineItemCustomFieldChange | SetOrderLineItemCustomTypeChange @@ -331,11 +373,17 @@ export type Change = | SetOrderTaxedPriceChange | SetOrderTotalPriceChange | SetOrderTotalTaxChange + | SetParcelCustomFieldChange + | SetParcelCustomTypeChange | SetParcelItemsChange | SetParcelMeasurementsChange | SetParcelTrackingDataChange + | SetPasswordChange | SetPermissionsChange + | SetPriceKeyChange + | SetPriceModeChange | SetPricesChange + | SetProductAttributeChange | SetProductCountChange | SetProductPriceCustomFieldChange | SetProductPriceCustomTypeChange @@ -346,12 +394,21 @@ export type Change = | SetRatingChange | SetReservationsChange | SetRestockableInDaysChange + | SetReturnInfoChange + | SetReturnItemCustomLineItemCustomFieldChange + | SetReturnItemCustomLineItemCustomTypeChange + | SetReturnItemLineItemCustomFieldChange + | SetReturnItemLineItemCustomTypeChange | SetReturnPaymentStateChange | SetReturnShipmentStateChange | SetSalutationChange | SetSearchKeywordsChange | SetSellerCommentChange | SetShippingAddressChange + | SetShippingAddressCustomFieldChange + | SetShippingAddressCustomTypeChange + | SetShippingCustomFieldChange + | SetShippingCustomTypeChange | SetShippingInfoPriceChange | SetShippingInfoTaxedPriceChange | SetShippingMethodChange @@ -378,13 +435,17 @@ export type Change = | SetTextLineItemCustomTypeChange | SetTextLineItemDescriptionChange | SetTitleChange + | SetTransactionCustomFieldChange + | SetTransactionCustomTypeChange | SetTransitionsChange + | SetUnitTypeChange | SetValidFromAndUntilChange | SetValidFromChange | SetValidToChange | SetValidUntilChange | SetValueChange | SetVariantAvailabilityChange + | SetVariantExclusionChange | SetVariantSelectionChange | SetVatIdChange | TransitionCustomLineItemStateChange @@ -392,6 +453,7 @@ export type Change = | TransitionStateChange | UnknownChange | UnpublishChange + | UpdateItemShippingAddressChange | UpdateSyncInfoChange | VerifyEmailChange export interface IChange { @@ -449,6 +511,23 @@ export interface AddAssetChange extends IChange { * */ readonly nextValue: Asset + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Add Associate](ctp:api:type:BusinessUnitAddAssociateAction) update action. @@ -593,12 +672,17 @@ export interface AddEnumValueChange extends IChange { * Value after the change. * */ - readonly nextValue: EnumValue + readonly nextValue: CustomFieldEnumValue /** * Name of the updated [FieldDefinition](ctp:api:type:FieldDefinition). * */ readonly fieldName: string + /** + * Name of the updated [AttributeDefinition](ctp:api:type:AttributeDefinition). + * + */ + readonly attributeName: string } /** * Change triggered by the [Add External Image](ctp:api:type:ProductAddExternalImageAction) update action. @@ -620,12 +704,22 @@ export interface AddExternalImageChange extends IChange { */ readonly nextValue: Image[] /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * * */ readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Add FieldDefinition](ctp:api:type:TypeAddFieldDefinitionAction) update action. @@ -643,7 +737,7 @@ export interface AddFieldDefinitionChange extends IChange { readonly nextValue: FieldDefinition } /** - * Change triggered by the [Add Associate](ctp:api:type:BusinessUnitAddAssociateAction) update action on a parent of a Business Unit in cases where [inheritance applies](/../api/associates-overview#conditions-for-inheritance). + * This change is initiated by background processes after the [Add Associate](ctp:api:type:BusinessUnitAddAssociateAction) update action is performed (if [Associates are inherited](/../api/associates-overview#inheritance-of-associates-and-their-roles)). */ export interface AddInheritedAssociateChange extends IChange { readonly type: 'AddInheritedAssociateChange' @@ -670,7 +764,7 @@ export interface AddInterfaceInteractionChange extends IChange { * Value after the change. * */ - readonly nextValue: CustomFieldExpandedValue + readonly nextValue: CustomFields } /** * Change triggered by the following update actions: @@ -713,7 +807,7 @@ export interface AddLocalizedEnumValueChange extends IChange { * Value after the change. * */ - readonly nextValue: AttributeLocalizedEnumValue + readonly nextValue: CustomFieldLocalizedEnumValue /** * Name of the updated [FieldDefinition](ctp:api:type:FieldDefinition); only present on changes to Types. * @@ -844,6 +938,8 @@ export interface AddPriceChange extends IChange { */ readonly nextValue: Price /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * @@ -856,6 +952,14 @@ export interface AddPriceChange extends IChange { * */ readonly priceId: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Add Product](ctp:api:type:ProductSelectionAddProductAction) update action. @@ -972,12 +1076,12 @@ export interface AddShoppingListLineItemChange extends IChange { * Value before the change. * */ - readonly previousValue: LineItem + readonly previousValue: ShoppingListLineItem /** * Value after the change. * */ - readonly nextValue: LineItem + readonly nextValue: ShoppingListLineItem } /** * Change triggered by the [Add State roles](ctp:api:type:StateAddRolesAction) update action. @@ -1053,6 +1157,15 @@ export interface AddToCategoryChange extends IChange { * */ readonly category: Reference + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string } /** * Change triggered by the [Add Transaction](ctp:api:type:PaymentAddTransactionAction) update action. @@ -1089,6 +1202,8 @@ export interface AddVariantChange extends IChange { */ readonly nextValue: Variant /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * @@ -1117,7 +1232,7 @@ export interface ChangeAddressChange extends IChange { readonly nextValue: Address } /** - * Change triggered automatically due to a user-initiated change. + * This change is initiated by background processes after the [Change AmountPlanned](ctp:api:type:PaymentChangeAmountPlannedAction) update action is performed. */ export interface ChangeAmountAuthorizedChange extends IChange { readonly type: 'ChangeAmountAuthorizedChange' @@ -1129,12 +1244,12 @@ export interface ChangeAmountAuthorizedChange extends IChange { * Value before the change. * */ - readonly previousValue: Money + readonly previousValue: _Money /** * Value after the change. * */ - readonly nextValue: Money + readonly nextValue: _Money } /** * Change triggered by the [Change AmountPlanned](ctp:api:type:PaymentChangeAmountPlannedAction) update action. @@ -1149,12 +1264,12 @@ export interface ChangeAmountPlannedChange extends IChange { * Value before the change. * */ - readonly previousValue: Money + readonly previousValue: _Money /** * Value after the change. * */ - readonly nextValue: Money + readonly nextValue: _Money } /** * Change triggered by the following update actions: @@ -1184,6 +1299,23 @@ export interface ChangeAssetNameChange extends IChange { * */ readonly asset: AssetChangeValue + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the following update actions: @@ -1208,6 +1340,23 @@ export interface ChangeAssetOrderChange extends IChange { * */ readonly nextValue: LocalizedString[] + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Change Associate](ctp:api:type:BusinessUnitChangeAssociateAction) update action. @@ -1334,6 +1483,16 @@ export interface ChangeCartDiscountsChange extends IChange { * */ readonly nextValue: Reference[] + /** + * Elements added to the array. + * + */ + readonly addedItems: Reference[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: Reference[] } /** * Change triggered by the [Change Cart Predicate](ctp:api:type:CartDiscountChangeCartPredicateAction) update action. @@ -1456,6 +1615,11 @@ export interface ChangeEnumValueLabelChange extends IChange { * */ readonly valueKey: string + /** + * Name of the updated [AttributeDefinition](ctp:api:type:AttributeDefinition). + * + */ + readonly attributeName: string } /** * Change triggered by the [Change the order of EnumValues](ctp:api:type:TypeChangeEnumValueOrderAction) update action. @@ -1470,17 +1634,22 @@ export interface ChangeEnumValueOrderChange extends IChange { * Value before the change. * */ - readonly previousValue: EnumValue[] + readonly previousValue: CustomFieldEnumValue[] /** * Value after the change. * */ - readonly nextValue: EnumValue[] + readonly nextValue: CustomFieldEnumValue[] /** * Name of the updated [FieldDefinition](ctp:api:type:FieldDefinition). * */ readonly fieldName: string + /** + * Name of the updated [AttributeDefinition](ctp:api:type:AttributeDefinition). + * + */ + readonly attributeName: string } /** * Change triggered by the [Change the order of FieldDefinitions](ctp:api:type:TypeChangeFieldDefinitionOrderAction) update action. @@ -1521,6 +1690,16 @@ export interface ChangeGroupsChange extends IChange { * */ readonly nextValue: string[] + /** + * Elements added to the array. + * + */ + readonly addedItems: string[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: string[] } /** * Change triggered by the [Change Associate](ctp:api:type:BusinessUnitChangeAssociateAction) update action on a parent of a Business Unit in cases where [inheritance applies](/../api/associates-overview#conditions-for-inheritance). @@ -1579,12 +1758,12 @@ export interface ChangeInputHintChange extends IChange { * Value before the change. * */ - readonly previousValue: TextInputHint + readonly previousValue: TypeTextInputHint /** * Value after the change. * */ - readonly nextValue: TextInputHint + readonly nextValue: TypeTextInputHint /** * Name of the updated [FieldDefinition](ctp:api:type:FieldDefinition); only present on changes to Types. * @@ -1813,12 +1992,12 @@ export interface ChangeLocalizedEnumValueOrderChange extends IChange { * Value before the change. * */ - readonly previousValue: LocalizedEnumValue[] + readonly previousValue: AttributeLocalizedEnumValue[] /** * Value after the change. * */ - readonly nextValue: LocalizedEnumValue[] + readonly nextValue: AttributeLocalizedEnumValue[] /** * Name of the updated [FieldDefinition](ctp:api:type:FieldDefinition); only present on changes to Types. * @@ -1836,7 +2015,7 @@ export interface ChangeLocalizedEnumValueOrderChange extends IChange { * - [Change Name](ctp:api:type:CartDiscountChangeNameAction) on Cart Discounts. * - [Change Name](ctp:api:type:CategoryChangeNameAction) on Categories. * - [Change Name](ctp:api:type:ChannelChangeNameAction) on Channels. - * - [Change Name](ctp:api:type:ProductChangeNameAction) on Products. + * - [Change Product Name](ctp:api:type:ProductChangeNameAction) on Products. * - [Change Name](ctp:api:type:ProductDiscountChangeNameAction) on Product Discounts. * - [Change Name](ctp:api:type:ProductSelectionChangeNameAction) on Product Selections. * - [Change Name](ctp:api:type:ShoppingListChangeNameAction) on Shopping Lists. @@ -1880,6 +2059,8 @@ export interface ChangeMasterVariantChange extends IChange { */ readonly nextValue: Variant /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * @@ -2064,12 +2245,12 @@ export interface ChangePlainEnumValueOrderChange extends IChange { * Value before the change. * */ - readonly previousValue: EnumValue[] + readonly previousValue: AttributePlainEnumValue[] /** * Value after the change. * */ - readonly nextValue: EnumValue[] + readonly nextValue: AttributePlainEnumValue[] /** * Name of the updated [AttributeDefinition](ctp:api:type:AttributeDefinition). * @@ -2116,6 +2297,8 @@ export interface ChangePriceChange extends IChange { */ readonly nextValue: Price /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * @@ -2128,6 +2311,14 @@ export interface ChangePriceChange extends IChange { * */ readonly priceId: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Change Product Selection Active](ctp:api:type:StoreChangeProductSelectionAction) update action. @@ -2234,6 +2425,9 @@ export interface ChangeRequiresDiscountCodeChange extends IChange { */ readonly nextValue: boolean } +/** + * This change is initiated by background processes after the [Set Rating](ctp:api:type:ReviewSetRatingAction) update action is performed. + */ export interface ChangeReviewRatingStatisticsChange extends IChange { readonly type: 'ChangeReviewRatingStatisticsChange' /** @@ -2343,6 +2537,15 @@ export interface ChangeSlugChange extends IChange { * */ readonly nextValue: LocalizedString + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string } /** * Change triggered by the following update actions: @@ -2717,12 +2920,22 @@ export interface MoveImageToPositionChange extends IChange { */ readonly nextValue: Image[] /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * * */ readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Publish](ctp:api:type:ProductPublishAction) update action. @@ -2767,6 +2980,23 @@ export interface RemoveAssetChange extends IChange { * */ readonly previousValue: Asset + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Remove Associate](ctp:api:type:BusinessUnitRemoveAssociateAction) update action. @@ -2876,7 +3106,7 @@ export interface RemoveDeliveryItemsChange extends IChange { * Value before the change. * */ - readonly previousValue: Delivery + readonly previousValue: DeliveryChangeValue } /** * Change triggered by the [Remove DiscountCode](ctp:api:type:StagedOrderRemoveDiscountCodeAction) update action. @@ -2906,7 +3136,7 @@ export interface RemoveEnumValuesChange extends IChange { * Value before the change. * */ - readonly previousValue: EnumValue + readonly previousValue: AttributePlainEnumValue /** * Name of the updated [AttributeDefinition](ctp:api:type:AttributeDefinition). * @@ -2952,6 +3182,15 @@ export interface RemoveFromCategoryChange extends IChange { * */ readonly category: Reference + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string } /** * Change triggered by the [Remove Image](ctp:api:type:ProductRemoveImageAction) update action. @@ -2973,15 +3212,25 @@ export interface RemoveImageChange extends IChange { */ readonly nextValue: Image[] /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * * */ readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** - * Change triggered by the [Remove Associate](ctp:api:type:BusinessUnitRemoveAssociateAction) update action on a parent of a Business Unit in cases where [inheritance applies](/../api/associates-overview#conditions-for-inheritance). + * This change is initiated by background processes after the [Remove Associate](ctp:api:type:BusinessUnitRemoveAssociateAction) update action is performed (if [Associates are inherited](/../api/associates-overview#inheritance-of-associates-and-their-roles)). */ export interface RemoveInheritedAssociateChange extends IChange { readonly type: 'RemoveInheritedAssociateChange' @@ -3028,7 +3277,7 @@ export interface RemoveLocalizedEnumValuesChange extends IChange { * Value before the change. * */ - readonly previousValue: LocalizedEnumValue + readonly previousValue: AttributeLocalizedEnumValue /** * Name of the updated [AttributeDefinition](ctp:api:type:AttributeDefinition). * @@ -3139,6 +3388,8 @@ export interface RemovePriceChange extends IChange { */ readonly nextValue: Price /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * @@ -3151,6 +3402,14 @@ export interface RemovePriceChange extends IChange { * */ readonly priceId: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Remove Product](ctp:api:type:ProductSelectionRemoveProductAction) update action. @@ -3240,12 +3499,12 @@ export interface RemoveShoppingListLineItemChange extends IChange { * Value before the change. * */ - readonly previousValue: LineItem + readonly previousValue: ShoppingListLineItem /** * Value after the change. * */ - readonly nextValue: LineItem + readonly nextValue: ShoppingListLineItem } /** * Change triggered by the [Remove State roles](ctp:api:type:StateRemoveRolesAction) update action. @@ -3322,6 +3581,8 @@ export interface RemoveVariantChange extends IChange { */ readonly nextValue: Variant /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * @@ -3376,7 +3637,10 @@ export interface SetAddressChange extends IChange { readonly nextValue: Address } /** - * Change triggered by the [Set Address Custom Field](ctp:api:type:BusinessUnitSetAddressCustomFieldAction) update action. + * Change triggered by the following update actions: + * - [Set Address Custom Field](ctp:api:type:BusinessUnitSetAddressCustomFieldAction) on Business Units. + * - [Set Address Custom Field](ctp:api:type:CustomerSetAddressCustomFieldAction) on Customers. + * - [Set Address Custom Field](ctp:api:type:ChannelSetAddressCustomFieldAction) on Channels. * */ export interface SetAddressCustomFieldChange extends IChange { @@ -3414,7 +3678,11 @@ export interface SetAddressCustomFieldChange extends IChange { readonly nextValue: any } /** - * Change triggered by the [Set Address Custom Type](ctp:api:type:BusinessUnitSetAddressCustomTypeAction) update action. + * Change triggered by the following update actions: + * - [Set Address Custom Type](ctp:api:type:BusinessUnitSetAddressCustomTypeAction) on Business Units. + * - [Set Address Custom Type](ctp:api:type:CustomerSetAddressCustomTypeAction) on Customers. + * - [Set Address Custom Type](ctp:api:type:ChannelSetAddressCustomTypeAction) on Channels. + * */ export interface SetAddressCustomTypeChange extends IChange { readonly type: 'SetAddressCustomTypeChange' @@ -3464,7 +3732,7 @@ export interface SetAnonymousIdChange extends IChange { readonly nextValue: string } /** - * Change triggered automatically due to a user-initiated change. + * This change is initiated by background processes when a discount is applied through a Discount Code. */ export interface SetApplicationVersionChange extends IChange { readonly type: 'SetApplicationVersionChange' @@ -3522,6 +3790,23 @@ export interface SetAssetCustomFieldChange extends IChange { * */ readonly asset: AssetChangeValue + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the following update actions: @@ -3551,6 +3836,23 @@ export interface SetAssetCustomTypeChange extends IChange { * */ readonly asset: AssetChangeValue + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the following update actions: @@ -3580,6 +3882,23 @@ export interface SetAssetDescriptionChange extends IChange { * */ readonly asset: AssetChangeValue + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the following update actions: @@ -3609,6 +3928,23 @@ export interface SetAssetKeyChange extends IChange { * */ readonly asset: AssetChangeValue + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the following update actions: @@ -3638,6 +3974,23 @@ export interface SetAssetSourcesChange extends IChange { * */ readonly asset: AssetChangeValue + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the following update actions: @@ -3667,6 +4020,23 @@ export interface SetAssetTagsChange extends IChange { * */ readonly asset: AssetChangeValue + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Set Attribute](ctp:api:type:ProductSetAttributeAction) update action. @@ -3681,19 +4051,29 @@ export interface SetAttributeChange extends IChange { * Value before the change. * */ - readonly previousValue: AttributeValue + readonly previousValue: Attribute /** * Value after the change. * */ - readonly nextValue: AttributeValue + readonly nextValue: Attribute /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * * */ readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Set AuthenticationMode](ctp:api:type:CustomerSetAuthenticationModeAction) update action. @@ -3799,6 +4179,8 @@ export interface SetCategoryOrderHintChange extends IChange { */ readonly nextValue: CategoryOrderHints /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * @@ -3831,6 +4213,16 @@ export interface SetChannelRolesChange extends IChange { * */ readonly nextValue: ChannelRoleEnum[] + /** + * Elements added to the array. + * + */ + readonly addedItems: ChannelRoleEnum[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: ChannelRoleEnum[] } /** * Change triggered by the [Set Company Name](ctp:api:type:CustomerSetCompanyNameAction) update action. @@ -3891,6 +4283,16 @@ export interface SetCountriesChange extends IChange { * */ readonly nextValue: StoreCountry[] + /** + * Elements added to the array. + * + */ + readonly addedItems: StoreCountry[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: StoreCountry[] } /** * Change triggered by the [Set Country](ctp:api:type:StagedOrderSetCountryAction) update action. @@ -4002,6 +4404,12 @@ export interface SetCustomLineItemCustomFieldChange extends IChange { * */ readonly customLineItemId: string + /** + * `id` of the referenced [Type](ctp:api:type:Type). + * + * + */ + readonly customTypeId: string } /** * Change triggered by the following update actions: @@ -4051,12 +4459,12 @@ export interface SetCustomLineItemMoneyChange extends IChange { * Value before the change. * */ - readonly previousValue: Money + readonly previousValue: _Money /** * Value after the change. * */ - readonly nextValue: Money + readonly nextValue: _Money /** * Name of the updated [CustomLineItem](ctp:api:type:CustomLineItem). * @@ -4098,6 +4506,11 @@ export interface SetCustomLineItemShippingDetailsChange extends IChange { * */ readonly customLineItemId: string + /** + * Name of the updated [CustomLineItem](ctp:api:type:CustomLineItem). + * + */ + readonly customLineItem: LocalizedString } /** * Change triggered by the [Set CustomLineItem TaxAmount](ctp:api:type:StagedOrderSetCustomLineItemTaxAmountAction) update action. @@ -4211,12 +4624,12 @@ export interface SetCustomLineItemTaxedPriceChange extends IChange { * Value before the change. * */ - readonly previousValue: Money + readonly previousValue: TaxedItemPrice /** * Value after the change. * */ - readonly nextValue: Money + readonly nextValue: TaxedItemPrice /** * Name of the updated [CustomLineItem](ctp:api:type:CustomLineItem). * @@ -4239,12 +4652,12 @@ export interface SetCustomLineItemTotalPriceChange extends IChange { * Value before the change. * */ - readonly previousValue: Money + readonly previousValue: _Money /** * Value after the change. * */ - readonly nextValue: Money + readonly nextValue: _Money /** * Name of the updated [CustomLineItem](ctp:api:type:CustomLineItem). * @@ -4367,7 +4780,10 @@ export interface SetCustomerEmailChange extends IChange { readonly nextValue: string } /** - * Change triggered by the [Set CustomerGroup](ctp:api:type:CustomerSetCustomerGroupAction) update action. + * Change triggered by the following update actions: + * - [Set CustomerGroup](ctp:api:type:CustomerSetCustomerGroupAction) on Customers. + * - [Set CustomerGroup](ctp:api:type:StagedOrderSetCustomerGroupAction) on Order Edits. + * */ export interface SetCustomerGroupChange extends IChange { readonly type: 'SetCustomerGroupChange' @@ -4607,13 +5023,15 @@ export interface SetDiscountedPriceChange extends IChange { * Value before the change. * */ - readonly previousValue: Price + readonly previousValue: DiscountedPrice /** * Value after the change. * */ - readonly nextValue: Price + readonly nextValue: DiscountedPrice /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * @@ -4621,7 +5039,9 @@ export interface SetDiscountedPriceChange extends IChange { */ readonly catalogData: string /** - * `sku` or `key` of the updated [ProductVariant](ctp:api:type:ProductVariant). + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. * * */ @@ -4632,6 +5052,11 @@ export interface SetDiscountedPriceChange extends IChange { * */ readonly priceId: string + /** + * Embedded Price of the [ProductVariant](ctp:api:type:ProductVariant). + * + */ + readonly price: Price } /** * Change triggered by the [Set Distribution Channels](ctp:api:type:StoreSetDistributionChannelsAction) update action. @@ -4652,6 +5077,16 @@ export interface SetDistributionChannelsChange extends IChange { * */ readonly nextValue: Reference[] + /** + * Elements added to the array. + * + */ + readonly addedItems: Reference[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: Reference[] } /** * Change triggered by the [Set ExpectedDelivery](ctp:api:type:InventoryEntrySetExpectedDeliveryAction) update action. @@ -4757,12 +5192,22 @@ export interface SetImageLabelChange extends IChange { */ readonly nextValue: Image /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * * */ readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Set AttributeDefinition InputTip](ctp:api:type:ProductTypeSetInputTipAction) update action. @@ -4810,7 +5255,7 @@ export interface SetInterfaceIdChange extends IChange { readonly nextValue: string } /** - * Change triggered automatically due to a user-initiated change. + * This change is initiated by background processes after the [Set Valid From](ctp:api:type:ProductDiscountSetValidFromAction), [Set Valid Until](ctp:api:type:ProductDiscountSetValidUntilAction), or [Set Valid From and Until](ctp:api:type:ProductDiscountSetValidFromAndUntilAction) update action is performed. */ export interface SetIsValidChange extends IChange { readonly type: 'SetIsValidChange' @@ -4836,6 +5281,8 @@ export interface SetIsValidChange extends IChange { * - [Set Key](ctp:api:type:CategorySetKeyAction) on Categories. * - [Set Key](ctp:api:type:CustomerSetKeyAction) on Customers. * - [Set Key](ctp:api:type:CustomerGroupSetKeyAction) on Customer Groups. + * - [Set Key](ctp:api:type:DiscountCodeSetKeyAction) on Discount Codes. + * - [Set Key](ctp:api:type:InventoryEntrySetKeyAction) on Inventories. * - [Set Key](ctp:api:type:PaymentSetKeyAction) on Payments. * - [Set Key](ctp:api:type:ProductSetKeyAction) on Products. * - [Set Key](ctp:api:type:ProductDiscountSetKeyAction) on Product Discounts. @@ -4882,6 +5329,16 @@ export interface SetLanguagesChange extends IChange { * */ readonly nextValue: string[] + /** + * Elements added to the array. + * + */ + readonly addedItems: string[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: string[] } /** * Change triggered by [Set Last Name](ctp:api:type:CustomerSetLastNameAction) update action. @@ -4903,6 +5360,9 @@ export interface SetLastNameChange extends IChange { */ readonly nextValue: string } +/** + * This change is initiated by background processes after the [Delete Product](/../api/projects/products#delete-product) request or [Remove ProductVariant](ctp:api:type:ProductRemoveVariantAction) update action is performed. + */ export interface SetLineItemDeactivatedAtChange extends IChange { readonly type: 'SetLineItemDeactivatedAtChange' /** @@ -4947,11 +5407,19 @@ export interface SetLineItemDiscountedPriceChange extends IChange { */ readonly lineItem: LocalizedString /** - * `sku` or `key` of the updated [ProductVariant](ctp:api:type:ProductVariant). + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. * * */ readonly variant: string + /** + * `id` of the updated [LineItem](ctp:api:type:LineItem). + * + * + */ + readonly lineItemId: string } export interface SetLineItemDiscountedPricePerQuantityChange extends IChange { readonly type: 'SetLineItemDiscountedPricePerQuantityChange' @@ -4975,11 +5443,19 @@ export interface SetLineItemDiscountedPricePerQuantityChange extends IChange { */ readonly lineItem: LocalizedString /** - * `sku` or `key` of the updated [ProductVariant](ctp:api:type:ProductVariant). + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. * * */ readonly variant: string + /** + * `id` of the updated [LineItem](ctp:api:type:LineItem). + * + * + */ + readonly lineItemId: string } /** * Change triggered by the [Set LineItem DistributionChannel](ctp:api:type:StagedOrderSetLineItemDistributionChannelAction) update action. @@ -5006,7 +5482,9 @@ export interface SetLineItemDistributionChannelChange extends IChange { */ readonly lineItem: LocalizedString /** - * `sku` or `key` of the updated [ProductVariant](ctp:api:type:ProductVariant). + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. * * */ @@ -5036,6 +5514,12 @@ export interface SetLineItemPriceChange extends IChange { * */ readonly lineItem: LocalizedString + /** + * `id` of the updated [LineItem](ctp:api:type:LineItem). + * + * + */ + readonly lineItemId: string } export interface SetLineItemProductKeyChange extends IChange { readonly type: 'SetLineItemProductKeyChange' @@ -5065,7 +5549,9 @@ export interface SetLineItemProductKeyChange extends IChange { */ readonly lineItemId: string /** - * `sku` or `key` of the updated [ProductVariant](ctp:api:type:ProductVariant). + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. * * */ @@ -5096,11 +5582,19 @@ export interface SetLineItemProductSlugChange extends IChange { */ readonly lineItem: LocalizedString /** - * `sku` or `key` of the updated [ProductVariant](ctp:api:type:ProductVariant). + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. * * */ readonly variant: string + /** + * `id` of the updated [LineItem](ctp:api:type:LineItem). + * + * + */ + readonly lineItemId: string } /** * Change triggered by the following update actions: @@ -5131,6 +5625,19 @@ export interface SetLineItemShippingDetailsChange extends IChange { * */ readonly lineItemId: string + /** + * Name of the [Product](ctp:api:type:Product) the updated Line Item is based on. + * + */ + readonly lineItem: LocalizedString + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Set LineItem TaxAmount](ctp:api:type:StagedOrderSetLineItemTaxAmountAction) update action. @@ -5157,7 +5664,9 @@ export interface SetLineItemTaxAmountChange extends IChange { */ readonly lineItem: LocalizedString /** - * `sku` or `key` of the [ProductVariant](ctp:api:type:ProductVariant). + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. * * */ @@ -5168,6 +5677,12 @@ export interface SetLineItemTaxAmountChange extends IChange { * */ readonly taxMode: TaxMode + /** + * `id` of the updated [LineItem](ctp:api:type:LineItem). + * + * + */ + readonly lineItemId: string } /** * Change triggered by the [Set LineItemTaxRate](ctp:api:type:StagedOrderSetLineItemTaxRateAction) update action. @@ -5194,7 +5709,9 @@ export interface SetLineItemTaxRateChange extends IChange { */ readonly lineItem: LocalizedString /** - * `sku` or `key` of the [ProductVariant](ctp:api:type:ProductVariant). + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. * * */ @@ -5205,6 +5722,12 @@ export interface SetLineItemTaxRateChange extends IChange { * */ readonly taxMode: TaxMode + /** + * `id` of the updated [LineItem](ctp:api:type:LineItem). + * + * + */ + readonly lineItemId: string } export interface SetLineItemTaxedPriceChange extends IChange { readonly type: 'SetLineItemTaxedPriceChange' @@ -5233,6 +5756,14 @@ export interface SetLineItemTaxedPriceChange extends IChange { * */ readonly lineItemId: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Set LineItemTotalPrice](ctp:api:type:StagedOrderSetLineItemTotalPriceAction) update action. @@ -5247,17 +5778,31 @@ export interface SetLineItemTotalPriceChange extends IChange { * Value before the change. * */ - readonly previousValue: Money + readonly previousValue: _Money /** * Value after the change. * */ - readonly nextValue: Money + readonly nextValue: _Money /** * Name of the [Product](ctp:api:type:Product) the updated Line Item is based on. * */ readonly lineItem: LocalizedString + /** + * `id` of the updated [LineItem](ctp:api:type:LineItem). + * + * + */ + readonly lineItemId: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the following update actions: @@ -5378,6 +5923,15 @@ export interface SetMetaDescriptionChange extends IChange { * */ readonly nextValue: LocalizedString + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string } /** * Change triggered by the following update actions: @@ -5402,6 +5956,15 @@ export interface SetMetaKeywordsChange extends IChange { * */ readonly nextValue: LocalizedString + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string } /** * Change triggered by the following update actions: @@ -5426,6 +5989,15 @@ export interface SetMetaTitleChange extends IChange { * */ readonly nextValue: LocalizedString + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string } /** * Change triggered by the [Set MethodInfoInterface](ctp:api:type:PaymentSetMethodInfoInterfaceAction) update action. @@ -5592,11 +6164,19 @@ export interface SetOrderLineItemCustomFieldChange extends IChange { */ readonly lineItem: LocalizedString /** - * `sku` or `key` of the [ProductVariant](ctp:api:type:ProductVariant). + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. * * */ readonly variant: string + /** + * `id` of the updated [LineItem](ctp:api:type:LineItem). + * + * + */ + readonly lineItemId: string } /** * Change triggered by the following update actions: @@ -5627,11 +6207,19 @@ export interface SetOrderLineItemCustomTypeChange extends IChange { */ readonly lineItem: LocalizedString /** - * `sku` or `key` of the [ProductVariant](ctp:api:type:ProductVariant). + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. * * */ readonly variant: string + /** + * `id` of the updated [LineItem](ctp:api:type:LineItem). + * + * + */ + readonly lineItemId: string } /** * Change triggered by the following update actions: @@ -5667,13 +6255,15 @@ export interface SetOrderTaxedPriceChange extends IChange { * Value before the change. * */ - readonly previousValue: TaxedItemPrice + readonly previousValue: TaxedPrice /** * Value after the change. * */ - readonly nextValue: TaxedItemPrice + readonly nextValue: TaxedPrice /** + * Indicates how taxes are set on the Cart. + * * */ readonly taxMode: TaxMode @@ -5691,12 +6281,12 @@ export interface SetOrderTotalPriceChange extends IChange { * Value before the change. * */ - readonly previousValue: Money + readonly previousValue: _Money /** * Value after the change. * */ - readonly nextValue: Money + readonly nextValue: _Money } /** * Change triggered by the [Set OrderTotalTax](ctp:api:type:StagedOrderSetOrderTotalTaxAction) update action. @@ -5711,12 +6301,12 @@ export interface SetOrderTotalTaxChange extends IChange { * Value before the change. * */ - readonly previousValue: Money + readonly previousValue: _Money /** * Value after the change. * */ - readonly nextValue: Money + readonly nextValue: _Money /** * `"ExternalAmount"` * @@ -5831,6 +6421,16 @@ export interface SetPermissionsChange extends IChange { * */ readonly nextValue: Permission[] + /** + * Elements added to the array. + * + */ + readonly addedItems: Permission[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: Permission[] } /** * Change triggered by the [Set Prices](ctp:api:type:ProductSetPricesAction) update action. @@ -5852,6 +6452,8 @@ export interface SetPricesChange extends IChange { */ readonly nextValue: Price[] /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * @@ -5859,14 +6461,26 @@ export interface SetPricesChange extends IChange { */ readonly catalogData: string /** - * `sku` or `key` of the [ProductVariant](ctp:api:type:ProductVariant). + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. * * */ readonly variant: string + /** + * Elements added to the array. + * + */ + readonly addedItems: Price[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: Price[] } /** - * Change triggered automatically by the [Add Product](ctp:api:type:ProductSelectionAddProductAction) or [Remove Product](ctp:api:type:ProductSelectionRemoveProductAction) update action. + * This change is initiated by background processes after the [Add Product](ctp:api:type:ProductSelectionAddProductAction) or [Remove Product](ctp:api:type:ProductSelectionRemoveProductAction) update action is performed. */ export interface SetProductCountChange extends IChange { readonly type: 'SetProductCountChange' @@ -5905,12 +6519,39 @@ export interface SetProductPriceCustomFieldChange extends IChange { */ readonly nextValue: CustomFields /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * * */ readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string + /** + * `id` of the Embedded [Price](ctp:api:type:Price). + * + * + */ + readonly priceId: string + /** + * `id` of the referenced [Type](ctp:api:type:Type). + * + * + */ + readonly customTypeId: string + /** + * Name of the [Custom Field](/../api/projects/custom-fields). + * + */ + readonly name: string } /** * Change triggered by the [Set Price Custom Type](ctp:api:type:ProductSetProductPriceCustomTypeAction) update action. @@ -5932,12 +6573,28 @@ export interface SetProductPriceCustomTypeChange extends IChange { */ readonly nextValue: CustomFields /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * * */ readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string + /** + * `id` of the Embedded [Price](ctp:api:type:Price). + * + * + */ + readonly priceId: string } /** * Change triggered by the [Set Product Selections](ctp:api:type:StoreSetProductSelectionsAction) update action. @@ -5958,6 +6615,16 @@ export interface SetProductSelectionsChange extends IChange { * */ readonly nextValue: ProductSelectionSetting[] + /** + * Elements added to the array. + * + */ + readonly addedItems: ProductSelectionSetting[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: ProductSelectionSetting[] } /** * Change triggered by the [Set ProductVariant Key](ctp:api:type:ProductSetProductVariantKeyAction) update action. @@ -5979,12 +6646,22 @@ export interface SetProductVariantKeyChange extends IChange { */ readonly nextValue: string /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * * */ readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Update CustomObject](ctp:api:endpoint:/{projectKey}/custom-objects:POST) request when an existing property is updated. @@ -6055,6 +6732,9 @@ export interface SetRatingChange extends IChange { */ readonly nextValue: number } +/** + * This change is initiated by background processes after the [Add Quantity](ctp:api:type:InventoryEntryAddQuantityAction), [Remove Quantity](ctp:api:type:InventoryEntryRemoveQuantityAction), or [Change Quantity](ctp:api:type:InventoryEntryChangeQuantityAction) update action is performed. + */ export interface SetReservationsChange extends IChange { readonly type: 'SetReservationsChange' /** @@ -6071,6 +6751,16 @@ export interface SetReservationsChange extends IChange { * */ readonly nextValue: Reservation[] + /** + * Elements added to the array. + * + */ + readonly addedItems: Reservation[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: Reservation[] } /** * Change triggered by the [Set RestockableInDays](ctp:api:type:InventoryEntrySetRestockableInDaysAction) update action. @@ -6180,6 +6870,8 @@ export interface SetSearchKeywordsChange extends IChange { */ readonly nextValue: SearchKeywords /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * @@ -6241,12 +6933,12 @@ export interface SetShippingInfoPriceChange extends IChange { * Value before the change. * */ - readonly previousValue: Money + readonly previousValue: _Money /** * Value after the change. * */ - readonly nextValue: Money + readonly nextValue: _Money } export interface SetShippingInfoTaxedPriceChange extends IChange { readonly type: 'SetShippingInfoTaxedPriceChange' @@ -6258,12 +6950,12 @@ export interface SetShippingInfoTaxedPriceChange extends IChange { * Value before the change. * */ - readonly previousValue: TaxedPrice + readonly previousValue: TaxedItemPrice /** * Value after the change. * */ - readonly nextValue: TaxedPrice + readonly nextValue: TaxedItemPrice } /** * Change triggered by the [Set ShippingMethod](ctp:api:type:StagedOrderSetShippingMethodAction) update action. @@ -6347,12 +7039,12 @@ export interface SetShippingRateChange extends IChange { * Value before the change. * */ - readonly previousValue: Money + readonly previousValue: ShippingRate /** * Value after the change. * */ - readonly nextValue: Money + readonly nextValue: ShippingRate } /** * Change triggered by the [Set Shipping Rate Input](ctp:api:type:StagedOrderSetShippingRateInputAction) update action. @@ -6459,12 +7151,22 @@ export interface SetSkuChange extends IChange { */ readonly nextValue: string /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * * */ readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string } /** * Change triggered by the [Set Slug](ctp:api:type:ShoppingListSetSlugAction) update action. @@ -6505,6 +7207,16 @@ export interface SetStateRolesChange extends IChange { * */ readonly nextValue: StateRoleEnum[] + /** + * Elements added to the array. + * + */ + readonly addedItems: StateRoleEnum[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: StateRoleEnum[] } /** * Change triggered by the [Set StatusInterfaceCode](ctp:api:type:PaymentSetStatusInterfaceCodeAction) update action. @@ -6563,12 +7275,12 @@ export interface SetStoreChange extends IChange { * Value before the change. * */ - readonly previousValue: Reference + readonly previousValue: KeyReference /** * Value after the change. * */ - readonly nextValue: Reference + readonly nextValue: KeyReference } /** * Change triggered by the [Set Store Mode](ctp:api:type:BusinessUnitSetStoreModeAction) update action. @@ -6609,6 +7321,16 @@ export interface SetStoresChange extends IChange { * */ readonly nextValue: Reference[] + /** + * Elements added to the array. + * + */ + readonly addedItems: KeyReference[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: KeyReference[] } /** * Change triggered by the [Set SupplyChannel](ctp:api:type:InventoryEntrySetSupplyChannelAction) update action. @@ -6649,6 +7371,16 @@ export interface SetSupplyChannelsChange extends IChange { * */ readonly nextValue: Reference[] + /** + * Elements added to the array. + * + */ + readonly addedItems: Reference[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: Reference[] } /** * Change triggered by the [Set Target](ctp:api:type:ReviewSetTargetAction) update action. @@ -6839,6 +7571,16 @@ export interface SetTransitionsChange extends IChange { * */ readonly nextValue: Reference[] + /** + * Elements added to the array. + * + */ + readonly addedItems: Reference[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: Reference[] } /** * Change triggered by the following update actions: @@ -6956,7 +7698,7 @@ export interface SetValueChange extends IChange { readonly nextValue: any } /** - * Change triggered automatically when an [InventoryEntry](ctp:api:type:InventoryEntry) associated with a Product changes. + * This change is initiated by background processes after the [Add Quantity](ctp:api:type:InventoryEntryAddQuantityAction), [Remove Quantity](ctp:api:type:InventoryEntryRemoveQuantityAction), or [Change Quantity](ctp:api:type:InventoryEntryChangeQuantityAction) update action is performed. */ export interface SetVariantAvailabilityChange extends IChange { readonly type: 'SetVariantAvailabilityChange' @@ -6975,6 +7717,8 @@ export interface SetVariantAvailabilityChange extends IChange { */ readonly nextValue: ProductVariantAvailability /** + * Product data that was updated. + * * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. * @@ -6982,7 +7726,9 @@ export interface SetVariantAvailabilityChange extends IChange { */ readonly catalogData: string /** - * `sku` or `key` of the [ProductVariant](ctp:api:type:ProductVariant). + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. * * */ @@ -7057,11 +7803,17 @@ export interface TransitionCustomLineItemStateChange extends IChange { */ readonly nextValue: ItemState[] /** - * `id` of the updated [CustomLineItem](ctp:api:type:CustomLineItem). + * `id` of the updated [LineItem](ctp:api:type:LineItem). * * */ readonly lineItemId: string + /** + * `id` of the updated [CustomLineItem](ctp:api:type:CustomLineItem). + * + * + */ + readonly customLineItemId: string /** * `id` of the [State](ctp:api:type:State) involved in the transition. * @@ -7203,3 +7955,1401 @@ export interface VerifyEmailChange extends IChange { */ readonly change: string } +export interface AddShippingChange extends IChange { + readonly type: 'AddShippingChange' + /** + * + */ + readonly change: string + /** + * Value after the change. + * + */ + readonly nextValue: Shipping +} +/** + * Change triggered by the [Change Approval Rule Mode](ctp:api:type:BusinessUnitChangeApprovalRuleModeAction) update action. + */ +export interface ChangeApprovalRuleModeChange extends IChange { + readonly type: 'ChangeApprovalRuleModeChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: BusinessUnitApprovalRuleMode + /** + * Value after the change. + * + */ + readonly nextValue: BusinessUnitApprovalRuleMode +} +/** + * Change triggered by the following update actions: + * + * - [Change Customer](ctp:api:type:QuoteChangeCustomerAction) on Quotes + * - [Change Customer](ctp:api:type:QuoteRequestChangeCustomerAction) on Quote Requests + * + */ +export interface ChangeCustomerChange extends IChange { + readonly type: 'ChangeCustomerChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: Reference + /** + * Value after the change. + * + */ + readonly nextValue: Reference +} +/** + * This change is initiated by background processes after the [Transition State](ctp:api:type:ReviewTransitionStateAction) update action is performed. + */ +export interface ChangeIncludedInStatisticsChange extends IChange { + readonly type: 'ChangeIncludedInStatisticsChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: boolean + /** + * Value after the change. + * + */ + readonly nextValue: boolean +} +/** + * This change is initiated by background processes after the [Add ProductVariant](ctp:api:type:ProductAddVariantAction) update action is performed. + */ +export interface ChangeLastVariantIdChange extends IChange { + readonly type: 'ChangeLastVariantIdChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: number + /** + * Value after the change. + * + */ + readonly nextValue: number +} +/** + * This change is initiated by background processes after the [Change Name](ctp:api:type:ShoppingListChangeNameAction) update action is performed. + */ +export interface ChangeLineItemNameChange extends IChange { + readonly type: 'ChangeLineItemNameChange' + /** + * + */ + readonly change: string + /** + * Holds information about the updated Shopping List Line Item. + * + */ + readonly lineItem: ShoppingListLineItemValue + /** + * Value before the change. + * + */ + readonly previousValue: LocalizedString + /** + * Value after the change. + * + */ + readonly nextValue: LocalizedString +} +/** + * This change is initiated by background processes after the [Publish](ctp:api:type:ProductPublishAction) or [Unpublish](ctp:api:type:ProductUnpublishAction) update action is performed. + */ +export interface ChangeLineItemPublishedChange extends IChange { + readonly type: 'ChangeLineItemPublishedChange' + /** + * + */ + readonly change: string + /** + * Holds information about the updated Shopping List Line Item. + * + */ + readonly lineItem: ShoppingListLineItemValue + /** + * Value before the change. + * + */ + readonly previousValue: boolean + /** + * Value after the change. + * + */ + readonly nextValue: boolean +} +/** + * Change triggered by the [Exclude Product](ctp:api:type:ProductSelectionExcludeProductAction) update action. + */ +export interface ExcludeProductChange extends IChange { + readonly type: 'ExcludeProductChange' + /** + * + */ + readonly change: string + /** + * Only Product Variants with the explicitly listed SKUs are part of a Product Selection with `IndividualExclusion` [ProductSelectionMode](ctp:api:type:ProductSelectionMode). + * + * + */ + readonly variantExclusion: ProductVariantExclusion + /** + * Value after the change. + * + */ + readonly nextValue: Reference +} +export interface RemoveShippingChange extends IChange { + readonly type: 'RemoveShippingChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: Shipping +} +/** + * Change triggered by the [Replace TaxRate](ctp:api:type:TaxCategoryReplaceTaxRateAction) update action. + */ +export interface ReplaceTaxRateChange extends IChange { + readonly type: 'ReplaceTaxRateChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: TaxRate + /** + * Value after the change. + * + */ + readonly nextValue: TaxRate +} +/** + * Change triggered by the [Revert Staged Changes](ctp:api:type:ProductRevertStagedChangesAction) update action. + */ +export interface RevertStagedChangesChange extends IChange { + readonly type: 'RevertStagedChangesChange' + /** + * + */ + readonly change: string +} +/** + * Change triggered by the [Revert Staged Variant Changes](ctp:api:type:ProductRevertStagedVariantChangesAction) update action. + */ +export interface RevertStagedVariantChangesChange extends IChange { + readonly type: 'RevertStagedVariantChangesChange' + /** + * + */ + readonly change: string +} +/** + * This change is initiated by background processes after the [Change Parent](ctp:api:type:CategoryChangeParentAction) update action is performed. + */ +export interface SetAncestorsChange extends IChange { + readonly type: 'SetAncestorsChange' + /** + * + */ + readonly change: string + /** + * Elements added to the array. + * + */ + readonly addedItems: Reference[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: Reference[] + /** + * Value before the change. + * + */ + readonly previousValue: Reference[] + /** + * Value after the change. + * + */ + readonly nextValue: Reference[] +} +/** + * Change triggered by the [Set Billing Address CustomField](ctp:api:type:OrderSetBillingAddressCustomFieldAction) update action. + */ +export interface SetBillingAddressCustomFieldChange extends IChange { + readonly type: 'SetBillingAddressCustomFieldChange' + /** + * + */ + readonly change: string + /** + * Name of the [Custom Field](/../api/projects/custom-fields). + * + */ + readonly name: string + /** + * `id` of the referenced [Type](ctp:api:type:Type). + * + * + */ + readonly customTypeId: string + /** + * Value before the change. + * + */ + readonly previousValue: any + /** + * Value after the change. + * + */ + readonly nextValue: any +} +/** + * Change triggered by the [Set Billing Address Custom Type](ctp:api:type:OrderSetBillingAddressCustomTypeAction) update action. + */ +export interface SetBillingAddressCustomTypeChange extends IChange { + readonly type: 'SetBillingAddressCustomTypeChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: CustomFields + /** + * Value after the change. + * + */ + readonly nextValue: CustomFields +} +/** + * Change triggered by the [Set Business Unit](ctp:api:type:ShoppingListSetBusinessUnitAction) update action. + */ +export interface SetBusinessUnitChange extends IChange { + readonly type: 'SetBusinessUnitChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: KeyReference + /** + * Value after the change. + * + */ + readonly nextValue: KeyReference +} +/** + * Change triggered after a recalculation of discount on a [Custom Line Item](ctp:api:type:CustomLineItem). + */ +export interface SetCustomLineItemDiscountedPriceChange extends IChange { + readonly type: 'SetCustomLineItemDiscountedPriceChange' + /** + * + */ + readonly change: string + /** + * Name of the updated [CustomLineItem](ctp:api:type:CustomLineItem). + * + */ + readonly customLineItem: LocalizedString + /** + * `id` of the updated [CustomLineItem](ctp:api:type:CustomLineItem). + * + * + */ + readonly customLineItemId: string + /** + * Value before the change. + * + */ + readonly previousValue: DiscountedLineItemPrice + /** + * Value after the change. + * + */ + readonly nextValue: DiscountedLineItemPrice +} +/** + * Change triggered after a recalculation of discount on a [Custom Line Item](ctp:api:type:CustomLineItem). + */ +export interface SetCustomLineItemDiscountedPricePerQuantityChange + extends IChange { + readonly type: 'SetCustomLineItemDiscountedPricePerQuantityChange' + /** + * + */ + readonly change: string + /** + * Name of the updated [CustomLineItem](ctp:api:type:CustomLineItem). + * + */ + readonly customLineItem: LocalizedString + /** + * `id` of the updated [CustomLineItem](ctp:api:type:CustomLineItem). + * + * + */ + readonly customLineItemId: string + /** + * Value before the change. + * + */ + readonly previousValue: DiscountedLineItemPriceForQuantity + /** + * Value after the change. + * + */ + readonly nextValue: DiscountedLineItemPriceForQuantity +} +/** + * Change triggered by the [Set CustomerGroupAssignments](ctp:api:type:CustomerSetCustomerGroupAssignmentsAction) update action. + */ +export interface SetCustomerGroupAssignmentsChange extends IChange { + readonly type: 'SetCustomerGroupAssignmentsChange' + /** + * + */ + readonly change: string + /** + * Elements added to the array. + * + */ + readonly addedItems: CustomerGroupAssignment[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: CustomerGroupAssignment[] + /** + * Value before the change. + * + */ + readonly previousValue: CustomerGroupAssignment[] + /** + * Value after the change. + * + */ + readonly nextValue: CustomerGroupAssignment[] +} +/** + * Change triggered by the [Set Delivery Address CustomField](ctp:api:type:OrderSetDeliveryAddressCustomFieldAction) update action. + */ +export interface SetDeliveryAddressCustomFieldChange extends IChange { + readonly type: 'SetDeliveryAddressCustomFieldChange' + /** + * + */ + readonly change: string + /** + * `id` of the updated [Delivery](ctp:api:type:Delivery). + * + * + */ + readonly deliveryId: string + /** + * `id` of the updated [Address](ctp:api:type:Address). + * + * + */ + readonly addressId: string + /** + * Name of the [Custom Field](/../api/projects/custom-fields). + * + */ + readonly name: string + /** + * `id` of the referenced [Type](ctp:api:type:Type). + * + * + */ + readonly customTypeId: string + /** + * Value before the change. + * + */ + readonly previousValue: any + /** + * Value after the change. + * + */ + readonly nextValue: any +} +/** + * Change triggered by the [Set Delivery Address Custom Type](ctp:api:type:OrderSetDeliveryAddressCustomTypeAction) update action. + */ +export interface SetDeliveryAddressCustomTypeChange extends IChange { + readonly type: 'SetDeliveryAddressCustomTypeChange' + /** + * + */ + readonly change: string + /** + * `id` of the updated [Delivery](ctp:api:type:Delivery). + * + * + */ + readonly deliveryId: string + /** + * `id` of the updated [Address](ctp:api:type:Address). + * + * + */ + readonly addressId: string + /** + * Value before the change. + * + */ + readonly previousValue: CustomFields + /** + * Value after the change. + * + */ + readonly nextValue: CustomFields +} +/** + * Change triggered by the [Set Delivery CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. + */ +export interface SetDeliveryCustomFieldChange extends IChange { + readonly type: 'SetDeliveryCustomFieldChange' + /** + * + */ + readonly change: string + /** + * `id` of the updated [Delivery](ctp:api:type:Delivery). + * + * + */ + readonly deliveryId: string + /** + * Name of the [Custom Field](/../api/projects/custom-fields). + * + */ + readonly name: string + /** + * `id` of the referenced [Type](ctp:api:type:Type). + * + * + */ + readonly customTypeId: string + /** + * Value before the change. + * + */ + readonly previousValue: any + /** + * Value after the change. + * + */ + readonly nextValue: any +} +/** + * Change triggered by the [Set Delivery Custom Type](ctp:api:type:OrderSetDeliveryCustomTypeAction) update action. + */ +export interface SetDeliveryCustomTypeChange extends IChange { + readonly type: 'SetDeliveryCustomTypeChange' + /** + * + */ + readonly change: string + /** + * `id` of the updated [Delivery](ctp:api:type:Delivery). + * + * + */ + readonly deliveryId: string + /** + * Value before the change. + * + */ + readonly previousValue: CustomFields + /** + * Value after the change. + * + */ + readonly nextValue: CustomFields +} +/** + * Change triggered by the [Add DiscountCode](ctp:api:type:StagedOrderAddDiscountCodeAction), [Remove DiscountCode](ctp:api:type:StagedOrderRemoveDiscountCodeAction), [Add LineItem](ctp:api:type:StagedOrderAddLineItemAction), or [Remove LineItem](ctp:api:type:StagedOrderRemoveLineItemAction) update action. + */ +export interface SetDiscountOnTotalPriceChange extends IChange { + readonly type: 'SetDiscountOnTotalPriceChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: DiscountOnTotalPrice + /** + * Value after the change. + * + */ + readonly nextValue: DiscountOnTotalPrice +} +/** + * This change is initiated by background processes after the [Change Parent Unit](ctp:api:type:BusinessUnitChangeParentUnitAction) or [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) update action is performed (if BusinessUnit `storeMode` is `"FromParent"`). + */ +export interface SetInheritedStoresChange extends IChange { + readonly type: 'SetInheritedStoresChange' + /** + * + */ + readonly change: string + /** + * Elements added to the array. + * + */ + readonly addedItems: KeyReference[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: KeyReference[] + /** + * Value before the change. + * + */ + readonly previousValue: KeyReference[] + /** + * Value after the change. + * + */ + readonly nextValue: KeyReference[] +} +/** + * Change triggered by the [Set ItemShipping Address CustomField](ctp:api:type:OrderSetItemShippingAddressCustomFieldAction) update action. + */ +export interface SetItemShippingAddressCustomFieldChange extends IChange { + readonly type: 'SetItemShippingAddressCustomFieldChange' + /** + * + */ + readonly change: string + /** + * `id` of the updated [Address](ctp:api:type:Address). + * + * + */ + readonly addressId: string + /** + * Name of the [Custom Field](/../api/projects/custom-fields). + * + */ + readonly name: string + /** + * `id` of the referenced [Type](ctp:api:type:Type). + * + * + */ + readonly customTypeId: string + /** + * Value before the change. + * + */ + readonly previousValue: any + /** + * Value after the change. + * + */ + readonly nextValue: any +} +/** + * Change triggered by the [Set ItemShipping Address Custom Type](ctp:api:type:OrderSetItemShippingAddressCustomTypeAction) update action. + */ +export interface SetItemShippingAddressCustomTypeChange extends IChange { + readonly type: 'SetItemShippingAddressCustomTypeChange' + /** + * + */ + readonly change: string + /** + * `id` of the updated [Address](ctp:api:type:Address). + * + * + */ + readonly addressId: string + /** + * Value before the change. + * + */ + readonly previousValue: CustomFields + /** + * Value after the change. + * + */ + readonly nextValue: CustomFields +} +/** + * Change triggered by the [Set Inventory Limits](ctp:api:type:InventoryEntrySetInventoryLimitsAction) update action. + */ +export interface SetMaxCartQuantityChange extends IChange { + readonly type: 'SetMaxCartQuantityChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: number + /** + * Value after the change. + * + */ + readonly nextValue: number +} +/** + * Change triggered by the [Set Inventory Limits](ctp:api:type:InventoryEntrySetInventoryLimitsAction) update action. + */ +export interface SetMinCartQuantityChange extends IChange { + readonly type: 'SetMinCartQuantityChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: number + /** + * Value after the change. + * + */ + readonly nextValue: number +} +/** + * Change triggered by the [Set Parcel CustomField](ctp:api:type:OrderSetParcelCustomFieldAction) update action. + */ +export interface SetParcelCustomFieldChange extends IChange { + readonly type: 'SetParcelCustomFieldChange' + /** + * + */ + readonly change: string + /** + * Information about the updated Parcel. + * + */ + readonly parcel: ParcelChangeValue + /** + * `id` of the referenced [Type](ctp:api:type:Type). + * + * + */ + readonly customTypeId: string + /** + * Name of the [Custom Field](/../api/projects/custom-fields). + * + */ + readonly name: string + /** + * Value before the change. + * + */ + readonly previousValue: any + /** + * Value after the change. + * + */ + readonly nextValue: any +} +/** + * Change triggered by the [Set Parcel Custom Type](ctp:api:type:OrderSetParcelCustomTypeAction) update action. + */ +export interface SetParcelCustomTypeChange extends IChange { + readonly type: 'SetParcelCustomTypeChange' + /** + * + */ + readonly change: string + /** + * Information about the updated Parcel. + * + */ + readonly parcel: ParcelChangeValue + /** + * Value before the change. + * + */ + readonly previousValue: CustomFields + /** + * Value after the change. + * + */ + readonly nextValue: CustomFields +} +/** + * Change triggered by the [Change password of Customer](/../api/projects/customers#change-password-of-customer) or [Change password of Customer in Store](/../api/projects/customers#change-password-of-customer-in-store) request. + */ +export interface SetPasswordChange extends IChange { + readonly type: 'SetPasswordChange' + /** + * + */ + readonly change: string +} +/** + * Change triggered by the [Set Price Key](ctp:api:type:ProductSetPriceKeyAction) update action. + */ +export interface SetPriceKeyChange extends IChange { + readonly type: 'SetPriceKeyChange' + /** + * + */ + readonly change: string + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string + /** + * `id` of the Embedded [Price](ctp:api:type:Price). + * + * + */ + readonly priceId: string + /** + * Value before the change. + * + */ + readonly previousValue: string + /** + * Value after the change. + * + */ + readonly nextValue: string +} +/** + * Change triggered by the [Set PriceMode](ctp:api:type:ProductSetPriceModeAction) update action. + */ +export interface SetPriceModeChange extends IChange { + readonly type: 'SetPriceModeChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: ProductPriceModeEnum + /** + * Value after the change. + * + */ + readonly nextValue: ProductPriceModeEnum +} +/** + * Change triggered by the [Set Product Attribute](ctp:api:type:ProductSetProductAttributeAction) update action. + */ +export interface SetProductAttributeChange extends IChange { + readonly type: 'SetProductAttributeChange' + /** + * + */ + readonly change: string + /** + * Product data that was updated. + * + * - `staged`, if the staged [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * - `current`, if the current [ProductCatalogData](ctp:api:type:ProductCatalogData) was updated. + * + * + */ + readonly catalogData: string + /** + * Value before the change. + * + */ + readonly previousValue: Attribute + /** + * Value after the change. + * + */ + readonly nextValue: Attribute +} +/** + * Change triggered by the [Set ReturnInfo](ctp:api:type:OrderSetReturnInfoAction) update action. + */ +export interface SetReturnInfoChange extends IChange { + readonly type: 'SetReturnInfoChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: ReturnInfo + /** + * Value after the change. + * + */ + readonly nextValue: ReturnInfo +} +/** + * Change triggered by the [Set ReturnItem CustomField](ctp:api:type:OrderSetReturnItemCustomFieldAction) update action. + */ +export interface SetReturnItemCustomLineItemCustomFieldChange extends IChange { + readonly type: 'SetReturnItemCustomLineItemCustomFieldChange' + /** + * + */ + readonly change: string + /** + * Name of the updated [CustomLineItem](ctp:api:type:CustomLineItem). + * + */ + readonly customLineItem: LocalizedString + /** + * `id` of the updated [CustomLineItem](ctp:api:type:CustomLineItem). + * + * + */ + readonly customLineItemId: string + /** + * Name of the [Custom Field](/../api/projects/custom-fields). + * + */ + readonly name: string + /** + * `id` of the referenced [Type](ctp:api:type:Type). + * + * + */ + readonly customTypeId: string + /** + * Value before the change. + * + */ + readonly previousValue: any + /** + * Value after the change. + * + */ + readonly nextValue: any +} +/** + * Change triggered by the [Set ReturnItem Custom Type](ctp:api:type:OrderSetReturnItemCustomTypeAction) update action. + */ +export interface SetReturnItemCustomLineItemCustomTypeChange extends IChange { + readonly type: 'SetReturnItemCustomLineItemCustomTypeChange' + /** + * + */ + readonly change: string + /** + * Name of the updated [CustomLineItem](ctp:api:type:CustomLineItem). + * + */ + readonly customLineItem: LocalizedString + /** + * `id` of the updated [CustomLineItem](ctp:api:type:CustomLineItem). + * + * + */ + readonly customLineItemId: string + /** + * Value before the change. + * + */ + readonly previousValue: CustomFields + /** + * Value after the change. + * + */ + readonly nextValue: CustomFields +} +/** + * Change triggered by the [Set ReturnItem CustomField](ctp:api:type:OrderSetReturnItemCustomFieldAction) update action. + */ +export interface SetReturnItemLineItemCustomFieldChange extends IChange { + readonly type: 'SetReturnItemLineItemCustomFieldChange' + /** + * + */ + readonly change: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string + /** + * Name of the [Product](ctp:api:type:Product) the updated Line Item is based on. + * + */ + readonly lineItem: LocalizedString + /** + * `id` of the updated [LineItem](ctp:api:type:LineItem). + * + * + */ + readonly lineItemId: string + /** + * Name of the [Custom Field](/../api/projects/custom-fields). + * + */ + readonly name: string + /** + * `id` of the referenced [Type](ctp:api:type:Type). + * + * + */ + readonly customTypeId: string + /** + * Value before the change. + * + */ + readonly previousValue: any + /** + * Value after the change. + * + */ + readonly nextValue: any +} +/** + * Change triggered by the [Set ReturnItem Custom Type](ctp:api:type:OrderSetReturnItemCustomTypeAction) update action. + */ +export interface SetReturnItemLineItemCustomTypeChange extends IChange { + readonly type: 'SetReturnItemLineItemCustomTypeChange' + /** + * + */ + readonly change: string + /** + * Identifier of the updated Product Variant. + * + * This field holds the SKU, if defined; otherwise the key; otherwise the ID. + * + * + */ + readonly variant: string + /** + * Name of the [Product](ctp:api:type:Product) the updated Line Item is based on. + * + */ + readonly lineItem: LocalizedString + /** + * `id` of the updated [LineItem](ctp:api:type:LineItem). + * + * + */ + readonly lineItemId: string + /** + * Value before the change. + * + */ + readonly previousValue: CustomFields + /** + * Value after the change. + * + */ + readonly nextValue: CustomFields +} +/** + * Change triggered by the [Set Shipping Address CustomField](ctp:api:type:OrderSetShippingAddressCustomFieldAction) update action. + */ +export interface SetShippingAddressCustomFieldChange extends IChange { + readonly type: 'SetShippingAddressCustomFieldChange' + /** + * + */ + readonly change: string + /** + * Name of the [Custom Field](/../api/projects/custom-fields). + * + */ + readonly name: string + /** + * `id` of the referenced [Type](ctp:api:type:Type). + * + * + */ + readonly customTypeId: string + /** + * Value before the change. + * + */ + readonly previousValue: any + /** + * Value after the change. + * + */ + readonly nextValue: any +} +/** + * Change triggered by the [Set Shipping Address Custom Type](ctp:api:type:OrderSetShippingAddressCustomTypeAction) update action. + */ +export interface SetShippingAddressCustomTypeChange extends IChange { + readonly type: 'SetShippingAddressCustomTypeChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: CustomFields + /** + * Value after the change. + * + */ + readonly nextValue: CustomFields +} +/** + * Change triggered by the [Set Shipping CustomField](ctp:api:type:OrderSetShippingCustomFieldAction) update action. + */ +export interface SetShippingCustomFieldChange extends IChange { + readonly type: 'SetShippingCustomFieldChange' + /** + * + */ + readonly change: string + /** + * `shippingKey` of the updated [Shipping](ctp:api:type:Shipping). + * + * + */ + readonly shippingKey: string + /** + * Name of the [Custom Field](/../api/projects/custom-fields). + * + */ + readonly name: string + /** + * `id` of the referenced [Type](ctp:api:type:Type). + * + * + */ + readonly customTypeId: string + /** + * Value before the change. + * + */ + readonly previousValue: any + /** + * Value after the change. + * + */ + readonly nextValue: any +} +/** + * Change triggered by the [Set Shipping Custom Type](ctp:api:type:OrderSetShippingCustomTypeAction) update action. + */ +export interface SetShippingCustomTypeChange extends IChange { + readonly type: 'SetShippingCustomTypeChange' + /** + * + */ + readonly change: string + /** + * `shippingKey` of the updated [Shipping](ctp:api:type:Shipping). + * + * + */ + readonly shippingKey: string + /** + * Value before the change. + * + */ + readonly previousValue: CustomFields + /** + * Value after the change. + * + */ + readonly nextValue: CustomFields +} +/** + * Change triggered by the [Set Transaction CustomField](ctp:api:type:PaymentSetTransactionCustomFieldAction) update action. + */ +export interface SetTransactionCustomFieldChange extends IChange { + readonly type: 'SetTransactionCustomFieldChange' + /** + * + */ + readonly change: string + /** + * Holds information about the updated Transaction. + * + */ + readonly transaction: TransactionChangeValue + /** + * Name of the [Custom Field](/../api/projects/custom-fields). + * + */ + readonly name: string + /** + * `id` of the referenced [Type](ctp:api:type:Type). + * + * + */ + readonly customTypeId: string + /** + * Value before the change. + * + */ + readonly previousValue: any + /** + * Value after the change. + * + */ + readonly nextValue: any +} +/** + * Change triggered by the [Set Transaction Custom Type](ctp:api:type:PaymentSetTransactionCustomTypeAction) update action. + */ +export interface SetTransactionCustomTypeChange extends IChange { + readonly type: 'SetTransactionCustomTypeChange' + /** + * + */ + readonly change: string + /** + * Holds information about the updated Transaction. + * + */ + readonly transaction: TransactionChangeValue + /** + * Value before the change. + * + */ + readonly previousValue: CustomFields + /** + * Value after the change. + * + */ + readonly nextValue: CustomFields +} +/** + * Change triggered by the [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) update action. + */ +export interface SetUnitTypeChange extends IChange { + readonly type: 'SetUnitTypeChange' + /** + * + */ + readonly change: string + /** + * If `unitType="Division"`, reference to the new parent unit for the [Business Unit](ctp:api:type:BusinessUnit). + * + */ + readonly parentUnit: BusinessUnitResourceIdentifier + /** + * Value before the change. + * + */ + readonly previousValue: BusinessUnitType + /** + * Value after the change. + * + */ + readonly nextValue: BusinessUnitType +} +/** + * Change triggered by the [Set Variant Exclusion](ctp:api:type:ProductSelectionSetVariantExclusionAction) update action. + */ +export interface SetVariantExclusionChange extends IChange { + readonly type: 'SetVariantExclusionChange' + /** + * + */ + readonly change: string + /** + * Reference to the updated [Product](ctp:api:type:Product). + * + */ + readonly product: Reference + /** + * Value before the change. + * + */ + readonly previousValue: ProductVariantExclusion + /** + * Value after the change. + * + */ + readonly nextValue: ProductVariantExclusion +} +/** + * Change triggered by the [Update ItemShippingAddress](ctp:api:type:OrderUpdateItemShippingAddressAction) update action. + */ +export interface UpdateItemShippingAddressChange extends IChange { + readonly type: 'UpdateItemShippingAddressChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: Address + /** + * Value after the change. + * + */ + readonly nextValue: Address +} +/** + * Change triggered by the [Set Associates](ctp:api:type:BusinessUnitSetAssociatesAction) update action. + */ +export interface SetAssociatesChange extends IChange { + readonly type: 'SetAssociatesChange' + /** + * + */ + readonly change: string + /** + * Elements added to the array. + * + */ + readonly addedItems: Associate[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: Associate[] + /** + * Value before the change. + * + */ + readonly previousValue: Associate[] + /** + * Value after the change. + * + */ + readonly nextValue: Associate[] +} +/** + * This change is initiated by background processes after the [Change Parent Unit](ctp:api:type:BusinessUnitChangeParentUnitAction) or [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) update action is performed (if [Associates are inherited](/../api/associates-overview#inheritance-of-associates-and-their-roles)). + */ +export interface SetInheritedAssociatesChange extends IChange { + readonly type: 'SetInheritedAssociatesChange' + /** + * + */ + readonly change: string + /** + * Elements added to the array. + * + */ + readonly addedItems: InheritedAssociate[] + /** + * Elements removed from the array. + * + */ + readonly removedItems: InheritedAssociate[] + /** + * Value before the change. + * + */ + readonly previousValue: InheritedAssociate[] + /** + * Value after the change. + * + */ + readonly nextValue: InheritedAssociate[] +} +/** + * Change triggered by the following update actions: + * + * - [Set Unit Type](ctp:api:type:BusinessUnitSetUnitTypeAction) on Business Units + * - [Change Parent Unit](ctp:api:type:BusinessUnitChangeParentUnitAction) on Business Units + * + */ +export interface ChangeTopLevelUnitChange extends IChange { + readonly type: 'ChangeTopLevelUnitChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: KeyReference + /** + * Value after the change. + * + */ + readonly nextValue: KeyReference +} +/** + * Change triggered by the [Change Price Rounding Mode](ctp:api:type:StagedOrderChangePriceRoundingModeAction) update action. + */ +export interface ChangePriceRoundingModeChange extends IChange { + readonly type: 'ChangePriceRoundingModeChange' + /** + * + */ + readonly change: string + /** + * Value before the change. + * + */ + readonly previousValue: RoundingMode + /** + * Value after the change. + * + */ + readonly nextValue: RoundingMode +} diff --git a/packages/history-sdk/src/generated/models/common.ts b/packages/history-sdk/src/generated/models/common.ts index 70bafebc3..837862f30 100644 --- a/packages/history-sdk/src/generated/models/common.ts +++ b/packages/history-sdk/src/generated/models/common.ts @@ -4,187 +4,139 @@ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. */ +/** + * JSON object where the keys are of type [Locale](ctp:api:type:Locale), and the values are the strings used for the corresponding language. + * + */ export interface LocalizedString { [key: string]: string } -export interface Address { - /** - * Unique ID of the Address. - * - */ - readonly id: string - /** - * - */ - readonly key: string - /** - * - */ - readonly title: string - /** - * - */ - readonly salutation: string - /** - * - */ - readonly firstName: string - /** - * - */ - readonly lastName: string - /** - * - */ - readonly streetName: string - /** - * - */ - readonly streetNumber: string +export interface Asset { /** + * Unique identifier of the Asset. Not required when importing Assets using the [Import API](/import-export/import-resources). * - */ - readonly additionalStreetInfo: string - /** * */ - readonly postalCode: string + readonly id: string /** * */ - readonly city: string + readonly sources: AssetSource[] /** + * Name of the Asset. * - */ - readonly region: string - /** * */ - readonly state: string + readonly name: LocalizedString /** - * Two-digit country code as per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). - * + * Description of the Asset. * - */ - readonly country: string - /** * */ - readonly company: string + readonly description?: LocalizedString /** + * Keywords for categorizing and organizing Assets. * - */ - readonly department: string - /** * */ - readonly building: string + readonly tags?: string[] /** + * Custom Fields defined for the Asset. * - */ - readonly apartment: string - /** * */ - readonly pOBox: string + readonly custom?: CustomFields /** + * User-defined identifier of the Asset. It is unique per [Category](ctp:api:type:Category) or [ProductVariant](ctp:api:type:ProductVariant). * - */ - readonly phone: string - /** * */ - readonly mobile: string + readonly key?: string +} +/** + * Dimensions of the Asset source specified by the number of pixels. + * + */ +export interface AssetDimensions { /** + * Width of the Asset source. * - */ - readonly email: string - /** * */ - readonly fax: string + readonly w: number /** + * Height of the Asset source. * - */ - readonly additionalAddressInfo: string - /** * */ - readonly externalId: string + readonly h: number } -export interface Asset { +/** + * Representation of an [Asset](#asset) in a specific format, for example a video in a certain encoding, or an image in a certain resolution. + * + */ +export interface AssetSource { /** + * URI of the AssetSource. * - */ - readonly id: string - /** * */ - readonly name: LocalizedString + readonly uri: string /** + * User-defined identifier of the AssetSource. Must be unique per [Asset](ctp:api:type:Asset). * */ - readonly description: LocalizedString + readonly key?: string /** + * Width and height of the AssetSource. * - */ - readonly custom: CustomFields - /** * */ - readonly key: string -} -export interface AssetDimensions { + readonly dimensions?: AssetDimensions /** + * Indicates the type of content, for example `application/pdf`. * - */ - readonly w: number - /** * */ - readonly h: number + readonly contentType?: string } -export interface AssetSource { +export interface Associate { /** + * Roles assigned to the Associate within a Business Unit. * - */ - readonly uri: string - /** * */ - readonly key: string + readonly associateRoleAssignments: AssociateRoleAssignment[] /** + * Deprecated type. Use `associateRoleAssignments` instead. * - */ - readonly dimensions: AssetDimensions - /** * */ - readonly contentType: string -} -export interface Associate { + readonly roles?: AssociateRoleDeprecated[] /** + * The [Customer](ctp:api:type:Customer) that acts as an Associate in the Business Unit. * - */ - readonly associateRoleAssignments: AssociateRoleAssignment[] - /** * */ - readonly customer: Reference + readonly customer: CustomerReference } export interface AssociateRoleAssignment { /** + * Role the Associate holds within a Business Unit. + * * */ - readonly associateRole: KeyReference + readonly associateRole: AssociateRoleKeyReference /** - * Determines whether an [AssociateRoleAssignment](ctp:api:type:AssociateRoleAssignment) can be inherited by child Business Units. + * Determines whether the AssociateRoleAssignment can be inherited by child Business Units. + * * */ readonly inheritance: AssociateRoleInheritanceMode } /** * Determines whether an [AssociateRoleAssignment](ctp:api:type:AssociateRoleAssignment) can be inherited by child Business Units. + * */ export enum AssociateRoleInheritanceModeValues { Disabled = 'Disabled', @@ -195,6 +147,10 @@ export type AssociateRoleInheritanceMode = | 'Disabled' | 'Enabled' | (string & {}) +/** + * Specifies how an Attribute (or a set of Attributes) should be validated across all variants of a Product: + * + */ export enum AttributeConstraintEnumValues { CombinationUnique = 'CombinationUnique', None = 'None', @@ -210,37 +166,57 @@ export type AttributeConstraintEnum = | (string & {}) export interface AttributeDefinition { /** + * Describes the Type of the Attribute. * */ readonly type: AttributeType /** - * The unique name of the attribute used in the API. The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (`_`) and the hyphen-minus (`-`). When using the same `name` for an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned. An exception to this are the values of an `enum` or `lenum` type and sets thereof. + * User-defined name of the Attribute that is unique within the [Project](ctp:api:type:Project). + * * */ readonly name: string /** + * Human-readable label for the Attribute. * */ readonly label: LocalizedString /** - * Whether the attribute is required to have a value. + * If `true`, the Attribute must have a value on a [ProductVariant](ctp:api:type:ProductVariant). * */ readonly isRequired: boolean /** + * Specifies whether the Attribute is defined at the Product or Variant level. + * + * + */ + readonly level: AttributeLevelEnum + /** + * Specifies how Attributes are validated across all variants of a Product. + * * */ readonly attributeConstraint: AttributeConstraintEnum /** + * Provides additional Attribute information to aid content managers configure Product details. + * * */ - readonly inputTip: LocalizedString + readonly inputTip?: LocalizedString /** + * Provides a visual representation directive for values of this Attribute (only relevant for [AttributeTextType](ctp:api:type:AttributeTextType) and [AttributeLocalizableTextType](ctp:api:type:AttributeLocalizableTextType)). * */ readonly inputHint: TextInputHint /** - * Whether the attribute's values should generally be enabled in product search. This determines whether the value is stored in products for matching terms in the context of full-text search queries and can be used in facets & filters as part of product search queries. The exact features that are enabled/disabled with this flag depend on the concrete attribute type and are described there. The max size of a searchable field is **restricted to 10922 characters**. This constraint is enforced at both product creation and product update. If the length of the input exceeds the maximum size an InvalidField error is returned. + * If `true`, the Attribute's values are available in the [Product Search](/../api/projects/product-search) or the [Product Projection Search](/../api/projects/product-projection-search) API for use in full-text search queries, filters, and facets. + * However, if an Attribute's `level` is set as `Product`, then Product Projection Search does **not support** the Attribute. + * + * The exact features that are available with this flag depend on the specific [AttributeType](ctp:api:type:AttributeType). + * The maximum size of a searchable field is **restricted** by the [Field content size limit](/../api/limits#field-content-size). + * This constraint is enforced at both [Product creation](ctp:api:endpoint:/{projectKey}/products:POST) and [Product update](/../api/projects/products#update-product). + * If the length of the input exceeds the maximum size, an [InvalidField](ctp:api:type:InvalidFieldError) error is returned. * */ readonly isSearchable: boolean @@ -281,6 +257,9 @@ export interface AttributePlainEnumValue { */ readonly label: string } +/** + * Umbrella type for specific attribute types discriminated by property `name`. + */ export interface AttributeType { /** * @@ -295,6 +274,7 @@ export enum AuthenticationModeValues { export type AuthenticationMode = 'ExternalAuth' | 'Password' | (string & {}) /** * Determines whether a Business Unit can inherit Associates from a parent. + * */ export enum BusinessUnitAssociateModeValues { Explicit = 'Explicit', @@ -307,6 +287,7 @@ export type BusinessUnitAssociateMode = | (string & {}) /** * Indicates whether the Business Unit can be edited and used in [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quote Requests](ctp:api:type:QuoteRequest), or [Quotes](ctp:api:type:Quote). + * */ export enum BusinessUnitStatusValues { Active = 'Active', @@ -316,6 +297,7 @@ export enum BusinessUnitStatusValues { export type BusinessUnitStatus = 'Active' | 'Inactive' | (string & {}) /** * Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from its parent unit. + * */ export enum BusinessUnitStoreModeValues { Explicit = 'Explicit', @@ -323,6 +305,9 @@ export enum BusinessUnitStoreModeValues { } export type BusinessUnitStoreMode = 'Explicit' | 'FromParent' | (string & {}) +/** + * JSON object where the keys are [Category](ctp:api:type:Category) `id`, and the values are order hint values: strings representing a number between `0` and `1`, but not ending in `0`. Order hints allow controlling the order of Products and how they appear in Categories. Products without order hints have an order score below `0`. Order hints are not unique. If a subset of Products have the same value for order hint in a specific category, the behavior is undetermined. + */ export interface CategoryOrderHints { [key: string]: string } @@ -345,97 +330,226 @@ export type ChannelRoleEnum = | 'Primary' | 'ProductDistribution' | (string & {}) +/** + * Serves as value of the `custom` field on a resource or data type customized with a [Type](ctp:api:type:Type). + * + */ export interface CustomFields { /** + * Reference to the [Type](ctp:api:type:Type) that holds the [FieldDefinitions](ctp:api:type:FieldDefinition) for the Custom Fields. + * * */ - readonly type: Reference + readonly type: TypeReference /** - * A valid JSON object, based on FieldDefinition. + * Object containing the Custom Fields for the [customized resource or data type](/../api/projects/types#resourcetypeid). + * * */ - readonly fields: any + readonly fields: FieldContainer } +/** + * 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. + * You control the lifecycle of this item. + * + */ export interface CustomLineItem { /** - * The unique ID of this CustomLineItem. + * Unique identifier of the Custom Line Item. + * * */ readonly id: string /** + * User-defined unique identifier of the Custom Line Item. + * + * + */ + readonly key?: string + /** + * Name of the Custom Line Item. + * * */ readonly name: LocalizedString /** + * Money value of the Custom Line Item. + * + * + */ + readonly money: TypedMoney + /** + * Automatically set after the `taxRate` is set. + * * */ - readonly money: Money + readonly taxedPrice?: TaxedItemPrice /** + * Total taxed prices based on the quantity of the Custom Line Item assigned to each [Shipping Method](ctp:api:type:ShippingMethod). Only applicable for Carts with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + * Automatically set after `perMethodTaxRate` is set. * */ - readonly taxedPrice: TaxedItemPrice + readonly taxedPricePortions: MethodTaxedPrice[] /** + * Total price of the Custom Line Item (`money` multiplied by `quantity`). + * If the Custom Line Item is discounted, the total price is `discountedPricePerQuantity` multiplied by `quantity`. + * + * Includes taxes if the [TaxRate](ctp:api:type:TaxRate) `includedInPrice` is `true`. + * * */ - readonly totalPrice: Money + readonly totalPrice: CentPrecisionMoney /** - * A unique String in the cart to identify this CustomLineItem. + * User-defined identifier used in a deep-link URL for the Custom Line Item. + * It matches the pattern `[a-zA-Z0-9_-]{2,256}`. + * * */ readonly slug: string /** - * The amount of a CustomLineItem in the cart. Must be a positive integer. + * Number of Custom Line Items in the [Cart](ctp:api:type:Cart) or [Order](ctp:api:type:Order). + * * */ readonly quantity: number + /** + * Tracks specific quantities of the Custom Line Item within a given State. When a Custom Line Item is added to a Cart, its full quantity is set to the built-in "Initial" state. State transitions for Custom Line Items are managed on the [Order](ctp:api:type:Order). + * + * + */ + readonly state: ItemState[] + /** + * Used to select a Tax Rate when a Cart has the `Platform` [TaxMode](ctp:api:type:TaxMode). + * + * + */ + readonly taxCategory?: TaxCategoryReference + /** + * - 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. + * - For a Cart with `External` TaxMode, the `taxRate` of Custom Line Items can be set using [ExternalTaxRateDraft](ctp:api:type:ExternalTaxRateDraft). + * + * + */ + readonly taxRate?: TaxRate + /** + * 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). + * For a Cart with `External` [TaxMode](ctp:api:type:TaxMode), the Tax Rate must be set with [ExternalTaxRateDraft](ctp:api:type:ExternalTaxRateDraft). + * + */ + readonly perMethodTaxRate: MethodTaxRate[] + /** + * Discounted price of a single quantity of the Custom Line Item. + * + * + */ + readonly discountedPricePerQuantity: DiscountedLineItemPriceForQuantity[] + /** + * Custom Fields of the Custom Line Item. + * + * + */ + readonly custom?: CustomFields + /** + * Container for Custom Line Item-specific addresses. + * + * + */ + readonly shippingDetails?: ItemShippingDetails + /** + * Indicates whether Cart Discounts with a matching [CartDiscountCustomLineItemsTarget](ctp:api:type:CartDiscountCustomLineItemsTarget), [MultiBuyCustomLineItemsTarget](ctp:api:type:MultiBuyCustomLineItemsTarget), or [CartDiscountPatternTarget](ctp:api:type:CartDiscountPatternTarget) are applied to the Custom Line Item. + * + * + */ + readonly priceMode: CustomLineItemPriceMode + /** + * Recurring Order and frequency data. + * + * + */ + readonly recurrenceInfo?: CustomLineItemRecurrenceInfo } +/** + * Contains information on how items are shipped to Customers, for example, a delivery note. + * + */ export interface Delivery { /** + * Unique identifier of the Delivery. * */ readonly id: string /** + * User-defined unique identifier of the Delivery. + * + */ + readonly key?: string + /** + * Date and time (UTC) the Delivery was created. + * * */ readonly createdAt: string /** + * Line Items or Custom Line Items that are delivered. + * * */ readonly items: DeliveryItem[] /** + * Information regarding the appearance, content, and shipment of a Parcel. + * * */ readonly parcels: Parcel[] /** + * Address to which Parcels are delivered. + * * */ readonly address?: Address /** - * Custom Fields for the Transaction. + * Custom Fields of the Delivery. + * * */ readonly custom?: CustomFields } export interface DeliveryItem { /** + * `id` of the [LineItem](ctp:api:type:LineItem) or [CustomLineItem](ctp:api:type:CustomLineItem) delivered. + * * */ readonly id: string /** + * Number of Line Items or Custom Line Items delivered. + * * */ readonly quantity: number } export interface DiscountCodeInfo { /** + * Discount Code associated with the Cart or Order. + * * */ - readonly discountCode: Reference + readonly discountCode: DiscountCodeReference /** + * Indicates the state of the Discount Code applied to the Cart or Order. + * * */ readonly state: DiscountCodeState } +/** + * Indicates the state of a Discount Code in a Cart. + * + * If an Order is created from a Cart with a state other than `MatchesCart` or `ApplicationStoppedByGroupBestDeal`, a [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) error is returned. + * + * For Orders created from a Cart with a `ApplicationStoppedByGroupBestDeal` state, the discount code is not applied. + * + */ export enum DiscountCodeStateValues { ApplicationStoppedByGroupBestDeal = 'ApplicationStoppedByGroupBestDeal', ApplicationStoppedByPreviousDiscount = 'ApplicationStoppedByPreviousDiscount', @@ -457,239 +571,465 @@ export type DiscountCodeState = | (string & {}) export interface DiscountedLineItemPortion { /** + * A [CartDiscountReference](ctp:api:type:CartDiscountReference) or [DirectDiscountReference](ctp:api:type:DirectDiscountReference) of the applicable discount on the Line Item. + * * */ readonly discount: Reference /** + * Money value of the applicable discount. + * * */ - readonly discountedAmount: Money + readonly discountedAmount: TypedMoney } export interface DiscountedLineItemPrice { /** + * Money value of the discounted Line Item or Custom Line Item. + * * */ - readonly value: Money + readonly value: TypedMoney /** + * Discount applicable on the Line Item or Custom Line Item. + * * */ readonly includedDiscounts: DiscountedLineItemPortion[] } export interface DiscountedLineItemPriceForQuantity { /** + * Number of Line Items or Custom Line Items in the Cart. + * * */ readonly quantity: number /** + * Discounted price of the Line Item or Custom Line Item. + * * */ readonly discountedPrice: DiscountedLineItemPrice } +/** + * Defines a [Custom Field](/../api/projects/custom-fields) and its meta-information. + * This FieldDefinition is similar to an [AttributeDefinition](ctp:api:type:AttributeDefinition) of [Product Types](/../api/projects/productTypes). + * + */ export interface FieldDefinition { /** + * Data type of the Custom Field to define. * */ readonly type: FieldType /** - * The name of the field. The name must be between two and 36 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (`_`) and the hyphen-minus (`-`). The name must be unique for a given resource type ID. In case there is a field with the same name in another type it has to have the same FieldType also. + * Name of the Custom Field to define. + * Must be unique for a given [ResourceTypeId](ctp:api:type:ResourceTypeId). + * In case there is a FieldDefinition with the same `name` in another [Type](ctp:api:type:Type), both FieldDefinitions must have the same `type`. + * * */ readonly name: string /** + * A human-readable label for the field. * */ readonly label: LocalizedString /** + * Defines whether the field is required to have a value. * */ - readonly inputHint: TextInputHint -} -export interface FieldType { + readonly required: boolean /** + * Defines the visual representation of the field in user interfaces like the Merchant Center. + * It is only relevant for string-based [FieldTypes](ctp:api:type:FieldType) like [CustomFieldStringType](ctp:api:type:CustomFieldStringType) and [CustomFieldLocalizedStringType](ctp:api:type:CustomFieldLocalizedStringType). * - */ - readonly name: string -} -export interface GeoLocation { - /** * */ - readonly type: string + readonly inputHint?: TypeTextInputHint +} +export interface FieldType { /** * */ - readonly coordinates: number[] + readonly name: string } export interface Image { /** + * URL of the image in its original size that must be unique within a single [ProductVariant](ctp:api:type:ProductVariant). + * * */ readonly url: string /** + * Dimensions of the original image. + * * */ readonly dimensions: ImageDimensions /** + * Custom label for the image. + * * */ - readonly label: string + readonly label?: string } export interface ImageDimensions { /** + * Width of the image. * */ readonly w: number /** + * Height of the image. * */ readonly h: number } export interface InheritedAssociate { /** + * Inherited roles of the Associate within a Business Unit. + * * */ readonly associateRoleAssignments: InheritedAssociateRoleAssignment[] /** + * The [Customer](ctp:api:type:Customer) that acts as an Associate in the Business Unit. + * * */ - readonly customer: Reference + readonly customer: CustomerReference } export interface InheritedAssociateRoleAssignment { /** + * Inherited role the Associate holds within a Business Unit. + * * */ - readonly associateRole: KeyReference + readonly associateRole: AssociateRoleKeyReference /** + * Reference to the parent Business Unit where the assignment is defined explicitly. + * * */ - readonly source: KeyReference + readonly source: BusinessUnitKeyReference } export interface ItemShippingDetails { /** + * Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped. + * * */ readonly targets: ItemShippingTarget[] /** - * true if the quantity of the (custom) line item is equal to the sum of the sub-quantities in `targets`, `false` otherwise. A cart cannot be ordered when the value is `false`. The error InvalidItemShippingDetails will be triggered. + * - `true` if the quantity of Line Items or Custom Line Items is equal to the sum of sub-quantities defined in `targets`. + * - `false` if the quantity of Line Items or Custom Line Items is not equal to the sum of sub-quantities defined in `targets`. + * Ordering a Cart when the value is `false` returns an [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) error. + * * */ readonly valid: boolean } +/** + * Determines the address (as a reference to an address in `itemShippingAddresses`) and the quantity shipped to the address. + * + * If multiple shipping addresses are present for a Line Item or Custom Line Item, sub-quantities must be specified. + * An array of addresses and sub-quantities is stored per Line Item or Custom Line Item. + * + */ export interface ItemShippingTarget { /** - * The key of the address in the cart's `itemShippingAddresses` + * Key of the address in the [Cart](ctp:api:type:Cart) `itemShippingAddresses`. + * Duplicate address keys are not allowed. + * * */ readonly addressKey: string /** - * The quantity of items that should go to the address with the specified `addressKey`. Only positive values are allowed. Using `0` as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails. + * Quantity of Line Items or Custom Line Items shipped to the address with the specified `addressKey`. + * + * 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). + * * */ readonly quantity: number + /** + * User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + * + * It connects Line Item or Custom Line Item quantities with individual Shipping Methods. + * + */ + readonly shippingMethodKey?: string } export interface ItemState { /** + * Number of Line Items or Custom Line Items in this State. + * * */ readonly quantity: number /** + * State of the Line Items or Custom Line Items in a custom workflow. + * * */ - readonly state: Reference + readonly state: StateReference } -export interface KeyReference { +/** + * A KeyReference represents a loose reference to another resource in the same Project identified by the resource's `key` field. If available, the `key` is immutable and mandatory. KeyReferences do not support [Reference Expansion](/general-concepts#reference-expansion). + * + */ +export type KeyReference = + | AssociateRoleKeyReference + | BusinessUnitKeyReference + | StoreKeyReference +export interface IKeyReference { /** + * Type of referenced resource. + * * */ - readonly key: string + readonly typeId: ReferenceTypeId /** + * User-defined unique and immutable key of the referenced resource. + * * */ - readonly typeId: ReferenceTypeId + readonly key: string } +/** + * The representation of a [Line Item](/../api/carts-orders-overview#line-items) in a [Cart](ctp:api:type:Cart) or in an [Order](ctp:api:type:Order). + * + */ export interface LineItem { /** + * Unique identifier of the LineItem. + * * */ - readonly addedAt: string + readonly id: string /** + * User-defined unique identifier of the LineItem. + * * */ - readonly custom: CustomFields + readonly key?: string /** + * `id` of the [Product](ctp:api:type:Product) the Line Item is based on. + * * */ - readonly id: string + readonly productId: string /** + * `key` of the [Product](ctp:api:type:Product). + * + * This field is only present on: + * + * - Line Items in a [Cart](ctp:api:type:Cart) when the `key` is available on that specific Product at the time the LineItem was created or updated on the Cart. + * - Line Items in an [Order](ctp:api:type:Order) when the `key` is available on the specific Product at the time the Order was created from the Cart. + * + * Present on resources created or updated after 3 December 2021. + * + * + */ + readonly productKey?: string + /** + * Name of the Product. + * * */ readonly name: LocalizedString /** + * `slug` of the current version of the Product. Updated automatically if the `slug` changes. Empty if the Product has been deleted. + * The `productSlug` field of LineItem is not expanded when using [Reference Expansion](/../api/general-concepts#reference-expansion). + * * */ - readonly productId: string + readonly productSlug?: LocalizedString + /** + * Product Type of the Product. + * + * + */ + readonly productType: ProductTypeReference /** + * Holds the data of the Product Variant added to the Cart. + * + * 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. + * Must be updated using the [Recalculate](ctp:api:type:CartRecalculateAction) update action. + * * */ - readonly productSlug: LocalizedString + readonly variant: ProductVariant /** + * 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`. + * * */ - readonly productType: Reference + readonly price: Price /** + * Number of Line Items of the given Product Variant present in the [Cart](ctp:api:type:Cart) or [Order](ctp:api:type:Order). + * * */ readonly quantity: number /** + * 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`. + * Includes taxes if the [TaxRate](ctp:api:type:TaxRate) `includedInPrice` is `true`. + * + * If `ExternalPrice` [LineItemPriceMode](#ctp:api:type:LineItemPriceMode) is used with high-precision money, then the total price is rounded by using the `HalfEven` rounding mode. + * + * + */ + readonly totalPrice: CentPrecisionMoney + /** + * Discounted price of a single quantity of the Line Item. + * + * + */ + readonly discountedPricePerQuantity: DiscountedLineItemPriceForQuantity[] + /** + * Automatically set after `taxRate` is set. + * + * + */ + readonly taxedPrice?: TaxedItemPrice + /** + * Total taxed prices based on the quantity of Line Item assigned to each [Shipping Method](ctp:api:type:ShippingMethod). Only applicable for Carts with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + * Automatically set after `perMethodTaxRate` is set. + * + */ + readonly taxedPricePortions: MethodTaxedPrice[] + /** + * Tracks specific quantities of the Line Item within a given State. When a Line Item is added to a Cart, its full quantity is set to the built-in "Initial" state. State transitions for Line Items are managed on the [Order](ctp:api:type:Order). + * + * + */ + readonly state: ItemState[] + /** + * - 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. + * - For a Cart with `External` TaxMode, the `taxRate` of Line Items can be set using [ExternalTaxRateDraft](ctp:api:type:ExternalTaxRateDraft). + * + * + */ + readonly taxRate?: TaxRate + /** + * 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). + * For a Cart with `External` [TaxMode](ctp:api:type:TaxMode), the Tax Rate must be set with [ExternalTaxRateDraft](ctp:api:type:ExternalTaxRateDraft). + * + */ + readonly perMethodTaxRate: MethodTaxRate[] + /** + * Identifies [Inventory entries](/../api/projects/inventory) that are reserved. The referenced Channel has the `InventorySupply` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum). + * + * + */ + readonly supplyChannel?: ChannelReference + /** + * Used to [select](/../api/pricing-and-discounts-overview#line-item-price-selection) a Product Price. The referenced Channel has the `ProductDistribution` [ChannelRoleEnum](ctp:api:type:ChannelRoleEnum). + * + * + */ + readonly distributionChannel?: ChannelReference + /** + * Indicates how the Price for the Line Item is set. + * + * + */ + readonly priceMode: LineItemPriceMode + /** + * Indicates how the Line Item is added to the Cart. + * + * + */ + readonly lineItemMode: LineItemMode + /** + * Inventory mode specific to this Line Item only, and valid for the entire `quantity` of the Line Item. + * Only present if the inventory mode is different from the `inventoryMode` specified on the [Cart](ctp:api:type:Cart). + * + * + */ + readonly inventoryMode?: InventoryMode + /** + * Container for Line Item-specific addresses. + * + * + */ + readonly shippingDetails?: ItemShippingDetails + /** + * Custom Fields of the Line Item. + * + * + */ + readonly custom?: CustomFields + /** + * Date and time (UTC) the Line Item was added to the Cart. + * + * + */ + readonly addedAt?: string + /** + * Date and time (UTC) the Line Item was last updated. + * * */ - readonly variant: Variant + readonly lastModifiedAt?: string /** + * Recurring Order and frequency data. + * * */ - readonly variantId: number + readonly recurrenceInfo?: LineItemRecurrenceInfo } /** - * Shape of the value for `addLocation` and `removeLocation` actions + * A geographical location representing a country and optionally a state within this country. A location can only be assigned to one Zone. */ export interface Location { /** - * Two-digit country code as per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). - * + * Country code of the geographic location. * */ readonly country: string /** + * State within the country. * */ - readonly state: string + readonly state?: string } +/** + * Draft object to store money in cent amounts for a specific currency. + */ export interface Money { /** - * Currency code compliant to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + * Amount in the smallest indivisible unit of a currency, such as: * + * * Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as `500`). + * * The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as `5`). * - */ - readonly currencyCode: string - /** * */ readonly centAmount: number /** + * Currency code compliant to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). * - */ - readonly fractionDigits: number - /** * */ - readonly type: MoneyType + readonly currencyCode: string } +export type _Money = Money | TypedMoney +/** + * Determines the type of money used. + */ export enum MoneyTypeValues { CentPrecision = 'centPrecision', HighPrecision = 'highPrecision', } export type MoneyType = 'centPrecision' | 'highPrecision' | (string & {}) +/** + * Indicates the state of the Order. + * + */ export enum OrderStateValues { Cancelled = 'Cancelled', Complete = 'Complete', @@ -703,52 +1043,90 @@ export type OrderState = | 'Confirmed' | 'Open' | (string & {}) +/** + * Information regarding the appearance, content, and shipment of a Parcel. + * + */ export interface Parcel { /** + * Unique identifier of the Parcel. * */ readonly id: string /** + * User-defined unique identifier of the Parcel. + * + */ + readonly key?: string + /** + * Date and time (UTC) the Parcel was created. + * * */ readonly createdAt: string /** + * Information about the dimensions of the Parcel. + * * */ - readonly measurements: ParcelMeasurements + readonly measurements?: ParcelMeasurements /** + * Shipment tracking information of the Parcel. + * * */ - readonly trackingData: TrackingData + readonly trackingData?: TrackingData /** + * Line Items or Custom Line Items delivered in this Parcel. + * * */ - readonly items: DeliveryItem[] + readonly items?: DeliveryItem[] + /** + * Custom Fields of the Parcel. + * + * + */ + readonly custom?: CustomFields } export interface ParcelMeasurements { /** + * Height of the Parcel. + * * */ - readonly heightInMillimeter: number + readonly heightInMillimeter?: number /** + * Length of the Parcel. + * * */ - readonly lengthInMillimeter: number + readonly lengthInMillimeter?: number /** + * Width of the Parcel. + * * */ - readonly widthInMillimeter: number + readonly widthInMillimeter?: number /** + * Weight of the Parcel. + * * */ - readonly weightInGram: number + readonly weightInGram?: number } export interface PaymentInfo { /** + * [References](ctp:api:type:Reference) to the Payments associated with the Order. + * * */ - readonly payments: Reference[] + readonly payments: PaymentReference[] } +/** + * Indicates the payment status for the Order. + * + */ export enum PaymentStateValues { BalanceDue = 'BalanceDue', CreditOwed = 'CreditOwed', @@ -765,159 +1143,312 @@ export type PaymentState = | 'Pending' | (string & {}) /** - * Permissions grant granular access to [Business Units](ctp:api:type:BusinessUnit), [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quotes](ctp:api:type:Quote), and [Quote Requests](ctp:api:type:QuoteRequest). + * Permissions grant granular access to [Approval Rules](ctp:api:type:ApprovalRule), [Approval Flows](ctp:api:type:ApprovalFlow), [Business Units](ctp:api:type:BusinessUnit), [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quotes](ctp:api:type:Quote), [Quote Requests](ctp:api:type:QuoteRequest), and [Shopping Lists](ctp:api:type:ShoppingList). + * */ export enum PermissionValues { AcceptMyQuotes = 'AcceptMyQuotes', AcceptOthersQuotes = 'AcceptOthersQuotes', AddChildUnits = 'AddChildUnits', + CreateApprovalRules = 'CreateApprovalRules', CreateMyCarts = 'CreateMyCarts', CreateMyOrdersFromMyCarts = 'CreateMyOrdersFromMyCarts', CreateMyOrdersFromMyQuotes = 'CreateMyOrdersFromMyQuotes', CreateMyQuoteRequestsFromMyCarts = 'CreateMyQuoteRequestsFromMyCarts', + CreateMyShoppingLists = 'CreateMyShoppingLists', CreateOrdersFromOthersCarts = 'CreateOrdersFromOthersCarts', CreateOrdersFromOthersQuotes = 'CreateOrdersFromOthersQuotes', CreateOthersCarts = 'CreateOthersCarts', + CreateOthersShoppingLists = 'CreateOthersShoppingLists', CreateQuoteRequestsFromOthersCarts = 'CreateQuoteRequestsFromOthersCarts', DeclineMyQuotes = 'DeclineMyQuotes', DeclineOthersQuotes = 'DeclineOthersQuotes', DeleteMyCarts = 'DeleteMyCarts', + DeleteMyShoppingLists = 'DeleteMyShoppingLists', DeleteOthersCarts = 'DeleteOthersCarts', + DeleteOthersShoppingLists = 'DeleteOthersShoppingLists', ReassignMyQuotes = 'ReassignMyQuotes', ReassignOthersQuotes = 'ReassignOthersQuotes', RenegotiateMyQuotes = 'RenegotiateMyQuotes', RenegotiateOthersQuotes = 'RenegotiateOthersQuotes', + UpdateApprovalFlows = 'UpdateApprovalFlows', + UpdateApprovalRules = 'UpdateApprovalRules', UpdateAssociates = 'UpdateAssociates', UpdateBusinessUnitDetails = 'UpdateBusinessUnitDetails', UpdateMyCarts = 'UpdateMyCarts', UpdateMyOrders = 'UpdateMyOrders', UpdateMyQuoteRequests = 'UpdateMyQuoteRequests', + UpdateMyShoppingLists = 'UpdateMyShoppingLists', UpdateOthersCarts = 'UpdateOthersCarts', UpdateOthersOrders = 'UpdateOthersOrders', UpdateOthersQuoteRequests = 'UpdateOthersQuoteRequests', + UpdateOthersShoppingLists = 'UpdateOthersShoppingLists', UpdateParentUnit = 'UpdateParentUnit', ViewMyCarts = 'ViewMyCarts', ViewMyOrders = 'ViewMyOrders', ViewMyQuoteRequests = 'ViewMyQuoteRequests', ViewMyQuotes = 'ViewMyQuotes', + ViewMyShoppingLists = 'ViewMyShoppingLists', ViewOthersCarts = 'ViewOthersCarts', ViewOthersOrders = 'ViewOthersOrders', ViewOthersQuoteRequests = 'ViewOthersQuoteRequests', ViewOthersQuotes = 'ViewOthersQuotes', + ViewOthersShoppingLists = 'ViewOthersShoppingLists', } export type Permission = | 'AcceptMyQuotes' | 'AcceptOthersQuotes' | 'AddChildUnits' + | 'CreateApprovalRules' | 'CreateMyCarts' | 'CreateMyOrdersFromMyCarts' | 'CreateMyOrdersFromMyQuotes' | 'CreateMyQuoteRequestsFromMyCarts' + | 'CreateMyShoppingLists' | 'CreateOrdersFromOthersCarts' | 'CreateOrdersFromOthersQuotes' | 'CreateOthersCarts' + | 'CreateOthersShoppingLists' | 'CreateQuoteRequestsFromOthersCarts' | 'DeclineMyQuotes' | 'DeclineOthersQuotes' | 'DeleteMyCarts' + | 'DeleteMyShoppingLists' | 'DeleteOthersCarts' + | 'DeleteOthersShoppingLists' | 'ReassignMyQuotes' | 'ReassignOthersQuotes' | 'RenegotiateMyQuotes' | 'RenegotiateOthersQuotes' + | 'UpdateApprovalFlows' + | 'UpdateApprovalRules' | 'UpdateAssociates' | 'UpdateBusinessUnitDetails' | 'UpdateMyCarts' | 'UpdateMyOrders' | 'UpdateMyQuoteRequests' + | 'UpdateMyShoppingLists' | 'UpdateOthersCarts' | 'UpdateOthersOrders' | 'UpdateOthersQuoteRequests' + | 'UpdateOthersShoppingLists' | 'UpdateParentUnit' | 'ViewMyCarts' | 'ViewMyOrders' | 'ViewMyQuoteRequests' | 'ViewMyQuotes' + | 'ViewMyShoppingLists' | 'ViewOthersCarts' | 'ViewOthersOrders' | 'ViewOthersQuoteRequests' | 'ViewOthersQuotes' + | 'ViewOthersShoppingLists' | (string & {}) +/** + * The representation for prices embedded in [LineItems](ctp:api:type:LineItem) and in [ProductVariants](ctp:api:type:ProductVariant) when the [ProductPriceMode](ctp:api:type:ProductPriceModeEnum) is `Embedded`. + * For the `Standalone` ProductPriceMode refer to [StandalonePrice](ctp:api:type:StandalonePrice). + */ export interface Price { /** + * Unique identifier of this Price. + * * */ readonly id: string /** + * User-defined identifier of the Price. It is unique per [ProductVariant](ctp:api:type:ProductVariant). + * + * + */ + readonly key?: string + /** + * Money value of this Price. + * + * + */ + readonly value: TypedMoney + /** + * Country for which this Price is valid. + * + * + */ + readonly country?: string + /** + * [CustomerGroup](ctp:api:type:CustomerGroup) for which this Price is valid. + * + * + */ + readonly customerGroup?: CustomerGroupReference + /** + * `ProductDistribution` [Channel](ctp:api:type:Channel) for which this Price is valid. + * + * + */ + readonly channel?: ChannelReference + /** + * Date and time from which this Price is valid. + * + * + */ + readonly validFrom?: string + /** + * Date and time until this Price is valid. Prices that are no longer valid are not automatically removed, but they can be [removed](ctp:api:type:ProductRemovePriceAction) if necessary. + * + * + */ + readonly validUntil?: string + /** + * Is set if a [ProductDiscount](ctp:api:type:ProductDiscount) has been applied. + * If set, the API uses the DiscountedPrice value for the [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection). + * When a [relative discount](ctp:api:type:ProductDiscountValueRelative) has been applied and the fraction part of the DiscountedPrice `value` is 0.5, the `value` is rounded in favor of the customer with [half-down rounding](https://en.wikipedia.org/wiki/Rounding#Round_half_down). + * + * + */ + readonly discounted?: DiscountedPrice + /** + * Present if different Prices for certain [LineItem](ctp:api:type:LineItem) quantities have been specified. + * + * If `discounted` is present, the tiered Price is ignored for a Product Variant. + * + * + */ + readonly tiers?: PriceTier[] + /** + * Custom Fields defined for the Price. + * + * + */ + readonly custom?: CustomFields + /** + * [Recurrence Policy](ctp:api:type:RecurrencePolicy) for which this Price is valid. + * * */ - readonly value: Money + readonly recurrencePolicy?: RecurrencePolicyReference } export interface ProductSelectionSetting { /** + * Reference to a ProductSelection. * */ - readonly productSelection: Reference + readonly productSelection: ProductSelectionReference /** + * If `true`, all Products assigned to this Product Selection are part of the Store's assortment. * */ readonly active: boolean } +/** + * The [InventoryEntry](ctp:api:type:InventoryEntry) information of the Product Variant. If there is a supply [Channel](ctp:api:type:Channel) for the InventoryEntry, then `channels` is returned. If not, then `isOnStock`, `restockableInDays`, and `availableQuantity` are returned. + * + */ export interface ProductVariantAvailability { /** + * For each [InventoryEntry](ctp:api:type:InventoryEntry) with a supply Channel, an entry is added to `channels`. + * + * + */ + readonly channels?: ProductVariantChannelAvailabilityMap + /** + * Indicates whether a Product Variant is in stock. + * + * + */ + readonly isOnStock?: boolean + /** + * Number of days to restock a Product Variant once it is out of stock. + * * */ - readonly isOnStock: boolean + readonly restockableInDays?: number /** + * Number of items of the Product Variant that are in stock. + * * */ - readonly restockableInDays: number + readonly availableQuantity?: number /** + * Unique identifier of the [InventoryEntry](ctp:api:type:InventoryEntry). + * * */ - readonly availableQuantity: number + readonly id?: string /** + * Current version of the [InventoryEntry](ctp:api:type:InventoryEntry). + * * */ - readonly channels: ProductVariantChannelAvailabilityMap + readonly version?: number } export interface ProductVariantChannelAvailability { /** + * Indicates whether a Product Variant is in stock in a specified [Channel](ctp:api:type:Channel). + * + * + */ + readonly isOnStock?: boolean + /** + * Number of days to restock a Product Variant once it is out of stock in a specified [Channel](ctp:api:type:Channel). + * + * + */ + readonly restockableInDays?: number + /** + * Number of items of this Product Variant that are in stock in a specified [Channel](ctp:api:type:Channel). + * * */ - readonly isOnStock: boolean + readonly availableQuantity?: number /** + * Unique identifier of the [InventoryEntry](ctp:api:type:InventoryEntry). + * * */ - readonly restockableInDays: number + readonly id: string /** + * Current version of the [InventoryEntry](ctp:api:type:InventoryEntry). + * * */ - readonly availableQuantity: number + readonly version: number } +/** + * JSON object where the keys are supply [Channel](/projects/channels) `id`, and the values are [ProductVariantChannelAvailability](/projects/products#productvariantchannelavailability). + * + */ export interface ProductVariantChannelAvailabilityMap { [key: string]: ProductVariantChannelAvailability } +/** + * Polymorphic base type for Product Variant Selections. The actual type is determined by the `type` field. + * + */ export interface ProductVariantSelection { /** + * Determines whether the SKUs are to be included in, or excluded from, the Product Selection. * - */ - readonly type: ProductVariantSelectionTypeEnum - /** * */ - readonly skus: string[] + readonly type: ProductVariantSelectionTypeEnum } export enum ProductVariantSelectionTypeEnumValues { Exclusion = 'exclusion', + IncludeAllExcept = 'includeAllExcept', + IncludeOnly = 'includeOnly', Inclusion = 'inclusion', } export type ProductVariantSelectionTypeEnum = | 'exclusion' + | 'includeAllExcept' + | 'includeOnly' | 'inclusion' | (string & {}) +/** + * Predefined states tracking the status of the Quote Request in the negotiation process. + * + */ export enum QuoteRequestStateValues { Accepted = 'Accepted', Cancelled = 'Cancelled', @@ -933,12 +1464,16 @@ export type QuoteRequestState = | 'Rejected' | 'Submitted' | (string & {}) +/** + * Predefined states tracking the status of the Quote. + * + */ export enum QuoteStateValues { Accepted = 'Accepted', Declined = 'Declined', DeclinedForRenegotiation = 'DeclinedForRenegotiation', - Failed = 'Failed', Pending = 'Pending', + RenegotiationAddressed = 'RenegotiationAddressed', Withdrawn = 'Withdrawn', } @@ -946,22 +1481,54 @@ export type QuoteState = | 'Accepted' | 'Declined' | 'DeclinedForRenegotiation' - | 'Failed' | 'Pending' + | 'RenegotiationAddressed' | 'Withdrawn' | (string & {}) -export interface Reference { - /** +/** + * A Reference represents a loose reference to another resource in the same Project identified by its `id`. The `typeId` indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like [ChannelReference](ctp:api:type:ChannelReference). A referenced resource can be embedded through [Reference Expansion](/general-concepts#reference-expansion). The expanded reference is the value of an additional `obj` field then. + * + */ +export type Reference = + | CartDiscountReference + | CategoryReference + | ChannelReference + | CustomerGroupReference + | CustomerReference + | DiscountCodeReference + | PaymentReference + | ProductDiscountReference + | ProductReference + | ProductSelectionReference + | ProductTypeReference + | RecurrencePolicyReference + | ShippingMethodReference + | StateReference + | TaxCategoryReference + | TypeReference +export interface IReference { + /** + * Type of referenced resource. + * * */ - readonly id: string + readonly typeId: ReferenceTypeId /** + * Unique ID of the referenced resource. + * * */ - readonly typeId: ReferenceTypeId + readonly id: string } +/** + * Type of resource the value should reference. Supported resource type identifiers are: + * + */ export enum ReferenceTypeIdValues { + ApprovalFlow = 'approval-flow', + ApprovalRule = 'approval-rule', AssociateRole = 'associate-role', + AttributeGroup = 'attribute-group', BusinessUnit = 'business-unit', Cart = 'cart', CartDiscount = 'cart-discount', @@ -971,7 +1538,9 @@ export enum ReferenceTypeIdValues { CustomerEmailToken = 'customer-email-token', CustomerGroup = 'customer-group', CustomerPasswordToken = 'customer-password-token', + DirectDiscount = 'direct-discount', DiscountCode = 'discount-code', + DiscountGroup = 'discount-group', Extension = 'extension', InventoryEntry = 'inventory-entry', KeyValueDocument = 'key-value-document', @@ -981,14 +1550,19 @@ export enum ReferenceTypeIdValues { PaymentMethod = 'payment-method', Product = 'product', ProductDiscount = 'product-discount', + ProductPrice = 'product-price', ProductSelection = 'product-selection', + ProductTailoring = 'product-tailoring', ProductType = 'product-type', Quote = 'quote', QuoteRequest = 'quote-request', + RecurrencePolicy = 'recurrence-policy', + RecurringOrder = 'recurring-order', Review = 'review', ShippingMethod = 'shipping-method', ShoppingList = 'shopping-list', StagedQuote = 'staged-quote', + StandalonePrice = 'standalone-price', State = 'state', Store = 'store', Subscription = 'subscription', @@ -998,7 +1572,10 @@ export enum ReferenceTypeIdValues { } export type ReferenceTypeId = + | 'approval-flow' + | 'approval-rule' | 'associate-role' + | 'attribute-group' | 'business-unit' | 'cart' | 'cart-discount' @@ -1008,7 +1585,9 @@ export type ReferenceTypeId = | 'customer-email-token' | 'customer-group' | 'customer-password-token' + | 'direct-discount' | 'discount-code' + | 'discount-group' | 'extension' | 'inventory-entry' | 'key-value-document' @@ -1018,14 +1597,19 @@ export type ReferenceTypeId = | 'payment-method' | 'product' | 'product-discount' + | 'product-price' | 'product-selection' + | 'product-tailoring' | 'product-type' | 'quote' | 'quote-request' + | 'recurrence-policy' + | 'recurring-order' | 'review' | 'shipping-method' | 'shopping-list' | 'staged-quote' + | 'standalone-price' | 'state' | 'store' | 'subscription' @@ -1039,6 +1623,8 @@ export interface Reservation { */ readonly quantity: number /** + * A Reference represents a loose reference to another resource in the same Project identified by its `id`. The `typeId` indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like [ChannelReference](ctp:api:type:ChannelReference). A referenced resource can be embedded through [Reference Expansion](/general-concepts#reference-expansion). The expanded reference is the value of an additional `obj` field then. + * * */ readonly owner: Reference @@ -1055,37 +1641,60 @@ export interface ResourceIdentifier { /** * */ - readonly id: string + readonly id?: string /** * */ - readonly key: string + readonly key?: string /** + * Type of resource the value should reference. Supported resource type identifiers are: + * * */ readonly typeId: ReferenceTypeId } +export type _ResourceIdentifier = + | ResourceIdentifier + | BusinessUnitResourceIdentifier +/** + * Stores information about returns connected to an Order. + * + */ export interface ReturnInfo { /** + * Information on the Line Items or Custom Line Items returned. + * * */ readonly items: ReturnItem[] /** - * Identifies, which return tracking ID is connected to this particular return. + * User-defined identifier to track the return. + * * */ - readonly returnTrackingId: string + readonly returnTrackingId?: string /** + * Date and time (UTC) the return is initiated. + * * */ - readonly returnDate: string + readonly returnDate?: string } export interface ReturnItem { /** + * Unique identifier of the Return Item. + * * */ readonly id: string /** + * User-defined unique identifier of the Return Item. + * + */ + readonly key?: string + /** + * Number of Line Items or Custom Line Items returned. + * * */ readonly quantity: number @@ -1094,22 +1703,41 @@ export interface ReturnItem { */ readonly type: string /** + * User-defined description for the return. + * * */ - readonly comment: string + readonly comment?: string /** + * Shipment status of the Return Item. + * * */ readonly shipmentState: ReturnShipmentState /** + * Payment status of the Return Item: + * + * - `NonRefundable`, for items in the `Advised` [ReturnShipmentState](ctp:api:type:ReturnShipmentState) + * - `Initial`, for items in the `Returned` [ReturnShipmentState](ctp:api:type:ReturnShipmentState) + * * */ readonly paymentState: ReturnPaymentState /** + * Custom Fields of the Return Item. + * + * + */ + readonly custom?: CustomFields + /** + * Date and time (UTC) the Return Item was last updated. + * * */ readonly lastModifiedAt: string /** + * Date and time (UTC) the Return Item was initially created. + * * */ readonly createdAt: string @@ -1142,7 +1770,8 @@ export type ReturnShipmentState = | (string & {}) export interface ReviewRatingStatistics { /** - * Average rating of one target This number is rounded with 5 decimals. + * Average rating of one target + * This number is rounded with 5 decimals. * */ readonly averageRating: number @@ -1162,12 +1791,18 @@ export interface ReviewRatingStatistics { */ readonly count: number /** - * The full distribution of the ratings. The keys are the different ratings and the values are the count of reviews having this rating. Only the used ratings appear in this object. + * Full distribution of the ratings. + * The keys are the different ratings and the values are the count of reviews having this rating. + * Only the used ratings appear in this object. * */ readonly ratingsDistribution: any } -export enum RoundingModeValues { +/** + * Determines how monetary values are rounded. + * + */ +export enum RoundingModeValues { HalfDown = 'HalfDown', HalfEven = 'HalfEven', HalfUp = 'HalfUp', @@ -1176,26 +1811,45 @@ export enum RoundingModeValues { export type RoundingMode = 'HalfDown' | 'HalfEven' | 'HalfUp' | (string & {}) export interface SearchKeyword { /** + * Text to return in the [SuggestionResult](ctp:api:type:SuggestionResult). + * * */ readonly text: string /** + * If no tokenizer is defined, the `text` is used as a single token. + * * */ - readonly suggestTokenizer: SuggestTokenizer + readonly suggestTokenizer?: SuggestTokenizer } +/** + * Search keywords are JSON objects primarily used by [Search Term Suggestions](/projects/search-term-suggestions), but are also considered for a [full text search](/projects/product-projection-search#full-text-search) in the Product Projection Search API. + * The keys are of type [Locale](ctp:api:type:Locale), and the values are an array of [SearchKeyword](ctp:api:type:SearchKeyword). + * + */ export interface SearchKeywords { [key: string]: SearchKeyword[] } +/** + * Defines which matching items are to be discounted. + * + */ export enum SelectionModeValues { Cheapest = 'Cheapest', MostExpensive = 'MostExpensive', } export type SelectionMode = 'Cheapest' | 'MostExpensive' | (string & {}) +/** + * Indicates the shipment status of the Order. + * + */ export enum ShipmentStateValues { Backorder = 'Backorder', + Canceled = 'Canceled', Delayed = 'Delayed', + Delivered = 'Delivered', Partial = 'Partial', Pending = 'Pending', Ready = 'Ready', @@ -1204,7 +1858,9 @@ export enum ShipmentStateValues { export type ShipmentState = | 'Backorder' + | 'Canceled' | 'Delayed' + | 'Delivered' | 'Partial' | 'Pending' | 'Ready' @@ -1212,19 +1868,25 @@ export type ShipmentState = | (string & {}) export interface ShippingRate { /** + * Currency amount of the ShippingRate. * */ - readonly price: Money + readonly price: CentPrecisionMoney /** + * [Free shipping](/../api/shipping-delivery-overview#free-shipping) is applied if the sum of the (Custom) Line Item Prices reaches the specified value. * */ - readonly freeAbove: Money + readonly freeAbove?: CentPrecisionMoney /** - * Only appears in response to requests for ShippingMethods by Cart or location to mark this shipping rate as one that matches the Cart or location. + * `true` if the ShippingRate matches given [Cart](ctp:api:type:Cart) or [Location](ctp:api:type:Location). + * Only appears in response to requests for [Get ShippingMethods for a Cart](ctp:api:endpoint:/{projectKey}/shipping-methods/matching-cart:GET) or + * [Get ShippingMethods for a Location](ctp:api:endpoint:/{projectKey}/shipping-methods/matching-location:GET). + * * */ - readonly isMatching: boolean + readonly isMatching?: boolean /** + * Price tiers for the ShippingRate. * */ readonly tiers: ShippingRatePriceTier[] @@ -1246,12 +1908,20 @@ export type ShippingRateTierType = | 'CartScore' | 'CartValue' | (string & {}) +/** + * Describes how the Cart Discount interacts with other Discounts. + * + */ export enum StackingModeValues { Stacking = 'Stacking', StopAfterThisDiscount = 'StopAfterThisDiscount', } export type StackingMode = 'Stacking' | 'StopAfterThisDiscount' | (string & {}) +/** + * Predefined states tracking the status of the Staged Quote. + * + */ export enum StagedQuoteStateValues { Closed = 'Closed', InProgress = 'InProgress', @@ -1307,8 +1977,13 @@ export interface StoreCountry { */ readonly code: string } +/** + * It is used to calculate the [taxPortions](/../api/projects/carts#taxedprice) field in a Cart or Order. + */ export interface SubRate { /** + * Name of the SubRate. + * * */ readonly name: string @@ -1323,21 +1998,34 @@ export interface SuggestTokenizer { */ readonly type: string } +/** + * Contains synchronization activity information of the Order (like export or import). + * + */ export interface SyncInfo { /** + * Connection to a synchronization destination. + * * */ - readonly channel: Reference + readonly channel: ChannelReference /** - * Can be used to reference an external order instance, file etc. + * Identifier of an external order instance, file, or other resource. + * * */ - readonly externalId: string + readonly externalId?: string /** + * Date and time (UTC) the information was synced. + * * */ readonly syncedAt: string } +/** + * Determines in which [Tax calculation mode](/carts-orders-overview#tax-calculation-mode) taxed prices are calculated. + * + */ export enum TaxCalculationModeValues { LineItemLevel = 'LineItemLevel', UnitPriceLevel = 'UnitPriceLevel', @@ -1347,6 +2035,10 @@ export type TaxCalculationMode = | 'LineItemLevel' | 'UnitPriceLevel' | (string & {}) +/** + * Indicates how taxes are set on the Cart. + * + */ export enum TaxModeValues { Disabled = 'Disabled', External = 'External', @@ -1360,123 +2052,215 @@ export type TaxMode = | 'ExternalAmount' | 'Platform' | (string & {}) -/** - * Shape of the value for `addTaxRate` and `removeTaxRate` actions - */ export interface TaxRate { /** - * The ID is always set if the tax rate is part of a TaxCategory. The external tax rates in a Cart do not contain an `id`. + * Present if the TaxRate is part of a [TaxCategory](ctp:api:type:TaxCategory). + * Absent for external TaxRates in [LineItem](ctp:api:type:LineItem), [CustomLineItem](ctp:api:type:CustomLineItem), and [ShippingInfo](ctp:api:type:ShippingInfo). + * + * + */ + readonly id?: string + /** + * User-defined unique identifier of the TaxRate. + * Present when set using [TaxRateDraft](ctp:api:type:TaxRateDraft). Not available for external TaxRates created using [ExternalTaxRateDraft](ctp:api:type:ExternalTaxRateDraft). + * * */ - readonly id: string + readonly key?: string /** + * Name of the TaxRate. + * * */ readonly name: string /** - * Percentage in the range of [0..1]. The sum of the amounts of all `subRates`, if there are any. + * Tax rate. If subrates are used, the amount is the sum of all rates in `subRates`. + * * */ readonly amount: number /** + * If `true`, tax is included in [Embedded Prices](ctp:api:type:Price) or [Standalone Prices](ctp:api:type:StandalonePrice), and the `taxedPrice` is present on [LineItems](ctp:api:type:LineItem). In this case, the `totalNet` price on [TaxedPrice](ctp:api:type:TaxedPrice) includes the TaxRate. + * * */ readonly includedInPrice: boolean /** - * Two-digit country code as per [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). + * Country in which the tax rate is applied in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * * */ readonly country: string /** - * The state in the country + * State within the country, such as Texas in the United States. + * * */ - readonly state: string + readonly state?: string /** + * Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate `amount`. + * These subrates are used to calculate the `taxPortions` field of a [Cart](ctp:api:type:Cart) or [Order](ctp:api:type:Order) and the `taxedPrice` field of [LineItems](ctp:api:type:LineItem), [CustomLineItems](ctp:api:type:CustomLineItem), and [ShippingInfos](ctp:api:type:ShippingInfo). + * * */ - readonly subRates: SubRate[] + readonly subRates?: SubRate[] } export interface TaxedItemPrice { /** + * Total net amount of the Line Item or Custom Line Item. + * + * + */ + readonly totalNet: CentPrecisionMoney + /** + * Total gross amount of the Line Item or Custom Line Item. + * + * + */ + readonly totalGross: CentPrecisionMoney + /** + * Taxable portions added to the total net price. + * + * Calculated from the [TaxRates](ctp:api:type:TaxRate). + * * */ - readonly totalNet: Money + readonly taxPortions: TaxPortion[] /** + * Total tax applicable for the Line Item or Custom Line Item. + * Automatically calculated as the difference between the `totalGross` and `totalNet` values. + * * */ - readonly totalGross: Money + readonly totalTax?: CentPrecisionMoney } export interface TaxedPrice { /** - * Total net price of the Order. + * Total net price of the Cart or Order. + * + * + */ + readonly totalNet: CentPrecisionMoney + /** + * Total gross price of the Cart or Order. + * + * + */ + readonly totalGross: CentPrecisionMoney + /** + * Taxable portions added to the total net price. + * + * Calculated from the [TaxRates](ctp:api:type:TaxRate). + * * */ - readonly totalNet: Money + readonly taxPortions: TaxPortion[] /** - * Total gross price of the Order. + * Total tax applicable for the Cart or Order. + * + * Automatically calculated as the difference between the `totalGross` and `totalNet` values. + * * */ - readonly totalGross: Money + readonly totalTax?: CentPrecisionMoney } +/** + * A text input hint is a string with one of the following values: + * + */ export enum TextInputHintValues { MultiLine = 'MultiLine', SingleLine = 'SingleLine', } export type TextInputHint = 'MultiLine' | 'SingleLine' | (string & {}) +/** + * TextLineItems are Line Items that use text values instead of references to Products. + * + */ export interface TextLineItem { /** + * Date and time (UTC) the TextLineItem was added to the [ShoppingList](ctp:api:type:ShoppingList). + * * */ readonly addedAt: string /** + * Custom Fields of the TextLineItem. + * * */ - readonly custom: CustomFields + readonly custom?: CustomFields /** + * Description of the TextLineItem. + * * */ - readonly description: LocalizedString + readonly description?: LocalizedString /** + * Unique identifier of the TextLineItem. * */ readonly id: string /** + * User-defined identifier of the TextLineItem. It is unique per [ShoppingList](ctp:api:type:ShoppingList). + * + */ + readonly key?: string + /** + * Name of the TextLineItem. + * * */ readonly name: LocalizedString /** + * Number of entries in the TextLineItem. + * * */ readonly quantity: number } +/** + * Information that helps track a Parcel. + * + */ export interface TrackingData { /** - * The ID to track one parcel. + * Identifier to track the Parcel. + * * */ - readonly trackingId: string + readonly trackingId?: string /** - * The carrier that delivers the parcel. + * Name of the carrier that delivers the Parcel. + * * */ - readonly carrier: string + readonly carrier?: string /** + * Name of the provider that serves as facade to several carriers. + * * */ - readonly provider: string + readonly provider?: string /** + * Transaction identifier with the `provider`. + * * */ - readonly providerTransaction: string + readonly providerTransaction?: string /** - * Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true). + * - If `true`, the Parcel is being returned. + * - If `false`, the Parcel is being delivered to the customer. + * * */ - readonly isReturn: boolean + readonly isReturn?: boolean } +/** + * Represents a financial transaction typically created as a result of a notification from the payment service. + * + */ export interface Transaction { /** * Unique identifier of the Transaction. @@ -1484,28 +2268,42 @@ export interface Transaction { */ readonly id: string /** - * Time at which the transaction took place. + * Date and time (UTC) the Transaction took place. * */ - readonly timestamp: string + readonly timestamp?: string /** + * Type of the Transaction. For example, `Authorization`. * */ readonly type: TransactionType /** + * Money value of the Transaction. + * * */ - readonly amount: Money + readonly amount: CentPrecisionMoney /** - * Identifier used by the interface that manages the transaction (usually the PSP). If a matching interaction was logged in the `interfaceInteractions` array, the corresponding interaction should be findable with this ID. + * Identifier used by the interface that manages the Transaction (usually the PSP). + * If a matching interaction was logged in the `interfaceInteractions` array, the corresponding interaction can be found with this ID. * */ - readonly interactionId: string + readonly interactionId?: string /** + * State of the Transaction. * */ readonly state: TransactionState + /** + * Custom Fields defined for the Transaction. + * + */ + readonly custom?: CustomFields } +/** + * Transactions can be in one of the following States: + * + */ export enum TransactionStateValues { Failure = 'Failure', Initial = 'Initial', @@ -1548,3 +2346,1407 @@ export interface Variant { */ readonly key: string } +export interface Attribute { + /** + * Name of the Attribute. + * + * + */ + readonly name: string + /** + * The [AttributeType](ctp:api:type:AttributeType) determines the format of the Attribute `value` to be provided: + * + * - For [Enum Type](ctp:api:type:AttributeEnumType) and [Localized Enum Type](ctp:api:type:AttributeLocalizedEnumType), + * use the `key` of the [Plain Enum Value](ctp:api:type:AttributePlainEnumValue) or [Localized Enum Value](ctp:api:type:AttributeLocalizedEnumValue) objects, + * or the complete objects as `value`. + * - For [Localizable Text Type](ctp:api:type:AttributeLocalizableTextType), use the [LocalizedString](ctp:api:type:LocalizedString) object as `value`. + * - For [Money Type](ctp:api:type:AttributeMoneyType) Attributes, use the [Money](ctp:api:type:Money) object as `value`. + * - For [Set Type](ctp:api:type:AttributeSetType) Attributes, use the entire `set` object as `value`. + * - For [Nested Type](ctp:api:type:AttributeNestedType) Attributes, use the list of values of all Attributes of the nested Product as `value`. + * - For [Reference Type](ctp:api:type:AttributeReferenceType) Attributes, use the [Reference](ctp:api:type:Reference) object as `value`. + * + * + */ + readonly value: any +} +/** + * Determines whether a Business Unit can inherit [Approval Rules](/projects/approval-rules) from a parent. Only Business Units of type `Division` can use `ExplicitAndFromParent`. + * + */ +export enum BusinessUnitApprovalRuleModeValues { + Explicit = 'Explicit', + ExplicitAndFromParent = 'ExplicitAndFromParent', +} + +export type BusinessUnitApprovalRuleMode = + | 'Explicit' + | 'ExplicitAndFromParent' + | (string & {}) +/** + * [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to a [BusinessUnit](ctp:api:type:BusinessUnit). Either `id` or `key` is required. If both are set, an [InvalidJsonInput](/../api/errors#invalidjsoninput) error is returned. + * + */ +export interface BusinessUnitResourceIdentifier extends ResourceIdentifier { + /** + * Unique identifier of the referenced [BusinessUnit](ctp:api:type:BusinessUnit). Required if `key` is absent. + * + * + */ + readonly id?: string + /** + * Unique key of the referenced [BusinessUnit](ctp:api:type:BusinessUnit). Required if `id` is absent. + * + * + */ + readonly key?: string +} +/** + * The type of the Business Unit indicating its position in a hierarchy. + * + */ +export enum BusinessUnitTypeValues { + Company = 'Company', + Division = 'Division', +} + +export type BusinessUnitType = 'Company' | 'Division' | (string & {}) +/** + * Defines an allowed value of a [CustomFieldEnumType](ctp:api:type:CustomFieldEnumType) field. + * + */ +export interface CustomFieldEnumValue { + /** + * Key of the value used as a programmatic identifier. + * + * + */ + readonly key: string + /** + * Descriptive label of the value. + * + * + */ + readonly label: string +} +/** + * Defines an allowed value of a [CustomFieldLocalizedEnumType](ctp:api:type:CustomFieldLocalizedEnumType) field. + * + */ +export interface CustomFieldLocalizedEnumValue { + /** + * Key of the value used as a programmatic identifier. + * + * + */ + readonly key: string + /** + * Descriptive localized label of the value. + * + * + */ + readonly label: LocalizedString +} +export interface CustomerGroupAssignment { + /** + * Reference to a Customer Group. + * + * + */ + readonly customerGroup: CustomerGroupReference +} +export interface DiscountOnTotalPrice { + /** + * Money value of the discount on the total price of the Cart or Order. + * + * + */ + readonly discountedAmount: TypedMoney + /** + * Discounts that impact the total price of the Cart or Order. + * + * + */ + readonly includedDiscounts: DiscountedTotalPricePortion[] + /** + * Money value of the discount on the total net price of the Cart or Order. + * + * The same percentage of discount applies as on the `discountedAmount`. + * Present only when `taxedPrice` of the Cart or Order exists. + * + * + */ + readonly discountedNetAmount?: TypedMoney + /** + * Money value of the discount on the total gross price of the Cart or Order. + * + * The same percentage of discount applies as on the `discountedAmount`. + * Present only when `taxedPrice` of the Cart or Order exists. + * + * + */ + readonly discountedGrossAmount?: TypedMoney +} +export interface DiscountedTotalPricePortion { + /** + * A [CartDiscountReference](ctp:api:type:CartDiscountReference) or [DirectDiscountReference](ctp:api:type:DirectDiscountReference) to the discount applied on the Cart `totalPrice`. + * + * + */ + readonly discount: Reference + /** + * Money value of the discount. + * + * + */ + readonly discountedAmount: TypedMoney +} +/** + * This mode determines the type of Prices used for [price selection](/../api/pricing-and-discounts-overview#price-selection) by Line Items and Products. + * For more information about the difference between the Prices, see [Pricing](/../api/pricing-and-discounts-overview). + * + */ +export enum ProductPriceModeEnumValues { + Embedded = 'Embedded', + Standalone = 'Standalone', +} + +export type ProductPriceModeEnum = 'Embedded' | 'Standalone' | (string & {}) +/** + * Only Product Variants with the explicitly listed SKUs are part of a Product Selection with `IndividualExclusion` [ProductSelectionMode](ctp:api:type:ProductSelectionMode). + * + */ +export interface ProductVariantExclusion { + /** + * Non-empty array of SKUs representing Product Variants to be included in the Product Selection with `IndividualExclusion` [ProductSelectionMode](ctp:api:type:ProductSelectionMode). + * + * + */ + readonly skus: string[] +} +export interface Shipping { + /** + * User-defined unique identifier of the Shipping in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + * + * + */ + readonly shippingKey: string + /** + * Automatically set when the [Shipping Method is added](ctp:api:type:CartAddShippingMethodAction). + * + * + */ + readonly shippingInfo: ShippingInfo + /** + * Determines the shipping rates and Tax Rates of associated Line Items. + * + * + */ + readonly shippingAddress: Address + /** + * Used as an input to select a [ShippingRatePriceTier](ctp:api:type:ShippingRatePriceTier). + * The data type of this field depends on the `shippingRateInputType.type` configured in the [Project](ctp:api:type:Project): + * + * - If `CartClassification`, it is [ClassificationShippingRateInput](ctp:api:type:ClassificationShippingRateInput). + * - If `CartScore`, it is [ScoreShippingRateInput](ctp:api:type:ScoreShippingRateInput). + * - If `CartValue`, it cannot be used. + * + * + */ + readonly shippingRateInput?: ShippingRateInput + /** + * Custom Fields of Shipping with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + * + * + */ + readonly shippingCustomFields?: CustomFields +} +export interface ShippingInfo { + /** + * Name of the Shipping Method. + * + * + */ + readonly shippingMethodName: string + /** + * 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. + * + * + */ + readonly price: CentPrecisionMoney + /** + * Used to determine the price. + * + * + */ + readonly shippingRate: ShippingRate + /** + * Automatically set after the `taxRate` is set. + * + * + */ + readonly taxedPrice?: TaxedItemPrice + /** + * Automatically set in the `Platform` [TaxMode](ctp:api:type:TaxMode) after the [shipping address is set](ctp:api:type:CartSetShippingAddressAction). + * + * For the `External` [TaxMode](ctp:api:type:TaxMode) the Tax Rate must be set explicitly with the [ExternalTaxRateDraft](ctp:api:type:ExternalTaxRateDraft). + * + * + */ + readonly taxRate?: TaxRate + /** + * Used to select a Tax Rate when a Cart has the `Platform` [TaxMode](ctp:api:type:TaxMode). + * + * + */ + readonly taxCategory?: TaxCategoryReference + /** + * Not set if a custom Shipping Method is used. + * + * + */ + readonly shippingMethod?: ShippingMethodReference + /** + * Information on how items are delivered to customers. + * + * + */ + readonly deliveries?: Delivery[] + /** + * Discounted price of the Shipping Method. + * + * + */ + readonly discountedPrice?: DiscountedLineItemPrice + /** + * Indicates whether the [ShippingMethod](ctp:api:type:ShippingMethod) referenced in this ShippingInfo is allowed for the Cart. + * + * + */ + readonly shippingMethodState: ShippingMethodState +} +export interface ShippingRateInput { + /** + * + */ + readonly type: string +} +/** + * ShoppingListLineItems are Line Items that contain references to [ProductVariants](ctp:api:type:ProductVariant) in a [Product](ctp:api:type:Product). + * + * In addition to standard [Reference Expansion](/general-concepts#reference-expansion), a ShoppingListLineItem offers expansion on `productSlug` and `variant`, defined with the query parameter `expand`. + * + */ +export interface ShoppingListLineItem { + /** + * Date and time (UTC) the ShoppingListLineItem was added to the ShoppingList. + * + * + */ + readonly addedAt: string + /** + * Custom Fields of the ShoppingListLineItem. + * + * + */ + readonly custom?: CustomFields + /** + * If the Product or Product Variant is deleted, `deactivatedAt` is the date and time (UTC) of deletion. + * + * This data is updated in an [eventual consistent manner](/general-concepts#eventual-consistency) when the Product Variant cannot be ordered anymore. + * + * + */ + readonly deactivatedAt?: string + /** + * Unique identifier of the ShoppingListLineItem. + * + */ + readonly id: string + /** + * User-defined identifier of the ShoppingListLineItem. It is unique per [ShoppingList](ctp:api:type:ShoppingList). + * + */ + readonly key?: string + /** + * Name of the Product. + * + * This data is updated in an [eventual consistent manner](/general-concepts#eventual-consistency) when the Product's name changes. + * + * + */ + readonly name: LocalizedString + /** + * Unique identifier of a [Product](ctp:api:type:Product). + * + * + */ + readonly productId: string + /** + * The Product Type defining the Attributes of the [Product](ctp:api:type:Product). + * + * + */ + readonly productType: ProductTypeReference + /** + * Whether the related [Product](ctp:api:type:Product) is published or not. + * + * This data is updated in an [eventual consistent manner](/general-concepts#eventual-consistency) when the Product's published status changes. + * + * + */ + readonly published: boolean + /** + * Number of Products in the ShoppingListLineItem. + * + * + */ + readonly quantity: number + /** + * `id` of the [ProductVariant](ctp:api:type:ProductVariant) the ShoppingListLineItem refers to. If not set, the ShoppingListLineItem refers to the Master Variant. + * + * + */ + readonly variantId?: number + /** + * Data of the [ProductVariant](ctp:api:type:ProductVariant). This data includes all the Product Attributes and Variant Attributes to ensure the full Attribute context of the Product Variant. + * + * Returned when expanded using `expand=lineItems[*].variant`. You cannot expand only a single element of the array. + * + * + */ + readonly variant?: ProductVariant + /** + * Slug of the current [ProductData](ctp:api:type:ProductData). + * + * Returned when expanded using `expand=lineItems[*].productSlug`. You cannot expand only a single element of the array. + * + * + */ + readonly productSlug?: LocalizedString +} +/** + * Provides a visual representation type for this field. It is only relevant for string-based field types like [CustomFieldStringType](ctp:api:type:CustomFieldStringType) and [CustomFieldLocalizedStringType](ctp:api:type:CustomFieldLocalizedStringType). Following values are supported: + * + */ +export enum TypeTextInputHintValues { + MultiLine = 'MultiLine', + SingleLine = 'SingleLine', +} + +export type TypeTextInputHint = 'MultiLine' | 'SingleLine' | (string & {}) +/** + * Base polymorphic read-only money type that stores currency in cent precision or high precision, that is in sub-cents. + * + */ +export type TypedMoney = CentPrecisionMoney +export interface ITypedMoney { + /** + * Amount in the smallest indivisible unit of a currency, such as: + * + * * Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as `500`). + * * The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as `5`). + * + * + */ + readonly centAmount: number + /** + * Currency code compliant to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + * + * + */ + readonly currencyCode: string + /** + * Type of money used. + * + * + */ + readonly type: MoneyType + /** + * Number of digits after the decimal separator. + * + * * For [CentPrecisionMoney](ctp:api:type:CentPrecisionMoney), it is equal to the default number of fraction digits for a currency. + * * For [HighPrecisionMoney](ctp:api:type:HighPrecisionMoney), it is greater than the default number of fraction digits for a currency. + * + * + */ + readonly fractionDigits: number +} +/** + * Object that stores money in cent amounts of a specific currency. + */ +export interface CentPrecisionMoney extends ITypedMoney { + readonly type: 'centPrecision' + /** + * Amount in the smallest indivisible unit of a currency, such as: + * + * * Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as `500`). + * * The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as `5`). + * + * + */ + readonly centAmount: number + /** + * Currency code compliant to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + * + * + */ + readonly currencyCode: string + /** + * The number of default fraction digits for the given currency, like `2` for EUR or `0` for JPY. + * + * + */ + readonly fractionDigits: number +} +export interface DiscountedPrice { + /** + * Money value of the discounted price. + * + * + */ + readonly value: TypedMoney + /** + * [ProductDiscount](ctp:api:type:ProductDiscount) related to the discounted price. + * + * + */ + readonly discount: ProductDiscountReference +} +/** + * Determines whether the selected [ShippingMethod](ctp:api:type:ShippingMethod) is allowed for the Cart. For more information, see [Predicates](/shipping-delivery-overview#predicates). + * + */ +export enum ShippingMethodStateValues { + DoesNotMatchCart = 'DoesNotMatchCart', + MatchesCart = 'MatchesCart', +} + +export type ShippingMethodState = + | 'DoesNotMatchCart' + | 'MatchesCart' + | (string & {}) +/** + * Roles defining how an [Associate](ctp:api:type:Associate) can interact with a Business Unit. + * + */ +export enum AssociateRoleDeprecatedValues { + Admin = 'Admin', + Buyer = 'Buyer', +} + +export type AssociateRoleDeprecated = 'Admin' | 'Buyer' | (string & {}) +/** + * [KeyReference](ctp:api:type:KeyReference) to an [AssociateRole](ctp:api:type:AssociateRole). + * + */ +export interface AssociateRoleKeyReference extends IKeyReference { + readonly typeId: 'associate-role' + /** + * Unique and immutable key of the referenced [AssociateRole](ctp:api:type:AssociateRole). + * + * + */ + readonly key: string +} +export enum AttributeLevelEnumValues { + Product = 'Product', + Variant = 'Variant', +} + +export type AttributeLevelEnum = 'Product' | 'Variant' | (string & {}) +/** + * Polymorphic base type that represents a postal address and contact details. + * Depending on the read or write action, it can be either [Address](ctp:api:type:Address) or [AddressDraft](ctp:api:type:AddressDraft) that + * only differ in the data type for the optional `custom` field. + * + */ +export interface BaseAddress { + /** + * Unique identifier of the Address. + * + * It is not recommended to set it manually since the API overwrites this ID when creating an Address for a [Customer](ctp:api:type:Customer). + * Use `key` instead and omit this field from the request to let the API generate the ID for the Address. + * + * + */ + readonly id?: string + /** + * User-defined identifier of the Address that must be unique when multiple addresses are referenced in [BusinessUnits](ctp:api:type:BusinessUnit), [Customers](ctp:api:type:Customer), and `itemShippingAddresses` (LineItem-specific addresses) of a [Cart](ctp:api:type:Cart), [Order](ctp:api:type:Order), [QuoteRequest](ctp:api:type:QuoteRequest), or [Quote](ctp:api:type:Quote). + * + * + */ + readonly key?: string + /** + * Name of the country. + * + * + */ + readonly country: string + /** + * Title of the contact, for example 'Dr.' + * + * + */ + readonly title?: string + /** + * Salutation of the contact, for example 'Mr.' or 'Ms.' + * + * + */ + readonly salutation?: string + /** + * Given name (first name) of the contact. + * + * + */ + readonly firstName?: string + /** + * Family name (last name) of the contact. + * + * + */ + readonly lastName?: string + /** + * Name of the street. + * + * + */ + readonly streetName?: string + /** + * Street number. + * + * + */ + readonly streetNumber?: string + /** + * Further information on the street address. + * + * + */ + readonly additionalStreetInfo?: string + /** + * Postal code. + * + * + */ + readonly postalCode?: string + /** + * Name of the city. + * + * + */ + readonly city?: string + /** + * Name of the region. + * + * + */ + readonly region?: string + /** + * Name of the state, for example, Colorado. + * + * + */ + readonly state?: string + /** + * Name of the company. + * + * + */ + readonly company?: string + /** + * Name of the department. + * + * + */ + readonly department?: string + /** + * Number or name of the building. + * + * + */ + readonly building?: string + /** + * Number or name of the apartment. + * + * + */ + readonly apartment?: string + /** + * Post office box number. + * + * + */ + readonly pOBox?: string + /** + * Phone number of the contact. + * + * + */ + readonly phone?: string + /** + * Mobile phone number of the contact. + * + * + */ + readonly mobile?: string + /** + * Email address of the contact. + * + * + */ + readonly email?: string + /** + * Fax number of the contact. + * + * + */ + readonly fax?: string + /** + * Further information on the Address. + * + * + */ + readonly additionalAddressInfo?: string + /** + * ID for the contact used in an external system. + * + * + */ + readonly externalId?: string +} +export type _BaseAddress = BaseAddress | Address +/** + * Address type returned by read methods. + * Optionally, the `custom` field can be present in addition to the fields of a [BaseAddress](ctp:api:type:BaseAddress). + * + */ +export interface Address extends BaseAddress { + /** + * Custom Fields defined for the Address. + * + */ + readonly custom?: CustomFields +} +/** + * [KeyReference](ctp:api:type:KeyReference) to a [BusinessUnit](ctp:api:type:BusinessUnit). + * + */ +export interface BusinessUnitKeyReference extends IKeyReference { + readonly typeId: 'business-unit' + /** + * Unique and immutable key of the referenced [BusinessUnit](ctp:api:type:BusinessUnit). + * + * + */ + readonly key: string +} +/** + * [Reference](ctp:api:type:Reference) to a [CartDiscount](ctp:api:type:CartDiscount). + * + */ +export interface CartDiscountReference extends IReference { + readonly typeId: 'cart-discount' + /** + * Unique identifier of the referenced [CartDiscount](ctp:api:type:CartDiscount). + * + * + */ + readonly id: string +} +export interface CartDiscountTarget { + /** + * + */ + readonly type: string +} +export interface CartDiscountValue { + /** + * + */ + readonly type: string +} +/** + * [Reference](ctp:api:type:Reference) to a [Category](ctp:api:type:Category). + * + */ +export interface CategoryReference extends IReference { + readonly typeId: 'category' + /** + * Unique identifier of the referenced [Category](ctp:api:type:Category). + * + * + */ + readonly id: string +} +/** + * [Reference](ctp:api:type:Reference) to a [Channel](ctp:api:type:Channel). + * + */ +export interface ChannelReference extends IReference { + readonly typeId: 'channel' + /** + * Unique identifier of the referenced [Channel](ctp:api:type:Channel). + * + * + */ + readonly id: string +} +/** + * Determines if Cart Discounts can be applied to a Custom Line Item in the Cart. + * + */ +export enum CustomLineItemPriceModeValues { + External = 'External', + Standard = 'Standard', +} + +export type CustomLineItemPriceMode = 'External' | 'Standard' | (string & {}) +/** + * Information about recurring orders and frequencies. + * + */ +export interface CustomLineItemRecurrenceInfo { + /** + * [Reference](ctp:api:type:Reference) to a RecurrencePolicy. + * + * + */ + readonly recurrencePolicy: RecurrencePolicyReference +} +/** + * [Reference](ctp:api:type:Reference) to a [CustomerGroup](ctp:api:type:CustomerGroup). + * + */ +export interface CustomerGroupReference extends IReference { + readonly typeId: 'customer-group' + /** + * Unique identifier of the referenced [CustomerGroup](ctp:api:type:CustomerGroup). + * + * + */ + readonly id: string +} +/** + * [Reference](ctp:api:type:Reference) to a [Customer](ctp:api:type:Customer). + * + */ +export interface CustomerReference extends IReference { + readonly typeId: 'customer' + /** + * Unique identifier of the referenced [Customer](ctp:api:type:Customer). + * + * + */ + readonly id: string +} +/** + * [Reference](ctp:api:type:Reference) to a [DiscountCode](ctp:api:type:DiscountCode). + * + */ +export interface DiscountCodeReference extends IReference { + readonly typeId: 'discount-code' + /** + * Unique identifier of the referenced [DiscountCode](ctp:api:type:DiscountCode). + * + * + */ + readonly id: string +} +export interface FieldContainer { + [key: string]: any +} +/** + * GeoJSON Geometry represents a [Geometry Object](https://datatracker.ietf.org/doc/html/rfc7946#section-3.1) as defined in the GeoJSON standard. + * + */ +export type GeoJson = GeoLocation +export interface IGeoJson { + /** + * + */ + readonly type: string +} +export interface GeoLocation extends IGeoJson { + readonly type: 'Point' + /** + * + */ + readonly coordinates: number[] +} +/** + * Indicates how Line Items in a Cart are tracked. + * + */ +export enum InventoryModeValues { + None = 'None', + ReserveOnOrder = 'ReserveOnOrder', + TrackOnly = 'TrackOnly', +} + +export type InventoryMode = + | 'None' + | 'ReserveOnOrder' + | 'TrackOnly' + | (string & {}) +/** + * Indicates how a Line Item was added to a Cart. + * + */ +export enum LineItemModeValues { + GiftLineItem = 'GiftLineItem', + Standard = 'Standard', +} + +export type LineItemMode = 'GiftLineItem' | 'Standard' | (string & {}) +/** + * This mode indicates how the price is set for the Line Item. + * + */ +export enum LineItemPriceModeValues { + ExternalPrice = 'ExternalPrice', + ExternalTotal = 'ExternalTotal', + Platform = 'Platform', +} + +export type LineItemPriceMode = + | 'ExternalPrice' + | 'ExternalTotal' + | 'Platform' + | (string & {}) +/** + * Information about recurring orders and frequencies. + * + */ +export interface LineItemRecurrenceInfo { + /** + * [Reference](ctp:api:type:Reference) to a RecurrencePolicy. + * + * + */ + readonly recurrencePolicy: RecurrencePolicyReference + /** + * Indicates how the price of a line item will be selected during order creation. + * + * + */ + readonly priceSelectionMode: PriceSelectionMode +} +export interface MethodTaxRate { + /** + * User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + * + * + */ + readonly shippingMethodKey: string + /** + * Tax Rate for the Shipping Method. + * + * + */ + readonly taxRate?: TaxRate +} +export interface MethodTaxedPrice { + /** + * User-defined unique identifier of the [Shipping Method](ctp:api:type:ShippingMethod) in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). + * + * + */ + readonly shippingMethodKey: string + /** + * Total taxed price based on the quantity of the Line Item or Custom Line Item assigned to the Shipping Method identified by `shippingMethodKey`. + * + * + */ + readonly taxedPrice?: TaxedItemPrice +} +/** + * [Reference](ctp:api:type:Reference) to a [Payment](ctp:api:type:Payment). + * + */ +export interface PaymentReference extends IReference { + readonly typeId: 'payment' + /** + * Unique identifier of the referenced [Payment](ctp:api:type:Payment). + * + * + */ + readonly id: string +} +/** + * Indicates how the price of a [Line Item](ctp:api:type:LineItem) or [Custom Line Item](ctp:api:type:CustomLineItem) is selected during Order creation. + * + */ +export enum PriceSelectionModeValues { + Dynamic = 'Dynamic', + Fixed = 'Fixed', +} + +export type PriceSelectionMode = 'Dynamic' | 'Fixed' | (string & {}) +/** + * A Price tier is selected instead of the default Price when a certain quantity of the [ProductVariant](ctp:api:type:ProductVariant) is [added to a Cart](/projects/carts#add-lineitem) and ordered. + * _For If no Price tier is found for the Order quantity, the base Price is used. + * A Price tier is applied for the entire quantity of a Product Variant put as [LineItem](/projects/carts#lineitem) in a Cart as soon as the minimum quantity for the Price tier is reached. + * The Price tier is applied per Line Item of the Product Variant. If, for example, the same Product Variant appears in the same Cart as several Line Items, (what can be achieved by different values of a Custom Field on the Line Items) for each Line Item the minimum quantity must be reached to get the Price tier. + * + */ +export interface PriceTier { + /** + * Minimum quantity this Price tier is valid for. + * + * The minimum quantity is always greater than or equal to 2. The base Price is interpreted as valid for a minimum quantity equal to 1. + * A [Price](ctp:api:type:Price) or [StandalonePrice](ctp:api:type:StandalonePrice) cannot contain more than one tier with the same `minimumQuantity`. + * + * + */ + readonly minimumQuantity: number + /** + * Money value that applies when the `minimumQuantity` is greater than or equal to the [LineItem](ctp:api:type:LineItem) `quantity`. + * + * The `currencyCode` of a Price tier is always the same as the `currencyCode` in the `value` of the related Price. + * + * + */ + readonly value: TypedMoney +} +/** + * [Reference](ctp:api:type:Reference) to a [ProductDiscount](ctp:api:type:ProductDiscount). + * + */ +export interface ProductDiscountReference extends IReference { + readonly typeId: 'product-discount' + /** + * Unique identifier of the referenced [ProductDiscount](ctp:api:type:ProductDiscount). + * + * + */ + readonly id: string +} +export interface ProductDiscountValue { + /** + * + */ + readonly type: string +} +/** + * [Reference](ctp:api:type:Reference) to a [Product](ctp:api:type:Product). + * + */ +export interface ProductReference extends IReference { + readonly typeId: 'product' + /** + * Unique identifier of the referenced [Product](ctp:api:type:Product). + * + * + */ + readonly id: string +} +/** + * [Reference](ctp:api:type:Reference) to a [ProductSelection](ctp:api:type:ProductSelection). + * + */ +export interface ProductSelectionReference extends IReference { + readonly typeId: 'product-selection' + /** + * Unique identifier of the referenced [ProductSelection](ctp:api:type:ProductSelection). + * + * + */ + readonly id: string +} +/** + * [Reference](ctp:api:type:Reference) to a [ProductType](ctp:api:type:ProductType). + * + */ +export interface ProductTypeReference extends IReference { + readonly typeId: 'product-type' + /** + * Unique identifier of the referenced [ProductType](ctp:api:type:ProductType). + * + * + */ + readonly id: string +} +/** + * A concrete sellable good for which inventory can be tracked. Product Variants are generally mapped to specific SKUs. + * + */ +export interface ProductVariant { + /** + * A unique, sequential identifier of the Product Variant within the Product. + * + * + */ + readonly id: number + /** + * User-defined unique SKU of the Product Variant. + * + * + */ + readonly sku?: string + /** + * User-defined unique identifier of the ProductVariant. + * + * This is different from [Product](ctp:api:type:Product) `key`. + * + * + */ + readonly key?: string + /** + * The Embedded Prices of the Product Variant. + * Cannot contain two Prices of the same Price scope (with same currency, country, Customer Group, Channel, `validFrom` and `validUntil`). + * + * + */ + readonly prices?: Price[] + /** + * Variant Attributes according to the respective [AttributeDefinition](ctp:api:type:AttributeDefinition). + * + * + */ + readonly attributes?: Attribute[] + /** + * Only available when [price selection](/../api/pricing-and-discounts-overview#price-selection) is used. + * Cannot be used in a [Query Predicate](ctp:api:type:QueryPredicate). + * + * + */ + readonly price?: Price + /** + * Images of the Product Variant. + * + * + */ + readonly images?: Image[] + /** + * Media assets of the Product Variant. + * + * + */ + readonly assets?: Asset[] + /** + * Set if the Product Variant is tracked by [Inventory](ctp:api:type:InventoryEntry). + * Can be used as an optimization to reduce calls to the Inventory service. + * May not contain the latest Inventory State (it is [eventually consistent](/general-concepts#eventual-consistency)). + * + * + */ + readonly availability?: ProductVariantAvailability + /** + * `true` if the Product Variant matches the search query. + * Only available in response to a [Product Projection Search](ctp:api:type:ProductProjectionSearch) request. + * + * + */ + readonly isMatchingVariant?: boolean + /** + * Only available in response to a [Product Projection Search](ctp:api:type:ProductProjectionSearch) request + * with [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). + * Can be used to sort, [filter](ctp:api:type:ProductProjectionSearchFilterScopedPrice), and facet. + * + * + */ + readonly scopedPrice?: ScopedPrice + /** + * Only available in response to a [Product Projection Search](ctp:api:type:ProductProjectionSearchFilterScopedPrice) request + * with [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). + * + * + */ + readonly scopedPriceDiscounted?: boolean + /** + * Only available when [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection) is used. + * Cannot be used in a [Query Predicate](ctp:api:type:QueryPredicate). + * + * + */ + readonly recurrencePrices?: Price[] +} +/** + * [Reference](ctp:api:type:Reference) to a [RecurrencePolicy](ctp:api:type:RecurrencePolicy). + * + */ +export interface RecurrencePolicyReference extends IReference { + readonly typeId: 'recurrence-policy' + /** + * Unique identifier of the referenced [RecurrencePolicy](ctp:api:type:RecurrencePolicy). + * + * + */ + readonly id: string +} +/** + * With Types, you can model your own Custom Fields on the following resources and data types. + * + */ +export enum ResourceTypeIdValues { + Address = 'address', + ApprovalFlow = 'approval-flow', + ApprovalRule = 'approval-rule', + Asset = 'asset', + AssociateRole = 'associate-role', + BusinessUnit = 'business-unit', + CartDiscount = 'cart-discount', + Category = 'category', + Channel = 'channel', + CustomLineItem = 'custom-line-item', + Customer = 'customer', + CustomerGroup = 'customer-group', + DiscountCode = 'discount-code', + InventoryEntry = 'inventory-entry', + LineItem = 'line-item', + Order = 'order', + OrderDelivery = 'order-delivery', + OrderEdit = 'order-edit', + OrderParcel = 'order-parcel', + OrderReturnItem = 'order-return-item', + Payment = 'payment', + PaymentInterfaceInteraction = 'payment-interface-interaction', + ProductPrice = 'product-price', + ProductSelection = 'product-selection', + ProductTailoring = 'product-tailoring', + Quote = 'quote', + RecurringOrder = 'recurring-order', + Review = 'review', + Shipping = 'shipping', + ShippingMethod = 'shipping-method', + ShoppingList = 'shopping-list', + ShoppingListTextLineItem = 'shopping-list-text-line-item', + StandalonePrice = 'standalone-price', + Store = 'store', + Transaction = 'transaction', +} + +export type ResourceTypeId = + | 'address' + | 'approval-flow' + | 'approval-rule' + | 'asset' + | 'associate-role' + | 'business-unit' + | 'cart-discount' + | 'category' + | 'channel' + | 'custom-line-item' + | 'customer' + | 'customer-group' + | 'discount-code' + | 'inventory-entry' + | 'line-item' + | 'order' + | 'order-delivery' + | 'order-edit' + | 'order-parcel' + | 'order-return-item' + | 'payment' + | 'payment-interface-interaction' + | 'product-price' + | 'product-selection' + | 'product-tailoring' + | 'quote' + | 'recurring-order' + | 'review' + | 'shipping' + | 'shipping-method' + | 'shopping-list' + | 'shopping-list-text-line-item' + | 'standalone-price' + | 'store' + | 'transaction' + | (string & {}) +/** + * Scoped Price is contained in a [ProductVariant](ctp:api:type:ProductVariant) which is returned in response to a + * [Product Projection Search](ctp:api:type:ProductProjectionSearchFilterScopedPrice) request when [Scoped Price Search](/../api/pricing-and-discounts-overview#scoped-price-search) is used. + * + */ +export interface ScopedPrice { + /** + * Platform-generated unique identifier of the Price. + * + * + */ + readonly id: string + /** + * Original value of the Price. + * + * + */ + readonly value: TypedMoney + /** + * If available, either the original price `value` or `discounted` value. + * + * + */ + readonly currentValue: TypedMoney + /** + * Country code of the geographic location. + * + * + */ + readonly country?: string + /** + * Reference to a CustomerGroup. + * + * + */ + readonly customerGroup?: CustomerGroupReference + /** + * Reference to a Channel. + * + * + */ + readonly channel?: ChannelReference + /** + * Date and time from which the Price is valid. + * + * + */ + readonly validFrom?: string + /** + * Date and time until which the Price is valid. + * + * + */ + readonly validUntil?: string + /** + * Is set when a matching [ProductDiscount](ctp:api:type:ProductDiscount) exists. If set, the [Cart](ctp:api:type:Cart) uses the discounted value for the [Cart Price calculation](ctp:api:type:CartAddLineItemAction). + * + * When a [relative Product Discount](ctp:api:type:ProductDiscountValueRelative) is applied and the fractional part of the discounted Price is 0.5, the discounted Price is [rounded half down](https://en.wikipedia.org/wiki/Rounding#Round_half_down) in favor of the Customer. + * + * + */ + readonly discounted?: DiscountedPrice + /** + * Custom Fields for the Price. + * + * + */ + readonly custom?: CustomFields +} +/** + * [Reference](ctp:api:type:Reference) to a [ShippingMethod](ctp:api:type:ShippingMethod). + * + */ +export interface ShippingMethodReference extends IReference { + readonly typeId: 'shipping-method' + /** + * Unique identifier of the referenced [ShippingMethod](ctp:api:type:ShippingMethod). + * + * + */ + readonly id: string +} +/** + * [Reference](ctp:api:type:Reference) to a [State](ctp:api:type:State). + * + */ +export interface StateReference extends IReference { + readonly typeId: 'state' + /** + * Unique identifier of the referenced [State](ctp:api:type:State). + * + * + */ + readonly id: string +} +/** + * [KeyReference](ctp:api:type:KeyReference) to a [Store](ctp:api:type:Store). + * + */ +export interface StoreKeyReference extends IKeyReference { + readonly typeId: 'store' + /** + * Unique and immutable key of the referenced [Store](ctp:api:type:Store). + * + * + */ + readonly key: string +} +/** + * [Reference](ctp:api:type:Reference) to a [TaxCategory](ctp:api:type:TaxCategory). + * + */ +export interface TaxCategoryReference extends IReference { + readonly typeId: 'tax-category' + /** + * Unique identifier of the referenced [TaxCategory](ctp:api:type:TaxCategory). + * + * + */ + readonly id: string +} +/** + * The tax portions are calculated from the [TaxRates](ctp:api:type:TaxRate). + * If a Tax Rate has [SubRates](ctp:api:type:SubRate), they are used and can be identified by name. + * Tax portions from Line Items with the same `rate` and `name` are accumulated to the same tax portion. + * + */ +export interface TaxPortion { + /** + * Name of the tax portion. + * + * + */ + readonly name?: string + /** + * A number in the range 0-1. + * + * + */ + readonly rate: number + /** + * Money value of the tax portion. + * + * + */ + readonly amount: CentPrecisionMoney +} +/** + * [Reference](ctp:api:type:Reference) to a [Type](ctp:api:type:Type). + * + */ +export interface TypeReference extends IReference { + readonly typeId: 'type' + /** + * Unique identifier of the referenced [Type](ctp:api:type:Type). + * + * + */ + readonly id: string +} +/** + * These objects represent information about which [API Client](/../api/projects/api-clients) created or modified a resource. For more information, see [Client Logging](/../api/general-concepts#client-logging). + * + */ +export interface ClientLogging { + /** + * `id` of the [API Client](ctp:api:type:ApiClient) which created the resource. + * + * + */ + readonly clientId?: string + /** + * [External user ID](/../api/general-concepts#external-user-ids) provided by `X-External-User-ID` HTTP Header. + * + * + */ + readonly externalUserId?: string + /** + * Indicates the [Customer](ctp:api:type:Customer) who modified the resource using a token from the [password flow](/authorization#password-flow). + * + * + */ + readonly customer?: CustomerReference + /** + * Indicates that the resource was modified during an [anonymous session](ctp:api:type:AnonymousSession) with the logged ID. + * + * + */ + readonly anonymousId?: string + /** + * Indicates the [Customer](ctp:api:type:Customer) who created or modified the resource in the context of a [Business Unit](ctp:api:type:BusinessUnit). Only available for [B2B](/../offering/composable-commerce#composable-commerce-for-b2b)-enabled Projects when an Associate acts on behalf of a company using the [associate endpoints](/associates-overview#on-the-associate-endpoints). + * + * + */ + readonly associate?: CustomerReference +} diff --git a/packages/history-sdk/src/generated/models/label.ts b/packages/history-sdk/src/generated/models/label.ts index b993abf04..f059de23d 100644 --- a/packages/history-sdk/src/generated/models/label.ts +++ b/packages/history-sdk/src/generated/models/label.ts @@ -4,7 +4,7 @@ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. */ -import { LocalizedString, Money, Reference } from './common' +import { LocalizedString, Reference, _Money } from './common' /** * Provides descriptive information specific to the resource. @@ -128,7 +128,7 @@ export interface PaymentLabel extends ILabel { * * */ - readonly amountPlanned: Money + readonly amountPlanned: _Money } export interface ProductLabel extends ILabel { readonly type: 'ProductLabel' diff --git a/packages/importapi-sdk/src/generated/client/by-project-key-request-builder.ts b/packages/importapi-sdk/src/generated/client/by-project-key-request-builder.ts index 0a2d29592..160d51f8b 100644 --- a/packages/importapi-sdk/src/generated/client/by-project-key-request-builder.ts +++ b/packages/importapi-sdk/src/generated/client/by-project-key-request-builder.ts @@ -52,8 +52,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public categories(): ByProjectKeyCategoriesRequestBuilder { - return new ByProjectKeyCategoriesRequestBuilder({ + public businessUnits(): ByProjectKeyBusinessUnitsRequestBuilder { + return new ByProjectKeyBusinessUnitsRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -61,8 +61,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public prices(): ByProjectKeyPricesRequestBuilder { - return new ByProjectKeyPricesRequestBuilder({ + public categories(): ByProjectKeyCategoriesRequestBuilder { + return new ByProjectKeyCategoriesRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -70,8 +70,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public standalonePrices(): ByProjectKeyStandalonePricesRequestBuilder { - return new ByProjectKeyStandalonePricesRequestBuilder({ + public customers(): ByProjectKeyCustomersRequestBuilder { + return new ByProjectKeyCustomersRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -79,8 +79,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public products(): ByProjectKeyProductsRequestBuilder { - return new ByProjectKeyProductsRequestBuilder({ + public discountCodes(): ByProjectKeyDiscountCodesRequestBuilder { + return new ByProjectKeyDiscountCodesRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -88,8 +88,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public productDrafts(): ByProjectKeyProductDraftsRequestBuilder { - return new ByProjectKeyProductDraftsRequestBuilder({ + public prices(): ByProjectKeyPricesRequestBuilder { + return new ByProjectKeyPricesRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -97,8 +97,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public productTypes(): ByProjectKeyProductTypesRequestBuilder { - return new ByProjectKeyProductTypesRequestBuilder({ + public inventories(): ByProjectKeyInventoriesRequestBuilder { + return new ByProjectKeyInventoriesRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -106,8 +106,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public productVariants(): ByProjectKeyProductVariantsRequestBuilder { - return new ByProjectKeyProductVariantsRequestBuilder({ + public products(): ByProjectKeyProductsRequestBuilder { + return new ByProjectKeyProductsRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -115,8 +115,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public productVariantPatches(): ByProjectKeyProductVariantPatchesRequestBuilder { - return new ByProjectKeyProductVariantPatchesRequestBuilder({ + public productDrafts(): ByProjectKeyProductDraftsRequestBuilder { + return new ByProjectKeyProductDraftsRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -124,8 +124,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public orders(): ByProjectKeyOrdersRequestBuilder { - return new ByProjectKeyOrdersRequestBuilder({ + public productTypes(): ByProjectKeyProductTypesRequestBuilder { + return new ByProjectKeyProductTypesRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -133,8 +133,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public orderPatches(): ByProjectKeyOrderPatchesRequestBuilder { - return new ByProjectKeyOrderPatchesRequestBuilder({ + public productVariants(): ByProjectKeyProductVariantsRequestBuilder { + return new ByProjectKeyProductVariantsRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -142,8 +142,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public customers(): ByProjectKeyCustomersRequestBuilder { - return new ByProjectKeyCustomersRequestBuilder({ + public productVariantPatches(): ByProjectKeyProductVariantPatchesRequestBuilder { + return new ByProjectKeyProductVariantPatchesRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -151,8 +151,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public inventories(): ByProjectKeyInventoriesRequestBuilder { - return new ByProjectKeyInventoriesRequestBuilder({ + public productSelections(): ByProjectKeyProductSelectionsRequestBuilder { + return new ByProjectKeyProductSelectionsRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -160,8 +160,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public types(): ByProjectKeyTypesRequestBuilder { - return new ByProjectKeyTypesRequestBuilder({ + public orders(): ByProjectKeyOrdersRequestBuilder { + return new ByProjectKeyOrdersRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -169,8 +169,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public discountCodes(): ByProjectKeyDiscountCodesRequestBuilder { - return new ByProjectKeyDiscountCodesRequestBuilder({ + public orderPatches(): ByProjectKeyOrderPatchesRequestBuilder { + return new ByProjectKeyOrderPatchesRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -178,8 +178,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public productSelections(): ByProjectKeyProductSelectionsRequestBuilder { - return new ByProjectKeyProductSelectionsRequestBuilder({ + public standalonePrices(): ByProjectKeyStandalonePricesRequestBuilder { + return new ByProjectKeyStandalonePricesRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, @@ -187,8 +187,8 @@ export class ByProjectKeyRequestBuilder { baseUri: this.args.baseUri, }) } - public businessUnits(): ByProjectKeyBusinessUnitsRequestBuilder { - return new ByProjectKeyBusinessUnitsRequestBuilder({ + public types(): ByProjectKeyTypesRequestBuilder { + return new ByProjectKeyTypesRequestBuilder({ pathArgs: { ...this.args.pathArgs, }, diff --git a/packages/importapi-sdk/src/generated/client/import-containers/by-project-key-prices-import-containers-by-import-container-key-request-builder.ts b/packages/importapi-sdk/src/generated/client/import-containers/by-project-key-prices-import-containers-by-import-container-key-request-builder.ts index 6fed4137f..cd11d2622 100644 --- a/packages/importapi-sdk/src/generated/client/import-containers/by-project-key-prices-import-containers-by-import-container-key-request-builder.ts +++ b/packages/importapi-sdk/src/generated/client/import-containers/by-project-key-prices-import-containers-by-import-container-key-request-builder.ts @@ -20,7 +20,7 @@ export class ByProjectKeyPricesImportContainersByImportContainerKeyRequestBuilde } ) {} /** - * Creates an Import Request for Prices. + * Creates an Import Request for Embedded Prices. */ public post(methodArgs: { body: PriceImportRequest diff --git a/packages/importapi-sdk/src/generated/index.ts b/packages/importapi-sdk/src/generated/index.ts index ccf9a7ccb..1705b40d1 100644 --- a/packages/importapi-sdk/src/generated/index.ts +++ b/packages/importapi-sdk/src/generated/index.ts @@ -1,8 +1,9 @@ + /** - * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. - * Please don't change this file manually but run `rmf-codegen generate -o -t typescript_client` to update it. - * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. - */ +* Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. +* Please don't change this file manually but run `rmf-codegen generate -o -t typescript_client` to update it. +* For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. +*/ // resources export * from './client/api-root'; //Root client that is used to access all the endpoints in the API @@ -89,3 +90,5 @@ export * from './shared/utils/common-types' export * from './shared/utils/middleware' export * from './shared/utils/requests-utils' export * from './shared/utils/uri-utils' + + diff --git a/packages/platform-sdk/src/generated/client/cart-discounts/by-project-key-cart-discounts-request-builder.ts b/packages/platform-sdk/src/generated/client/cart-discounts/by-project-key-cart-discounts-request-builder.ts index 882841edf..6bb12262e 100644 --- a/packages/platform-sdk/src/generated/client/cart-discounts/by-project-key-cart-discounts-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/cart-discounts/by-project-key-cart-discounts-request-builder.ts @@ -105,6 +105,7 @@ export class ByProjectKeyCartDiscountsRequestBuilder { } /** * Creating a Cart Discount produces the [CartDiscountCreated](ctp:api:type:CartDiscountCreatedMessage) Message. + * */ public post(methodArgs: { queryArgs?: { diff --git a/packages/platform-sdk/src/generated/client/carts/by-project-key-carts-request-builder.ts b/packages/platform-sdk/src/generated/client/carts/by-project-key-carts-request-builder.ts index e1e29eea3..7e6db91fe 100644 --- a/packages/platform-sdk/src/generated/client/carts/by-project-key-carts-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/carts/by-project-key-carts-request-builder.ts @@ -6,6 +6,7 @@ import { Cart, CartDraft, CartPagedQueryResponse } from '../../models/cart' import { executeRequest, QueryParam } from '../../shared/utils/common-types' import { ApiRequest } from '../../shared/utils/requests-utils' +import { ByProjectKeyCartsCustomerIdByCustomerIdMergeRequestBuilder } from '../merge/by-project-key-carts-customer-id-by-customer-id-merge-request-builder' import { ByProjectKeyCartsReplicateRequestBuilder } from '../replicate/by-project-key-carts-replicate-request-builder' import { ByProjectKeyCartsByIDRequestBuilder } from './by-project-key-carts-by-id-request-builder' import { ByProjectKeyCartsCustomerIdByCustomerIdRequestBuilder } from './by-project-key-carts-customer-id-by-customer-id-request-builder' @@ -43,6 +44,18 @@ export class ByProjectKeyCartsRequestBuilder { baseUri: this.args.baseUri, }) } + public customerIdWithCustomerIdValueMerge(childPathArgs: { + customerId: string + }): ByProjectKeyCartsCustomerIdByCustomerIdMergeRequestBuilder { + return new ByProjectKeyCartsCustomerIdByCustomerIdMergeRequestBuilder({ + pathArgs: { + ...this.args.pathArgs, + ...childPathArgs, + }, + executeRequest: this.args.executeRequest, + baseUri: this.args.baseUri, + }) + } public withKey(childPathArgs: { key: string }): ByProjectKeyCartsKeyByKeyRequestBuilder { diff --git a/packages/platform-sdk/src/generated/client/carts/by-project-key-in-store-key-by-store-key-carts-request-builder.ts b/packages/platform-sdk/src/generated/client/carts/by-project-key-in-store-key-by-store-key-carts-request-builder.ts index 2b17f2b2a..8444b55bb 100644 --- a/packages/platform-sdk/src/generated/client/carts/by-project-key-in-store-key-by-store-key-carts-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/carts/by-project-key-in-store-key-by-store-key-carts-request-builder.ts @@ -6,6 +6,7 @@ import { Cart, CartDraft, CartPagedQueryResponse } from '../../models/cart' import { executeRequest, QueryParam } from '../../shared/utils/common-types' import { ApiRequest } from '../../shared/utils/requests-utils' +import { ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdMergeRequestBuilder } from '../merge/by-project-key-in-store-key-by-store-key-carts-customer-id-by-customer-id-merge-request-builder' import { ByProjectKeyInStoreKeyByStoreKeyCartsReplicateRequestBuilder } from '../replicate/by-project-key-in-store-key-by-store-key-carts-replicate-request-builder' import { ByProjectKeyInStoreKeyByStoreKeyCartsByIDRequestBuilder } from './by-project-key-in-store-key-by-store-key-carts-by-id-request-builder' import { ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdRequestBuilder } from './by-project-key-in-store-key-by-store-key-carts-customer-id-by-customer-id-request-builder' @@ -37,6 +38,20 @@ export class ByProjectKeyInStoreKeyByStoreKeyCartsRequestBuilder { } ) } + public customerIdWithCustomerIdValueMerge(childPathArgs: { + customerId: string + }): ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdMergeRequestBuilder { + return new ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdMergeRequestBuilder( + { + pathArgs: { + ...this.args.pathArgs, + ...childPathArgs, + }, + executeRequest: this.args.executeRequest, + baseUri: this.args.baseUri, + } + ) + } public withKey(childPathArgs: { key: string }): ByProjectKeyInStoreKeyByStoreKeyCartsKeyByKeyRequestBuilder { diff --git a/packages/platform-sdk/src/generated/client/customers/by-project-key-customers-request-builder.ts b/packages/platform-sdk/src/generated/client/customers/by-project-key-customers-request-builder.ts index 649687238..1edc4d06a 100644 --- a/packages/platform-sdk/src/generated/client/customers/by-project-key-customers-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/customers/by-project-key-customers-request-builder.ts @@ -207,6 +207,8 @@ export class ByProjectKeyCustomersRequestBuilder { ) } /** + * Allows converting an anonymous Cart to the active Cart of a Customer with [cart merge](/../api/customers-overview#cart-merge-during-sign-in-and-sign-up). + * * Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. Simultaneously creating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. * */ diff --git a/packages/platform-sdk/src/generated/client/customers/by-project-key-in-store-key-by-store-key-customers-request-builder.ts b/packages/platform-sdk/src/generated/client/customers/by-project-key-in-store-key-by-store-key-customers-request-builder.ts index 92d0692f4..e705aa705 100644 --- a/packages/platform-sdk/src/generated/client/customers/by-project-key-in-store-key-by-store-key-customers-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/customers/by-project-key-in-store-key-by-store-key-customers-request-builder.ts @@ -197,7 +197,8 @@ export class ByProjectKeyInStoreKeyByStoreKeyCustomersRequestBuilder { * * If a Cart with a `store` field specified, the `store` field must reference the same [Store](ctp:api:type:Store) specified in the `{storeKey}` path parameter. * - * If the Customer has multiple active Carts, the anonymous Cart is [merged](/../api/customers-overview#cart-merge-during-sign-in-and-sign-up) into the most recently modified active Cart. + * Allows converting an anonymous Cart to the active Cart of a Customer with [cart merge](/../api/customers-overview#cart-merge-during-sign-in-and-sign-up). + * If the Customer has multiple active Carts, the anonymous Cart is merged into the most recently modified active Cart. * * Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. Simultaneously creating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error. * diff --git a/packages/platform-sdk/src/generated/client/login/by-project-key-in-store-key-by-store-key-login-request-builder.ts b/packages/platform-sdk/src/generated/client/login/by-project-key-in-store-key-by-store-key-login-request-builder.ts index 62161a2fc..618743d70 100644 --- a/packages/platform-sdk/src/generated/client/login/by-project-key-in-store-key-by-store-key-login-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/login/by-project-key-in-store-key-by-store-key-login-request-builder.ts @@ -22,7 +22,9 @@ export class ByProjectKeyInStoreKeyByStoreKeyLoginRequestBuilder { /** * Authenticates a Customer associated with a [Store](ctp:api:type:Store). * - * If the Customer has multiple active Carts, the anonymous Cart is [merged](/../api/customers-overview#cart-merge-during-sign-in-and-sign-up) into the most recently modified active Cart. + * Allows [merging](/../api/customers-overview#cart-merge-during-sign-in-and-sign-up) items from an anonymous Cart into the most recently modified active Cart of a Customer. + * If no active Cart exists, the anonymous Cart becomes the Customer's active Cart. + * If the Customer has multiple active Carts, the anonymous Cart is merged into the most recently modified active Cart. * * If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), this method returns an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error. * diff --git a/packages/platform-sdk/src/generated/client/login/by-project-key-login-request-builder.ts b/packages/platform-sdk/src/generated/client/login/by-project-key-login-request-builder.ts index 24a0cb90f..4dcefb81e 100644 --- a/packages/platform-sdk/src/generated/client/login/by-project-key-login-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/login/by-project-key-login-request-builder.ts @@ -21,7 +21,9 @@ export class ByProjectKeyLoginRequestBuilder { /** * Authenticates a global Customer. * - * If the Customer has multiple active Carts, the anonymous Cart is [merged](/../api/customers-overview#cart-merge-during-sign-in-and-sign-up) into the most recently modified active Cart. + * Allows [merging](/../api/customers-overview#cart-merge-during-sign-in-and-sign-up) items from an anonymous Cart into the most recently modified active Cart of a Customer. + * If no active Cart exists, the anonymous Cart becomes the Customer's active Cart. + * If the Customer has multiple active Carts, the anonymous Cart is merged into the most recently modified active Cart. * * If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. * diff --git a/packages/platform-sdk/src/generated/client/merge/by-project-key-carts-customer-id-by-customer-id-merge-request-builder.ts b/packages/platform-sdk/src/generated/client/merge/by-project-key-carts-customer-id-by-customer-id-merge-request-builder.ts new file mode 100644 index 000000000..fd571695d --- /dev/null +++ b/packages/platform-sdk/src/generated/client/merge/by-project-key-carts-customer-id-by-customer-id-merge-request-builder.ts @@ -0,0 +1,48 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ +import { Cart, MergeCartDraft } from '../../models/cart' +import { executeRequest } from '../../shared/utils/common-types' +import { ApiRequest } from '../../shared/utils/requests-utils' +/** + **/ +export class ByProjectKeyCartsCustomerIdByCustomerIdMergeRequestBuilder { + constructor( + protected readonly args: { + pathArgs: { + projectKey: string + customerId: string + } + executeRequest: executeRequest + baseUri?: string + } + ) {} + /** + * Merges items from an anonymous Cart into the most recently modified active Cart of a Customer. If no active Cart exists, the anonymous Cart becomes the Customer's active Cart. + * For more information, see [Merge behavior](/../api/carts-orders-overview#merge-behavior). + * + */ + public post(methodArgs: { + body: MergeCartDraft + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'POST', + uriTemplate: '/{projectKey}/carts/customer-id={customerId}/merge', + pathVariables: this.args.pathArgs, + headers: { + 'Content-Type': 'application/json', + ...methodArgs?.headers, + }, + body: methodArgs?.body, + }, + this.args.executeRequest + ) + } +} diff --git a/packages/platform-sdk/src/generated/client/merge/by-project-key-in-store-key-by-store-key-carts-customer-id-by-customer-id-merge-request-builder.ts b/packages/platform-sdk/src/generated/client/merge/by-project-key-in-store-key-by-store-key-carts-customer-id-by-customer-id-merge-request-builder.ts new file mode 100644 index 000000000..70ed7201b --- /dev/null +++ b/packages/platform-sdk/src/generated/client/merge/by-project-key-in-store-key-by-store-key-carts-customer-id-by-customer-id-merge-request-builder.ts @@ -0,0 +1,53 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ +import { Cart, MergeCartDraft } from '../../models/cart' +import { executeRequest } from '../../shared/utils/common-types' +import { ApiRequest } from '../../shared/utils/requests-utils' +/** + **/ +export class ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdMergeRequestBuilder { + constructor( + protected readonly args: { + pathArgs: { + projectKey: string + storeKey: string + customerId: string + } + executeRequest: executeRequest + baseUri?: string + } + ) {} + /** + * Merges items from an anonymous Cart into the most recently modified active Cart of a Customer. If no active Cart exists, the anonymous Cart becomes the Customer's active Cart. + * + * If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. + * + * For more information, see [Merge behavior](/../api/carts-orders-overview#merge-behavior). + * + */ + public post(methodArgs: { + body: MergeCartDraft + headers?: { + [key: string]: string | string[] + } + }): ApiRequest { + return new ApiRequest( + { + baseUri: this.args.baseUri, + method: 'POST', + uriTemplate: + '/{projectKey}/in-store/key={storeKey}/carts/customer-id={customerId}/merge', + pathVariables: this.args.pathArgs, + headers: { + 'Content-Type': 'application/json', + ...methodArgs?.headers, + }, + body: methodArgs?.body, + }, + this.args.executeRequest + ) + } +} diff --git a/packages/platform-sdk/src/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-by-id-request-builder.ts b/packages/platform-sdk/src/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-by-id-request-builder.ts index e0d7162b8..e4467b095 100644 --- a/packages/platform-sdk/src/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-by-id-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-by-id-request-builder.ts @@ -40,6 +40,7 @@ export class ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDRequestBuilde priceChannel?: string priceRecurrencePolicy?: string localeProjection?: string | string[] + 'filter[attributes]'?: string | string[] expand?: string | string[] [key: string]: QueryParam } diff --git a/packages/platform-sdk/src/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-key-by-key-request-builder.ts b/packages/platform-sdk/src/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-key-by-key-request-builder.ts index 4844befe7..e3ef59303 100644 --- a/packages/platform-sdk/src/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-key-by-key-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-key-by-key-request-builder.ts @@ -40,6 +40,7 @@ export class ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyRequestBu priceChannel?: string priceRecurrencePolicy?: string localeProjection?: string | string[] + 'filter[attributes]'?: string | string[] expand?: string | string[] [key: string]: QueryParam } diff --git a/packages/platform-sdk/src/generated/client/product-projections/by-project-key-product-projections-by-id-request-builder.ts b/packages/platform-sdk/src/generated/client/product-projections/by-project-key-product-projections-by-id-request-builder.ts index 26e1295bc..aae8bbf5f 100644 --- a/packages/platform-sdk/src/generated/client/product-projections/by-project-key-product-projections-by-id-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/product-projections/by-project-key-product-projections-by-id-request-builder.ts @@ -34,6 +34,7 @@ export class ByProjectKeyProductProjectionsByIDRequestBuilder { priceRecurrencePolicy?: string localeProjection?: string | string[] storeProjection?: string + 'filter[attributes]'?: string | string[] expand?: string | string[] [key: string]: QueryParam } diff --git a/packages/platform-sdk/src/generated/client/product-projections/by-project-key-product-projections-key-by-key-request-builder.ts b/packages/platform-sdk/src/generated/client/product-projections/by-project-key-product-projections-key-by-key-request-builder.ts index 44ea8d70f..d77bbdf63 100644 --- a/packages/platform-sdk/src/generated/client/product-projections/by-project-key-product-projections-key-by-key-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/product-projections/by-project-key-product-projections-key-by-key-request-builder.ts @@ -36,6 +36,7 @@ export class ByProjectKeyProductProjectionsKeyByKeyRequestBuilder { priceRecurrencePolicy?: string localeProjection?: string | string[] storeProjection?: string + 'filter[attributes]'?: string | string[] expand?: string | string[] [key: string]: QueryParam } diff --git a/packages/platform-sdk/src/generated/client/product-projections/by-project-key-product-projections-request-builder.ts b/packages/platform-sdk/src/generated/client/product-projections/by-project-key-product-projections-request-builder.ts index b8d05bfd1..785979d64 100644 --- a/packages/platform-sdk/src/generated/client/product-projections/by-project-key-product-projections-request-builder.ts +++ b/packages/platform-sdk/src/generated/client/product-projections/by-project-key-product-projections-request-builder.ts @@ -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 diff --git a/packages/platform-sdk/src/generated/index.ts b/packages/platform-sdk/src/generated/index.ts index b294bfc20..af66d0777 100644 --- a/packages/platform-sdk/src/generated/index.ts +++ b/packages/platform-sdk/src/generated/index.ts @@ -1,8 +1,9 @@ + /** - * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. - * Please don't change this file manually but run `rmf-codegen generate -o -t typescript_client` to update it. - * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. - */ +* Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. +* Please don't change this file manually but run `rmf-codegen generate -o -t typescript_client` to update it. +* For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. +*/ // resources export * from './client/active-cart/by-project-key-in-store-key-by-store-key-me-active-cart-request-builder' @@ -130,6 +131,8 @@ export * from './client/matching/by-project-key-product-discounts-matching-reque export * from './client/me/by-project-key-in-business-unit-key-by-business-unit-key-me-request-builder' export * from './client/me/by-project-key-in-store-key-by-store-key-me-request-builder' export * from './client/me/by-project-key-me-request-builder' +export * from './client/merge/by-project-key-carts-customer-id-by-customer-id-merge-request-builder' +export * from './client/merge/by-project-key-in-store-key-by-store-key-carts-customer-id-by-customer-id-merge-request-builder' export * from './client/messages/by-project-key-messages-by-id-request-builder' export * from './client/messages/by-project-key-messages-request-builder' export * from './client/orders/by-project-key-as-associate-by-associate-id-in-business-unit-key-by-business-unit-key-orders-by-id-request-builder' @@ -351,3 +354,5 @@ export * from './shared/utils/common-types' export * from './shared/utils/middleware' export * from './shared/utils/requests-utils' export * from './shared/utils/uri-utils' + + diff --git a/packages/platform-sdk/src/generated/models/cart-discount.ts b/packages/platform-sdk/src/generated/models/cart-discount.ts index fe174ab9e..5be0afc0b 100644 --- a/packages/platform-sdk/src/generated/models/cart-discount.ts +++ b/packages/platform-sdk/src/generated/models/cart-discount.ts @@ -147,8 +147,8 @@ export interface CartDiscount extends BaseResource { */ readonly requiresDiscountCode: boolean /** - * References of all resources that are addressed in the predicate. - * The API generates this array from the predicate. + * References to all resources addressed in the `cartPredicate` by their IDs. + * This value is generated by the platform. * * */ @@ -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 { @@ -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 { @@ -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 @@ -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. * * diff --git a/packages/platform-sdk/src/generated/models/cart.ts b/packages/platform-sdk/src/generated/models/cart.ts index 602e0402d..99e7159df 100644 --- a/packages/platform-sdk/src/generated/models/cart.ts +++ b/packages/platform-sdk/src/generated/models/cart.ts @@ -555,6 +555,19 @@ export interface CartDraft { */ readonly custom?: CustomFieldsDraft } +/** + * Determines how to manually merge an anonymous Cart with an existing Customer Cart. + * + */ +export enum CartMergeModeValues { + MergeWithExistingCustomerCart = 'MergeWithExistingCustomerCart', + UseAsNewActiveCustomerCart = 'UseAsNewActiveCustomerCart', +} + +export type CartMergeMode = + | 'MergeWithExistingCustomerCart' + | 'UseAsNewActiveCustomerCart' + | (string & {}) /** * Indicates who created the Cart. * @@ -1170,7 +1183,7 @@ export interface IDiscountTypeCombination { readonly type: string } /** - * Indicates the best deal logic applies to a Cart or Order and indicates the discount type that offers the best deal. + * Indicates if a Product Discount or Cart Discount offers the best deal for a Cart or Order. * */ export interface BestDeal extends IDiscountTypeCombination { @@ -1738,6 +1751,38 @@ export type LineItemPriceMode = | 'ExternalTotal' | 'Platform' | (string & {}) +/** + * Used for merging an anonymous Cart with a Customer Cart with the [Merge Cart](ctp:api:endpoint:/{projectKey}/carts/customer-id={customerId}/merge:POST) and [Merge Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts/customer-id={customerId}/merge:POST) endpoints. Either `anonymousCart` or `anonymousId` is required. + * + */ +export interface MergeCartDraft { + /** + * [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to the anonymous [Cart](ctp:api:type:Cart) to be merged. Required if `anonymousId` is not provided. + * + * + */ + readonly anonymousCart?: CartResourceIdentifier + /** + * Determines how to merge the anonymous Cart with the existing Customer Cart. + * + * + */ + readonly mergeMode?: CartMergeMode + /** + * - If `true`, the [LineItem](ctp:api:type:LineItem) Product data (`name`, `variant`, and `productType`) of the returned Cart will be updated. + * - If `false`, only the prices, discounts, and tax rates will be updated. + * + * + */ + readonly updateProductData?: boolean + /** + * Assigns the Customer to the [Carts](ctp:api:type:Cart) that have the same `anonymousId`. Required if `anonymousCart` is not provided. + * If both `anonymousCart` and `anonymousId` are provided, this value must match the `anonymousId` of the anonymous [Cart](ctp:api:type:Cart) otherwise, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned. + * + * + */ + readonly anonymousId?: string +} export interface MethodExternalTaxRateDraft { /** * User-defined unique identifier of the Shipping Method in a Cart with `Multiple` [ShippingMode](ctp:api:type:ShippingMode). @@ -2381,8 +2426,10 @@ export interface CartAddCustomShippingMethodAction extends ICartUpdateAction { } /** * Adds a [DiscountCode](ctp:api:type:DiscountCode) to the Cart to activate the related [Cart Discounts](/../api/projects/cartDiscounts). - * Adding a Discount Code is only possible if no [DirectDiscount](ctp:api:type:DirectDiscount) has been applied to the Cart. - * Discount Codes can be added to [frozen Carts](ctp:api:type:FrozenCarts), but their [DiscountCodeState](ctp:api:type:DiscountCodeState) is then `DoesNotMatchCart`. + * If the related Cart Discounts are inactive or invalid, or belong to a different Store than the Cart, a [DiscountCodeNonApplicableError](ctp:api:type:DiscountCodeNonApplicableError) is returned. + * + * A Discount Code can be added only if no [DirectDiscount](ctp:api:type:DirectDiscount) has been applied to the Cart. + * For [frozen Carts](ctp:api:type:FrozenCarts), the [DiscountCodeState](ctp:api:type:DiscountCodeState) must be `DoesNotMatchCart` when adding a Discount Code. * * The maximum number of Discount Codes in a Cart is restricted by a [limit](/../api/limits#carts). * @@ -2884,6 +2931,8 @@ export interface CartChangeTaxRoundingModeAction extends ICartUpdateAction { * Changes the [CartState](ctp:api:type:CartState) from `Active` to `Frozen`. Results in a [Frozen Cart](ctp:api:type:FrozenCarts). * Fails with [InvalidOperation](ctp:api:type:InvalidOperationError) error when the Cart is empty. * + * Freezing a Cart produces the [CartFrozen](ctp:api:type:CartFrozenMessage) Message. + * */ export interface CartFreezeCartAction extends ICartUpdateAction { readonly action: 'freezeCart' @@ -2969,8 +3018,8 @@ export interface CartRemoveLineItemAction extends ICartUpdateAction { */ readonly lineItemKey?: string /** - * Amount to subtract from the LineItem's `quantity`. - * If absent, the LineItem is removed from the Cart. + * Amount to subtract from the LineItem quantity. + * If omitted, the LineItem is removed from the Cart. * * */ @@ -3427,6 +3476,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. * */ @@ -3796,6 +3847,7 @@ export interface CartSetLineItemTaxRateAction extends ICartUpdateAction { } /** * Sets the [LineItem](ctp:api:type:LineItem) `totalPrice` and `price`, and changes the `priceMode` to `ExternalTotal` [LineItemPriceMode](ctp:api:type:LineItemPriceMode). + * Cannot be used on Gift Line Items (see [LineItemMode](ctp:api:type:LineItemMode)). * */ export interface CartSetLineItemTotalPriceAction extends ICartUpdateAction { @@ -4025,6 +4077,8 @@ export interface CartSetShippingRateInputAction extends ICartUpdateAction { * Changes the [CartState](ctp:api:type:CartState) from `Frozen` to `Active`. Reactivates a [Frozen Cart](ctp:api:type:FrozenCarts). * 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. * + * Unfreezing a Cart produces the [CartUnfrozen](ctp:api:type:CartUnfrozenMessage) Message. + * */ export interface CartUnfreezeCartAction extends ICartUpdateAction { readonly action: 'unfreezeCart' diff --git a/packages/platform-sdk/src/generated/models/discount-code.ts b/packages/platform-sdk/src/generated/models/discount-code.ts index bd7644230..25eb6c943 100644 --- a/packages/platform-sdk/src/generated/models/discount-code.ts +++ b/packages/platform-sdk/src/generated/models/discount-code.ts @@ -103,8 +103,8 @@ export interface DiscountCode extends BaseResource { */ readonly isActive: boolean /** - * Array generated from the Cart predicate. - * It contains the references of all the resources that are addressed in the predicate. + * References to all resources addressed in the `cartPredicate` by their IDs. + * This value is generated by the platform. * * */ diff --git a/packages/platform-sdk/src/generated/models/error.ts b/packages/platform-sdk/src/generated/models/error.ts index 604f52f3a..678dd871c 100644 --- a/packages/platform-sdk/src/generated/models/error.ts +++ b/packages/platform-sdk/src/generated/models/error.ts @@ -112,6 +112,7 @@ export type ErrorObject = | ProjectNotConfiguredForLanguagesError | QueryComplexityLimitExceededError | QueryTimedOutError + | RecurringOrderFailureError | ReferenceExistsError | ReferencedResourceNotFoundError | RequiredFieldError @@ -377,12 +378,14 @@ export interface CountryNotConfiguredInStoreError extends IErrorObject { * * The error is returned as a failed response to: * - * - [Create Cart](ctp:api:endpoint:/{projectKey}/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts:POST) requests and [Add DiscountCode](ctp:api:type:CartAddDiscountCodeAction) update action on Carts. - * - [Create Cart](ctp:api:endpoint:/{projectKey}/me/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/carts:POST) requests and [Add DiscountCode](ctp:api:type:MyCartAddDiscountCodeAction) update action on My Carts. + * - [Create Cart](ctp:api:endpoint:/{projectKey}/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts:POST) requests. + * - [Create Cart](ctp:api:endpoint:/{projectKey}/me/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/carts:POST) requests. * - [Create Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts:POST) request on Associate Carts. * - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. * - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. - * - [Add DiscountCode](ctp:api:type:StagedOrderAddDiscountCodeAction) update action on Order Edits. + * - [Add DiscountCode](ctp:api:type:CartAddDiscountCodeAction) update action on Carts, if the associated Cart Discounts are inactive or invalid, or belongs to a different Store than the Cart. + * - [Add DiscountCode](ctp:api:type:MyCartAddDiscountCodeAction) update action on My Carts, if the associated Cart Discounts are inactive or invalid, or belongs to a different Store than the Cart. + * - [Add DiscountCode](ctp:api:type:StagedOrderAddDiscountCodeAction) update action on Order Edits, if the associated Cart Discounts are inactive or invalid, or belongs to a different Store than the Order. * - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) request on Associate Orders. * */ @@ -1867,6 +1870,26 @@ export interface QueryTimedOutError extends IErrorObject { */ readonly message: string } +/** + * Returned when a subsequent Order for a [Recurring Order](ctp:api:type:RecurringOrder) could not be processed. + * + */ +export interface RecurringOrderFailureError extends IErrorObject { + readonly code: 'RecurringOrderFailure' + [key: string]: any + /** + * Plain text description of the error. + * + * + */ + readonly message: string + /** + * Details about the error's cause and the entities involved. + * + * + */ + readonly details: any +} /** * Returned when a resource cannot be deleted because it is being referenced by another resource. * @@ -2204,6 +2227,7 @@ export type GraphQLErrorObject = | GraphQLProjectNotConfiguredForLanguagesError | GraphQLQueryComplexityLimitExceededError | GraphQLQueryTimedOutError + | GraphQLRecurringOrderFailureError | GraphQLReferenceExistsError | GraphQLReferencedResourceNotFoundError | GraphQLRequiredFieldError @@ -2415,12 +2439,14 @@ export interface GraphQLCountryNotConfiguredInStoreError * * The error is returned as a failed response to: * - * - [Create Cart](ctp:api:endpoint:/{projectKey}/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts:POST) requests and [Add DiscountCode](ctp:api:type:CartAddDiscountCodeAction) update action on Carts. - * - [Create Cart](ctp:api:endpoint:/{projectKey}/me/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/carts:POST) requests and [Add DiscountCode](ctp:api:type:MyCartAddDiscountCodeAction) update action on My Carts. + * - [Create Cart](ctp:api:endpoint:/{projectKey}/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts:POST) requests. + * - [Create Cart](ctp:api:endpoint:/{projectKey}/me/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/carts:POST) requests. * - [Create Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts:POST) request on Associate Carts. * - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders. * - [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders. - * - [Add DiscountCode](ctp:api:type:StagedOrderAddDiscountCodeAction) update action on Order Edits. + * - [Add DiscountCode](ctp:api:type:CartAddDiscountCodeAction) update action on Carts, if the associated Cart Discounts are inactive or invalid, or belongs to a different Store than the Cart. + * - [Add DiscountCode](ctp:api:type:MyCartAddDiscountCodeAction) update action on My Carts, if the associated Cart Discounts are inactive or invalid, or belongs to a different Store than the Cart. + * - [Add DiscountCode](ctp:api:type:StagedOrderAddDiscountCodeAction) update action on Order Edits, if the associated Cart Discounts are inactive or invalid, or belongs to a different Store than the Order. * - [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) request on Associate Orders. * */ @@ -3507,6 +3533,20 @@ export interface GraphQLQueryTimedOutError extends IGraphQLErrorObject { readonly code: 'QueryTimedOut' [key: string]: any } +/** + * Returned when a subsequent Order for a [Recurring Order](ctp:api:type:RecurringOrder) could not be processed. + * + */ +export interface GraphQLRecurringOrderFailureError extends IGraphQLErrorObject { + readonly code: 'RecurringOrderFailure' + [key: string]: any + /** + * Details about the error's cause and the entities involved. + * + * + */ + readonly details: any +} /** * Returned when a resource cannot be deleted because it is being referenced by another resource. * diff --git a/packages/platform-sdk/src/generated/models/me.ts b/packages/platform-sdk/src/generated/models/me.ts index a6fcef56d..d89715203 100644 --- a/packages/platform-sdk/src/generated/models/me.ts +++ b/packages/platform-sdk/src/generated/models/me.ts @@ -1452,8 +1452,10 @@ export interface MyBusinessUnitSetDefaultShippingAddressAction } /** * Adds a [DiscountCode](ctp:api:type:DiscountCode) to the Cart to activate the related [CartDiscounts](/../api/projects/cartDiscounts). - * Adding a Discount Code is only possible if no [DirectDiscount](ctp:api:type:DirectDiscount) has been applied to the Cart. - * Discount Codes can be added to [frozen Carts](ctp:api:type:FrozenCarts), but their [DiscountCodeState](ctp:api:type:DiscountCodeState) is then `DoesNotMatchCart`. + * If the related Cart Discounts are inactive or invalid, or belong to a different Store than the Cart, a [DiscountCodeNonApplicableError](ctp:api:type:DiscountCodeNonApplicableError) is returned. + * + * A Discount Code can be added only if no [DirectDiscount](ctp:api:type:DirectDiscount) has been applied to the Cart. + * For [frozen Carts](ctp:api:type:FrozenCarts), the [DiscountCodeState](ctp:api:type:DiscountCodeState) must be `DoesNotMatchCart` when adding a Discount Code. * * The maximum number of Discount Codes in a Cart is restricted by a [limit](/../api/limits#carts). * @@ -1740,8 +1742,8 @@ export interface MyCartRemoveLineItemAction extends IMyCartUpdateAction { */ readonly lineItemKey?: string /** - * Amount to subtract from the LineItem's `quantity`. - * If absent, the LineItem is removed from the Cart. + * Amount to subtract from the LineItem quantity. + * If omitted, the LineItem is removed from the Cart. * * */ diff --git a/packages/platform-sdk/src/generated/models/message.ts b/packages/platform-sdk/src/generated/models/message.ts index d529bc2ba..ab4f20eee 100644 --- a/packages/platform-sdk/src/generated/models/message.ts +++ b/packages/platform-sdk/src/generated/models/message.ts @@ -58,6 +58,7 @@ import { import { CustomerGroupReference } from './customer-group' import { DiscountCode, DiscountCodeReference } from './discount-code' import { DiscountGroup } from './discount-group' +import { RecurringOrderFailureError } from './error' import { InventoryEntry } from './inventory' import { Delivery, @@ -200,6 +201,8 @@ export type Message = | CartDiscountStoreAddedMessage | CartDiscountStoreRemovedMessage | CartDiscountStoresSetMessage + | CartFrozenMessage + | CartUnfrozenMessage | CategoryCreatedMessage | CategorySlugChangedMessage | CustomLineItemStateTransitionMessage @@ -289,6 +292,7 @@ export type Message = | OrderLineItemRemovedMessage | OrderMessage | OrderPaymentAddedMessage + | OrderPaymentRemovedMessage | OrderPaymentStateChangedMessage | OrderPurchaseOrderNumberSetMessage | OrderReturnShipmentStateChangedMessage @@ -398,6 +402,7 @@ export type Message = | RecurringOrderCustomTypeSetMessage | RecurringOrderDeletedMessage | RecurringOrderExpiresAtSetMessage + | RecurringOrderFailedMessage | RecurringOrderKeySetMessage | RecurringOrderScheduleSetMessage | RecurringOrderStartsAtSetMessage @@ -4957,6 +4962,134 @@ export interface CartDiscountStoresSetMessage extends IMessage { */ readonly stores: StoreKeyReference[] } +/** + * Generated after a successful [Freeze Cart](ctp:api:type:CartFreezeCartAction) update action. + * + */ +export interface CartFrozenMessage extends IMessage { + readonly type: 'CartFrozen' + /** + * Unique identifier of the Message. Can be used to track which Messages have been processed. + * + */ + readonly id: string + /** + * Version of a resource. In case of Messages, this is always `1`. + * + */ + readonly version: number + /** + * Date and time (UTC) the Message was generated. + * + */ + readonly createdAt: string + /** + * Value of `createdAt`. + * + */ + readonly lastModifiedAt: string + /** + * IDs and references that last modified the Message. + * + * + */ + readonly lastModifiedBy?: LastModifiedBy + /** + * IDs and references that created the Message. + * + * + */ + readonly createdBy?: CreatedBy + /** + * Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + * `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + * + * + */ + readonly sequenceNumber: number + /** + * [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + * + * + */ + readonly resource: Reference + /** + * Version of the resource on which the change or action was performed. + * + * + */ + readonly resourceVersion: number + /** + * User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + * + * + */ + readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers +} +/** + * Generated after a successful [Unfreeze Cart](ctp:api:type:CartUnfreezeCartAction) update action. + * + */ +export interface CartUnfrozenMessage extends IMessage { + readonly type: 'CartUnfrozen' + /** + * Unique identifier of the Message. Can be used to track which Messages have been processed. + * + */ + readonly id: string + /** + * Version of a resource. In case of Messages, this is always `1`. + * + */ + readonly version: number + /** + * Date and time (UTC) the Message was generated. + * + */ + readonly createdAt: string + /** + * Value of `createdAt`. + * + */ + readonly lastModifiedAt: string + /** + * IDs and references that last modified the Message. + * + * + */ + readonly lastModifiedBy?: LastModifiedBy + /** + * IDs and references that created the Message. + * + * + */ + readonly createdBy?: CreatedBy + /** + * Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + * `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + * + * + */ + readonly sequenceNumber: number + /** + * [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + * + * + */ + readonly resource: Reference + /** + * Version of the resource on which the change or action was performed. + * + * + */ + readonly resourceVersion: number + /** + * User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + * + * + */ + readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers +} /** * Generated after a successful [Create Category](ctp:api:endpoint:/{projectKey}/categories:POST) request. * @@ -8630,6 +8763,12 @@ export interface InventoryEntryQuantitySetMessage extends IMessage { * */ readonly newAvailableQuantity: number + /** + * SKU of the [InventoryEntry](ctp:api:type:InventoryEntry) for which the quantity was updated. + * + * + */ + readonly sku?: string /** * [Reference](ctp:api:type:Reference) to the [Channel](ctp:api:type:Channel) where the [InventoryEntry](ctp:api:type:InventoryEntry) quantity was set. * @@ -11888,7 +12027,83 @@ export interface OrderPaymentAddedMessage extends IMessage { * * */ - readonly payment: PaymentReference + readonly paymentRef: PaymentReference +} +/** + * Generated after a successful [Remove Payment](ctp:api:type:OrderRemovePaymentAction) update action or when a [Payment](ctp:api:type:Payment) is removed via [Order Edits](ctp:api:type:StagedOrderRemovePaymentAction). + * + */ +export interface OrderPaymentRemovedMessage extends IMessage { + readonly type: 'OrderPaymentRemoved' + /** + * Unique identifier of the Message. Can be used to track which Messages have been processed. + * + */ + readonly id: string + /** + * Version of a resource. In case of Messages, this is always `1`. + * + */ + readonly version: number + /** + * Date and time (UTC) the Message was generated. + * + */ + readonly createdAt: string + /** + * Value of `createdAt`. + * + */ + readonly lastModifiedAt: string + /** + * IDs and references that last modified the Message. + * + * + */ + readonly lastModifiedBy?: LastModifiedBy + /** + * IDs and references that created the Message. + * + * + */ + readonly createdBy?: CreatedBy + /** + * Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + * `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + * + * + */ + readonly sequenceNumber: number + /** + * [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + * + * + */ + readonly resource: Reference + /** + * Version of the resource on which the change or action was performed. + * + * + */ + readonly resourceVersion: number + /** + * User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + * + * + */ + readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers + /** + * [Payment](ctp:api:type:Payment) that was removed from the [Order](ctp:api:type:Order). + * + * + */ + readonly paymentRef: PaymentReference + /** + * Indicates whether the removal of the Payment resulted in no Payments remaining on the Order. The value is `true` if all Payments have been removed (none remain), and `false` if there are still Payments associated with the Order after the removal. + * + * + */ + readonly removedPaymentInfo: boolean } /** * Generated after a successful [Change PaymentState](ctp:api:type:OrderChangePaymentStateAction) update action. @@ -20509,6 +20724,100 @@ export interface RecurringOrderExpiresAtSetMessage extends IMessage { */ readonly oldExpiresAt: string } +/** + * Generated after a [RecurringOrder](ctp:api:type:RecurringOrder) failed to process an Order. + * + */ +export interface RecurringOrderFailedMessage extends IMessage { + readonly type: 'RecurringOrderFailed' + /** + * Unique identifier of the Message. Can be used to track which Messages have been processed. + * + */ + readonly id: string + /** + * Version of a resource. In case of Messages, this is always `1`. + * + */ + readonly version: number + /** + * Date and time (UTC) the Message was generated. + * + */ + readonly createdAt: string + /** + * Value of `createdAt`. + * + */ + readonly lastModifiedAt: string + /** + * IDs and references that last modified the Message. + * + * + */ + readonly lastModifiedBy?: LastModifiedBy + /** + * IDs and references that created the Message. + * + * + */ + readonly createdBy?: CreatedBy + /** + * Message number in relation to other Messages for a given resource. The `sequenceNumber` of the next Message for the resource is the successor of the `sequenceNumber` of the current Message. Meaning, the `sequenceNumber` of the next Message equals the `sequenceNumber` of the current Message + 1. + * `sequenceNumber` can be used to ensure that Messages are processed in the correct order for a particular resource. + * + * + */ + readonly sequenceNumber: number + /** + * [Reference](ctp:api:type:Reference) to the resource on which the change or action was performed. + * + * + */ + readonly resource: Reference + /** + * Version of the resource on which the change or action was performed. + * + * + */ + readonly resourceVersion: number + /** + * User-provided identifiers of the resource, such as `key` or `externalId`. Only present if the resource has such identifiers. + * + * + */ + readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers + /** + * ID of the [Cart](ctp:api:type:Cart) used in the failed Order creation attempt. + * + * + */ + readonly cartId: string + /** + * Date and time (UTC) when the Order creation attempt failed. + * + * + */ + readonly failedAt: string + /** + * Description of why the Order creation failed, such as insufficient stock. + * + * + */ + readonly failureReason: string + /** + * Date and time (UTC) the Order was scheduled to be created. + * + * + */ + readonly orderScheduledAt: string + /** + * Errors due to which the Order creation failed. + * + * + */ + readonly errors?: RecurringOrderFailureError[] +} /** * Generated after a successful [Set Key](ctp:api:type:RecurringOrderSetKeyAction) update action. * @@ -23787,6 +24096,8 @@ export type MessagePayload = | CartDiscountStoreAddedMessagePayload | CartDiscountStoreRemovedMessagePayload | CartDiscountStoresSetMessagePayload + | CartFrozenMessagePayload + | CartUnfrozenMessagePayload | CategoryCreatedMessagePayload | CategorySlugChangedMessagePayload | CustomLineItemStateTransitionMessagePayload @@ -23876,6 +24187,7 @@ export type MessagePayload = | OrderLineItemRemovedMessagePayload | OrderMessagePayload | OrderPaymentAddedMessagePayload + | OrderPaymentRemovedMessagePayload | OrderPaymentStateChangedMessagePayload | OrderPurchaseOrderNumberSetMessagePayload | OrderReturnShipmentStateChangedMessagePayload @@ -23985,6 +24297,7 @@ export type MessagePayload = | RecurringOrderCustomTypeSetMessagePayload | RecurringOrderDeletedMessagePayload | RecurringOrderExpiresAtSetMessagePayload + | RecurringOrderFailedMessagePayload | RecurringOrderKeySetMessagePayload | RecurringOrderScheduleSetMessagePayload | RecurringOrderStartsAtSetMessagePayload @@ -25049,6 +25362,20 @@ export interface CartDiscountStoresSetMessagePayload extends IMessagePayload { */ readonly stores: StoreKeyReference[] } +/** + * Generated after a successful [Freeze Cart](ctp:api:type:CartFreezeCartAction) update action. + * + */ +export interface CartFrozenMessagePayload extends IMessagePayload { + readonly type: 'CartFrozen' +} +/** + * Generated after a successful [Unfreeze Cart](ctp:api:type:CartUnfreezeCartAction) update action. + * + */ +export interface CartUnfrozenMessagePayload extends IMessagePayload { + readonly type: 'CartUnfrozen' +} /** * Generated after a successful [Create Category](ctp:api:endpoint:/{projectKey}/categories:POST) request. * @@ -25896,6 +26223,12 @@ export interface InventoryEntryQuantitySetMessagePayload * */ readonly newAvailableQuantity: number + /** + * SKU of the [InventoryEntry](ctp:api:type:InventoryEntry) for which the quantity was updated. + * + * + */ + readonly sku?: string /** * [Reference](ctp:api:type:Reference) to the [Channel](ctp:api:type:Channel) where the [InventoryEntry](ctp:api:type:InventoryEntry) quantity was set. * @@ -26878,7 +27211,26 @@ export interface OrderPaymentAddedMessagePayload extends IMessagePayload { * * */ - readonly payment: PaymentReference + readonly paymentRef: PaymentReference +} +/** + * Generated after a successful [Remove Payment](ctp:api:type:OrderRemovePaymentAction) update action or when a [Payment](ctp:api:type:Payment) is removed via [Order Edits](ctp:api:type:StagedOrderRemovePaymentAction). + * + */ +export interface OrderPaymentRemovedMessagePayload extends IMessagePayload { + readonly type: 'OrderPaymentRemoved' + /** + * [Payment](ctp:api:type:Payment) that was removed from the [Order](ctp:api:type:Order). + * + * + */ + readonly paymentRef: PaymentReference + /** + * Indicates whether the removal of the Payment resulted in no Payments remaining on the Order. The value is `true` if all Payments have been removed (none remain), and `false` if there are still Payments associated with the Order after the removal. + * + * + */ + readonly removedPaymentInfo: boolean } /** * Generated after a successful [Change PaymentState](ctp:api:type:OrderChangePaymentStateAction) update action. @@ -29307,6 +29659,43 @@ export interface RecurringOrderExpiresAtSetMessagePayload */ readonly oldExpiresAt: string } +/** + * Generated after a [RecurringOrder](ctp:api:type:RecurringOrder) failed to process an Order. + * + */ +export interface RecurringOrderFailedMessagePayload extends IMessagePayload { + readonly type: 'RecurringOrderFailed' + /** + * ID of the [Cart](ctp:api:type:Cart) used in the failed Order creation attempt. + * + * + */ + readonly cartId: string + /** + * Date and time (UTC) when the Order creation attempt failed. + * + * + */ + readonly failedAt: string + /** + * Description of why the Order creation failed, such as insufficient stock. + * + * + */ + readonly failureReason: string + /** + * Date and time (UTC) the Order was scheduled to be created. + * + * + */ + readonly orderScheduledAt: string + /** + * Errors due to which the Order creation failed. + * + * + */ + readonly errors?: RecurringOrderFailureError[] +} /** * Generated after a successful [Set Key](ctp:api:type:RecurringOrderSetKeyAction) update action. * diff --git a/packages/platform-sdk/src/generated/models/order-edit.ts b/packages/platform-sdk/src/generated/models/order-edit.ts index 3cbd602d5..1ef6656cb 100644 --- a/packages/platform-sdk/src/generated/models/order-edit.ts +++ b/packages/platform-sdk/src/generated/models/order-edit.ts @@ -591,6 +591,8 @@ export interface StagedOrderAddCustomLineItemAction * A [Delivery](ctp:api:type:Delivery) can only be added to an [Order](ctp:api:type:Order) if * its `shippingInfo` (for `shippingMode` = `Single`), or its `shipping` (for `shippingMode` = `Multiple`) exists. * + * Multiple Deliveries can be added to the same Order to represent split or partial shipments. However, the API doesn't validate that the cumulative quantities of Line Items or Custom Line Items across all Deliveries match or stay within the originally ordered quantities. For more information, see [Multiple Deliveries](/../api/shipping-delivery-overview#multiple-deliveries) on the Shipping and Delivery overview page. + * * Produces the [Delivery Added](ctp:api:type:DeliveryAddedMessage) Message. * */ @@ -636,8 +638,10 @@ export interface StagedOrderAddDeliveryAction extends IStagedOrderUpdateAction { readonly custom?: CustomFieldsDraft } /** - * Adds a [DiscountCode](ctp:api:type:DiscountCode) to the Cart to activate the related [Cart Discounts](/../api/projects/cartDiscounts). - * Adding a Discount Code is only possible if no [DirectDiscount](ctp:api:type:DirectDiscount) has been applied to the Order. + * Adds a [DiscountCode](ctp:api:type:DiscountCode) to the Order to activate the related [Cart Discounts](/../api/projects/cartDiscounts). + * If the related Cart Discounts are inactive or invalid, or belong to a different Store than the Order, a [DiscountCodeNonApplicableError](ctp:api:type:DiscountCodeNonApplicableError) is returned. + * + * A Discount Code can be added only if no [DirectDiscount](ctp:api:type:DirectDiscount) has been applied to the Order. * * The maximum number of Discount Codes in a Cart is restricted by a [limit](/../api/limits#carts). * @@ -845,6 +849,10 @@ export interface StagedOrderAddParcelToDeliveryAction */ readonly custom?: CustomFieldsDraft } +/** + * Produces the [Order Payment Added](ctp:api:type:OrderPaymentAddedMessage) Message. + * + */ export interface StagedOrderAddPaymentAction extends IStagedOrderUpdateAction { readonly action: 'addPayment' /** @@ -1258,8 +1266,8 @@ export interface StagedOrderRemoveLineItemAction */ readonly lineItemKey?: string /** - * New value to set. - * If absent or `0`, the Line Item is removed from the Cart. + * Amount to subtract from the LineItem quantity. + * If omitted, the LineItem is removed from the Order. * * */ @@ -1309,6 +1317,10 @@ export interface StagedOrderRemoveParcelFromDeliveryAction */ readonly parcelKey?: string } +/** + * Produces the [Order Payment Removed](ctp:api:type:OrderPaymentRemovedMessage) Message. + * + */ export interface StagedOrderRemovePaymentAction extends IStagedOrderUpdateAction { readonly action: 'removePayment' diff --git a/packages/platform-sdk/src/generated/models/order.ts b/packages/platform-sdk/src/generated/models/order.ts index 085d582f4..f1c9de75b 100644 --- a/packages/platform-sdk/src/generated/models/order.ts +++ b/packages/platform-sdk/src/generated/models/order.ts @@ -1974,7 +1974,7 @@ export interface IReturnItem { */ readonly lastModifiedAt: string /** - * Date and time (UTC) the Return Item was intitially created. + * Date and time (UTC) the Return Item was initially created. * * */ @@ -2033,7 +2033,7 @@ export interface CustomLineItemReturnItem extends IReturnItem { */ readonly lastModifiedAt: string /** - * Date and time (UTC) the Return Item was intitially created. + * Date and time (UTC) the Return Item was initially created. * * */ @@ -2098,7 +2098,7 @@ export interface LineItemReturnItem extends IReturnItem { */ readonly lastModifiedAt: string /** - * Date and time (UTC) the Return Item was intitially created. + * Date and time (UTC) the Return Item was initially created. * * */ @@ -2346,6 +2346,8 @@ export interface TrackingData { * A [Delivery](ctp:api:type:Delivery) can only be added to an [Order](ctp:api:type:Order) if * its `shippingInfo` (for `shippingMode` = `Single`), or its `shipping` (for `shippingMode` = `Multiple`) exists. * + * Multiple Deliveries can be added to the same Order to represent split or partial shipments. However, the API doesn't validate that the cumulative quantities of Line Items or Custom Line Items across all Deliveries match or stay within the originally ordered quantities. For more information, see [Multiple Deliveries](/../api/shipping-delivery-overview#multiple-deliveries) on the Shipping and Delivery overview page. + * * Produces the [Delivery Added](ctp:api:type:DeliveryAddedMessage) Message. * */ @@ -2459,6 +2461,10 @@ export interface OrderAddParcelToDeliveryAction extends IOrderUpdateAction { */ readonly custom?: CustomFieldsDraft } +/** + * Produces the [Order Payment Added](ctp:api:type:OrderPaymentAddedMessage) Message. + * + */ export interface OrderAddPaymentAction extends IOrderUpdateAction { readonly action: 'addPayment' /** @@ -2650,6 +2656,10 @@ export interface OrderRemoveParcelFromDeliveryAction */ readonly parcelKey?: string } +/** + * Produces the [Order Payment Removed](ctp:api:type:OrderPaymentRemovedMessage) Message. + * + */ export interface OrderRemovePaymentAction extends IOrderUpdateAction { readonly action: 'removePayment' /** diff --git a/packages/platform-sdk/src/generated/models/product-discount.ts b/packages/platform-sdk/src/generated/models/product-discount.ts index 8a2fe45bc..b9a25b1f2 100644 --- a/packages/platform-sdk/src/generated/models/product-discount.ts +++ b/packages/platform-sdk/src/generated/models/product-discount.ts @@ -98,7 +98,8 @@ export interface ProductDiscount extends BaseResource { */ readonly isActive: boolean /** - * References of all the resources that are addressed in the `predicate`. + * References to all resources addressed in the `predicate` by their IDs. + * This value is generated by the platform. * * */ diff --git a/packages/platform-sdk/src/generated/models/project.ts b/packages/platform-sdk/src/generated/models/project.ts index 2bfb309a4..b92dae049 100644 --- a/packages/platform-sdk/src/generated/models/project.ts +++ b/packages/platform-sdk/src/generated/models/project.ts @@ -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. * * */ @@ -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). * @@ -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 { /** @@ -290,6 +320,7 @@ export type ProjectUpdateAction = | ProjectChangeShoppingListsConfigurationAction | ProjectChangeTaxRoundingModeAction | ProjectSetBusinessUnitAssociateRoleOnCreationAction + | ProjectSetDiscountsConfigurationAction | ProjectSetExternalOAuthAction | ProjectSetShippingRateInputTypeAction export interface IProjectUpdateAction { @@ -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' /** diff --git a/packages/platform-sdk/src/generated/models/recurring-order.ts b/packages/platform-sdk/src/generated/models/recurring-order.ts index 3ef3b9636..f3a0397f7 100644 --- a/packages/platform-sdk/src/generated/models/recurring-order.ts +++ b/packages/platform-sdk/src/generated/models/recurring-order.ts @@ -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. * @@ -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. * diff --git a/packages/platform-sdk/src/generated/models/search.ts b/packages/platform-sdk/src/generated/models/search.ts index db4058b46..9a51101d8 100644 --- a/packages/platform-sdk/src/generated/models/search.ts +++ b/packages/platform-sdk/src/generated/models/search.ts @@ -119,6 +119,7 @@ export type _SearchQueryExpression = | SearchExistsExpression | SearchFullTextExpression | SearchFullTextPrefixExpression + | SearchFuzzyExpression | SearchLongRangeExpression | SearchNumberRangeExpression | SearchPrefixExpression @@ -160,6 +161,12 @@ export interface SearchFullTextPrefixExpression extends SearchQueryExpression { */ readonly fullTextPrefix: SearchFullTextPrefixValue } +export interface SearchFuzzyExpression extends SearchQueryExpression { + /** + * + */ + readonly fuzzy: SearchFuzzyValue +} export interface SearchLongRangeExpression extends SearchQueryExpression { /** * @@ -202,6 +209,7 @@ export type _SearchQueryExpressionValue = | SearchExistsValue | SearchFullTextPrefixValue | SearchFullTextValue + | SearchFuzzyValue | SearchLongRangeValue | SearchNumberRangeValue | SearchTimeRangeValue @@ -317,6 +325,36 @@ export interface SearchFullTextValue extends SearchQueryExpressionValue { */ readonly mustMatch?: SearchMatchType } +export interface SearchFuzzyValue extends SearchQueryExpressionValue { + /** + * The search term to find fuzzy matches for. If multiple terms are provided (separated by whitespace), the fuzziness level is applied to each term individually. + * + * + */ + readonly value: any + /** + * The maximum fuzziness level desired for the search term. Allowed values are `0`, `1`, and `2`. The API automatically adjusts the effective fuzziness level based on the length of the search term if it exceeds the maximum allowed for the given string length according to the following rules: + * + * * Terms with 1-2 characters: 0 (exact match) + * * Terms with 3-5 characters: 1 (up to one difference is allowed) + * * Terms with more than 5 characters: 2 (up to two differences are allowed) + * + * + */ + readonly level: number + /** + * Language of the localized value. Must be provided when the field is of type `localizedTextField`. The provided Locale must be one of the Project's languages. + * + * + */ + readonly language?: string + /** + * Controls whether all of the provided terms must match (`all`, default) or any of those (`any`). + * + * + */ + readonly mustMatch?: SearchMatchType +} export interface SearchLongRangeValue extends SearchQueryExpressionValue { /** * diff --git a/packages/platform-sdk/src/generated/models/standalone-price.ts b/packages/platform-sdk/src/generated/models/standalone-price.ts index 29c35dcb0..616a691e0 100644 --- a/packages/platform-sdk/src/generated/models/standalone-price.ts +++ b/packages/platform-sdk/src/generated/models/standalone-price.ts @@ -466,7 +466,7 @@ export interface StandalonePriceRemovePriceTierAction * * */ - readonly tierMinimumQuantity: number + readonly minimumQuantity: number } /** * Removes all staged changes from the StandalonePrice. diff --git a/packages/platform-sdk/src/generated/models/store.ts b/packages/platform-sdk/src/generated/models/store.ts index 3d92249f6..dc154de52 100644 --- a/packages/platform-sdk/src/generated/models/store.ts +++ b/packages/platform-sdk/src/generated/models/store.ts @@ -130,7 +130,7 @@ export interface Store extends BaseResource { * - Leave empty if all Products in the [Project](ctp:api:type:Project) should be available in this Store. * - If only `inactive` Product Selections with `IndividualExclusion` [ProductSelectionMode](ctp:api:type:ProductSelectionMode) are provided, all the Products are available in this Store. * - If all the Product Selections provided are `inactive` and there's at least a Product Selection of mode `Individual`, no Product is available in this Store. - * - If at least an `active` Product Selection is provided, only `active` Product Selections are considered to compute the availlability in this Store. + * - If at least an `active` Product Selection is provided, only `active` Product Selections are considered to compute the availability in this Store. * */ readonly productSelections: ProductSelectionSetting[] diff --git a/packages/platform-sdk/test/generated/client/merge/by-project-key-carts-customer-id-by-customer-id-merge-request-builder.test.ts b/packages/platform-sdk/test/generated/client/merge/by-project-key-carts-customer-id-by-customer-id-merge-request-builder.test.ts new file mode 100644 index 000000000..7e35ee519 --- /dev/null +++ b/packages/platform-sdk/test/generated/client/merge/by-project-key-carts-customer-id-by-customer-id-merge-request-builder.test.ts @@ -0,0 +1,38 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ + +import { RequestWithMethod } from '../../../request-with-method' +import { ApiRoot } from '../../../../src' + +const apiRoot: ApiRoot = new ApiRoot({ executeRequest: null }) + +export function getRequestsWithMethodParameters(): RequestWithMethod[] { + return [ + { + method: 'post', + uri: '/test_projectKey/carts/customer-id=test_customerId/merge', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .carts() + .customerIdWithCustomerIdValueMerge({ customerId: 'test_customerId' }) + .post({ body: null, headers: null }), + }, + ] +} + +describe('Testing ByProjectKeyCartsCustomerIdByCustomerIdMergeRequestBuilder Requests', () => { + const requestsToTest = getRequestsWithMethodParameters() + requestsToTest.forEach((rm) => { + test(`Testing => request method: ${rm.method} and url: ${rm.uri}`, async () => { + expect(rm.method.toLowerCase()).toBe( + rm.request.clientRequest().method.toLowerCase() + ) + expect(rm.uri.toLowerCase()).toBe( + rm.request.clientRequest().uri.toLowerCase() + ) + }) + }) +}) diff --git a/packages/platform-sdk/test/generated/client/merge/by-project-key-in-store-key-by-store-key-carts-customer-id-by-customer-id-merge-request-builder.test.ts b/packages/platform-sdk/test/generated/client/merge/by-project-key-in-store-key-by-store-key-carts-customer-id-by-customer-id-merge-request-builder.test.ts new file mode 100644 index 000000000..0d1614899 --- /dev/null +++ b/packages/platform-sdk/test/generated/client/merge/by-project-key-in-store-key-by-store-key-carts-customer-id-by-customer-id-merge-request-builder.test.ts @@ -0,0 +1,39 @@ +/** + * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT. + * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it. + * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/. + */ + +import { RequestWithMethod } from '../../../request-with-method' +import { ApiRoot } from '../../../../src' + +const apiRoot: ApiRoot = new ApiRoot({ executeRequest: null }) + +export function getRequestsWithMethodParameters(): RequestWithMethod[] { + return [ + { + method: 'post', + uri: '/test_projectKey/in-store/key=test_storeKey/carts/customer-id=test_customerId/merge', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .inStoreKeyWithStoreKeyValue({ storeKey: 'test_storeKey' }) + .carts() + .customerIdWithCustomerIdValueMerge({ customerId: 'test_customerId' }) + .post({ body: null, headers: null }), + }, + ] +} + +describe('Testing ByProjectKeyInStoreKeyByStoreKeyCartsCustomerIdByCustomerIdMergeRequestBuilder Requests', () => { + const requestsToTest = getRequestsWithMethodParameters() + requestsToTest.forEach((rm) => { + test(`Testing => request method: ${rm.method} and url: ${rm.uri}`, async () => { + expect(rm.method.toLowerCase()).toBe( + rm.request.clientRequest().method.toLowerCase() + ) + expect(rm.uri.toLowerCase()).toBe( + rm.request.clientRequest().uri.toLowerCase() + ) + }) + }) +}) diff --git a/packages/platform-sdk/test/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-by-id-request-builder.test.ts b/packages/platform-sdk/test/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-by-id-request-builder.test.ts index 0e8eab616..d8912ae58 100644 --- a/packages/platform-sdk/test/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-by-id-request-builder.test.ts +++ b/packages/platform-sdk/test/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-by-id-request-builder.test.ts @@ -95,6 +95,16 @@ export function getRequestsWithMethodParameters(): RequestWithMethod[] { .withId({ ID: 'test_ID' }) .get({ queryArgs: { localeProjection: 'localeProjection' } }), }, + { + method: 'get', + uri: '/test_projectKey/in-store/key=test_storeKey/product-projections/test_ID?filter[attributes]=filter[attributes]', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .inStoreKeyWithStoreKeyValue({ storeKey: 'test_storeKey' }) + .productProjections() + .withId({ ID: 'test_ID' }) + .get({ queryArgs: { 'filter[attributes]': 'filter[attributes]' } }), + }, { method: 'get', uri: '/test_projectKey/in-store/key=test_storeKey/product-projections/test_ID?expand=expand', diff --git a/packages/platform-sdk/test/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-key-by-key-request-builder.test.ts b/packages/platform-sdk/test/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-key-by-key-request-builder.test.ts index 0955f663c..6e27eb89c 100644 --- a/packages/platform-sdk/test/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-key-by-key-request-builder.test.ts +++ b/packages/platform-sdk/test/generated/client/product-projections/by-project-key-in-store-key-by-store-key-product-projections-key-by-key-request-builder.test.ts @@ -95,6 +95,16 @@ export function getRequestsWithMethodParameters(): RequestWithMethod[] { .withKey({ key: 'test_key' }) .get({ queryArgs: { localeProjection: 'localeProjection' } }), }, + { + method: 'get', + uri: '/test_projectKey/in-store/key=test_storeKey/product-projections/key=test_key?filter[attributes]=filter[attributes]', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .inStoreKeyWithStoreKeyValue({ storeKey: 'test_storeKey' }) + .productProjections() + .withKey({ key: 'test_key' }) + .get({ queryArgs: { 'filter[attributes]': 'filter[attributes]' } }), + }, { method: 'get', uri: '/test_projectKey/in-store/key=test_storeKey/product-projections/key=test_key?expand=expand', diff --git a/packages/platform-sdk/test/generated/client/product-projections/by-project-key-product-projections-by-id-request-builder.test.ts b/packages/platform-sdk/test/generated/client/product-projections/by-project-key-product-projections-by-id-request-builder.test.ts index ea30a1bf0..029b74ec5 100644 --- a/packages/platform-sdk/test/generated/client/product-projections/by-project-key-product-projections-by-id-request-builder.test.ts +++ b/packages/platform-sdk/test/generated/client/product-projections/by-project-key-product-projections-by-id-request-builder.test.ts @@ -96,6 +96,15 @@ export function getRequestsWithMethodParameters(): RequestWithMethod[] { .withId({ ID: 'test_ID' }) .get({ queryArgs: { storeProjection: 'storeProjection' } }), }, + { + method: 'get', + uri: '/test_projectKey/product-projections/test_ID?filter[attributes]=filter[attributes]', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .productProjections() + .withId({ ID: 'test_ID' }) + .get({ queryArgs: { 'filter[attributes]': 'filter[attributes]' } }), + }, { method: 'get', uri: '/test_projectKey/product-projections/test_ID?expand=expand', diff --git a/packages/platform-sdk/test/generated/client/product-projections/by-project-key-product-projections-key-by-key-request-builder.test.ts b/packages/platform-sdk/test/generated/client/product-projections/by-project-key-product-projections-key-by-key-request-builder.test.ts index b5e838787..16021eff8 100644 --- a/packages/platform-sdk/test/generated/client/product-projections/by-project-key-product-projections-key-by-key-request-builder.test.ts +++ b/packages/platform-sdk/test/generated/client/product-projections/by-project-key-product-projections-key-by-key-request-builder.test.ts @@ -96,6 +96,15 @@ export function getRequestsWithMethodParameters(): RequestWithMethod[] { .withKey({ key: 'test_key' }) .get({ queryArgs: { storeProjection: 'storeProjection' } }), }, + { + method: 'get', + uri: '/test_projectKey/product-projections/key=test_key?filter[attributes]=filter[attributes]', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .productProjections() + .withKey({ key: 'test_key' }) + .get({ queryArgs: { 'filter[attributes]': 'filter[attributes]' } }), + }, { method: 'get', uri: '/test_projectKey/product-projections/key=test_key?expand=expand', diff --git a/packages/platform-sdk/test/generated/client/product-projections/by-project-key-product-projections-request-builder.test.ts b/packages/platform-sdk/test/generated/client/product-projections/by-project-key-product-projections-request-builder.test.ts index b71dfa2e8..f360afb3d 100644 --- a/packages/platform-sdk/test/generated/client/product-projections/by-project-key-product-projections-request-builder.test.ts +++ b/packages/platform-sdk/test/generated/client/product-projections/by-project-key-product-projections-request-builder.test.ts @@ -87,6 +87,14 @@ export function getRequestsWithMethodParameters(): RequestWithMethod[] { .productProjections() .get({ queryArgs: { storeProjection: 'storeProjection' } }), }, + { + method: 'get', + uri: '/test_projectKey/product-projections?filter[attributes]=filter[attributes]', + request: apiRoot + .withProjectKey({ projectKey: 'test_projectKey' }) + .productProjections() + .get({ queryArgs: { 'filter[attributes]': 'filter[attributes]' } }), + }, { method: 'get', uri: '/test_projectKey/product-projections?expand=expand', diff --git a/reference.txt b/reference.txt new file mode 100644 index 000000000..b8501ec6c --- /dev/null +++ b/reference.txt @@ -0,0 +1 @@ +1b925f1c99aae06ddb51265cb5774ffe1fa90015 diff --git a/references.txt b/references.txt index b2bc06300..7785e3600 100644 --- a/references.txt +++ b/references.txt @@ -462,3 +462,22 @@ f890eb4fa0cfcd4c9ee767edd8106a4690a4dd7b 946b77339c0aa1f9205ccf4966e26de47cac11f3 bf9886771c750bd43c1fc124dd6689ef4e3b45c5 ea7ba668e4084d845f2f3871c239999f43613b28 +7c8466665829aaf9142b056c57fe5b32c4072076 +263e58a9f68bacfe67cd292b203c956d5ae9f264 +780cff25cc0c08ba669762069bb264848aa5f6d5 +503a69044e9969bc058a116a7f7ecd4556c85258 +85ec5b54fce964cd50dc254ed39d0ab1137076bc +65b14540239650479b1799503b3c9e3180d93186 +2e90c8c066eb618de26c10124e1d007cdfc842a4 +3999f168839d6e67496250d2c2c83edd7f7f5a59 +524cda1d7939151daccfc43d29db2af42b52c592 +2d80e476e7b846987e3c2db6fdba76c470f1c173 +2ca7fba4e989ff96a2a3008d3168ea243c9cc3a8 +62910ed7ec4d1110dd8e5c98acc931a7df092a2e +021ca761240e06e31ec45855e8660b712be31817 +bfb534af33764ac81a3784290b35530d926fccf1 +37f4edec0935ea3be543d48720fb67438c2ab341 +47d240c55478dd0c0e1aa47288c432f785240168 +68fb22e84fc95421ac888349924233d728ef2838 +78d1ed9c74ad1fd8f47f014bc4fe96ce2720d509 +603e489748f9c32c1891d60d6f767892a8ea5207