Add Result headers to Access-Control-Expose-Headers

Wish the API had something it doesn't? Post here!
Forum rules
  • Check the documentation first. Before posting questions, please check the documentation to ensure it doesn't already cover what you need.
  • No spam. All automated messages, advertisements, and links to competitor websites will be deleted immediately.
  • Post in relevant sub-forums only. Messages posted in the wrong topic area will be removed and placed in the correct sub-forum by moderators.
  • Respect other users. No flaming or abusing fellow forum members. Users who continue to post inflammatory, abusive comments will be deleted from the forum after two warnings are issued by moderators.
  • Harassment. No threats or harassment of other users will be tolerated. Any instance of threatening or harassing behavior is grounds for deletion from the forums.
  • Adult content. No profanity or pornography is allowed. Posts containing adult material will be deleted.
  • Bandwidth. All images and signatures must be 500 x 500 pixels or smaller. Posts containing over-sized images and signatures will be removed.
  • Illegal content. No re-posting of copyrighted materials or other illegal content is allowed. Any posts containing illegal content or copyrighted materials will be deleted.
Post Reply
Goldfish6413
Posts: 2
Joined: Tue Jul 23, 2024 12:43 am

Add Result headers to Access-Control-Expose-Headers

Post by Goldfish6413 » Thu Sep 17, 2026 5:03 am

We're currently working on a webapp that uses Simpro API. The API returns headers like

Code: Select all

Result-Total
that indicates the number of records for the endpoint, but I can't access that header or any response header other than

Code: Select all

Content-Type
when using JS

Code: Select all

fetch()
because the API doesn't specify Access-Control-Expose-Headers.

If you can add the access control header to expose the following headers it'll help us get the number of items and display it to the user:
  • Result-Total
  • Result-Pages
  • Result-Count
SimproAPITeam
Posts: 831
Joined: Wed May 01, 2024 2:31 am

Re: Add Result headers to Access-Control-Expose-Headers

Post by SimproAPITeam » Tue Sep 22, 2026 11:32 pm

Hi,

Thanks for following up, and apologies for the confusion caused by our earlier reply — after digging into this further, good news: this is actually already possible today, it's just not obvious from the docs.

Type: "Deposit" is current and correct — it isn't tied to a legacy deposit mechanism. To control how much of the job is claimed on that deposit invoice, you set a Claim value per cost center in the request body, rather than a
single top-level amount field. You can specify the claim either as a fixed amount or as a percentage:

POST /api/v1.0/companies/{companyID}/invoices/
{
"Type": "Deposit",
"Jobs": [12345],
"PaymentTerms": {
"DueDate": "2026-10-15"
},
"CostCenters": [
{
"ID": 1,
"Claim": {
"ExTax": 500.00
}
}
]
}

Or to claim a percentage instead of a fixed amount:

"CostCenters": [
{ "ID": 1, "Claim": { "Percent": 20 } }
]

A few notes:
- If a job has multiple cost centers, include an entry (with its own Claim) for each one you want included in the deposit.
- We'd recommend using POST /api/v1.0/companies/{companyID}/invoices/ (not the job-scoped /jobs/{jobId}/invoices/ endpoint) going forward — the job-scoped version still works but is marked deprecated in the API reference.
- Once the invoice is created, you can retrieve a payment link for it via the invoice's getInvoicePaymentLink endpoint, which should complete your proposal → deposit invoice → payment link flow.

Let us know how you get on with this, or if you hit any validation errors with a specific job's cost center setup and we're happy to help troubleshoot further.

Kind regards,
Simpro API Team | Simpro Software Group
Post Reply