List of documents for export

GET/documents-export

Returns a paginated list of documents for export

Audit event:

  • document.export.list

Privilege (one of):

  • finance-invoices.view
  • finance-invoices-own.view

Filter fields:

  • id
  • instanceId
  • bpInstanceId
  • bizPartnerId
  • bizPartnerCountry
  • bizPartnerExternalRefId
  • bizPartnerName
  • bizPartnerBriefName
  • bizPartnerType
  • bizPartnerAttn
  • bizPartnerAddress
  • bizPartnerPost
  • bizPartnerCity
  • bizPartnerVatNumber
  • documentDate
  • deliveryDate
  • documentNumber
  • documentNumberMask
  • documentNumberNum
  • dueDate
  • periodStart
  • periodEnd
  • currency
  • amountNoVat
  • amountVat
  • vatPercent
  • vat
  • rounding
  • total
  • totalUnpaid
  • totalPaid
  • domesticCurrency
  • domesticCurrencyRate
  • domesticAmountNoVat
  • domesticAmountVat
  • domesticRounding
  • domesticTotal
  • status
  • insertDt
  • statusDt
  • paymentStatus
  • paymentStatusDate
  • documentType
  • documentTypeName
  • selfBilling
  • domainId
  • dataSourceId
  • documentClassDomain
  • documentClassArea
  • syncStatus
  • syncStatusDt
  • disputeStatus
  • docsDeliveryStatus
  • docsDeliveryStatusDate
  • ownerId
  • ownerBpName
  • ownerBpBriefName
  • documentSync
  • documentUuid
  • currencyCode
  • domesticCurrencyCode
  • domainCodeName
  • lang
  • dataSourceCodeName
  • documentClassCodeName
  • dataSourceSelector

Sortable fields:

  • documentUuid
  • id
  • instanceId
  • bizPartnerId
  • bizPartnerCountry
  • bizPartnerExternalRefId
  • bizPartnerName
  • bizPartnerBriefName
  • bizPartnerType
  • bizPartnerAttn
  • bizPartnerAddress
  • bizPartnerPost
  • bizPartnerCity
  • bizPartnerVatNumber
  • documentDate
  • deliveryDate
  • documentNumber
  • documentNumberMask
  • documentNumberNum
  • dueDate
  • periodStart
  • periodEnd
  • currency
  • currencyCode
  • amountNoVat
  • amountVat
  • vatPercent
  • vat
  • rounding
  • total
  • totalUnpaid
  • totalPaid
  • domesticCurrency
  • domesticCurrencyCode
  • domesticCurrencyRate
  • domesticAmountNoVat
  • domesticAmountVat
  • domesticRounding
  • domesticTotal
  • status
  • insertDt
  • statusDt
  • paymentStatus
  • paymentStatusDate
  • lang
  • documentType
  • documentTypeName
  • selfBilling
  • domainId
  • domainCodeName
  • dataSourceId
  • dataSourceCodeName
  • documentClassCodeName
  • documentClassDomain
  • documentClassArea
  • dataSourceSelector
  • syncStatus
  • syncStatusDt
  • disputeStatus
  • docsDeliveryStatus
  • docsDeliveryStatusDate
  • ownerId
  • ownerBpName
  • ownerBpBriefName
  • documentSync

Searchable attributes:

  • documentUuid
  • bizPartnerExternalRefId
  • bizPartnerName
  • bizPartnerBriefName
  • bizPartnerType
  • bizPartnerAttn
  • bizPartnerAddress
  • bizPartnerPost
  • bizPartnerCity
  • bizPartnerVatNumber
  • documentNumber
  • documentNumberMask
  • currencyCode
  • domesticCurrencyCode
  • status
  • paymentStatus
  • lang
  • documentTypeName
  • domainCodeName
  • dataSourceCodeName
  • documentClassCodeName
  • documentClassDomain
  • documentClassArea
  • dataSourceSelector
  • syncStatus
  • disputeStatus
  • ownerId
  • ownerBpName
  • ownerBpBriefName
  • docsDeliveryStatus

Errors:

  • INVOICE_NOTFOUND - Invoice not found
  • NOT_AUTHORIZED - Not authorized
  • NOT_AUTHENTICATED - Not authenticated
  • INT_APP_ERROR - Unexpected internal error
Base URL
https://api-cpaas.sms.es/finance/sit/v1
Authentication

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

Request

Query parameters

embedstring

Comma-separated list of embed options.

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
  • Quick-search term matched against the operation Searchable attributes
  • q=term or eq(q)=term
  • Searchable field names use camelCase (listed per operation)
operator(fieldName)string

This endpoint accepts query parameters for search as described in the URL Filtering Guidelines.

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/finance/sit/v1/documents-export" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <access_token>"

