List of all balances for business partners (customers)

GET/balances/biz-partners/customers

Returns aggregated balances per business partner (customer) and currency, with optional grouping for deeper analysis.

Audit event:

  • invoice.biz-partners.customers.balance.list

Privilege (one of):

  • finance-balance-view
  • finance-balance-own-view

Filter fields:

  • instanceId
  • bizPartnerName
  • bizPartnerBriefName
  • bizPartnerId
  • bizPartnerType
  • currency
  • currencyCode
  • ownerId
  • ownerBpName
  • ownerBpBriefName
  • docClassId
  • docClassCodeName
  • docClassDomain
  • docClassArea
  • dataSourceId
  • dataSourceCodeName
  • domainId
  • domainCodeName
  • documentTypeId
  • documentTypeName
  • documentTypeSelfBilling
  • documentTypeDtsSelectorId
  • documentTypeDtsSelectorCodeName

Sortable fields:

  • bizPartnerName
  • bizPartnerBriefName
  • bizPartnerId
  • bizPartnerType
  • rounding
  • currency
  • currencyCode
  • ownerId
  • ownerBpName
  • ownerBpBriefName
  • docClassId
  • docClassCodeName
  • docClassDomain
  • docClassArea
  • dataSourceId
  • dataSourceCodeName
  • domainId
  • domainCodeName
  • documentTypeId
  • documentTypeName
  • documentTypeSelfBilling
  • documentTypeDtsSelectorId
  • documentTypeDtsSelectorCodeName
  • amountNoVat
  • amountVat
  • total
  • totalUnpaid
  • totalPaid

Searchable attributes:

  • bizPartnerBriefName
  • bizPartnerId
  • bizPartnerName
  • bizPartnerType
  • rounding
  • custName
  • currency
  • currencyCode
  • ownerId
  • ownerBpName
  • ownerBpBriefName
  • docClassId
  • docClassCodeName
  • docClassDomain
  • docClassArea
  • dataSourceId
  • dataSourceCodeName
  • domainId
  • domainCodeName
  • documentTypeId
  • documentTypeName
  • documentTypeSelfBilling
  • documentTypeDtsSelectorId
  • documentTypeDtsSelectorCodeName

Grouping fields

  • domainId
  • domainCodeName
  • docClassId
  • docClassCodeName
  • docClassDomain
  • docClassArea
  • documentTypeId
  • dataSourceId
  • dataSourceCodeName
  • documentTypeName
  • documentTypeDtsSelectorId
  • documentTypeDtsSelectorCodeName
  • documentTypeSelfBilling

Errors:

  • NOT_AUTHENTICATED - Not authenticated
  • NOT_AUTHORIZED - Not authorized
  • 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

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
groupstring
  • Comma-separated extra grouping dimensions for business-partner balance aggregation
  • Default grouping is always by bizPartnerId and currency
  • Grouped fields appear in the response only when listed in group
  • Sorting is not available for fields not included in group

Examples: - group=domainId — one row per business partner, currency, and domain - group=domainCodeName,dataSourceId — split by domain code and data source id - group=docClassId — response includes docClassId, docClassCodeName, docClassDomain, docClassArea - group=documentTypeId — response includes documentTypeId, documentTypeName, documentTypeSelfBilling - group=documentTypeDtsSelectorId — response includes documentTypeDtsSelectorId, documentTypeDtsSelectorCodeName

Request example

cURL · cURL
curl -L -X GET "https://api-cpaas.sms.es/finance/sit/v1/balances/biz-partners/customers" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <access_token>"

Responses

List of balances for customers

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

Amount including VAT

bizPartnerBriefNamestring
bizPartnerIdinteger
bizPartnerNamestring
bizPartnerTypestring
currencyinteger
currencyCodestring
dataSourceCodeNamestring

Returned when grouping by dataSourceCodeName. This attribute has repeatable codeName among different domains (domainId or domainCodeName); for exact targeting prefer dataSourceId or include domainId / domainCodeName in grouping.

dataSourceIdinteger

Returned when grouping by dataSourceId

docClassAreastring

Returned when grouping by docClassArea

docClassCodeNamestring

Returned when grouping by docClassCodeName

docClassDomainstring

Returned when grouping by docClassDomain

docClassIdinteger

Returned when grouping by docClassId

documentTypeDtsSelectorCodeNamestring

Returned when grouping by documentTypeDtsSelectorCodeName. This attribute has repeatable codeName among different dataSources; for exact targeting prefer documentTypeDtsSelectorId or include dataSource attributes in grouping

documentTypeDtsSelectorIdinteger

Returned when grouping by documentTypeDtsSelectorId

documentTypeIdinteger

Returned when grouping by documentTypeId

documentTypeNamestring

Returned when grouping by documentTypeName

documentTypeSelfBillingstring

Returned when grouping by documentTypeSelfBilling

Possible values: no, yes
domainCodeNamestring

Returned when grouping by domainCodeName

domainIdinteger

Returned when grouping by domainId

instanceIdinteger
ownerBpBriefNamestring
ownerBpNamestring
ownerIdinteger
roundingnumber (float)

Rounding difference (total - amountVat)

totalnumber (float)
totalPaidnumber (float)
totalUnpaidnumber (float)
vatnumber (float)

VAT amount (amountVat - amountNoVat)

metaobjectrequired
Show child attributes
paginationobjectrequired
Show child attributes
countintegerrequired
currentPageintegerrequired
perPageintegerrequired
totalintegerrequired
totalPagesintegerrequired
Example response
{
  "data": [
    {
      "amountNoVat": 0,
      "amountVat": 0,
      "bizPartnerBriefName": "string",
      "bizPartnerId": 0,
      "bizPartnerName": "string",
      "bizPartnerType": "string",
      "currency": 0,
      "currencyCode": "string",
      "dataSourceCodeName": "string",
      "dataSourceId": 0,
      "docClassArea": "string",
      "docClassCodeName": "string",
      "docClassDomain": "string",
      "docClassId": 0,
      "documentTypeDtsSelectorCodeName": "string",
      "documentTypeDtsSelectorId": 0,
      "documentTypeId": 0,
      "documentTypeName": "string",
      "documentTypeSelfBilling": "no",
      "domainCodeName": "string",
      "domainId": 0,
      "instanceId": 0,
      "ownerBpBriefName": "string",
      "ownerBpName": "string",
      "ownerId": 0,
      "rounding": 0,
      "total": 0,
      "totalPaid": 0,
      "totalUnpaid": 0,
      "vat": 0
    }
  ],
  "meta": {
    "pagination": {
      "count": 0,
      "currentPage": 0,
      "perPage": 0,
      "total": 0,
      "totalPages": 0
    }
  }
}