Class ByProjectKeyMeOrdersPost
- All Implemented Interfaces:
ConflictingTrait<ByProjectKeyMeOrdersPost>
,Deprecatable201Trait<ByProjectKeyMeOrdersPost>
,ErrorableTrait<ByProjectKeyMeOrdersPost>
,ExpandableTrait<ByProjectKeyMeOrdersPost>
,ClientRequestCommand<Order>
,CreateHttpRequestCommand
,HttpRequestCommand<Order>
,RequestCommand<Order>
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} or anonymous_id:{id} scope.
The Cart must have a shipping address set for taxes to be calculated. When creating B2B Orders, the Customer must have the CreateMyOrdersFromMyCarts
Permission. Creating an Order produces the OrderCreated Message.
If the Cart's customerId
does not match the customer:{id} scope, or the anonymousId
does not match the anonymous_id:{id} scope, a ResourceNotFound error is returned.
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:
- AssociateMissingPermission
- DiscountCodeNonApplicable
- InvalidItemShippingDetails
- OutOfStock
- PriceChanged
- ShippingMethodDoesNotMatchCart
- MatchingPriceNotFound
- MissingTaxRateForCountry
CompletableFuture<ApiHttpResponse<com.commercetools.api.models.order.Order>> result = apiRoot
.withProjectKey("{projectKey}")
.me()
.orders()
.post(null)
.execute()
-
Nested Class Summary
Nested classes/interfaces inherited from class io.vrap.rmf.base.client.ApiMethod
ApiMethod.ParamEntry<K,
V> -
Constructor Summary
ConstructorDescriptionByProjectKeyMeOrdersPost
(ApiHttpClient apiHttpClient, String projectKey, MyOrderFromCartDraft myOrderFromCartDraft) -
Method Summary
Modifier and TypeMethodDescription<TValue> ByProjectKeyMeOrdersPost
addExpand
(Collection<TValue> expand) add additional expand query parametersadd additional expand query parameteradd additional expand query parameter<TValue> ByProjectKeyMeOrdersPost
addExpand
(TValue expand) add additional expand query parameterboolean
execute
(ApiHttpClient client) executeBlocking
(ApiHttpClient client, Duration timeout) getBody()
int
hashCode()
int
com.fasterxml.jackson.core.type.TypeReference<Order>
void
setProjectKey
(String projectKey) toString()
withBody
(MyOrderFromCartDraft myOrderFromCartDraft) <TValue> ByProjectKeyMeOrdersPost
withExpand
(Collection<TValue> expand) set expand with the specified valuesset expand with the specified valuewithExpand
(Supplier<String> supplier) set expand with the specified value<TValue> ByProjectKeyMeOrdersPost
withExpand
(TValue expand) set expand with the specified valueMethods inherited from class io.vrap.rmf.base.client.ApiMethod
addHeader, addQueryParam, addQueryParams, contentType, createHttpRequest, execute, execute, execute, execute, execute, execute, execute, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, getFirstQueryParam, getHeaders, getQueryParam, getQueryParams, getQueryParamUriString, getQueryParamUriStrings, send, sendBlocking, sendBlocking, with, with, withHeader, withHeaders, withHttpRequest, withoutHeader, withoutQueryParam, withQueryParam, withQueryParams
Methods inherited from interface io.vrap.rmf.base.client.ClientRequestCommand
executeBlocking
Methods inherited from interface com.commercetools.api.client.ConflictingTrait
asConflictingTrait, asConflictingTraitToBaseType
Methods inherited from interface io.vrap.rmf.base.client.CreateHttpRequestCommand
createHttpRequest
Methods inherited from interface com.commercetools.api.client.Deprecatable201Trait
asDeprecatable201Trait, asDeprecatable201TraitToBaseType
Methods inherited from interface com.commercetools.api.client.ErrorableTrait
asErrorableTrait, asErrorableTraitToBaseType
Methods inherited from interface com.commercetools.api.client.ExpandableTrait
asExpandableTrait, asExpandableTraitToBaseType
Methods inherited from interface io.vrap.rmf.base.client.RequestCommand
executeBlocking
-
Constructor Details
-
ByProjectKeyMeOrdersPost
public ByProjectKeyMeOrdersPost(ApiHttpClient apiHttpClient, String projectKey, MyOrderFromCartDraft myOrderFromCartDraft) -
ByProjectKeyMeOrdersPost
-
-
Method Details
-
resultType
- Specified by:
resultType
in interfaceHttpRequestCommand<Order>
-
executeBlocking
- Specified by:
executeBlocking
in interfaceClientRequestCommand<Order>
- Specified by:
executeBlocking
in classApiMethod<ByProjectKeyMeOrdersPost,
Order>
-
execute
- Specified by:
execute
in interfaceClientRequestCommand<Order>
- Specified by:
execute
in classApiMethod<ByProjectKeyMeOrdersPost,
Order>
-
getProjectKey
-
getExpand
- Specified by:
getExpand
in interfaceExpandableTrait<ByProjectKeyMeOrdersPost>
-
setProjectKey
-
withExpand
set expand with the specified value- Specified by:
withExpand
in interfaceExpandableTrait<ByProjectKeyMeOrdersPost>
- Type Parameters:
TValue
- value type- Parameters:
expand
- value to be set- Returns:
- ByProjectKeyMeOrdersPost
-
addExpand
add additional expand query parameter- Specified by:
addExpand
in interfaceExpandableTrait<ByProjectKeyMeOrdersPost>
- Type Parameters:
TValue
- value type- Parameters:
expand
- value to be added- Returns:
- ByProjectKeyMeOrdersPost
-
withExpand
set expand with the specified value- Parameters:
supplier
- supplier for the value to be set- Returns:
- ByProjectKeyMeOrdersPost
-
addExpand
add additional expand query parameter- Parameters:
supplier
- supplier for the value to be added- Returns:
- ByProjectKeyMeOrdersPost
-
withExpand
set expand with the specified value- Parameters:
op
- builder for the value to be set- Returns:
- ByProjectKeyMeOrdersPost
-
addExpand
add additional expand query parameter- Parameters:
op
- builder for the value to be added- Returns:
- ByProjectKeyMeOrdersPost
-
withExpand
set expand with the specified values- Type Parameters:
TValue
- value type- Parameters:
expand
- values to be set- Returns:
- ByProjectKeyMeOrdersPost
-
addExpand
add additional expand query parameters- Type Parameters:
TValue
- value type- Parameters:
expand
- values to be added- Returns:
- ByProjectKeyMeOrdersPost
-
getBody
- Overrides:
getBody
in classTypeBodyApiMethod<ByProjectKeyMeOrdersPost,
Order, MyOrderFromCartDraft>
-
withBody
- Overrides:
withBody
in classTypeBodyApiMethod<ByProjectKeyMeOrdersPost,
Order, MyOrderFromCartDraft>
-
equals
-
hashCode
public int hashCode() -
toString
-
reflectionHashCode
public int reflectionHashCode()
-