List supplier invoice files

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

Returns a list of supplier invoice file metadata for the given supplier invoice (invoiceId).

Audit event:

  • supplier_invoice_file.list

Privilege (one of):

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

Sortable fields:

  • id
  • invoiceId
  • filename
  • fsFilename
  • status
  • size
  • statusDt
  • statusInfo
  • insertDt
  • dstFileTypeid
  • fsStatus
  • fsStatusDt

Filter fields:

  • id
  • invoiceId
  • filename
  • fsFilename
  • status
  • size
  • statusDt
  • statusInfo
  • insertDt
  • dstFileTypeid
  • fsStatus
  • fsStatusDt

Searchable attributes (q):

  • id
  • invoiceId
  • filename
  • fsFilename
  • size
  • status
  • statusDt
  • statusInfo
  • insertDt
  • dtsFileTypeId
  • fsStatus
  • fsStatusDt

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
  • 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

Query parameters

allstring

Returns all matching records (e.g. yes/no)

Possible values: yes, no
page_numberinteger

Page number for pagination

Default: 1
page_sizeinteger

Page size for pagination

Default: 10
pagingstring

Paging options as page_num,page_size (value only; e.g. 1,10). Use with page_number and page_size or alone.

Example: 1,10
sortstring

Sort options as comma-separated attributes; prefix with - for DESC (value only; e.g. -insertDt,filename).

Example: -insertDt,filename
qstring

Global search query across filterable attributes (when used with eq or omitted operator)

operator(fieldName)string

Search criteria can be specified using the following operators and attributes:

Available Operators:

  • isnull, isnotnull
  • isempty, isnotempty
  • eq, neq
  • startswith, endswith, contains, doesnotcontain
  • lt, lte, gt, gte
  • in, notin
  • between, notbetween

Special Cases:

  1. For operators [isnull, isnotnull, isempty, isnotempty]: field value can be omitted.
  2. For operators [in, notin]: field value must be a comma-separated list. Example: in(status)=active,pending,deleted
  3. For operators [between, notbetween]: field value must be two comma-separated values. Example: between(statusDt)=2024-01-01,2024-12-31

Default Behavior:

  • If operator is omitted, 'eq' is assumed
  • Example: fieldName=fieldValue is equivalent to eq(fieldName)=fieldValue

Example Usage:

  • eq(status)=active
  • startswith(filename)=invoice

Request example

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

Responses

List of supplier invoice files for the given invoice

application/json
dataobject[]

List of supplier invoice file items (only files that exist on disk are included)

Show child attributes
dtsFileTypeIdinteger

Document/file type ID

filenamestring

Original filename

fsFilenamestring

Filename on storage

fsStatusstring

File system sync status

fsStatusDtstring (date-time)

File system status date-time (RFC3339)

idinteger

File ID

insertDtstring (date-time)

Insert date-time (RFC3339)

invoiceIdinteger

Supplier invoice ID

sizeinteger

File size in bytes

statusstring

File status (e.g. active, deleted)

statusDtstring (date-time)

Status date-time (RFC3339)

statusInfostring

Optional status info

metaobject
Show child attributes
paginationobjectrequired
Show child attributes
countintegerrequired
currentPageintegerrequired
perPageintegerrequired
totalintegerrequired
totalPagesintegerrequired
Example response
{
  "data": [],
  "meta": {
    "pagination": {
      "count": 0,
      "currentPage": 1,
      "perPage": 100,
      "total": 0,
      "totalPages": 1
    }
  }
}