Page 1 of 1

Filtering by Job Cost Centre Name on Invoice or Job Query

Posted: Tue Nov 25, 2025 11:27 am
by devappau
We have working code which downloads all jobs and invoices between a certain issue date. If invoices run first, then they are piped into the Jobs request as a comma separated list to download the same jobs only. This query is working.

I'm trying to filter either the Invoice or Job query to download on the SimPro Cost Center Name, but the API says there is no filtering on subquery fields. As a result, we are downloading all of the records in the time period and then filtering with the results. It would be much quicker to be able to filter on the job cost center name directly on the Jobs or Invoices query.

$request->query()->merge([
'Jobs.ID' => "in($idsCsv)",
'columns' => 'ID,CustomFields,InternalID,Type,Customer,RecurringInvoice,DateIssued,Period,PaymentTermID,PaymentTerms,ProgressClaimNumber,IsFinalClaim,Stage,PerItem,OrderNo,LatePaymentFee,CISDeductionRate,AccountingCategory,Status,AutoAdjustStatus,Description,Notes,Total,Retainage,RetainageRebate,IsPaid,DatePaid,Currency,DateCreated,DateModified,CostCenters',
'display' => 'all',
]);

$items = Simpro::paginate($request)
->setPerPageLimit($this->max_page_size)
->collect()->all(); // gather all pages for this job

Is there a way to filter on the Invoices or Jobs object by Cost Center Name so we can only get the records required, instead of downloading everything in the time period and then filtering.

Re: Filtering by Job Cost Centre Name on Invoice or Job Query

Posted: Thu Nov 27, 2025 11:53 pm
by SimproAPITeam
Hi devappau,
We don't support searching for names in this instance but you should be able to search on cost center id's.

If you are looking for jobs related to specific invoiced cost centers you can query the jobs endpoint like this with the list of cost center id's

Code: Select all

/jobs/?Sections.CostCenters.ID=in(6347,10277)

If you want to retrieve jobs related to a specific cost centre type use the id to retrieve them like this:

Code: Select all

/jobs/?Sections.CostCenters.CostCenter=35
I hope this can improve your workflow.

Regards