2 weeks ago
Hi,
We have some OCC integration where another system can place order in hybris via v2 webservices.
They would like to provide their own order number.
Can anyone please let me know if it is possible to overwrite the order number generated by hybris or create the order with the number they provide instead of generating a new one.
Thanks in advance!
Request clarification before answering.
Hi,
2 ways to do this :
1. If your external system has a sequence you can create that sequence using the keygenerator in hybris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My suggestion would be to store the order code from the external system in a separate column (e.g., externalOrderCode) and search using this column in FlexibleSearch when needed. Additionally, you should add an index to improve the query's performance.
Updating the code attribute of an Order is acceptable as long as it does not conflict with the order code number series.
I assume you are using the standard flow since you mentioned v2 web services. In the standard flow, where you create a cart, add products to the cart, and place an order, SAP Commerce generates two codes: one for the cart and one for the order. While you can update the code attribute after order creation with the external ID, I believe generating two codes in this scenario is unnecessary. To avoid this, I would customize DefaultCartFactory and DefaultCreateOrderFromCartStrategy to prevent code generation when the cart and order are created by an external system.
Hope this helps,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
20 | |
4 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.