Retrieve document from archive

Prev
Get
/BSAPIRestproxy/api/archive/types/{docType}/documents/{documentId}

Fetches an archived document of the given type, number and year for a specific organization and shop. The document is returned as a binary file (PDF) with appropriate Content-Type and headers.

Path parameters
docType
stringRequired

Type of document (e.g. INVOICE, PACKNOTE, ORDER)

ExamplePACKNOTE
documentId
stringRequired

Document number in the archive

Example535881-0
Query parameters
year
integer (int32) Required

Year associated with the document

Example2025
org
integer (int64) Required

Organization number

Example98765478
shop
integer (int64) Required

Shop number

Example7654321076548
Responses
200

Document retrieved successfully

string (binary)
400

Invalid request parameters

object

Standard error payload

timestamp
string (date-time)
Example2025-10-08T19:34:12.345Z
status
integer (int32)
Example404
error
string
ExampleNot Found
message
string
ExampleNo document returned from bs-api
path
string
Example/api/archive/types/INVOICE/documents/536062
upstream
string
Examplebs-api SOAP fault: Client.ValidationError
404

Document not found in the archive

object

Standard error payload

timestamp
string (date-time)
Example2025-10-08T19:34:12.345Z
status
integer (int32)
Example404
error
string
ExampleNot Found
message
string
ExampleNo document returned from bs-api
path
string
Example/api/archive/types/INVOICE/documents/536062
upstream
string
Examplebs-api SOAP fault: Client.ValidationError
500

Internal server error

object

Standard error payload

timestamp
string (date-time)
Example2025-10-08T19:34:12.345Z
status
integer (int32)
Example404
error
string
ExampleNot Found
message
string
ExampleNo document returned from bs-api
path
string
Example/api/archive/types/INVOICE/documents/536062
upstream
string
Examplebs-api SOAP fault: Client.ValidationError
502

Upstream SOAP service error (bs-api)

object

Standard error payload

timestamp
string (date-time)
Example2025-10-08T19:34:12.345Z
status
integer (int32)
Example404
error
string
ExampleNot Found
message
string
ExampleNo document returned from bs-api
path
string
Example/api/archive/types/INVOICE/documents/536062
upstream
string
Examplebs-api SOAP fault: Client.ValidationError