APG PayAPG Paydocs

Loans

Get loan statement document

GET/loan-statements/{loanStatementId}/documents/{format}
Request
GEThttps://api.tst.au.apgpay.dev/loan-statements/{loanStatementId}/documents/{format}
curl -X GET https://api.tst.au.apgpay.dev/loan-statements/{loanStatementId}/documents/{format} \
  -H "Authorization: Bearer $API_KEY"

Return one of the statement's documents as the file itself, under its own media type: text/csv for Csv, application/pdf for Pdf, application/xml for Xml. Content-Disposition names the file; the name is stated here too, because generated clients drop headers.

With useLimepayGeneration=true the file is the one the platform stored, named {ediNumber}_{referenceStatementId}_{yyyyMMdd_HHmmss}.{documentId}[.V{schemaVersion}].{csv|pdf|xml}, the time in UTC. A format not produced for this statement yet, or XML for a loan whose settings do not enable it, is a 400.

With false, the file is relayed unchanged from APG's gateway under APG's own name. APG not finding the statement is a 404; any other refusal from APG is a 500.

Omitted, the environment decides: dev, tst and stg answer as true does, production as false does.

Send an Accept naming the format, or none. One naming none of the three, application/json for one, is a 406 with an empty body; one naming another of the three still gets the format in the path. Any other query parameter is a 400.

Permissions

Required permission
loanStatements:query

Requires the `query` action on `loanStatements` for the supplied runtime context

Path parameters

loanStatementIdstring
required
formatLoanStatementDocumentFormat
required

Which document. It also fixes the response's Content-Type.

CsvPdfXmlUnknown

Query parameters

useLimepayGenerationboolean

true serves the document the platform rendered and stored; one not produced yet is a 400, never a fall-back to APG. false relays APG's file, as edge does. Omitted, it depends on the environment, as on edge: dev, tst and stg serve the stored document, production relays APG's file.

Responses

Example response
"string"

Error responses