on 2022 Nov 30 5:23 PM
Good morning,
I create a quote, but I do not undestand how create order from this quote.
For create the quote I used this api
{{address}}/occ/v2/{{siteUid}}/users/{{userId}}/quotes<br>
but when I used this api for create order
{{address}}/occ/v2/{{siteUid}}/users/{{userId}}/quotes/{{quoteCode}}/action
{ "action": "CHECKOUT"}
I have this error
[QuoteController] Action [CHECKOUT] is not allowed for quote code [0000046011]
de.hybris.platform.b2bocc.exceptions.QuoteException: Action [CHECKOUT] is not allowed for quote code [0000046011]
at de.hybris.platform.b2bocc.v2.helper.QuoteHelper.acceptAndPrepareCheckout(QuoteHelper.java:262) ~[classes/:?]
at de.hybris.platform.b2bocc.v2.controllers.QuoteController.performQuoteAction(QuoteController.java:243) ~[classes/:?]
at de.hybris.platform.b2bocc.v2.controllers.QuoteController$$FastClassBySpringCGLIB$$1.invoke(<generated>) ~[classes/:?]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.19.jar:5.3.19]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) ~[spring-aop-5.3.19.jar:5.3.19]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.19.jar:5.3.19]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.19.jar:5.3.19]
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:61) ~[spring-security-core-5.6.1.jar:5.6.1]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.19.jar:5.3.19]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.19.jar:5.3.19]
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:58) ~[spring-aop-5.3.19.jar:5.3.19]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) ~[spring-aop-5.3.19.jar:5.3.19]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.19.jar:5.3.19]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.19.jar:5.3.19]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.19.jar:5.3.19]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.19.jar:5.3.19]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) ~[spring-aop-5.3.19.jar:5.3.19]
at de.hybris.platform.b2bocc.v2.controllers.QuoteController$$EnhancerBySpringCGLIB$$1.performQuoteAction(<generated>) ~[classes/:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
Stefania
Request clarification before answering.
Hi Stefania,
Commerce Quotes is one of the most important features in B2B, which enables buyers to create quotes and negotiate the final price of an order using the storefront. The whole process include different roles: buyer, sales representative and seller approver, furthermore, Quotes itself have different states: CREATED, SELLERAPPROVER_APPROVED, SELLERAPPROVER_REJECTED, etc.
Put it simply, it's the current user role and quotes state that decide which actions can be invoked for current quote.
In order to finish the quote flow, you should follow some steps from creating quote, submitting quote, adding discount to quote, approving quote to accepting quote, etc. please refer to https://help.sap.com/docs/SAP_COMMERCE/4c33bf189ab9409e84e589295c36d96e/a795b4722f6942c091ef716c66dd... and https://help.sap.com/docs/SAP_COMMERCE/4c33bf189ab9409e84e589295c36d96e/3608f3b42d1f46c68cb350845990... for details
For your case, you just create the quote, then accept the quote, which is not the correct path, so you cannot execute checkout from the quote (in other words, checkout is not permitted because of current state).
Hopefully it can help you a little.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.