Download supplier invoice file

GET/supplier-invoices/{invoiceId}/invoice-files-dl/{fileId}

Downloads the supplier invoice file identified by invoiceId and fileId.

Privilege (one of):

  • invoice-docs.view
  • invoice-docs-own.view

Audit event:

  • supplier_invoice_file.dl

Errors:

  • INVOICE_DOCS_API_V2:INVOICE_BASIC_NOT_FOUND - Invoice basic not found
  • INVOICE_NOTFOUND - Invoice not found
  • INVOICE_DOCS_API_V2:SUPPLIER_INVOICE_BELONG_TO_OTHER_INSTANCE - Supplier invoice belong to other instance
  • INVOICE_DOCS_API_V2:NO_CONFIGURED_FILE_PATH - No configured file path
  • INVOICE_FILE_NOTFOUND - Invoice file not found
  • INVOICE_DOCS_API_V2:SUPPLIER_INVOICE_FILE_DOES_NOT_EXIST - Supplier invoice file noes not exist
  • NOT_AUTHORIZED - Not authorized
  • NOT_AUTHENTICATED - Not authenticated
  • INT_APP_ERROR - Unexpected internal error
Base URL
https://api-cpaas.sms.es/invoice-docs/v2
Authentication

OAuth2 — send Authorization: Bearer <access_token>. Token URL: https://accounts-cpaas.sms.es/oauth2/access-token

Request

Path parameters

invoiceIdintegerrequired

Invoice ID

fileIdintegerrequired

Invoice file ID

Request example

cURL · cURL
curl -L -X GET "https://api-cpaas.sms.es/invoice-docs/v2/supplier-invoices/{invoiceId}/invoice-files-dl/{fileId}" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <access_token>"

Responses

Binary file body; headers describe name, length, and disposition

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Example response
string
Headers
Content-Dispositionstring

Attachment header with URL-encoded filename from file metadata (e.g. attachment; filename=invoice-2024-001.pdf)

Content-Lengthinteger

Size of the response body in bytes

Content-Typestring

Currently always application/vnd.openxmlformats-officedocument.spreadsheetml.sheet in the implementation