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?

https://us.v-cdn.net/6025193/uploads/077/QIXK9L2YDAZN.txt 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

Tags:

Answers

  • gregaricangregarican Member Posts: 336 

    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",

    ...

Sign In or Register to comment.