Adding shipping fee onto a Sale

bobpassarobobpassaro Member Posts: 9

Forgive me if I missed something on this. I imagine it's come up before, but I'm not seeing a straightforward solution.

I work on a website (not eCom, a standalone site) for a store that uses LS Retail in the bricks and mortar store. We can import products form LS to the site and sync inventory, etc. Currently, we are trying to upgrade the integration so that when a sale happens on the website we create an actual "Sale" in LS. Basically, I have this working fine using the API, but the problem has to do with shipping fees.

LS wants the Sale to be "balanced," that is, all the Sale Lines need to add up to exactly match the total of the transaction.

So, let's say somebody on the web buys a product for $100 and shipping ends up being $5.99.

If I POST the Sale with Sale Lines that just include the product ($100) and a SalePayment Amount of $105.99, obviously the Sale won't balance. I could just have a "Shipping" product in LS so I send the Sale Lines as product: $100 and shipping product: $5.99.

That would be fine, but the shipping fee can vary (and/or be changed by the webstore manager at any time) so this needs to get handled dynamically.

A few solutions I've been pondering:

  • Create a separate product for each possible shipping amount (ugh -- janky and fragile)
  • Create a "shipping" product on the fly that is priced at whatever the shipping fee is and then archive it after the Sale is complete (maybe workable, but also feels a little janky)
  • Manipulate the website data before posting it to LS, so we just eliminate the shipping fee entirely, and just have the LS Sale include actual products as Sale Lines and a total that matches those (not idea from a bookkeeping perspective)

Maybe I'm missing something easier? Is it possible to change the price of a product on the fly when posting a Sale (without do a separate PUT beforehand)? There is a PriceLevel "type" property and I see it can be set to "fixed" in some examples, but I don't see any documentation on other PriceLevel types. Is there some way to have a fluid price? Anyone else figured out a good way to deal with this in a dynamic way so that a shipping fee of any amount can be handled?



  • LeahLeah Moderator, Lightspeed Staff Posts: 165 moderator

    Hi @bobpassaro you can create a non-inventory item called 'Shipping' (or whatever you choose) and then update its price for each sale using the Sale SaleLine endpoint and changing the "unitPrice" field to match the shipping charge from the online order. This is likely the best way to achieve what you are looking for.

    API Support
    Lightspeed HQ
  • bobpassarobobpassaro Member Posts: 9

    Thanks. What I ended up doing was my #2 above, but this sounds a little better in that I guess I don't need to worry about inventory -- just price. Thanks, I'll try ti.

Sign In or Register to comment.