Apply discountPercent

aaronaaron Posts: 44Member
Hi,

So I read in another ticket here that discountPercent has been deprecated on Sale level and that you now need to apply discount on sale line level.

How do I apply the discountPercent? Cause i have been unable to get it to work.

I have tried multiple payloads, including this one:

{
	"completed": false,
	"referenceNumber": "Test",
	"referenceNumberSource": "Test API",
	"taxCategoryID": 0,
	"employeeID": 1,
	"shopID": 1,
	"registerID": 1,
	"customerID": 10,
	"SaleLines": {
		"SaleLine": [
			{
				"itemID": 17,
				"unitQuantity": 1,
				"Note": {
        			"note": "Note"
    			},
				"Discount": {
					"discountPercent": "100"
				}
			}
		]
	}
}

Tags:

2 comments

  • LeahLeah Posts: 67Moderator, Lightspeed Staff moderator
    Hi @aaron,

    You can't apply percentage discounts to line items in exactly the way you are trying to. The discount must already be created and you will then need to reference its ID like this:

    "SaleLine": 
                              {
                                "discountID": "1",
                                "itemID": 17,
                                "unitQuantity": 1,
                                "Note": {
                                               "note": "Note"
                                            }
                               }

    You can make a call to the Discount endpoint to get a list of the discounts and corresponding IDs
    API Support
    Lightspeed HQ
  • aaronaaron Posts: 44Member
    @Leah, That's a shame, but I guess this will do. Thanks!
Sign In or Register to comment.