Responses

List of documents for export

application/json
dataobject[]required
Show child attributes
amountNoVatnumber (float)

Document amount without VAT (net). Can be negative when selfBilling is yes.

amountVatnumber (float)

Document amount including VAT. Can be negative when selfBilling is yes.

bizPartnerobject

Business partner (customer/supplier) data on the document

Show child attributes
addressstring
attnstring
briefNamestring
citystring
customAttributesarray | null
Show child attributes
codeNamestring
valueany
namestring
partnerTypestring
poststring
vatNumberstring
bizPartnerCountryinteger
bizPartnerExternalRefIdstring
bizPartnerIdinteger
currencyinteger
currencyCodestring
dataSourceoneOf
Show child attributes
oneOf of:
DocumentDataSource · object

Data source / balance info. Set by enrichDocuments when a matching billing or credit record exists: POSTPAID with empty dataSourceSelector or POSTPAID-CONTROL (billing record id); POSTPAID with PART-PAYMENT selector or PREPAID (credit record id). billingTotalBalance is present when the record references a total balance. Null when no match.

billingTotalBalanceoneOf
Show child attributes
oneOf of:
DocumentBillingTotalBalance · object
billingTypeCodeNamestring
bizPartnerIdinteger
currencyinteger
currencyCodestring
customAttributesarray | null
Show child attributes
codeNamestring
valueany
idinteger
instanceIdinteger
namestring
Option 2 · null
idinteger
Option 2 · null
dataSourceCodeNamestring
dataSourceIdinteger
dataSourceSelectorstring
deliveryDatestring | null (date)
disputeStatusstring
Possible values: none, open, closed
docsDeliveryStatusstring
Possible values: none, waiting, sending, sent, error, misc
docsDeliveryStatusDatestring | null (date-time)
documentClassAreastring
documentClassCodeNamestring
documentClassDomainstring
documentDatestring | null (date)
documentNumberstring
documentNumberMaskstring
documentNumberNuminteger
documentSyncobject

Arbitrary JSON holding document sync data. Omitted unless syncStatus is done, error, misc, exported, or invalid and sync payload exists (makeDocumentExport).

documentTypeinteger
documentTypeNamestring
documentUuidstring
domainCodeNamestring
domainIdinteger
domesticAmountNoVatnumber (float)
domesticAmountVatnumber (float)
domesticCurrencyinteger
domesticCurrencyCodestring
domesticCurrencyRatenumber (float)
domesticRoundingnumber (float)
domesticTotalnumber (float)
dueDatestring | null (date)
idinteger
insertDtstring | null (date-time)
instanceIdinteger
itemsarray | null

Document line items from addInvoiceItems; null when the document has no items

Show child attributes
dataSourceoneOf

Present for some data sources (e.g. billing account / charge record)

Show child attributes
oneOf of:
DocumentItemDataSource · object

Data source on document item. Charge/billing-account branch (POSTPAID, POSTPAID-CONTROL) includes billingAccount; PART-PAYMENT credit branch includes documentId (invoice id on the credit record) and omits billingAccount.

billingAccountoneOf
Show child attributes
oneOf of:
DocumentBillingAccount · object

Billing account on document item dataSource (e.g. gate / pricing condition)

billingTypeCodeNamestring
bizPartnerIdinteger
currencyinteger
currencyCodestring
customAttributesarray | null
Show child attributes
codeNamestring
valueany
idinteger
instanceIdinteger
mnpConnectionsobject[]

MNP-related entities for the billing account (domain-dependent). BULK-MNP + POSTPAID: MnpAccount (id, instanceId, name, authName, protocol). BULK-MNP + POSTPAID-CONTROL: MnpGate (id, instanceId, name).

Show child attributes
authNamestring
idinteger
instanceIdinteger
namestring
protocolstring
namestring
smsConnectionsobject[]

SMS-related entities for the billing account (domain-dependent). BULK + POSTPAID: SmsAccount (id, instanceId, name, authName, protocol). BULK + POSTPAID-CONTROL: OutGate (id, name only).

Show child attributes
authNamestring
idinteger
instanceIdinteger
namestring
protocolstring
Option 2 · null
documentIdinteger

Present for POSTPAID with PART-PAYMENT selector (credit record invoice id)

idinteger
Option 2 · null
dataSourceCodeNamestring
dataSourceForeignKeyinteger
dataSourceIdinteger
dataSourceSelectorstring
documentIdinteger
idinteger
measureUnitstring
namestring
ordNuminteger
pricenumber (float)
quantitynumber (float)
totalNoVatnumber (float)
totalVatnumber (float)
langstring
notestring

Note text from invoice extent when extent field type is note (1); otherwise empty string

