CorefinityCorefinityDocs
Open the Control PanelControl Panel
Recipes · 8 of 8

Download invoices

List your invoices, read one and download its PDF.

On this page

An invoice's PDF is downloaded in two requests: one asks for a link, the next fetches the file. This recipe downloads a paid invoice of Harbour & Finch.

Before you start

  • A token with the read scope.
  • You may read your company's billing: its owner, its billing contacts and its primary user can.
  • Every step needs two-factor enrolment when your company requires it.
  • No step waits for a maintenance window.
  1. List the invoices

    Invoices are listed newest first. status narrows the list, and pdf.available says whether an invoice's PDF has been made.

    Paged by cursor: send next_cursor back as cursor; null means the last page.

    Terminal
    curl "https://manage.corefinity.com/api/corestack/billing/invoices?status=paid&limit=25" \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json"
  2. Read one invoice

    This step is optional. It answers the invoice with its lines, the credits applied to it, its payments and its credit notes.

    Terminal
    curl https://manage.corefinity.com/api/corestack/billing/invoices/8123 \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json"
  3. Ask for a link to the PDF

    The request has no body and answers 200 with download_url and expires_at. The link works for ten minutes, and only for you.

    Terminal
    curl -X POST https://manage.corefinity.com/api/corestack/billing/invoices/8123/pdf \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json"
    json
    {
      "url": "/nova-vendor/corecluster/billing/pdf/Xk3ExampleTokenExampleTokenExampleTokenExample12",
      "expires_at": "2026-11-18T10:25:00Z",
      "download_url": "/api/corestack/billing/pdf/Xk3ExampleTokenExampleTokenExampleTokenExample12"
    }
  4. Download the PDF

    Fetch download_url on the same host with the same token. The answer is the PDF file, named for the invoice number.

    Each download is recorded in your company's activity.

    Terminal
    curl https://manage.corefinity.com/api/corestack/billing/pdf/Xk3ExampleTokenExampleTokenExampleTokenExample12 \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json" \
      -o CF-100042.pdf

If it is refused

StatusreasonWhat to do
403billing_forbiddenBilling is for the company's owner, its billing contacts and its primary user
404feature_offBilling is not on for your company
422invalidCorrect the filter named in field
409pdf_pendingThe invoice's PDF has not been made yet. Try again in a few minutes
410link_expiredThe link has expired, or it was given to somebody else. Do step 3 again
404pdf_missingThe file could not be found. Open a ticket and Corefinity sends it
Was this helpful?
Open in ClaudeOpen in ChatGPT