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.
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
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.
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
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:
Phil.
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
Thanks Chris. That’s very helpful. It works fine now.
Regards,
Phil.
Glad to hear that.