Download boleto

GET

GET https://external-api.lia.com.br/external_api/v1/payments/:id/download_boleto

Example request

curl --location 'https://external-api-sandbox.lia.com.br/external_api/v1/payments/6884caff-825c-44e6-bfca-b33fa470dd41/download_boleto' \
--header 'Authorization: Bearer token'

Response Headers

HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="boleto_[PAYMENT_ID].pdf"
Content-Length: [SIZE_IN_BYTES]

Example Response

The response returns a binary PDF file containing the boleto (bank slip) with payment information including:

  • Barcode for payment processing
  • Payment amount and due date
  • Payer and recipient information
  • Bank processing information

Response Type: Binary PDF document

Status Code: 200 OK

To save the PDF file using curl, use the -o or -O flag:

# Save with custom filename
curl --location 'https://external-api-sandbox.lia.com.br/external_api/v1/payments/6884caff-825c-44e6-bfca-b33fa470dd41/download_boleto' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
-o boleto.pdf

# Save with server-suggested filename
curl --location 'https://external-api-sandbox.lia.com.br/external_api/v1/payments/6884caff-825c-44e6-bfca-b33fa470dd41/download_boleto' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
-OJ

Note: This endpoint only works for payments with payment_method: "boleto". Attempting to download a boleto for other payment methods will result in an error.