Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 7 additions & 21 deletions lib/commercetools-api/docs/RequestBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down Expand Up @@ -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.


Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.


Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.


Expand Down
5 changes: 3 additions & 2 deletions lib/commercetools-api/src/Models/Customer/CustomerDraft.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,16 @@ public function getTitle();
public function getAnonymousCartId();

/**
* <p>Identifies a <a href="ctp:api:type:Cart">Cart</a> that will be assigned to the new Customer.</p>
* <p>Assigns the Customer to the specified Cart.</p>
*

* @return null|CartResourceIdentifier
*/
public function getAnonymousCart();

/**
* <p>Identifies Carts and Orders belonging to an anonymous session that will be assigned to the new Customer.</p>
* <p>Assigns the Customer to all <a href="ctp:api:type:Cart">Carts</a>, <a href="ctp:api:type:Order">Orders</a>, <a href="ctp:api:type:ShoppingList">ShoppingLists</a>, and <a href="ctp:api:type:Payment">Payments</a> with the same <code>anonymousId</code>.</p>
* <p>If <code>anonymousCart</code> is provided, this value must match the <code>anonymousId</code> of the anonymous <a href="ctp:api:type:Cart">Cart</a>; otherwise, an <a href="ctp:api:type:InvalidOperationError">InvalidOperation</a> error is returned.</p>
*

* @return null|string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public function getAnonymousCartId()
}

/**
* <p>Identifies a <a href="ctp:api:type:Cart">Cart</a> that will be assigned to the new Customer.</p>
* <p>Assigns the Customer to the specified Cart.</p>
*

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

/**
* <p>Identifies Carts and Orders belonging to an anonymous session that will be assigned to the new Customer.</p>
* <p>Assigns the Customer to all <a href="ctp:api:type:Cart">Carts</a>, <a href="ctp:api:type:Order">Orders</a>, <a href="ctp:api:type:ShoppingList">ShoppingLists</a>, and <a href="ctp:api:type:Payment">Payments</a> with the same <code>anonymousId</code>.</p>
* <p>If <code>anonymousCart</code> is provided, this value must match the <code>anonymousId</code> of the anonymous <a href="ctp:api:type:Cart">Cart</a>; otherwise, an <a href="ctp:api:type:InvalidOperationError">InvalidOperation</a> error is returned.</p>
*

* @return null|string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ public function getAnonymousCartId()
}

/**
* <p>Identifies a <a href="ctp:api:type:Cart">Cart</a> that will be assigned to the new Customer.</p>
* <p>Assigns the Customer to the specified Cart.</p>
*
*
* @return null|CartResourceIdentifier
Expand All @@ -488,7 +488,8 @@ public function getAnonymousCart()
}

/**
* <p>Identifies Carts and Orders belonging to an anonymous session that will be assigned to the new Customer.</p>
* <p>Assigns the Customer to all <a href="ctp:api:type:Cart">Carts</a>, <a href="ctp:api:type:Order">Orders</a>, <a href="ctp:api:type:ShoppingList">ShoppingLists</a>, and <a href="ctp:api:type:Payment">Payments</a> with the same <code>anonymousId</code>.</p>
* <p>If <code>anonymousCart</code> is provided, this value must match the <code>anonymousId</code> of the anonymous <a href="ctp:api:type:Cart">Cart</a>; otherwise, an <a href="ctp:api:type:InvalidOperationError">InvalidOperation</a> error is returned.</p>
*
*
* @return null|string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ interface CustomerSignInResult extends JsonObject
public function getCustomer();

/**
* <p>Cart associated with the Customer.
* If empty, the Customer does not have a Cart assigned.</p>
* <p>Cart associated with the Customer.</p>
* <p>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: <a href="ctp:api:type:MatchingPriceNotFoundError">MatchingPriceNotFound</a> and <a href="ctp:api:type:MissingTaxRateForCountryError">MissingTaxRateForCountry</a>.</p>
* <p>For more information, see <a href="/../api/carts-orders-overview#update-a-cart">Cart updates</a>.</p>
*

* @return null|Cart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ public function getCustomer()
}

/**
* <p>Cart associated with the Customer.
* If empty, the Customer does not have a Cart assigned.</p>
* <p>Cart associated with the Customer.</p>
* <p>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: <a href="ctp:api:type:MatchingPriceNotFoundError">MatchingPriceNotFound</a> and <a href="ctp:api:type:MissingTaxRateForCountryError">MissingTaxRateForCountry</a>.</p>
* <p>For more information, see <a href="/../api/carts-orders-overview#update-a-cart">Cart updates</a>.</p>
*

* @return null|Cart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ public function getCustomer()
}

/**
* <p>Cart associated with the Customer.
* If empty, the Customer does not have a Cart assigned.</p>
* <p>Cart associated with the Customer.</p>
* <p>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: <a href="ctp:api:type:MatchingPriceNotFoundError">MatchingPriceNotFound</a> and <a href="ctp:api:type:MissingTaxRateForCountryError">MissingTaxRateForCountry</a>.</p>
* <p>For more information, see <a href="/../api/carts-orders-overview#update-a-cart">Cart updates</a>.</p>
*
*
* @return null|Cart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getPassword();
public function getAnonymousCartId();

/**
* <p>Identifies a <a href="ctp:api:type:Cart">Cart</a> that will be assigned to the Customer.</p>
* <p>Assigns the Customer to the specified Cart.</p>
*

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

/**
* <p>If both <code>anonymousCart</code> and <code>anonymousId</code> are provided, the <code>anonymousId</code> on the CustomerSignin must match that of the anonymous <a href="ctp:api:type:Cart">Cart</a>.
* Otherwise a <a href="ctp:api:type:InvalidOperationError">400 Bad Request</a> <code>Invalid Operation</code> error is returned with the message:
* &quot;Cart with the ID cart-id does not have the expected anonymousId.&quot;.</p>
* <p>Assigns the Customer to all <a href="ctp:api:type:Cart">Carts</a>, <a href="ctp:api:type:Order">Orders</a>, <a href="ctp:api:type:ShoppingList">ShoppingLists</a>, and <a href="ctp:api:type:Payment">Payments</a> with the same <code>anonymousId</code>.</p>
* <p>If <code>anonymousCart</code> is provided, this value must match the <code>anonymousId</code> of the anonymous <a href="ctp:api:type:Cart">Cart</a>; otherwise, an <a href="ctp:api:type:InvalidOperationError">InvalidOperation</a> error is returned.</p>
*

* @return null|string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function getAnonymousCartId()
}

/**
* <p>Identifies a <a href="ctp:api:type:Cart">Cart</a> that will be assigned to the Customer.</p>
* <p>Assigns the Customer to the specified Cart.</p>
*

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

/**
* <p>If both <code>anonymousCart</code> and <code>anonymousId</code> are provided, the <code>anonymousId</code> on the CustomerSignin must match that of the anonymous <a href="ctp:api:type:Cart">Cart</a>.
* Otherwise a <a href="ctp:api:type:InvalidOperationError">400 Bad Request</a> <code>Invalid Operation</code> error is returned with the message:
* &quot;Cart with the ID cart-id does not have the expected anonymousId.&quot;.</p>
* <p>Assigns the Customer to all <a href="ctp:api:type:Cart">Carts</a>, <a href="ctp:api:type:Order">Orders</a>, <a href="ctp:api:type:ShoppingList">ShoppingLists</a>, and <a href="ctp:api:type:Payment">Payments</a> with the same <code>anonymousId</code>.</p>
* <p>If <code>anonymousCart</code> is provided, this value must match the <code>anonymousId</code> of the anonymous <a href="ctp:api:type:Cart">Cart</a>; otherwise, an <a href="ctp:api:type:InvalidOperationError">InvalidOperation</a> error is returned.</p>
*

* @return null|string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function getAnonymousCartId()
}

/**
* <p>Identifies a <a href="ctp:api:type:Cart">Cart</a> that will be assigned to the Customer.</p>
* <p>Assigns the Customer to the specified Cart.</p>
*
*
* @return null|CartResourceIdentifier
Expand Down Expand Up @@ -190,9 +190,8 @@ public function getAnonymousCartSignInMode()
}

/**
* <p>If both <code>anonymousCart</code> and <code>anonymousId</code> are provided, the <code>anonymousId</code> on the CustomerSignin must match that of the anonymous <a href="ctp:api:type:Cart">Cart</a>.
* Otherwise a <a href="ctp:api:type:InvalidOperationError">400 Bad Request</a> <code>Invalid Operation</code> error is returned with the message:
* &quot;Cart with the ID cart-id does not have the expected anonymousId.&quot;.</p>
* <p>Assigns the Customer to all <a href="ctp:api:type:Cart">Carts</a>, <a href="ctp:api:type:Order">Orders</a>, <a href="ctp:api:type:ShoppingList">ShoppingLists</a>, and <a href="ctp:api:type:Payment">Payments</a> with the same <code>anonymousId</code>.</p>
* <p>If <code>anonymousCart</code> is provided, this value must match the <code>anonymousId</code> of the anonymous <a href="ctp:api:type:Cart">Cart</a>; otherwise, an <a href="ctp:api:type:InvalidOperationError">InvalidOperation</a> error is returned.</p>
*
*
* @return null|string
Expand Down
1 change: 1 addition & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -496,3 +496,4 @@ f8b027c8e1b5ba61ace3d3d358b9efc7ad4b93eb
63488aa919cebb6a9a606b287cd525eb7c588e99
12c86075166f683540662d5b7016fa7d48fe45e4
c6e3250e705b0c6fb714d7a6e0210872f9bfe0d5
91ef231b5881c329f1c3f405e250106f8473b57e