Page 1 of 1

sending quote via API, getting 401, but no quote found

PostPosted: Wed Apr 12, 2023 4:54 pm
by JuiceyBrucey
Hi,
I am sending a quote via the SalesQuotes API using CURL post.
I am getting a ["http_code"]=> int(201) reply.
But I am not seeing the quote being recorded anywhere.
Here is my payload:
Code: Select all
 "Type": "string",
                 "StaffUserName": "Admin",
                 "StaffTitle": "WEB GUY",
                 "StaffFirstName": "BRUCE",
                 "StaffSurname": "EVANS",
                 "InvoiceInitDate": "2023-04-12T14:04:16",
                 "OrderNo": "AWC_6433617071681258948",
                 "DebtorID": "abcabcabcabvcccccc",
                 "DebtorAccountNo": "123123123",
                 "DebtorName": "Abu Web Commerce",
                 "DebtorEmailAddress": "[email protected]",
                 "DeliveryAddress1": "1here",
                 "DeliveryAddress2": "2 there",
                 "DeliveryAddressSuburb": "Adel",
                 "DeliveryAddressState": "SA",
                 "DeliveryAddressPostcode": "",
                 "DeliveryAddressCountry": "Australia",
                "Lines": [{
                 "ItemNo": 0,
                 "QuoteLineID": "na",
                 "InventoryID": "4982d66f54f443089b07",
                 "PartNo": "na",
                 "Description": "ADVANCE CAT CHICKEN",
                 "QuantityOrdered": 1,
                 "UnitCost": 52,
                 "LineTotal": 52
               },{
                 "ItemNo": 0,
                 "QuoteLineID": "na",
                 "InventoryID": "9abc5172851040d18871",
                 "PartNo": "na",
                 "Description": "ADVANCE ADULT ALL BREED CHICKEN & SALMON WET DOG FOOD",
                 "QuantityOrdered": 1,
                 "UnitCost": 51,
                 "LineTotal": 51
               }]}


Not sure what I am doing wrong.
Any advice?

Also does a quote go into a SO_Main table with the status of '0' until it is finalised?
Cheers

Re: sending quote via API, getting 401, but no quote found  Topic is solved

PostPosted: Wed Apr 12, 2023 5:31 pm
by Mike.Sheen
A HTTP 201 indicates it created ok. Your topic says you were getting a 401. A confusing typo?

The response body you would have got back would have been the Quote DTO which would have included the QuoteID field which is actually the id of the created quote.

APICreateQuoteBody.png


A response header also would have included a location header which is the URI of the resource (quote) you just created.

APICreateQuote.png


JuiceyBrucey wrote:Also does a quote go into a SO_Main table with the status of '0' until it is finalised?

No, SO_Main is for sales orders, QO_Main is for quotes.

You can look in the QO_Main table to find your quote.

Re: sending quote via API, getting 401, but no quote found

PostPosted: Wed Apr 12, 2023 6:12 pm
by JuiceyBrucey
Excellent. Yes, I put the wrong error code in the subject by mistake.
Have found the quotes now, it has been working all along LOL.
Thank you very much.
Cheers