How can I retrieve project cost codes from all projects?

Enter '*' in the Project-Id header to retrieve all project cost codes.

Agave recommends fetching cost codes on a per-project basis for most use cases. When bulk retrieval is required, you can pass the '*' character in the Project-Id header, and Agave will return all project-level cost codes. 

Supported Systems

This functionality is supported for: 

  • Acumatica
  • Foundation
  • Sage Intacct
  • Sage 300 CRE
  • Viewpoint Spectrum
  • Viewpoint Vista

Sample Request for Retrieving all Project Cost Codes

Note the header in the sample request below:

curl --location 'https://api.agaveapi.com/cost-codes?per_page=10&page=1' \
--header 'API-Version: 2021-11-21' \
--header 'Client-Id: <client_id>' \
--header 'Client-Secret: <client_secret>' \
--header 'Account-Token: <account_token>' \
--header 'Include-Source-Data: true' \
--header 'Project-Id: *' \
--data ''

The response has the same structure as the Cost Codes endpoint.

Requirements & Implementation Details

Pagination Required

Applies to: Acumatica, Spectrum, Sage 300 CRE

Pagination is required when passing '*' for the Project-Id header.

 

Fewer Results Per Page

Applies to: Acumatica, Spectrum, Sage 300 CRE

Some pages will return fewer results than the specified per_page number as a result of de-duplication. If a page is not full, there may still be more pages.

 

Duplicates Across Projects

Applies to: Acumatica, Spectrum, Sage 300 CRE

De-duplication is only performed on a per-page basis, so your application will need to upsert or otherwise ignore duplicate records.

 

Standard Cost Codes are Not Returned

Applies to: Acumatica, Foundation, Sage Intacct, Sage 300 CRE, Viewpoint Spectrum, Viewpoint Vista

Standard cost codes, those that are not project-level, are not returned when this header is applied.