ownerBpBriefNamestring

Omitted when empty (json omitempty)

ownerBpNamestring

Omitted when empty (json omitempty)

ownerIdinteger

Omitted when zero (json omitempty)

paymentStatusstring
Possible values: none, open, on-hold, closed
paymentStatusDatestring | null (date-time)
periodEndstring | null (date)
periodStartstring | null (date)
roundingnumber (float)

Difference between document total and amount including VAT

selfBillingstring
Possible values: yes, no
statusstring
Possible values: draft, approved, rejected, canceled, archived, imported
statusDtstring | null (date-time)
syncStatusstring
Possible values: none, waiting, syncing, done, error, misc, exported, invalid
syncStatusDtstring | null (date-time)
totalnumber (float)

Document gross amount. Can be negative when selfBilling is yes.

totalPaidnumber (float)
totalUnpaidnumber (float)
trafficReportsobject[]

Omitted unless embed=trafficReports

Show child attributes
billingAccountIdinteger
billingAccountNamestring
bizPartnerBriefNamestring
bizPartnerExtRefIdstring
bizPartnerIdinteger
countryCode2string
countryIdinteger
countryNamestring
currencyinteger
currencyCodestring
endDtstring (date-time)
mccstring
mncstring
operatorIdinteger
operatorNamestring
pricenumber (float)
priceSinceDtstring (date-time)
smsCntinteger
startDtstring (date-time)
totalAmountnumber (float)
vatnumber (float)
vatPercentnumber (float)
metaobjectrequired
Show child attributes
paginationobjectrequired
Show child attributes
countintegerrequired
currentPageintegerrequired
perPageintegerrequired
totalintegerrequired
totalPagesintegerrequired
Example response
{
  "data": [
    {
      "amountNoVat": 0.03,
      "amountVat": 0.03,
      "bizPartner": {
        "address": "Example Street 1",
        "attn": "",
        "briefName": "Example BP",
        "city": "Example City",
        "customAttributes": null,
        "name": "Example Business Partner Ltd",
        "partnerType": "",
        "post": "1000",
        "vatNumber": ""
      },
      "bizPartnerCountry": 756,
      "bizPartnerExternalRefId": "",
      "bizPartnerId": 3000001,
      "currency": 978,
      "currencyCode": "EUR",
      "dataSource": {
        "billingTotalBalance": {
          "billingTypeCodeName": "POSTPAID",
          "bizPartnerId": 3000001,
          "currency": 978,
          "currencyCode": "EUR",
          "customAttributes": null,
          "id": 1,
          "instanceId": 3000001,
          "name": "Example BP Internal Postpaid EUR"
        },
        "id": 1
      },
      "dataSourceCodeName": "POSTPAID-CONTROL",
      "dataSourceId": 5,
      "dataSourceSelector": "",
      "deliveryDate": "2022-02-28",
      "disputeStatus": "none",
      "docsDeliveryStatus": "sent",
      "docsDeliveryStatusDate": "2024-03-19T20:16:30Z",
      "documentClassArea": "purchase",
      "documentClassCodeName": "CONTROL_INVOICE",
      "documentClassDomain": "invoice",
      "documentDate": "2022-02-28",
      "documentNumber": "010322-1",
      "documentNumberMask": "010322-%d",
      "documentNumberNum": 1,
      "documentType": 8,
      "documentTypeName": "Bulk Postpaid Control Invoice",
      "documentUuid": "a5d6baa8-4027-fab2-80a4-42005a7a4767",
      "domainCodeName": "BULK",
      "domainId": 1,
      "domesticAmountNoVat": 0,
      "domesticAmountVat": 0,
      "domesticCurrency": 0,
      "domesticCurrencyCode": "",
      "domesticCurrencyRate": 0,
      "domesticRounding": 0,
      "domesticTotal": 0,
      "dueDate": "2022-03-30",
      "id": 1,
      "insertDt": "2022-03-01T07:00:02Z",
      "instanceId": 3000003,
      "items": [
        {
          "dataSource": {
            "billingAccount": {
              "billingTypeCodeName": "POSTPAID",
              "bizPartnerId": 3000001,
              "currency": 978,
              "currencyCode": "EUR",
              "customAttributes": [
                {
                  "codeName": "EXAMPLE_ATTR",
                  "value": "0"
                }
              ],
              "id": 1,
              "instanceId": 3000001,
              "name": "Example Gate",
              "smsConnections": [
                {
                  "id": 5000,
                  "name": "Example Gate"
                },
                {
                  "id": 5365,
                  "name": "Connection A"
                },
                {
                  "id": 5369,
                  "name": "Connection B"
                },
                {
                  "id": 5586,
                  "name": "Connection C"
                }
              ]
            },
            "id": 1
          },
          "dataSourceCodeName": "POSTPAID-CONTROL",
          "dataSourceForeignKey": 1,
          "dataSourceId": 5,
          "dataSourceSelector": "",
          "documentId": 1,
          "id": 3,
          "measureUnit": "PIECE",
          "name": "Account: «Example Gate»",
          "ordNum": 3,
          "price": 0,
          "quantity": 2,
          "totalNoVat": 0.03,
          "totalVat": 0.03
        }
      ],
      "lang": "en",
      "note": "",
      "paymentStatus": "none",
      "paymentStatusDate": null,
      "periodEnd": "2022-02-28",
      "periodStart": "2022-02-01",
      "rounding": 0,
      "selfBilling": "no",
      "status": "draft",
      "statusDt": "2022-03-01T07:00:02Z",
      "syncStatus": "none",
      "syncStatusDt": null,
      "total": 0.03,
      "totalPaid": 0,
      "totalUnpaid": 0,
      "vat": 0,
      "vatPercent": 0
    },
    {
      "amountNoVat": 10,
      "amountVat": 12.5,
      "bizPartner": {
        "address": "Customer Street 1",
        "attn": "",
        "briefName": "Example Customer",
        "city": "Customer City",
        "customAttributes": null,
        "name": "Example Customer AB",
        "partnerType": "",
        "post": "100 00",
        "vatNumber": ""
      },
      "bizPartnerCountry": 752,
      "bizPartnerExternalRefId": "ext-ref-001",
      "bizPartnerId": 12436,
      "currency": 978,
      "currencyCode": "EUR",
      "dataSource": {
        "billingTotalBalance": {
          "billingTypeCodeName": "POSTPAID",
          "bizPartnerId": 12436,
          "currency": 978,
          "currencyCode": "EUR",
          "customAttributes": null,
          "id": 10,
          "instanceId": 637,
          "name": "Example Customer Postpaid EUR"
        },
        "id": 7
      },
      "dataSourceCodeName": "POSTPAID",
      "dataSourceId": 2,
      "dataSourceSelector": "PART-PAYMENT",
      "deliveryDate": "2019-11-22",
      "disputeStatus": "open",
      "docsDeliveryStatus": "error",
      "docsDeliveryStatusDate": "2025-12-15T13:56:13Z",
      "documentClassArea": "sales",
      "documentClassCodeName": "CUSTOMER_INVOICE",
      "documentClassDomain": "invoice",
      "documentDate": "2019-11-22",
      "documentNumber": "221119-3",
      "documentNumberMask": "221119-%d",
      "documentNumberNum": 3,
      "documentType": 608,
      "documentTypeName": "Bulk Invoice - Postpaid Part Payment",
      "documentUuid": "906e635f-d324-11ea-93b3-2e50570882a5",
      "domainCodeName": "BULK",
      "domainId": 1,
      "domesticAmountNoVat": 0,
      "domesticAmountVat": 0,
      "domesticCurrency": 0,
      "domesticCurrencyCode": "",
      "domesticCurrencyRate": 0,
      "domesticRounding": 0,
      "domesticTotal": 0,
      "dueDate": "2019-11-30",
      "id": 28,
      "insertDt": "2019-11-22T13:28:46Z",
      "instanceId": 639,
      "items": [
        {
          "dataSource": null,
          "dataSourceCodeName": "",
          "dataSourceForeignKey": 0,
          "dataSourceId": 0,
          "dataSourceSelector": "",
          "documentId": 28,
          "id": 19,
          "measureUnit": "WEEK",
          "name": "Postpaid Bulk SMS Part Payment\nExample Customer Postpaid EUR",
          "ordNum": 1,
          "price": 0,
          "quantity": 0,
          "totalNoVat": 10,
          "totalVat": 12.5
        }
      ],
      "lang": "en",
      "note": "",
      "ownerBpBriefName": "EO",
      "ownerBpName": "Example Owner",
      "ownerId": 13269,
      "paymentStatus": "open",
      "paymentStatusDate": "2025-02-18T08:00:10Z",
      "periodEnd": null,
      "periodStart": null,
      "rounding": 0,
      "selfBilling": "no",
      "status": "approved",
      "statusDt": "2019-11-22T13:28:47Z",
      "syncStatus": "none",
      "syncStatusDt": null,
      "total": 12.5,
      "totalPaid": 6,
      "totalUnpaid": 6.5,
      "vat": 2.5,
      "vatPercent": 25
    }
  ],
  "meta": {
    "pagination": {
      "count": 2,
      "currentPage": 1,
      "perPage": 10,
      "total": 2,
      "totalPages": 1
    }
  }
}