eCommerce Communication

In this article

Status

Payment

Shipping

If eCommerce will be used to send emails or monitor order status updates and handle final payment processes, a Web Hook must be implemented so Commerce Service can send messages and requests from LS Central over to the eCommerce platform.

Set the URL to the Web Hook in the Appsetting.config file:

<add key="ECom.Url" value="" />

“Demo” can be set as URL value for demo purposes and Commerce Service will always reply to LS Central with an OK and without trying to communicate with the eCommerce platform.

The POS Functionality Profile must include the URI to Commerce Service:

Note: A backslash (/) is required at the end of the Service URI: http://localhost/LScommerceService/BOJson.svc/

LS Central can send Order status updates when Customer Order status changes.

  1. To activate communication from LS Central to Commerce Service, go to Customer Order Setup.
  2. Select the Send LS Commerce Messages check box, and select the POS Functionality Profile in LS Commerce Func. Profile ID field that includes the URL to Commerce Service.

  3. Go to the Customer Order Line - Processing Status Setup page, and select Send LS Commerce Message check boxes that you want to be broadcast back to eCommerce for status updates.

Status

When LS Central broadcasts Order status update, Commerce Service will contact the eCommerce web hook and send an orderstatus message.

Copy

OrderMessageStatus object

{
    "CardId": "",
    "ExtOrderStatus": "",
    "HeaderStatus": "RECEIVED",
    "MsgSubject": "your order 001",
    "MsgDetail": "is ready for delivery",
    "OrderId": "CO000111",
    "OrderKOTStatus": "Not Sent",
    "Lines": [{
        "Amount": 99.0,
        "ExtLineStatus": "",
        "ItemId": "40020",
        "LineNo": "1",
        "NewStatus": "PICKING",
        "PrevStatus": "NEW",
        "Quantity": 1.0,
        "UnitOfMeasureId": "PCS",
        "VariantId": "001"
        }
    ]
}

Statues will include the Status Code used in LS Central.

MsgSubject and MsgDetail will have data if the email data to be sent is formatted by LS Central.

When status comes from Hospitality, it will include KOT Status but no Lines.

Payment

At time of Posting a Sales Order, a Finalized Payment request will be sent, if a Pre-Authorized payment token was taken when the order was created. To get Final payment confirmation from the payment provider, Commerce Service will contact the web hook and send the orderpayment command.

Copy

OrderMessagePayment object

{
    "OrderId": "CO00001",
    "Status": 1,
    "Token": "1234",
    "Amount": 100,
    "CurrencyCode": "GBP",
    "AuthCode": "1234",
    "Reference": "1234",
    "Lines": [{
        "LineNo": "1",
        "ItemId": "40020",
        "VariantId": "001",
        "UnitOfMeasureId": "PCS",
        "Quantity": 1.0,
        "Amount": 99.0
    }]
}

Status:

0: Customer order is unchanged, same amount and all items delivered

1: Customer order is changed since web order

2: Customer order was canceled

Copy

OrderMessageResult object

{
    "message": "Command posted successfully",
    "success": true
}

Response string should be OK if everything is OK, otherwise an error message is sent from the payment provider.

Shipping

When an order is ready for shipping, a Shipping request will be sent, Commerce Service will contact the web hook and send the ordershipping command.

Copy

OrderMessageShipping object

{
    "OrderId": "CO00001",
    "Provider": "FedEx",
    "Service": "GROUND",
    "ShipmentNo": "102234",
    "TrackingId": "123456",
    "TrackingUrl": "http://fedex.com/1234",
    "Lines": [{
        "Amount": 99.0,
        "ItemId": "40020",
        "LineNo": "1",
        "Quantity": 1.0,
        "UnitOfMeasureId": "PCS",
        "VariantId": "001"
    }]
}
Copy

OrderMessageShippingResult object

{
    "message": "Command posted successfully",
    "success": true,
    "trackingInfo": [{
            "trackingId": "123456",
            "trackingUrl": "http://fedex.com/1234",
            "shipmentProvider": "FedEx",
            "service": "GROUND"
    }]
}