Adding a Sale record not working?

ckirby350ckirby350 Member Posts: 1

Hi team,

We're new and trying to figure out how to put in historic sales. We're able to make POST and it does create the sale and decrements inventory, however the payment amount is zero and even if we put in a value in the request for timeStamp, it still saves as if current.

So, 2 questions:

1) What are we doing wrong to make the cash payment come out zero instead of $25 like we're putting in the request?

2) How do we create/update the sale date to show when this sale actually happened? There was an error displaying this embed.

I totally understand this may be a "newbie" thing, so appreciate the patience.

Thanks in advance for any info you can provide,

Chuck Kirby

Duff's Fine Jewelry



  • gregaricangregarican Member Posts: 866 

    When it comes to making POST or PUT API calls I typically look at what I get back from the API endpoint when making a GET request. Since the API docs don't give a functional example of a sale with salelines, payment, etc. this is all the more important.

    One thing I'd suggest is putting the amount value in quotes. If you look at the response of a GET request sent to the Sale endpoint, you'll see it's in quotes.


    "SalePayments": {

                    "SalePayment": {

                        "salePaymentID": "2371",

                        "amount": "349.38",

                        "createTime": "2019-01-02T16:07:27+00:00",

                        "archived": "false",

                        "remoteReference": "87ff32cf-5374-48b9-8b8d-e9375049404e",

                        "paymentID": "",

                        "saleID": "4158",

                        "paymentTypeID": "17",


  • rodeomasterrodeomaster Member Posts: 16


    We are also having an issue with creating a sale, in python we do:

    data = {

    "completed": "false",

    "voided": "false",

    "customerID": "6336",

    "employeeID": "5",

    "quoteID": "0",

    "registerID": "1",

    "shopID": "1",


    path = "{acount_id}/Sale.json"

    headers = {"Authorization": "Bearer {our_access_token}}

    response = requests.request("POST, path, headers=headers, data=data)

    But we receive:

    {'httpCode': '400', 'httpMessage': 'Bad Request', 'message': 'JSON Input was invalid. Error Message: Syntax error', 'errorClass': 'InvalidArgumentException'}

    We really can't figure our what is the issue... Hope you can help us! Thanks in advance

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 991 moderator
    edited July 2021

    Hi @rodeomaster,

    Please try to use extra brackets [ ] or curly brace { }, after the data so somehthing like data= {[


    Unfortunately, I'm not a master in Python.

Sign In or Register to comment.