Knowledge Center

Knowledge Center > API > REST API > REST API Reference > Accounting Periods > Get All Accounting Periods

Get All Accounting Periods

This reference describes how to query all accounting periods on your tenant through the REST API.

Prerequisites

You must have Z-Finance enabled on your tenant.

Request

  • Production: GET https://api.zuora.com/rest/v1/accounting-periods
  • API Sandbox: GET https://apisandbox-api.zuora.com/rest/v1/accounting-periods

Request Header Fields

Specify the following field in the request header.

Accept

optional

Optionally specify application/json. Only JSON is returned.

Request Query Fields

Optionally specify the following field in the query string of the request URL.

pageSize

optional

Number of rows to return in the response. Maximum value is 300. Default value is 300.

page

optional

The number of the page to return in the response.

Response

Response Body Fields

The following fields are returned in the body of the response.

accountingPeriods

An array of all accounting periods on your tenant. The accounting periods are returned in ascending order of start date; that is, the latest period is returned first.

id

ID of the accounting period.

name

Name of the accounting period.

startDate

The start date of the accounting period.

endDate

The end date of the accounting period.

status

Status of the accounting period. Possible values:

  • Open
  • PendingClose
  • Closed

runTrialBalanceStatus

Status of the trial balance for the accounting period. Possible values:

  • Pending
  • Processing
  • Completed
  • Error

runTrialBalanceStart

Date and time that the trial balance was run. If the trial balance status is Pending, this field is null.

runTrialBalanceEnd

Date and time that the trial balance was completed. If the trial balance status is Pending, Processing, or Error, this field is null.

runTrialBalanceErrorMessage

If trial balance status is Error, an error message is returned in this field.

fiscalYear

Fiscal year of the accounting period.

notes

Any optional notes about the accounting period.

<custom fields>

Custom fields you have configured for the accounting period object.

The fields use their API Name.

createdOn

Date and time when the accounting period was created.

createdBy

ID of the user who created the accounting period.

updatedOn

Date and time when the accounting period was last updated.

updatedBy

ID of the user who last updated the accounting period.

fileIds

File IDs of the reports available for the accounting period. You can retrieve the reports by specifying the file ID in a Get Files REST API call.

unprocessedChargesFileId

File ID of a report containing all unprocessed charges for the accounting period.

accountsReceivableInvoiceAgingDetailExportFileId

File ID of the Accounts Receivable Aging Invoice Detail report.

accountsReceivableAccountAgingDetailExportFileId

File ID of the Accounts Receivable Aging Account Detail report.

revenueDetailExcelFileId

File ID of the Revenue Detail report in XLSX format.

revenueDetailCsvFileId

File ID of the Revenue Detail report in CSV format.

arRollForwardDetailExportFileId

File ID of the Accounts Receivable Detail report.

fxRealizedGainAndLoss
DetailExportFileId

File ID of the Realized Gain and Loss Detail report.

Returned only if you have Foreign Currency Conversion enabled.

fxUnrealizedGainAndLoss​DetailExportFileId

File ID of the Unrealized Gain and Loss Detail report.

Returned only if you have Foreign Currency Conversion enabled.

success

Returns true if the request is successful. Otherwise, returns false.

processId

The internal process ID used to assist Zuora support. Returned only if success is false.

reasons

Information describing the reason for the result. Returned only if success is false.

code

An eight-digit numeric error code.

message

A description of the error.

nextPage

URL to retrieve the next page of the response.

Example

Example Request

GET https://apisandbox-api.zuora.com/rest/v1/accounting-periods

Example Response

