Sitecore Experience Commerce (Postorder components) |
Recently, I was working on sending the order details to the backend system (SAP), and here is my experience.
Fist, You need to define your pipeline and block, Or if you have any existing feature like Order you can create a new partnership for that - I choose the minion services to pick the Order and send it to the SAP system.
The important part is how to get all the required details and send it to the backend system.
Here are some essential components which we would need to get the information
You may need to add a reference for these components -
var contactDetails = arg.GetComponent<ContactComponent>();
var paymentDetails = arg.GetComponent<FederatedPaymentComponent>();
var fulfilmentDetails = arg.GetComponent<FulfillmentComponent>();
var listDetails = arg.GetComponent<ListMembershipsComponent>();
var listTransientDetails = arg.GetComponent<TransientListMembershipsComponent>();
For all order line items - We can simply run a for-each loop to get the information.
foreach (var orderLine in order.Lines)
{
}
Fill all the properties in the object, generate the serialized JSON and send it to your backend system.It's that much simple.
Let me know if need any detail or help on that.
No comments:
Post a Comment