Skip to main content

Download an Invoice

Route

POST
/api/v1/invoices/:id/download

Logic

  • If the invoice has already been generated, you will receive in the response the invoice object with the file_url where you can download your pdf file.
  • If the invoice has never been generated, this endpoint will returns an empty 200 response, you will receive a invoice.generated webhook when the PDF file is ready. You can check the webhook documentation to know more about this.

Usage

LAGO_URL="https://api.getlago.com"
INVOICE_ID="__YOU_INVOICE_ID__"
API_KEY="__YOUR_API_KEY__"

curl --location --request POST "$LAGO_URL/api/v1/$INVOICE_ID/download" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json'

Responses

  • The invoice file has already been generated.
  • The invoice file has not been generated, returns an empty response.