How can I search REST API Accountingperiod entries?

How can I search REST API Accountingperiod entries?

I have an interface program with its own period/year.

I would like to translate the period/year to the Netsuite Accountingperiod id.

 

Rookie Asked on September 7, 2020 in Accounting.
Add Comment
6 Answer(s)

Hi,

You can get a list of accounting period with this API call:
com/services/rest/record/v1/accountingperiod

Do you need to filter this list and, if so, using what criteria? This will determine whether you can use the simple list filtering or will need SuiteQL.

Thanks,

Chris

Intermediate Answered on September 7, 2020.
Add Comment

Hi Chris,

The problem is you cannot use the RefName field or Start date/End date fields to select the accounting period and therefore cannot get the id to add to (say) a journal posting.

IOW the …/accountingperiod?q=  doesn’t include those fields so field selection isn’t possible, it seems…

I have since built a dictionary of active NS accounting periods and am using that as my validation/translation mechanism.

Regards,

Phil.

Rookie Answered on September 8, 2020.
Add Comment

Hi Phil,

I can confirm that this works for me and returns a single accounting period for the given month:
https://{{Account ID}}.suitetalk.api.netsuite.com/services/rest/record/v1/accountingperiod?q=STARTDATE ON “1/1/2020” AND ISQUARTER IS FALSE AND ISYEAR IS FALSE

Thanks,

Chris

Intermediate Answered on September 8, 2020.
Add Comment

Hi Chris,

/services/rest/record/v1/accountingperiod?q=STARTDATE%20ON%20%E2%80%9C1/1/2020%E2%80%9D%20AND%20ISQUARTER%20IS%20FALSE%20AND%20ISYEAR%20IS%20FALSE

produces:

{“type”:”https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1″,”title”:”Invalid search query .”,”status”:400,”o:errorCode”:”INVALID_PARAMETER”}

Phil.

Rookie Answered on September 8, 2020.
Add Comment

Hi Phil,

I think the forum post may have done something strange to the quotes, try this:
/services/rest/record/v1/accountingperiod?q=STARTDATE%20ON%20%221/1/2020%22%20AND%20ISQUARTER%20IS%20FALSE%20AND%20ISYEAR%20IS%20FALSE

Thanks,

Chris

Intermediate Answered on September 8, 2020.
Add Comment

Thanks Chris. That’s very helpful. It works fine now.

Regards,

Phil.

Rookie Answered on September 8, 2020.

Glad to hear that.

on September 8, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor