diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md index 7ba24bf3de2..0e09f3479e0 100644 --- a/lib/commercetools-api/docs/RequestBuilder.md +++ b/lib/commercetools-api/docs/RequestBuilder.md @@ -3006,9 +3006,6 @@ $request = $builder ``` ## `withProjectKey("projectKey")->customers()->post(null)` -If the `anonymousCart` field is set on the [CustomerDraft](ctp:api:type:CustomerDraft), then the newly created Customer will be assigned to that [Cart](ctp:api:type:Cart). -Similarly, if the `anonymousId` field is set, the Customer will be set on all [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [ShoppingLists](ctp:api:type:ShoppingList) and [Payments](ctp:api:type:Payment) with the same `anonymousId`. - 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. @@ -4573,10 +4570,10 @@ $request = $builder When using this endpoint, if omitted, the Customer `stores` field is set to the [Store](ctp:api:type:Store) specified in the path parameter. -If the `anonymousCart` field is set on the [CustomerDraft](ctp:api:type:CustomerDraft), then the newly created Customer will be assigned to that [Cart](ctp:api:type:Cart). -Similarly, if the `anonymousId` field is set, the Customer will be set on all [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [ShoppingLists](ctp:api:type:ShoppingList) and [Payments](ctp:api:type:Payment) with the same `anonymousId`. 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. + 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. @@ -4880,11 +4877,9 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->login()->post(null)` -Authenticates a Customer associated with a [Store](ctp:api:type:Store). For more information, see [Global versus Store-specific Customers](/../api/customers-overview#global-versus-store-specific-customers). +Authenticates a Customer associated with a [Store](ctp:api:type:Store). -A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#update-a-cart) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). - -Triggers [Cart merge during sign-in](/../api/customers-overview#cart-merge-during-sign-in). +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. 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. @@ -5197,8 +5192,6 @@ If used with an optional [access token for an anonymous session](ctp:api:type:An - If the Customer does not have a Cart, the most recently modified anonymous cart becomes the Customer's Cart. - If the Customer already has a Cart, the most recently modified anonymous cart is handled according to [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode). -A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#update-a-cart) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). - If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. @@ -5655,12 +5648,11 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->signup()->post(null)` - If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly created Customer. If omitted in the request body, the [Customer](ctp:api:type:Customer) `stores` field is set to the [Store](ctp:api:type:Store) specified in the path parameter. -A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#update-a-cart) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). +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. Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. @@ -7136,13 +7128,9 @@ $request = $builder ``` ## `withProjectKey("projectKey")->login()->post(null)` -Authenticates a global Customer not associated with a Store. -For more information, see [Global versus Store-specific Customers](/../api/customers-overview#global-versus-store-specific-customers). -If the Customer is registered in a Store, use the [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/login:POST) method. - -Triggers [Cart merge during sign-in](/../api/customers-overview#cart-merge-during-sign-in). +Authenticates a global Customer. -A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#update-a-cart) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). +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. If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. @@ -7599,8 +7587,6 @@ If used with an optional [access token for an anonymous session](ctp:api:type:An - If the Customer does not have a Cart yet, the most recently modified anonymous cart becomes the Customer's Cart. - If the Customer already has a Cart, the most recently modified anonymous cart is handled in accordance with [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode). -A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#update-a-cart) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). - If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. diff --git a/lib/commercetools-api/src/Models/Customer/CustomerDraft.php b/lib/commercetools-api/src/Models/Customer/CustomerDraft.php index 7a4dfd7ebfa..b87e895f8c1 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerDraft.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerDraft.php @@ -135,7 +135,7 @@ public function getTitle(); public function getAnonymousCartId(); /** - *

Identifies a Cart that will be assigned to the new Customer.

+ *

Assigns the Customer to the specified Cart.

* * @return null|CartResourceIdentifier @@ -143,7 +143,8 @@ public function getAnonymousCartId(); public function getAnonymousCart(); /** - *

Identifies Carts and Orders belonging to an anonymous session that will be assigned to the new Customer.

+ *

Assigns the Customer to all Carts, Orders, ShoppingLists, and Payments with the same anonymousId.

+ *

If anonymousCart is provided, this value must match the anonymousId of the anonymous Cart; otherwise, an InvalidOperation error is returned.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php index 79a02d06258..0c184a05039 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerDraftBuilder.php @@ -314,7 +314,7 @@ public function getAnonymousCartId() } /** - *

Identifies a Cart that will be assigned to the new Customer.

+ *

Assigns the Customer to the specified Cart.

* * @return null|CartResourceIdentifier @@ -325,7 +325,8 @@ public function getAnonymousCart() } /** - *

Identifies Carts and Orders belonging to an anonymous session that will be assigned to the new Customer.

+ *

Assigns the Customer to all Carts, Orders, ShoppingLists, and Payments with the same anonymousId.

+ *

If anonymousCart is provided, this value must match the anonymousId of the anonymous Cart; otherwise, an InvalidOperation error is returned.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php b/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php index 9f778f346d3..f9f8bd7cef2 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerDraftModel.php @@ -467,7 +467,7 @@ public function getAnonymousCartId() } /** - *

Identifies a Cart that will be assigned to the new Customer.

+ *

Assigns the Customer to the specified Cart.

* * * @return null|CartResourceIdentifier @@ -488,7 +488,8 @@ public function getAnonymousCart() } /** - *

Identifies Carts and Orders belonging to an anonymous session that will be assigned to the new Customer.

+ *

Assigns the Customer to all Carts, Orders, ShoppingLists, and Payments with the same anonymousId.

+ *

If anonymousCart is provided, this value must match the anonymousId of the anonymous Cart; otherwise, an InvalidOperation error is returned.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSignInResult.php b/lib/commercetools-api/src/Models/Customer/CustomerSignInResult.php index 4f310a36ec2..b1afed796f4 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSignInResult.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSignInResult.php @@ -26,8 +26,10 @@ interface CustomerSignInResult extends JsonObject public function getCustomer(); /** - *

Cart associated with the Customer. - * If empty, the Customer does not have a Cart assigned.

+ *

Cart associated with the Customer.

+ *

The Cart is recalculated to remove invalid Line Items and apply the latest prices, taxes, and discounts. + * During these updates, the following errors can be returned: MatchingPriceNotFound and MissingTaxRateForCountry.

+ *

For more information, see Cart updates.

* * @return null|Cart diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSignInResultBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSignInResultBuilder.php index c74b6831d11..b2db928c91b 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSignInResultBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSignInResultBuilder.php @@ -46,8 +46,10 @@ public function getCustomer() } /** - *

Cart associated with the Customer. - * If empty, the Customer does not have a Cart assigned.

+ *

Cart associated with the Customer.

+ *

The Cart is recalculated to remove invalid Line Items and apply the latest prices, taxes, and discounts. + * During these updates, the following errors can be returned: MatchingPriceNotFound and MissingTaxRateForCountry.

+ *

For more information, see Cart updates.

* * @return null|Cart diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSignInResultModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSignInResultModel.php index 0f83a7eb420..8995d3d34bb 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSignInResultModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSignInResultModel.php @@ -67,8 +67,10 @@ public function getCustomer() } /** - *

Cart associated with the Customer. - * If empty, the Customer does not have a Cart assigned.

+ *

Cart associated with the Customer.

+ *

The Cart is recalculated to remove invalid Line Items and apply the latest prices, taxes, and discounts. + * During these updates, the following errors can be returned: MatchingPriceNotFound and MissingTaxRateForCountry.

+ *

For more information, see Cart updates.

* * * @return null|Cart diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSignin.php b/lib/commercetools-api/src/Models/Customer/CustomerSignin.php index e22994a6e12..52a3f9515cb 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSignin.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSignin.php @@ -47,7 +47,7 @@ public function getPassword(); public function getAnonymousCartId(); /** - *

Identifies a Cart that will be assigned to the Customer.

+ *

Assigns the Customer to the specified Cart.

* * @return null|CartResourceIdentifier @@ -66,9 +66,8 @@ public function getAnonymousCart(); public function getAnonymousCartSignInMode(); /** - *

If both anonymousCart and anonymousId are provided, the anonymousId on the CustomerSignin must match that of the anonymous Cart. - * Otherwise a 400 Bad Request Invalid Operation error is returned with the message: - * "Cart with the ID cart-id does not have the expected anonymousId.".

+ *

Assigns the Customer to all Carts, Orders, ShoppingLists, and Payments with the same anonymousId.

+ *

If anonymousCart is provided, this value must match the anonymousId of the anonymous Cart; otherwise, an InvalidOperation error is returned.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSigninBuilder.php b/lib/commercetools-api/src/Models/Customer/CustomerSigninBuilder.php index ae699be6bce..b37b02f8b0f 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSigninBuilder.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSigninBuilder.php @@ -98,7 +98,7 @@ public function getAnonymousCartId() } /** - *

Identifies a Cart that will be assigned to the Customer.

+ *

Assigns the Customer to the specified Cart.

* * @return null|CartResourceIdentifier @@ -123,9 +123,8 @@ public function getAnonymousCartSignInMode() } /** - *

If both anonymousCart and anonymousId are provided, the anonymousId on the CustomerSignin must match that of the anonymous Cart. - * Otherwise a 400 Bad Request Invalid Operation error is returned with the message: - * "Cart with the ID cart-id does not have the expected anonymousId.".

+ *

Assigns the Customer to all Carts, Orders, ShoppingLists, and Payments with the same anonymousId.

+ *

If anonymousCart is provided, this value must match the anonymousId of the anonymous Cart; otherwise, an InvalidOperation error is returned.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Customer/CustomerSigninModel.php b/lib/commercetools-api/src/Models/Customer/CustomerSigninModel.php index 166ec0b2aad..e61737cb118 100644 --- a/lib/commercetools-api/src/Models/Customer/CustomerSigninModel.php +++ b/lib/commercetools-api/src/Models/Customer/CustomerSigninModel.php @@ -146,7 +146,7 @@ public function getAnonymousCartId() } /** - *

Identifies a Cart that will be assigned to the Customer.

+ *

Assigns the Customer to the specified Cart.

* * * @return null|CartResourceIdentifier @@ -190,9 +190,8 @@ public function getAnonymousCartSignInMode() } /** - *

If both anonymousCart and anonymousId are provided, the anonymousId on the CustomerSignin must match that of the anonymous Cart. - * Otherwise a 400 Bad Request Invalid Operation error is returned with the message: - * "Cart with the ID cart-id does not have the expected anonymousId.".

+ *

Assigns the Customer to all Carts, Orders, ShoppingLists, and Payments with the same anonymousId.

+ *

If anonymousCart is provided, this value must match the anonymousId of the anonymous Cart; otherwise, an InvalidOperation error is returned.

* * * @return null|string diff --git a/references.txt b/references.txt index 05b7139eb22..2cf2ba36aac 100644 --- a/references.txt +++ b/references.txt @@ -496,3 +496,4 @@ f8b027c8e1b5ba61ace3d3d358b9efc7ad4b93eb 63488aa919cebb6a9a606b287cd525eb7c588e99 12c86075166f683540662d5b7016fa7d48fe45e4 c6e3250e705b0c6fb714d7a6e0210872f9bfe0d5 +91ef231b5881c329f1c3f405e250106f8473b57e