Find a api to get a salesorder by using invoice no  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Re: Find a api to get a salesorder by using invoice no

Postby SBarnes » Fri May 31, 2024 11:08 am

Mike.Sheen wrote:
It concerns me deeply that you seem to be wanting to read ALL sales orders and credit notes in full - this will be a major performance issue.


I don't disagree with Mike, although we have tried to answer your specific questions it may be better if you explain what you are trying to achieve so we can offer some advice on a strategy on how to achieve the desired outcome that will work effectively.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Find a api to get a salesorder by using invoice no

Postby kranil7701 » Tue Jun 04, 2024 3:03 pm

SBarnes wrote:Not sure what you mean by bills but credit notes would be

Code: Select all
https://api.jiwa.com.au/Queries/SO_Main?CreditNote=true&Include=Total&Fields=InvoiceID,CreditNote&apikey=9vjoF4M5-gYVBWjoFyW9nlQieB9FhxpJkAsRJznB_Ok&format=json

or

Code: Select all
https://api.jiwa.com.au/Queries/SalesOrderList?CreditNote=true&Include=Total&Fields=InvoiceID,CreditNote&apikey=9vjoF4M5-gYVBWjoFyW9nlQieB9FhxpJkAsRJznB_Ok&format=json


Which give

Code: Select all
{
    "Total": 7,
    "Results": [
        {
            "InvoiceID": "000000002400000002SF",
            "CreditNote": true
        },
        {
            "InvoiceID": "14CF9F98DCBD44ABB5C0",
            "CreditNote": true
        },
        {
            "InvoiceID": "274BFA583BE04BA6A137",
            "CreditNote": true
        },
        {
            "InvoiceID": "5714562EFAA24A1A9EDC",
            "CreditNote": true
        },
        {
            "InvoiceID": "86C37C974A3C4155A47A",
            "CreditNote": true
        },
        {
            "InvoiceID": "D6333A2B92A645A9BF30",
            "CreditNote": true
        },
        {
            "InvoiceID": "F1149BC9C9A24FD4A0B4",
            "CreditNote": true
        }
    ]
}




i want to filter this by current date is it possibale to make changes in api
kranil7701
Occasional Contributor
Occasional Contributor
 
Posts: 24
Joined: Tue Oct 31, 2023 1:03 pm

Re: Find a api to get a salesorder by using invoice no

Postby SBarnes » Tue Jun 04, 2024 3:08 pm

You don't need to change the api the swagger ui documents all the parameters you can supply have a look at https://api.jiwa.com.au/swagger-ui/#!/Q ... erList_Get
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Find a api to get a salesorder by using invoice no  Topic is solved

Postby Mike.Sheen » Tue Jun 04, 2024 3:21 pm

kranil7701 wrote:i want to filter this by current date is it possibale to make changes in api


To return only sales order credit notes (for instance) for a specific date, you can use the InvoiceInitDate={Date} parameter:

https://api.jiwa.com.au/Queries/SalesOr ... ormat=json

Or for a range use InvoiceInitDateBetween={From Date},{To Date}:

https://api.jiwa.com.au/Queries/SalesOr ... ormat=json

For after a date use InvoiceInitDateGreaterThan={Date}:

https://api.jiwa.com.au/Queries/SalesOr ... ormat=json

And for before a date use InvoiceInitDateLessThan={Date}:

https://api.jiwa.com.au/Queries/SalesOr ... ormat=json

The conventions for the parameter names to use, based on operation desired and field name are documented over on the ServiceStack AutoQuery docs
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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Previous

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 3 guests