diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md index 0a8eed1e199..2f20b380923 100644 --- a/lib/commercetools-api/docs/RequestBuilder.md +++ b/lib/commercetools-api/docs/RequestBuilder.md @@ -718,8 +718,10 @@ $request = $builder ## `withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->orders()->post(null)` Creates an Order from a [Cart](ctp:api:type:Cart) in a [BusinessUnit](ctp:api:type:BusinessUnit). -The Cart must have a shipping address set before creating an Order. -Creating an Order fails with an [InvalidOperation](ctp:api:type:InvalidOperationError) if the Cart does not reference the same BusinessUnit as the `businessUnitKey` path parameter. + +The Cart must have a shipping address and an active Shipping Method set. + +If the Cart does not reference the same BusinessUnit as the `businessUnitKey` path parameter, an [InvalidOperation](ctp:api:type:InvalidOperationError) is returned. Specific Error Codes: @@ -5063,7 +5065,9 @@ $request = $builder Creates an Order from a Cart in a [Store](ctp:api:type:Store) for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Order is automatically set based on the [customer:{id}](/scopes#composable-commerce-oauth) or [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope. -The Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction) for taxes to be calculated. When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyCarts` [Permission](ctp:api:type:Permission). +The Cart must have a shipping address and an active Shipping Method set. + +When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyCarts` [Permission](ctp:api:type:Permission). If the Cart's `customerId` does not match the [customer:{id}](/scopes#composable-commerce-oauth) scope, or the `anonymousId` does not match the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. @@ -5507,10 +5511,12 @@ $request = $builder ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->post(null)` Creates an Order from a Cart in a [Store](ctp:api:type:Store). -Before you create an Order, the Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction). +The Cart must have a shipping address and an active Shipping Method set. + The shipping address is used for tax calculation for a Cart with `Platform` [TaxMode](ctp:api:type:TaxMode). Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. + If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number. @@ -7451,11 +7457,12 @@ $request = $builder Creates an Order from a Cart for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Order is automatically set based on the [customer:{id}](/scopes#composable-commerce-oauth) or [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope. -The Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction) for taxes to be calculated. When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyCarts` [Permission](ctp:api:type:Permission). -Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. +The Cart must have a shipping address and an active Shipping Method set. When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyCarts` [Permission](ctp:api:type:Permission). If the Cart's `customerId` does not match the [customer:{id}](/scopes#composable-commerce-oauth) scope, or the `anonymousId` does not match the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. +Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. + If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number. @@ -8319,13 +8326,15 @@ $request = $builder ## `withProjectKey("projectKey")->orders()->post(null)` Creates an Order from a Cart. -Before you create an Order, the Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction). + +The Cart must have a shipping address and an active Shipping Method set. + The shipping address is used for tax calculation for a Cart with `Platform` [TaxMode](ctp:api:type:TaxMode). Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. - If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. - If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number. +If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. +If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number. Specific Error Codes: diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodAction.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodAction.php index 77c9d66c8c5..a07abcffd0a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodAction.php @@ -20,7 +20,7 @@ interface CartSetShippingMethodAction extends CartUpdateAction /** *
Value to set. * If empty, any existing value is removed.
- *If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.
+ *If the referenced Shipping Method is inactive, or has a predicate that does not match the Cart, an InvalidOperation error is returned.
* * @return null|ShippingMethodResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionBuilder.php index a418ccad33c..b409db3f9eb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionBuilder.php @@ -37,7 +37,7 @@ final class CartSetShippingMethodActionBuilder implements Builder /** *Value to set. * If empty, any existing value is removed.
- *If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.
+ *If the referenced Shipping Method is inactive, or has a predicate that does not match the Cart, an InvalidOperation error is returned.
* * @return null|ShippingMethodResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionModel.php index 11729daa524..bd246e9138b 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetShippingMethodActionModel.php @@ -75,7 +75,7 @@ public function getAction() /** *Value to set. * If empty, any existing value is removed.
- *If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.
+ *If the referenced Shipping Method is inactive, or has a predicate that does not match the Cart, an InvalidOperation error is returned.
* * * @return null|ShippingMethodResourceIdentifier diff --git a/references.txt b/references.txt index 876b8b66518..f25308b6428 100644 --- a/references.txt +++ b/references.txt @@ -423,3 +423,4 @@ fcc6480a0c34dde0eb5c0a44b1b166a4fdc212fc 8f053b3f8730a47bc1257e09304a442d35356b9e e68ca35e345e284ffc6281baa6fcfb56a3e93582 b1fc7dfd206272a7717ffe06bf9bdb40fc428a1d +2222db881c7a11c0c0e7a23d0b0165c1fe593281