Moonborn — API · billing
Redirect to a short-lived Stripe PDF URL for the invoice
Returns `307 Temporary Redirect` with a `Location` header pointing at a signed Stripe URL valid for ~30s. No JSON body. Clients that cannot follow redirects should issue a HEAD request to retrieve the URL.
GET/v1/billing/invoices/{id}/pdfscope · Bearer (API key or session JWT)
Path parameters
| Field | Type | Description |
|---|---|---|
| idreq | string | Internal invoice id (e.g. `inv_*`). |
Responses
307Redirect to Stripe-signed PDF URL
401Unauthenticated
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
404Invoice not found
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
410PDF no longer available (Stripe expired the asset)
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
Examples
cURL
curl -X GET https://api.moonborn.co/v1/billing/invoices/<id>/pdf \ -H "Authorization: Bearer $MOONBORN_API_KEY"
TypeScript
import Moonborn from '@moonborn/sdk';
const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });
const result = await client.billing.downloadInvoicePdf({
id: '<id>',
});Python
import os
from moonborn import Moonborn
client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])
result = client.billing.download_invoice_pdf(
id="<id>",
)