Discount on create sale not working.

Hi i am trying to create discount on sale but it is not working on api.


Discount(object) the discount % applied to this entire sale.

I tried discount object there and discount id also.


please help.

4 comments

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 723 moderator

    Hi @Jd_89050,

    Thank you for contacting us.

    Can you show me what you are doing?

  • Jd_89050Jd_89050 Member Posts: 9

    Hi @LucienVersendaal

    I am creating sale from website. now when I have discount in my order. I try to give it with "discount" field. which is not taking any discount and give me out of balance error.


    I am creating completed sale.


    (
        [employeeID] => 1
        [registerID] => 1
        [shopID] => 1
        [enablePromotions] => 1
        [customerID] => 279
        [completed] => 1
        [referenceNumber] => web order 139
        [SaleLines] => Array
            (
                [SaleLine] => Array
                    (
                        [0] => Array
                            (
                                [itemID] => 2036
                                [unitQuantity] => 1
                                [taxClassID] => 1
                            )
    
                    )
    
            )
    
        [SalePayments] => Array
            (
                [SalePayment] => Array
                    (
                        [amount] => 4.67
                        [paymentTypeID] => 7
                    )
    
            )
    [Discount]=>50 
    (I tried here discount object also
     which I retrieved from api ,
     and tried string value also none of them working for me.)
    
    )
    

    Please help.

  • Jd_89050Jd_89050 Member Posts: 9

    Hi @LucienVersendaal

    Please waiting for your answer.

    Thanks

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 723 moderator

    Hi @Jd_89050,

    Below you'll the payload:

    {
        "employeeID": 1,
        "registerID": 1,
        "shopID": 1,
        "completed": true,
        "SaleLines": {
            "SaleLine": [
            {
                "itemID": 12,
                "unitQuantity": 1,
                "discountID": 10
            },
            {
                "itemID": 28,
                "unitQuantity": 1,
                "discountID": 10
            }
            ]
        },
        "SalePayments": {
        	"SalePayment": {
        		"amount": 120,
        		"paymentTypeID": 1
        	}
        }
    }
    

    You'll need to apply the discountID to every line on the sale.

    I hope this helps.

Sign In or Register to comment.