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

Discussions relating to plugin development, and the Jiwa API.

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

Postby JuiceyBrucey » Wed Apr 12, 2023 4:54 pm

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
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 142
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1

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

Postby Mike.Sheen » Wed Apr 12, 2023 5:31 pm

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2488
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 770

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

Postby JuiceyBrucey » Wed Apr 12, 2023 6:12 pm

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
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 142
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 3 guests