Sale Line or Partial Refunds through API

Coop320Coop320 Posts: 3Member
edited June 25 in Development

Hey, I am able to process full refunds with:

/Sale/{saleID}/refund

but I would like to be able to put in partial refunds of a dollar amount and refund individual SaleLine's. How can I achieve this?

Additional info: Some sales are processed via 3rd party and won't actually be charged via lightspeed, but the data should still be there for reports and inventory.

Thanks!

4 comments

  • gregaricangregarican Posts: 269Member 

    Interesting question. Looking at the API docs, only a full sale refund seems to be listed as an endpoint --> https://developers.lightspeedhq.com/retail/endpoints/Sale-refund/. Don't see an API endpoint for refunding a specific sale line. Although in practice this would come into play.

    Most of the time I live in the Retail API world, and don't use the Lightspeed POS client much. Can you refund specific line items from a sale in the UI?

  • Alex LugoAlex Lugo Posts: 131Administrator, Lightspeed Staff moderator

    Hello @Coop320,

    Partial refunds are possible. Create a new sale and specify the parentSaleLineID for each line that is a refund.

    You can find a code sample in our documentation.

    https://developers.lightspeedhq.com/retail/tutorials/sales/#partial-refunds

    Alex Lugo
    API Support Specialist
    Lightspeed HQ
  • Coop320Coop320 Posts: 3Member

    Thank you both for responding. Unfortunately, I wasn't able to get this to work.

    Here was my request:

    POST: https://api.lightspeedapp.com/API/Account/{account#}/Sale

    {
    	"registerID": 1,
    	"employeeID": 40,
    	"shopID": 1,
    	"SaleLines": {
    		"SaleLine": {
    			"qty": -2,
    			"itemID": 479,
    			"parentSaleLineID": 39125
    		}
    	},
    	"SalePayments": {
    		"SalePayment": {
    			"amount": -30,
    			"paymentTypeID": 1
    		}
    	}
    }
    

    Here is what happened:

    Sale was created with a SaleLine of that Item with 0 quantity and parentSaleLineID is correctly set in the api response. (I cannot see this in the UI)

    Sale shows payment of -30 and balance of 30. Cannot complete the sale since balance is not 0.

    The original sale I'm trying to refund shows no reference to this Sale.

    I also tried using the same paymentTypeID as the original Sale.

  • Coop320Coop320 Posts: 3Member

    Update:

    The system did end up detecting those sales as refunds, it just took a little bit. But I still cannot complete the refund sale because of the balance. I'm guessing the qty: -2 should have put a -$30 but it did not.

Sign In or Register to comment.