{
    "accountingPeriods": [
        {
            "id": "8a8081ae5374904f01538338b66e1005",
            "name": "Mar 2016",
            "startDate": "2016-03-01",
            "endDate": "2016-03-31",
            "status": "Open",
            "runTrialBalanceStatus": "Error",
            "runTrialBalanceStart": "2016-03-16 23:25:22",
            "runTrialBalanceEnd": null,
            "runTrialBalanceErrorMessage": "Error creating the trial balance: exchange rate from USD to GBP on 08/03/2015 is not available.  Please import the rate and run trial balance again.",
            "fiscalYear": 2016,
            "notes": "",
            "fileIds": {
                "unprocessedChargesFileId": null,
                "accountsReceivableInvoiceAgingDetailExportFileId": "8a8081ae5374904f01538340273013f3",
                "accountsReceivableAccountAgingDetailExportFileId": "8a8081ae5374904f01538340274a13f4",
                "revenueDetailExcelFileId": "8a8081ae5374904f0153834032e41417",
                "revenueDetailCsvFileId": "8a8081ae5374904f0153834033221418",
                "arRollForwardDetailExportFileId": null,
                "fxRealizedGainAndLossDetailExportFileId": null,
                "fxUnrealizedGainAndLossDetailExportFileId": null
            },
            "createdOn": "2016-03-16 23:17:25",
            "createdBy": "e20b074746ec48f40147140f51e30a1a",
            "updatedOn": "2016-03-16 23:25:22",
            "updatedBy": "e20b074746ec48f40147140f51e30a1a"
        },
        {
            "id": "8a8081ae5374904f0153833918af1007",
            "name": "Apr 2016",
            "startDate": "2016-04-01",
            "endDate": "2016-04-30",
            "status": "Open",
            "runTrialBalanceStatus": "Error",
            "runTrialBalanceStart": "2016-03-16 23:23:40",
            "runTrialBalanceEnd": null,
            "runTrialBalanceErrorMessage": null,
            "fiscalYear": 2016,
            "notes": "",
            "fileIds": {
                "unprocessedChargesFileId": null,
                "accountsReceivableInvoiceAgingDetailExportFileId": "8a8081ae5374904f0153833e9a651363",
                "accountsReceivableAccountAgingDetailExportFileId": "8a8081ae5374904f0153833e9a7a1364",
                "revenueDetailExcelFileId": "8a8081ae5374904f0153833ea2c813ae",
                "revenueDetailCsvFileId": "8a8081ae5374904f0153833ea2d613af",
                "arRollForwardDetailExportFileId": null,
                "fxRealizedGainAndLossDetailExportFileId": null,
                "fxUnrealizedGainAndLossDetailExportFileId": null
            },
            "createdOn": "2016-03-16 23:17:50",
            "createdBy": "e20b074746ec48f40147140f51e30a1a",
            "updatedOn": "2016-03-16 23:23:40",
            "updatedBy": "e20b074746ec48f40147140f51e30a1a"
        },
        {
            "id": "8a8081ae5374904f0153833e4590132d",
            "name": "May 2016",
            "startDate": "2016-05-01",
            "endDate": "2016-05-31",
            "status": "Open",
            "runTrialBalanceStatus": "Error",
            "runTrialBalanceStart": "2016-05-18 01:42:30",
            "runTrialBalanceEnd": null,
            "runTrialBalanceErrorMessage": null,
            "fiscalYear": 2016,
            "notes": "",
            "fileIds": {
                "unprocessedChargesFileId": null,
                "accountsReceivableInvoiceAgingDetailExportFileId": null,
                "accountsReceivableAccountAgingDetailExportFileId": null,
                "revenueDetailExcelFileId": "8a8081ae54c2eabb0154c307e27e0033",
                "revenueDetailCsvFileId": "8a8081ae54c2eabb0154c307e2920034",
                "arRollForwardDetailExportFileId": null,
                "fxRealizedGainAndLossDetailExportFileId": null,
                "fxUnrealizedGainAndLossDetailExportFileId": null
            },
            "createdOn": "2016-03-16 23:23:29",
            "createdBy": "e20b074746ec48f40147140f51e30a1a",
            "updatedOn": "2016-05-18 01:42:30",
            "updatedBy": "e20b074746ec48f40147140f51e30a1a"
        },
        {
            "id": "e20b0747478025a1014780e489a60002",
            "name": "Open-Ended",
            "startDate": "2016-06-01",
            "endDate": null,
            "status": "Open",
            "runTrialBalanceStatus": "Pending",
            "runTrialBalanceStart": null,
            "runTrialBalanceEnd": null,
            "runTrialBalanceErrorMessage": null,
            "fiscalYear": 0,
            "notes": null,
            "fileIds": {
                "unprocessedChargesFileId": null,
                "accountsReceivableInvoiceAgingDetailExportFileId": null,
                "accountsReceivableAccountAgingDetailExportFileId": null,
                "revenueDetailExcelFileId": null,
                "revenueDetailCsvFileId": null,
                "arRollForwardDetailExportFileId": null,
                "fxRealizedGainAndLossDetailExportFileId": null,
                "fxUnrealizedGainAndLossDetailExportFileId": null
            },
            "createdOn": "2014-07-28 23:52:46",
            "createdBy": "402881e522cf4f9b0122cf5d82860002",
            "updatedOn": "2016-03-16 23:23:29",
            "updatedBy": "e20b074746ec48f40147140f51e30a1a"
        }
    ],
    "success": true
}
Last modified
18:49, 6 Jun 2016

Tags

Classifications

(not set)