Apply Customer Discount on Sale creation

aaronaaron Member Posts: 44
So I still can't quite figure out how to apply a discount when creating a sale through the API.

The user associated with the sale has a Discount. How do I make sure that his discount is applied when creating the sale?


  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 654 moderator
    Hey @aaron, thank you for your question!

    You'll need to make two calls. To do this efficiently I would suggest a GET and then a POST.

    You'll need to first do a GET to query the customer. You can do this with the following request url:{{AccountId}}/Customer/{{CustomerId}}.json?load_relation=["Discount"]

    You'll then need to get the discountID object value from the response and then put that in your POST request body

    So your request url would be

    </code>{{AccountId}}/Sale</pre><div><br><pre class="CodeBlock"><code>{
        "employeeID": 1,
        "registerID": 1,
        "shopID": 1,
        "customerID": 16,
        "completed": true,
        "SaleLines": {
                "itemID": 1,
                "unitQuantity": 1,
                "discountID": 10
        "SalePayments": {
        	"SalePayment": {
        		"amount": 100,
        		"paymentTypeID": 1

    Let's say the SalePayment.amount was greater than the value on the sale then the response body will return a Sale.change object which will tell you how much they've overpaid by.

    I hope this helps!

    Adrian Samuel

    Software Developer

    Lightspeed HQ

Sign In or Register to comment.