Skip to content

Get a document's link

A short-lived link to one document's PDF.

Updated

post

https://cloud.cahaves.com/api/billing/documents/{id}/link

Authorization

cahaves.cloud.sessionstringcookierequired

The session cookie Cloud sets when a customer signs in to the console with GitHub or Google. It is HttpOnly, so scripts cannot read it, and there are no API keys or tokens yet.

Path parameters

idstring<uuid>required

Example: "7c9e1b3d-5f7a-4c9e-8b1d-3f5a7c9e1b3d"

Headers

X-Cloud-Organizationstring<uuid>

The id of the organization the request works in, one the signed-in customer owns. Left out or empty, the request works in their oldest organization. Any other value answers 404 with `reason: "organization"`. A customer with no organization yet gets 409 "Create an organization first." from every route that works in one.

Example: "2f6c8e0a-4b1d-4e7f-9a3c-5d7e9f1b3a5c"

Responses

application/json

A link to the PDF.

urlstring<uri>required

Confirms the id is a document of the organization the request works in before the invoicing service is ever asked, so a customer can never reach another's document by guessing one; any other id, a document of another of your organizations included, answers 404 with "That document does not belong to this organization." 409 is "A voided invoice has no PDF to open." for a voided invoice, "This document's PDF is not ready yet. Try again in a minute." while it is not ready, or "This document's PDF cannot be opened right now." for any other refusal the service gives. 503 means the invoicing service did not answer. Like every write, a request that does not come from the console itself answers 403.

At most 10 requests a minute are accepted per account, and 60 across the platform.