SaleLineWorkOrder element, is this new?

gregaricangregarican Member Posts: 333 

For about a year now I've been exporting daily sales via the API. I know that over the past year I've pulled in completed workorders. But just now, a completed workorder from yesterday failed to be pulled in.

I'm performing a GET request against the Sale endpoint, and loading the SaleLines and SaleLines.Item relations. For the first time that I can tell, I am seeing this SaleLineWorkOrder element in the response.

"SaleLine": [

          {

            "saleLineID": "8204",

            "createTime": "2019-05-29T23:10:36+00:00",

            "timeStamp": "2019-06-20T23:03:07+00:00",

            "unitQuantity": "1",

            "unitPrice": "0",

            "normalUnitPrice": "0",

            "discountAmount": "0",

            "discountPercent": "0",

            "avgCost": "0",

            "fifoCost": "0",

            "tax": "true",

            "tax1Rate": "0.075",

            "tax2Rate": "0",

            "isLayaway": "false",

            "isWorkorder": "true",

            "isSpecialOrder": "false",

            "displayableSubtotal": "0",

            "displayableUnitPrice": "0",

            "calcLineDiscount": "0",

            "calcTransactionDiscount": "0",

            "calcTotal": "0",

            "calcSubtotal": "0",

            "calcTax1": "0",

            "calcTax2": "0",

            "taxClassID": "2",

            "customerID": "4348",

            "discountID": "0",

            "employeeID": "19",

            "itemID": "0",

            "noteID": "15998",

            "parentSaleLineID": "0",

            "shopID": "1",

            "saleID": "6888",

            "Note": {

              "noteID": "15998",

              "note": "Work order #1308, Item: battery \nReady on 06/07 at 7:10 pm\nCartier Watch lady 2 tone roman numerials wht dial blue hands\nchange battery",

              "isPublic": "false",

              "timeStamp": "2019-06-20T23:03:07+00:00"

            },

            "SaleLineWorkOrder": {

              "workOrderType": "parent",

              "workOrderId": "1308"

            }

          }

]


According to the API docs (https://developers.lightspeedhq.com/retail/endpoints/SaleLine/), I see no mention of this element. So it essentially broke my code. I am now ignoring the element and its child elements. Is this something new? If so, was there any prior announcement of this new addition?

2 comments

  • gregaricangregarican Member Posts: 333 

    As a follow-up I looked back for done & paid workorders. We have over 160 of them going back to when I first started pulling these sales and sale lines via the API. It wasn't until pulling in one from yesterday that my routine failed, due to this property being present.

  • LeahLeah Moderator, Lightspeed Staff Posts: 114 moderator

    Hi @gregarican, we looked into this and you are right, this is a new element that was recently introduced to the SaleLine endpoint. Thanks for bringing this to our attention, we will be updating the Retail API documentation accordingly in the very near future. We will also be taking action to ensure that, going forward, changes of this type are properly documented at time of release to ensure that developers are kept informed, and that any effects on your workflows can be mitigated accordingly.

    API Support
    Lightspeed HQ
Sign In or Register to comment.